Scouting App: Add ability to submit data with QR Codes
This patch adds the option for a scout to generate a QR Code
storing the collected data instead of submitting it. Next,
another user can submit the data by scanning the QR Code using the
new 'Scan' tab.
Since flatbuffers are pretty inefficient in terms of space usage, we
have trouble fitting all the data into a single QR code. The app
allows the user to split the data into multiple QR codes which have to
be scanned.
I tried a bunch of upstream QR code scanning libraries, but they're
all either unmaintained, not open source, or just don't work well. I
ended up settling on OpenCV because it was the most reliable library I
could find.
Co-Authored-By: Filip Kujawa <filip.j.kujawa@gmail.com>
Signed-off-by: Filip Kujawa <filip.j.kujawa@gmail.com>
Signed-off-by: Philipp Schrader <philipp.schrader+971@gmail.com>
Change-Id: I794b54bf7e8389200aa2abe8d05f622a987bca9c
diff --git a/tools/build_rules/js.bzl b/tools/build_rules/js.bzl
index 51fe987..c2468f8 100644
--- a/tools/build_rules/js.bzl
+++ b/tools/build_rules/js.bzl
@@ -378,7 +378,7 @@
copy_file(
name = name + "_config",
- out = "cypress.config.js",
+ out = name + "_cypress.config.js",
src = "//tools/build_rules/js:cypress.config.js",
visibility = ["//visibility:private"],
)
@@ -392,7 +392,7 @@
name = name,
args = [
"run",
- "--config-file=cypress.config.js",
+ "--config-file=%s_cypress.config.js" % name,
"--browser=" + chrome_location,
],
browsers = ["@chrome_linux//:all"],
diff --git a/tools/build_rules/js/cypress.config.js b/tools/build_rules/js/cypress.config.js
index e991016..5d2ec1c 100644
--- a/tools/build_rules/js/cypress.config.js
+++ b/tools/build_rules/js/cypress.config.js
@@ -9,6 +9,14 @@
launchOptions.args.push('--disable-gpu-shader-disk-cache');
launchOptions.args.push('--enable-logging');
launchOptions.args.push('--v=stderr');
+
+ // Point the browser at a video file to use as a webcam. This lets us
+ // validate things like QR code scanning.
+ launchOptions.args.push('--use-fake-ui-for-media-stream');
+ launchOptions.args.push('--use-fake-device-for-media-stream');
+ const fakeCameraVideo = `${process.env.TEST_UNDECLARED_OUTPUTS_DIR}/fake_camera.mjpeg`;
+ launchOptions.args.push(`--use-file-for-fake-video-capture=${fakeCameraVideo}`);
+
return launchOptions;
});