Merge branch 'next' of gitorious.org:fg/simgear into next

This commit is contained in:
Stuart Buchanan 2011-08-29 14:33:02 +01:00
commit 05272d1070
10 changed files with 130 additions and 60 deletions

View File

@ -5,7 +5,6 @@ foreach( mylibfolder
bucket
debug
ephemeris
hla
io
magvar
math
@ -24,14 +23,18 @@ foreach( mylibfolder
endforeach( mylibfolder )
if (NOT SIMGEAR_HEADLESS)
if(NOT SIMGEAR_HEADLESS)
add_subdirectory(environment)
add_subdirectory(screen)
add_subdirectory(scene)
add_subdirectory(sound)
endif()
endif(NOT SIMGEAR_HEADLESS)
if(ENABLE_RTI)
add_subdirectory(hla)
endif(ENABLE_RTI)
set(HEADERS compiler.h constants.h sg_inlines.h ${PROJECT_BINARY_DIR}/simgear/version.h)
install (FILES ${HEADERS} DESTINATION include/simgear/)

View File

@ -107,6 +107,18 @@ HLAFederate::timeAdvanceRequest(const SGTimeStamp& dt)
return _rtiFederate->timeAdvanceRequest(dt);
}
bool
HLAFederate::queryFederateTime(SGTimeStamp& timeStamp)
{
return _rtiFederate->queryFederateTime(timeStamp);
}
bool
HLAFederate::queryLookahead(SGTimeStamp& timeStamp)
{
return _rtiFederate->queryLookahead(timeStamp);
}
bool
HLAFederate::tick()
{

View File

@ -58,6 +58,9 @@ public:
bool timeAdvanceRequestBy(const SGTimeStamp& dt);
bool timeAdvanceRequest(const SGTimeStamp& dt);
bool queryFederateTime(SGTimeStamp& timeStamp);
bool queryLookahead(SGTimeStamp& timeStamp);
/// Process messages
bool tick();
bool tick(const double& minimum, const double& maximum);

View File

@ -381,37 +381,18 @@ public:
// }
// return false;
// }
// bool queryFederateTime(double& time)
// {
// try {
// RTIfedTime fedTime;
// _rtiAmbassador.queryFederateTime(fedTime);
// time = fedTime.getTime();
// return true;
// } catch (RTI::FederateNotExecutionMember& e) {
// } catch (RTI::ConcurrentAccessAttempted& e) {
// } catch (RTI::SaveInProgress& e) {
// } catch (RTI::RestoreInProgress& e) {
// } catch (RTI::RTIinternalError& e) {
// }
// return false;
// }
// bool queryLookahead(double& time)
// {
// try {
// RTIfedTime fedTime;
// _rtiAmbassador.queryLookahead(fedTime);
// time = fedTime.getTime();
// return true;
// } catch (RTI::FederateNotExecutionMember& e) {
// } catch (RTI::ConcurrentAccessAttempted& e) {
// } catch (RTI::SaveInProgress& e) {
// } catch (RTI::RestoreInProgress& e) {
// } catch (RTI::RTIinternalError& e) {
// }
// return false;
// }
void queryFederateTime(SGTimeStamp& timeStamp)
{
RTIfedTime fedTime;
_rtiAmbassador.queryFederateTime(fedTime);
timeStamp = toTimeStamp(fedTime);
}
void queryLookahead(SGTimeStamp& timeStamp)
{
RTIfedTime fedTime;
_rtiAmbassador.queryLookahead(fedTime);
timeStamp = toTimeStamp(fedTime);
}
RTI13ObjectClass* createObjectClass(const std::string& name, HLAObjectClass* hlaObjectClass)
{

View File

@ -451,6 +451,64 @@ RTI13Federate::timeAdvanceRequest(const SGTimeStamp& fedTime)
return true;
}
bool
RTI13Federate::queryFederateTime(SGTimeStamp& timeStamp)
{
if (!_ambassador.valid()) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time.");
return false;
}
try {
_ambassador->queryFederateTime(timeStamp);
} catch (RTI::FederateNotExecutionMember& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
return false;
} catch (RTI::ConcurrentAccessAttempted& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
return false;
} catch (RTI::SaveInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
return false;
} catch (RTI::RestoreInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
return false;
} catch (RTI::RTIinternalError& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
return false;
}
return true;
}
bool
RTI13Federate::queryLookahead(SGTimeStamp& timeStamp)
{
if (!_ambassador.valid()) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead.");
return false;
}
try {
_ambassador->queryLookahead(timeStamp);
} catch (RTI::FederateNotExecutionMember& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
return false;
} catch (RTI::ConcurrentAccessAttempted& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
return false;
} catch (RTI::SaveInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
return false;
} catch (RTI::RestoreInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
return false;
} catch (RTI::RTIinternalError& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
return false;
}
return true;
}
bool
RTI13Federate::tick()
{

View File

@ -60,6 +60,9 @@ public:
virtual bool timeAdvanceRequestBy(const SGTimeStamp& dt);
virtual bool timeAdvanceRequest(const SGTimeStamp& fedTime);
virtual bool queryFederateTime(SGTimeStamp& timeStamp);
virtual bool queryLookahead(SGTimeStamp& timeStamp);
/// Process messages
virtual bool tick();
virtual bool tick(const double& minimum, const double& maximum);

View File

@ -319,21 +319,21 @@ RTI13ObjectInstance::updateAttributeValues(const RTIData& tag)
}
} catch (RTI::ObjectNotKnown& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::AttributeNotDefined& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::AttributeNotOwned& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::FederateNotExecutionMember& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::ConcurrentAccessAttempted& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::SaveInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::RestoreInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::RTIinternalError& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
}
// That means clear()
@ -377,23 +377,23 @@ RTI13ObjectInstance::updateAttributeValues(const SGTimeStamp& timeStamp, const R
}
} catch (RTI::ObjectNotKnown& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::AttributeNotDefined& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::AttributeNotOwned& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::InvalidFederationTime& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::FederateNotExecutionMember& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::ConcurrentAccessAttempted& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::SaveInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::RestoreInProgress& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
} catch (RTI::RTIinternalError& e) {
SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not delete object instance: " << e._name << " " << e._reason);
SG_LOG(SG_NETWORK, SG_WARN, "RTI: could not update attribute values object instance: " << e._name << " " << e._reason);
}
// That means clear()

View File

@ -65,6 +65,9 @@ public:
virtual bool timeAdvanceRequestBy(const SGTimeStamp& dt) = 0;
virtual bool timeAdvanceRequest(const SGTimeStamp& fedTime) = 0;
virtual bool queryFederateTime(SGTimeStamp& timeStamp) = 0;
virtual bool queryLookahead(SGTimeStamp& timeStamp) = 0;
/// Process messages
virtual bool tick() = 0;
virtual bool tick(const double& minimum, const double& maximum) = 0;

View File

@ -21,6 +21,7 @@
#include <simgear/math/SGMath.hxx>
#include <simgear/misc/sg_path.hxx>
#include <simgear/xml/easyxml.hxx>
#include <simgear/misc/ResourceManager.hxx>
#include "props.hxx"
#include "props_io.hxx"
@ -170,12 +171,15 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
// Check for an include.
attval = atts.getValue("include");
if (attval != 0) {
SGPath path(SGPath(_base).dir());
path.append(attval);
try {
readProperties(path.str(), _root, 0, _extended);
SGPath path = simgear::ResourceManager::instance()->findPath(attval, SGPath(_base).dir());
if (path.isNull())
{
throw sg_io_exception("Cannot open file", sg_location(attval));
}
readProperties(path.str(), _root, 0, _extended);
} catch (sg_io_exception &e) {
setException(e);
setException(e);
}
}
@ -242,12 +246,15 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
bool omit = false;
attval = atts.getValue("include");
if (attval != 0) {
SGPath path(SGPath(_base).dir());
path.append(attval);
try {
readProperties(path.str(), node, 0, _extended);
SGPath path = simgear::ResourceManager::instance()->findPath(attval, SGPath(_base).dir());
if (path.isNull())
{
throw sg_io_exception("Cannot open file", sg_location(attval));
}
readProperties(path.str(), node, 0, _extended);
} catch (sg_io_exception &e) {
setException(e);
setException(e);
}
attval = atts.getValue("omit-node");

View File

@ -118,7 +118,7 @@ public:
* @param _loop Define whether this sound should be played in a loop.
*/
void play( bool loop = false ) {
_playing = true; _loop = loop; _changed = true;
_playing = true; _loop = loop; _changed = true; _static_changed = true;
}
/**