mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Ref T709, also log model name (so we can see if a particular model causes a crash)
This commit is contained in:
committed by
Mat Sutcliffe
parent
2793502839
commit
55d0eb97d0
@@ -995,11 +995,13 @@ namespace XSwiftBus
|
|||||||
double lxMeters = 0, lyMeters = 0, lzMeters = 0; // normally init not needed, just to avoid any issues
|
double lxMeters = 0, lyMeters = 0, lzMeters = 0; // normally init not needed, just to avoid any issues
|
||||||
static const double kFtToMeters = 0.3048;
|
static const double kFtToMeters = 0.3048;
|
||||||
|
|
||||||
|
std::string modelName = "unknown";
|
||||||
if (traffic->m_followPlaneViewCallsign == CTraffic::ownAircraftString())
|
if (traffic->m_followPlaneViewCallsign == CTraffic::ownAircraftString())
|
||||||
{
|
{
|
||||||
lxMeters = traffic->m_ownAircraftPositionX.get();
|
lxMeters = traffic->m_ownAircraftPositionX.get();
|
||||||
lyMeters = traffic->m_ownAircraftPositionY.get();
|
lyMeters = traffic->m_ownAircraftPositionY.get();
|
||||||
lzMeters = traffic->m_ownAircraftPositionZ.get();
|
lzMeters = traffic->m_ownAircraftPositionZ.get();
|
||||||
|
modelName = CTraffic::ownAircraftString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1033,6 +1035,7 @@ namespace XSwiftBus
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modelName = plane->modelName;
|
||||||
if (!isValidPosition(plane->position))
|
if (!isValidPosition(plane->position))
|
||||||
{
|
{
|
||||||
WARNING_LOG("Invalid follow aircraft position for " + plane->callsign);
|
WARNING_LOG("Invalid follow aircraft position for " + plane->callsign);
|
||||||
@@ -1043,7 +1046,7 @@ namespace XSwiftBus
|
|||||||
// avoid underflow of camera into ground
|
// avoid underflow of camera into ground
|
||||||
if (plane->isOnGround)
|
if (plane->isOnGround)
|
||||||
{
|
{
|
||||||
if (traffic->m_deltaCameraPosition.dyMeters < 5) { traffic->m_deltaCameraPosition.dyMeters = 5; }
|
if (traffic->m_deltaCameraPosition.dyMeters < 10) { traffic->m_deltaCameraPosition.dyMeters = 10; }
|
||||||
}
|
}
|
||||||
|
|
||||||
XPLMWorldToLocal(plane->position.lat, plane->position.lon, plane->position.elevation * kFtToMeters, &lxMeters, &lyMeters, &lzMeters);
|
XPLMWorldToLocal(plane->position.lat, plane->position.lon, plane->position.elevation * kFtToMeters, &lxMeters, &lyMeters, &lzMeters);
|
||||||
@@ -1069,7 +1072,7 @@ namespace XSwiftBus
|
|||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("Camera: " + pos2String(cameraPosition));
|
DEBUG_LOG("Camera: " + pos2String(cameraPosition));
|
||||||
DEBUG_LOG("Follow aircraft " + traffic->m_followPlaneViewCallsign);
|
DEBUG_LOG("Follow aircraft " + traffic->m_followPlaneViewCallsign + " " + modelName);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user