diff options
| -rw-r--r-- | ImageViewer.qml | 2 | ||||
| -rw-r--r-- | Main.qml | 23 | ||||
| -rw-r--r-- | main.cpp | 10 |
3 files changed, 30 insertions, 5 deletions
diff --git a/ImageViewer.qml b/ImageViewer.qml index ef9857d..722446b 100644 --- a/ImageViewer.qml +++ b/ImageViewer.qml @@ -61,7 +61,7 @@ Page { height: flickable.contentHeight function updateImage() { - // console.log("updateImage. visible: ", visible) + console.log("updateImage. visible: ", visible) if (image.source == newApiRoot + "/sensor/image") image.source = newApiRoot + "/sensor/image2" else @@ -132,6 +132,7 @@ ApplicationWindow { json["exposureTime"] = exposureTimeSpinBox.value; json["autoGain"] = enableAutoGainCheckbox.checked; json["gain"] = gainSpinBox.value / 10.; + json["triggerExposureDelayUs"] = triggerExposureDelayUsSpinBox.value; json["laserLevel"] = laserLevelSpinBox.value; console.log(JSON.stringify(json)); @@ -240,7 +241,6 @@ ApplicationWindow { color: "green" } - /* Label { id: maxDiffLabel @@ -312,7 +312,7 @@ ApplicationWindow { text: "Measurement: " + measurementCounter } -*/ + Label { Layout.fillWidth: true Layout.columnSpan: 2 @@ -383,6 +383,25 @@ ApplicationWindow { } Label { + text: qsTr("Trigger Exp Delay (us):") + } + + SpinBox { + id: triggerExposureDelayUsSpinBox + + Layout.fillWidth: true + Layout.minimumWidth: implicitWidth + + from: 0 + // TODO: fix this bullshit in DoubleSpinBox + to: 10000 + stepSize: 1 + editable: true + + onValueChanged: writeParams() + } + + Label { text: qsTr("Laser level (1/50K):") } @@ -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(); |
