From d3dcd356e063efa21aa83fef94775e7de3a9aaef Mon Sep 17 00:00:00 2001 From: Jacob Haip Date: Sat, 22 Apr 2023 20:17:24 -0400 Subject: add program to see threshold laser image and visualize detected blobs --- user-programs/folk-haip.local/laser-web-debug.folk | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 user-programs/folk-haip.local/laser-web-debug.folk (limited to 'user-programs') diff --git a/user-programs/folk-haip.local/laser-web-debug.folk b/user-programs/folk-haip.local/laser-web-debug.folk new file mode 100644 index 00000000..f65107c2 --- /dev/null +++ b/user-programs/folk-haip.local/laser-web-debug.folk @@ -0,0 +1,77 @@ +When the collected matches for [list tag /t/ has center /c/ size /s/] are /matches/ { + Wish the web server handles route "/laser-web-debug" with handler [list Evaluator::tryRunInSerializedEnvironment { + set blobsHtml "
    " + set blobsJson "" + foreach match $matches { + append blobsHtml "
  1. [dict get $match t]: [dict get $match c]
  2. " + append blobsJson "{\"id\": [dict get $match t], \"x\": [lindex [dict get $match c] 0], \"y\": [lindex [dict get $match c] 1]}," + } + append blobsHtml "
" + append blobsJson "" + html [string map [list MY_BLOBS_HTML $blobsHtml MY_BLOBS_JSON $blobsJson] { + + + + + + + + MY_BLOBS_HTML + + + + + + }] + } [Evaluator::serializeEnvironment]] +} \ No newline at end of file -- cgit v1.2.3