mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 22:56:33 +00:00
0b4b2f9f10
Commented out more things that are currently not needed.
41 lines
854 B
C++
41 lines
854 B
C++
#pragma once
|
|
|
|
#include <QJsonObject>
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QThread>
|
|
|
|
struct RectangleProperties
|
|
{
|
|
uint16_t width;
|
|
uint16_t height;
|
|
uint16_t middleX;
|
|
uint16_t middleY;
|
|
};
|
|
|
|
class RemoteControl : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RemoteControl();
|
|
~RemoteControl();
|
|
void run();
|
|
|
|
private slots:
|
|
void sendResponse(void);
|
|
void calculateTargetPosition(QJsonObject &commandObject);
|
|
void turnToTarget(QJsonObject &commandObject);
|
|
void zoomToTarget(QJsonObject &commandObject);
|
|
void restoreOrientation(void);
|
|
void restoreZoom(void);
|
|
RectangleProperties calculateRectangleProperties(uint16_t top, uint16_t left, uint16_t bottom, uint16_t right);
|
|
|
|
private:
|
|
void openNamedPipe(void);
|
|
bool mIsBusy;
|
|
int mFifoFdIn;
|
|
int mFifoFdOut;
|
|
QJsonObject mResponseObject;
|
|
};
|