mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T773, clear log when written, set object name for logger
This commit is contained in:
committed by
Mat Sutcliffe
parent
f6c5e6f3cb
commit
a629b70724
@@ -445,7 +445,8 @@ namespace BlackCore
|
||||
this->clearInterpolationLogCallsigns();
|
||||
|
||||
// write
|
||||
m_interpolationLogger.writeLogInBackground();
|
||||
const bool clearLog = true;
|
||||
m_interpolationLogger.writeLogInBackground(clearLog);
|
||||
CLogMessage(this).info(u"Started writing interpolation log");
|
||||
return true;
|
||||
}
|
||||
@@ -687,6 +688,8 @@ namespace BlackCore
|
||||
CIdentifiable(this)
|
||||
{
|
||||
this->setObjectName("Simulator: " + pluginInfo.getIdentifier());
|
||||
m_interpolationLogger.setObjectName("Logger: " + pluginInfo.getIdentifier());
|
||||
|
||||
ISimulator::registerHelp();
|
||||
|
||||
// provider signals, hook up with remote aircraft provider
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace BlackMisc
|
||||
return cats;
|
||||
}
|
||||
|
||||
CWorker *CInterpolationLogger::writeLogInBackground()
|
||||
CWorker *CInterpolationLogger::writeLogInBackground(bool clearLog)
|
||||
{
|
||||
QList<SituationLog> situations;
|
||||
QList<PartsLog> parts;
|
||||
@@ -58,10 +58,13 @@ namespace BlackMisc
|
||||
parts = m_partsLogs;
|
||||
}
|
||||
|
||||
CWorker *worker = CWorker::fromTask(this, "WriteInterpolationLog", [situations, parts]()
|
||||
QPointer<CInterpolationLogger> myself(this);
|
||||
CWorker *worker = CWorker::fromTask(this, "WriteInterpolationLog", [situations, parts, myself, clearLog]()
|
||||
{
|
||||
const CStatusMessageList msg = CInterpolationLogger::writeLogFiles(situations, parts);
|
||||
CLogMessage::preformatted(msg);
|
||||
|
||||
if (clearLog && myself) { myself->clearLog(); }
|
||||
});
|
||||
return worker;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace BlackMisc
|
||||
static const CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Write a log in background
|
||||
CWorker *writeLogInBackground();
|
||||
CWorker *writeLogInBackground(bool clearLog);
|
||||
|
||||
//! Clear log file
|
||||
void clearLog();
|
||||
|
||||
@@ -481,6 +481,8 @@ namespace BlackSimPlugin
|
||||
// update provider, own name, title
|
||||
this->updateOwnModel(settings.getOwnModel());
|
||||
this->setObjectName(simulator);
|
||||
m_interpolationLogger.setObjectName("Logger (emulated driver): " + simulator.toQString());
|
||||
|
||||
if (m_monitorWidget) { m_monitorWidget->updateWindowTitleAndUiValues(simulator); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user