mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #848, parse command line in simulator
* added default implementation * sims can override parseDetails for specific cmd lines * enable/disable FSUIPC in fscommon part * added useFsuipc(bool on)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
15020b2d5f
commit
c609c555b4
@@ -201,6 +201,12 @@ namespace BlackCore
|
||||
this->reverseLookupAndUpdateOwnAircraftModel(model);
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::parseDetails(const CSimpleCommandParser &parser)
|
||||
{
|
||||
Q_UNUSED(parser);
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimulatorCommon::reverseLookupAndUpdateOwnAircraftModel(const BlackMisc::Simulation::CAircraftModel &model)
|
||||
{
|
||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing sApp");
|
||||
@@ -323,6 +329,25 @@ namespace BlackCore
|
||||
return removed;
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
|
||||
{
|
||||
if (this->isMyIdentifier(originator)) { return false; }
|
||||
if (commandLine.isEmpty()) { return false; }
|
||||
CSimpleCommandParser parser(
|
||||
{
|
||||
".plugin", ".drv", ".driver"
|
||||
});
|
||||
parser.parse(commandLine);
|
||||
if (!parser.isKnownCommand()) { return false; }
|
||||
|
||||
if (parser.matchesPart(1, "unload"))
|
||||
{
|
||||
this->unload();
|
||||
return true;
|
||||
}
|
||||
return this->parseDetails(parser);
|
||||
}
|
||||
|
||||
void CSimulatorCommon::ps_oneSecondTimer()
|
||||
{
|
||||
blinkHighlightedAircraft();
|
||||
|
||||
Reference in New Issue
Block a user