summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 01b4e60..9e2094c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -91,7 +91,8 @@ int main(
// QNetworkRequest profileRequest(QUrl("http://rpizero:8081/v1/profile"));
// QNetworkRequest pixelsRequest(QUrl("http://radxa:8081/v1/pixels"));
QNetworkRequest pixelsRequest(QUrl("http://radxa:8080/v1/pixels"));
- QNetworkRequest profileRequest(QUrl("http://radxa:8081/v1/profile"));
+ QNetworkRequest profileRequest(QUrl("http://radxa:8080/v1/profile"));
+ // QNetworkRequest profileRequest(QUrl("http://radxa:80/v1/profile"));
auto manager = new QNetworkAccessManager(&app);
QTimer pixelsAutoRestartTimer(&app);
@@ -105,6 +106,7 @@ int main(
profileAutoRestartTimer.setInterval(500);
profileAutoRestartTimer.setSingleShot(false);
QObject::connect(&profileAutoRestartTimer, &QTimer::timeout, [&]() {
+ qDebug() << "SEND PROFILE REQUEST";
manager->get(profileRequest);
});
@@ -260,10 +262,11 @@ int main(
prev_y_profile = y_pixels;
} else if (reply->url().toString().endsWith("profile")) {
+ qDebug() << "GOT PROFILE";
++profilePacketCounter;
auto json = QJsonDocument::fromJson(reply->readAll()).object();
auto jsonProfile = json["profile"].toObject();
- auto jsonPointsMm = jsonProfile["pointsMm"].toArray();
+ auto jsonPointsMm = json["pointsMm"].toArray();
QList<qreal> x_profile(size_t(img_width), 0.);
QList<qreal> y_profile(size_t(img_width), 0.);
@@ -287,8 +290,10 @@ int main(
profileGraph->setData(x_profile, y_profile);
// pixelsGraph->setData(x_profile, y_profile);
+ qDebug() << "SEND PROFILE REQUEST1";
manager->get(profileRequest);
profileAutoRestartTimer.start();
+ qDebug() << "START PROFILE TIMER";
} else {
qDebug() << "unknown reply type";
}
@@ -302,6 +307,7 @@ int main(
manager->get(pixelsRequest);
pixelsAutoRestartTimer.start();
+ qDebug() << "SEND PROFILE REQUEST2";
manager->get(profileRequest);
// profileAutoRestartTimer.start();