mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Reflecting discussed changes for interpolation performance refs #386
(based on FSX testing) * Only send changed situation to SIM * Split sending of parts / situations * Only send parts with a reduced frequency (means slower as positions) * Mark geodetic height as null for default values (the value is usually unavailable) * Fixed altitude to MSL for network data * Trace which aircrafts support aircraft parts via network * Renamed insert_fron push_front (as proposed by Roland) Status quo / lessons learnt * On slower PCs jitter is still noticed for interpolated aircraft. * Running interpolation in an independent process (aka core, not in GUI) reduced load dependencies => it seems to make sense to run driver in own thread * The onGround flag in parts seems clumsy as it required to retrieve parts for position updates * In interpolation performance really matters
This commit is contained in:
@@ -648,16 +648,17 @@ namespace BlackCore
|
||||
{
|
||||
const CCallsign callsign(callsignChar);
|
||||
const CAircraftSituation situation(
|
||||
callsign,
|
||||
CCoordinateGeodetic(position->latitude, position->longitude, 0.0),
|
||||
CAltitude(position->altitudeTrue, CAltitude::AboveGround, CLengthUnit::ft()),
|
||||
CAltitude(position->altitudeTrue, CAltitude::MeanSeaLevel, CLengthUnit::ft()),
|
||||
CHeading(position->heading, CHeading::True, CAngleUnit::deg()),
|
||||
CAngle(position->pitch, CAngleUnit::deg()),
|
||||
CAngle(position->bank, CAngleUnit::deg()),
|
||||
CSpeed(position->groundSpeed, CSpeedUnit::kts())
|
||||
);
|
||||
|
||||
QString tn("transponder ");
|
||||
tn.append(callsign.asString());
|
||||
QString transponderName("transponder ");
|
||||
transponderName.append(callsign.asString());
|
||||
CTransponder::TransponderMode mode = CTransponder::StateStandby;
|
||||
switch (position->transponderMode)
|
||||
{
|
||||
@@ -675,19 +676,21 @@ namespace BlackCore
|
||||
break;
|
||||
}
|
||||
|
||||
// I did have a situation where I got wrong transponger codes (KB)
|
||||
// I did have a situation where I got wrong transponder codes (KB)
|
||||
// So I now check for a valid code in order to detect such codes
|
||||
CTransponder transponder(tn, 0, mode);
|
||||
CTransponder transponder;
|
||||
if (CTransponder::isValidTransponderCode(position->transponderCode))
|
||||
{
|
||||
transponder = CTransponder(tn, position->transponderCode, mode);
|
||||
transponder = CTransponder(transponderName, position->transponderCode, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: how do with log this
|
||||
qDebug() << "Wrong transponder code" << position->transponderMode << callsign;
|
||||
CLogMessage(static_cast<CNetworkVatlib *>(nullptr)).warning("Wrong transponder code %1 for %2") << position->transponderCode << callsign;
|
||||
|
||||
// default
|
||||
transponder = CTransponder(transponderName, 7000, mode);
|
||||
}
|
||||
emit cbvar_cast(cbvar)->aircraftPositionUpdate(callsign, situation, transponder);
|
||||
emit cbvar_cast(cbvar)->aircraftPositionUpdate(situation, transponder);
|
||||
}
|
||||
|
||||
void CNetworkVatlib::onAircraftConfigReceived(VatSessionID, const char *callsign, const char *aircraftConfig, void *cbvar)
|
||||
|
||||
Reference in New Issue
Block a user