summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 7bde680..19108d0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -110,6 +110,12 @@ void onNewPixels(
// qDebug() << __func__ << "got empty pixels";
}
+ for (size_t i = 640 - 5; i < 640 + 5; i++) {
+ // std::cout << pixels->pixels[i] << " ";
+ }
+
+ // std::cout << std::endl
+
::pixels = *pixels;
}
@@ -144,7 +150,7 @@ int main(int argc, char* argv[])
// if (false)
qDebug() << "size of raw profile" << sizeof(Pixels);
- if (false) {
+ if (true) {
// open binary calibration table
if (true) {
if (!openCalibrationTable("/home/user/dumps/binz.calibration_table",
@@ -294,8 +300,7 @@ int main(int argc, char* argv[])
interpolate(::calibrationTableX);
- if (!dump(::calibrationTableZ,
- "/home/user/dumps/binx.calibration_table")) {
+ if (!dump(::calibrationTableX, "/home/user/dumps/binx.calibration_table")) {
qApp->exit(EXIT_FAILURE);
}
@@ -305,6 +310,14 @@ int main(int argc, char* argv[])
}
}
+ QCryptographicHash hashZ(QCryptographicHash::Sha256);
+ hashZ.addData(QByteArrayView((char *) ::calibrationTableZ.data(), sizeof(CalibrationTable)));
+ qDebug() << "hash z" << sizeof(::calibrationTableZ) << hashZ.result().toHex();
+
+ QCryptographicHash hashX(QCryptographicHash::Sha256);
+ hashX.addData(QByteArrayView((char *) ::calibrationTableX.data(), sizeof(CalibrationTable)));
+ qDebug() << "hash x" << sizeof(::calibrationTableX) << hashX.result().toHex();
+
// exit(EXIT_SUCCESS);
// if (!initLaser()) {
@@ -353,7 +366,10 @@ int main(int argc, char* argv[])
QHttpServer qHttpServer;
qHttpServer.route("/v1/sensor/image", [&]() {
std::cout << "http: image" << std::endl << std::flush;
+ // FILE *f = fopen("/tmp/img.pgm", "w");
+ // static bool save = false;
pgm_save(::img);
+ // save = false;
std::lock_guard<std::mutex> lg(pgm_image_mtx);
qDebug() << "mutex locked";
qDebug() << "image saved to array";