mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T554, check function for auto publishing
This commit is contained in:
committed by
Mat Sutcliffe
parent
fab65c23b1
commit
ac22e1d17d
@@ -513,5 +513,23 @@ namespace BlackCore
|
||||
textPartDebug.setBody(QString("ECLIPSE_DBGP").toUtf8());
|
||||
return textPartDebug;
|
||||
}
|
||||
|
||||
ChangedAutoPublishData CDatabaseUtils::autoPublishDataChanged(const QString &modelString, const PhysicalQuantities::CLength &cg, const CSimulatorInfo &simulator)
|
||||
{
|
||||
ChangedAutoPublishData changed;
|
||||
if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return changed; }
|
||||
const CAircraftModel model = sApp->getWebDataServices()->getModelForModelString(modelString);
|
||||
return CDatabaseUtils::autoPublishDataChanged(model, cg, simulator);
|
||||
}
|
||||
|
||||
ChangedAutoPublishData CDatabaseUtils::autoPublishDataChanged(const CAircraftModel &model, const PhysicalQuantities::CLength &cg, const CSimulatorInfo &simulator)
|
||||
{
|
||||
ChangedAutoPublishData changed;
|
||||
changed.modelKnown = model.hasValidDbKey();
|
||||
if (!changed.modelKnown) { return changed; }
|
||||
changed.changedCG = !(cg == model.getCG());
|
||||
changed.changedSim = !(model.getSimulator().matchesAll(simulator));
|
||||
return changed;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user