From 1a565eaee0b6ef4d85f4451d737f6350fd09b787 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Fri, 14 Apr 2017 19:29:55 +0200 Subject: [PATCH] Add display from webcam to stage controller --- stages/index.html | 13 ++++++++++--- stages/style.css | 5 +++++ stages/webcam.pl | 9 +++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 stages/webcam.pl diff --git a/stages/index.html b/stages/index.html index 0bac9ec..267acc8 100644 --- a/stages/index.html +++ b/stages/index.html @@ -88,7 +88,7 @@ var data; case "zero": commands += "DP 0,0;"; break; case "anycommand": commands += val+";";break; } - commands += "PA?;PA,?;PR?;PR,?;"; + commands += "PA?;PA,?;"; runcmd(commands); } @@ -109,6 +109,7 @@ var data;
Last Update:
--

Move

+

Enter value (in mm) and press Enter to execute command

@@ -120,5 +121,11 @@ var data;

Run any other command

Console

-
- +
+ + diff --git a/stages/style.css b/stages/style.css index eb546f1..f498e5d 100644 --- a/stages/style.css +++ b/stages/style.css @@ -19,3 +19,8 @@ div.position .value{ text-align:right; font-family:monospace; } + +img { + display:block; + float:right; +} diff --git a/stages/webcam.pl b/stages/webcam.pl new file mode 100755 index 0000000..4f4d325 --- /dev/null +++ b/stages/webcam.pl @@ -0,0 +1,9 @@ +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTP-?i/i) { + &htsponse(200, "OK"); + } + +print "Content-Type: image/jpeg;\r\n\r\n"; + +system("fswebcam -F5 -d /dev/video1 -r 1280x720 --scale 844x475 --jpeg 80 '-' 2>/dev/null"); +return 1; -- 2.43.0