mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 08:26:33 +00:00
35 lines
804 B
C++
35 lines
804 B
C++
#include <QCoreApplication>
|
|
#include <QThread>
|
|
#include "config.hpp"
|
|
#include "localControl.h"
|
|
#include "remoteControl.h"
|
|
#include "serialCommand.hpp"
|
|
#include "serialPort.hpp"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication app(argc, argv);
|
|
SerialCommand serialCommand;
|
|
SerialPort serialPort;
|
|
Config::setInitalValues(&serialPort, &serialCommand);
|
|
|
|
bool useRemoteMode = true;
|
|
for (int i = 1; i < argc; ++i) {
|
|
if (QString(argv[i]) == "-l") {
|
|
useRemoteMode = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Remote mode will read commands from pipe
|
|
if (useRemoteMode == true) {
|
|
RemoteControl remoteControl;
|
|
remoteControl.run();
|
|
} else {
|
|
LocalControl localControl;
|
|
localControl.run();
|
|
}
|
|
|
|
return app.exec();
|
|
}
|