Skip to content

Commit

Permalink
Fix drag-and-drop on ground station
Browse files Browse the repository at this point in the history
This is a quick fix that allows drag-and-drop to begin working again
on the ground station touchscreen without breaking remote
drag-and-drop.

This part of the code sends drag messages over the network, something
that is only intended to work from android->ground, not from
ground->anything.

The current issue is that the drag messages are being sent by
the ground station to itself, which prevents locally dragging from
working properly.

Long term it would be wise to fix the drag-and-drop system so that it
is 2-way, which would necessarily handle issues like this anyway.
  • Loading branch information
steveatinfincia committed Jan 16, 2020
1 parent 073fe65 commit dfc96dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/qopenhdlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private slots:
private:
void init();

QString groundAddress;
QString groundAddress = "192.168.2.1";

void processCommand(QByteArray buffer);
void processSetWidgetLocation(nlohmann::json command);
Expand Down
2 changes: 2 additions & 0 deletions src/qopenhdlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void QOpenHDLink::readyRead() {

void QOpenHDLink::setWidgetLocation(QString widgetName, int alignment, int xOffset, int yOffset, bool hCenter, bool vCenter) {
#if defined(ENABLE_LINK)
#if !defined(__rasp_pi__)
nlohmann::json j = {
{"cmd", "setWidgetLocation"},
{"widgetName", widgetName.toStdString()},
Expand All @@ -72,6 +73,7 @@ void QOpenHDLink::setWidgetLocation(QString widgetName, int alignment, int xOffs
auto buf = QByteArray(serialized_string.c_str());
linkSocket->writeDatagram(buf, QHostAddress(groundAddress), LINK_PORT);
#endif
#endif
}

void QOpenHDLink::setWidgetEnabled(QString widgetName, bool enabled) {
Expand Down

0 comments on commit dfc96dc

Please sign in to comment.