QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Platform Namespace Reference

Functions

std::optional< int > initialize (int argc, char *argv[], const QGCCommandLineParser::CommandLineParseResult &args)
 Initialize platform: run safety checks and configure environment.
 
void setupPostApp ()
 Complete platform setup after application exists.
 
int showMultipleInstanceError (int argc, char *argv[])
 Show error dialog when another instance is already running.
 
bool checkSingleInstance (bool allowMultiple)
 Check if another instance is already running (single instance guard)
 

Function Documentation

◆ checkSingleInstance()

bool Platform::checkSingleInstance ( bool  allowMultiple)

Check if another instance is already running (single instance guard)

Parameters
allowMultipleIf true, skip the check and allow multiple instances
Returns
true if this instance can run, false if another instance is running

Definition at line 243 of file Platform.cc.

References RunGuard::tryToRun().

Referenced by initialize().

◆ initialize()

std::optional< int > Platform::initialize ( int  argc,
char *  argv[],
const QGCCommandLineParser::CommandLineParseResult args 
)

Initialize platform: run safety checks and configure environment.

Parameters
argcArgument count (for error dialogs)
argvArgument values (for error dialogs)
argsParsed command line arguments
Returns
Exit code if initialization failed, std::nullopt on success
Note
Call before constructing QGCApplication

Definition at line 135 of file Platform.cc.

References QGCCommandLineParser::CommandLineParseResult::allowMultiple, checkSingleInstance(), QGCCommandLineParser::CommandLineParseResult::listTests, QGCCommandLineParser::CommandLineParseResult::quietWindowsAsserts, QGCCommandLineParser::CommandLineParseResult::runningUnitTests, showMultipleInstanceError(), QGCCommandLineParser::CommandLineParseResult::useDesktopGL, and QGCCommandLineParser::CommandLineParseResult::useSwRast.

Referenced by main().

◆ setupPostApp()

void Platform::setupPostApp ( )

Complete platform setup after application exists.

Note
Call after Q(Core)Application exists and logging is installed

Definition at line 200 of file Platform.cc.

References AndroidInterface::checkStoragePermissions(), and SignalHandler::setupSignalHandlers().

Referenced by main().

◆ showMultipleInstanceError()

int Platform::showMultipleInstanceError ( int  argc,
char *  argv[] 
)

Show error dialog when another instance is already running.

Returns
Exit code (-1)

Definition at line 232 of file Platform.cc.

Referenced by initialize().