From 3229aaf68c4a111f86b6de184ea423172930e957 Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 12:35:50 +0000 Subject: [PATCH 1/9] Fixing .bar and .sh files to be using current jar filename and paths so you can run root using these --- RoboxRoot.bat | 2 +- RoboxRoot.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RoboxRoot.bat b/RoboxRoot.bat index 21660c3..d413491 100755 --- a/RoboxRoot.bat +++ b/RoboxRoot.bat @@ -1 +1 @@ -java\bin\java -Djava.net.preferIPv4Stack=true -DlibertySystems.configFile=RoboxRoot.configFile.xml -jar RoboxRemoteServer.jar server printerControl.yml +java -DlibertySystems.configFile=RoboxRoot.configFile.xml -jar target/Root.jar server root.yml diff --git a/RoboxRoot.sh b/RoboxRoot.sh index 475f440..944e7bf 100755 --- a/RoboxRoot.sh +++ b/RoboxRoot.sh @@ -1 +1 @@ -java/bin/java -Djava.net.preferIPv4Stack=true -DlibertySystems.configFile=RoboxRoot.configFile.xml -jar RoboxRemoteServer.jar server printerControl.yml +java/bin/java -DlibertySystems.configFile=RoboxRoot.configFile.xml -jar target/Root.jar server root.yml From 0bb6f98fdd92155e31c506360dae8ed3abe39dcd Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 13:11:38 +0000 Subject: [PATCH 2/9] adding vscode launch configuration to allow debugging --- .vscode/launch.json | 16 ++++++++++++++++ nologname.log.1 | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d1b0f66 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Debug (Launch) with Arguments Prompt", + "request": "launch", + "mainClass": "celtech.roboxremote.Root", + "args": "server root.yml", + "vmArgs": "-DlibertySystems.configFile=RoboxRoot.configFile.xml" + } + ] +} \ No newline at end of file diff --git a/nologname.log.1 b/nologname.log.1 index e69de29..5f1d08b 100644 --- a/nologname.log.1 +++ b/nologname.log.1 @@ -0,0 +1,14 @@ +2023-01-01 13:09:32,654 [main] INFO - StenographerFactory initialised with logfile=nologname.log loglevel= logmode=LOCAL +>>>> ERROR loading system config (using -DlibertySystems.configFile) org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source null +2023-01-01 13:09:32,983 [main] ERROR celtech.roboxbase.configuration.BaseConfiguration.loadConfigurationInstance(BaseConfiguration.java:293) - Couldn't load configuration - the application cannot derive the install directory +Exception in thread "main" +java.lang.NullPointerException + at java.base/java.io.File.(File.java:278) + at celtech.roboxbase.configuration.BaseConfiguration.getCommonApplicationDirectory(BaseConfiguration.java:398) + at celtech.roboxbase.configuration.BaseConfiguration.getApplicationPrinterDirectory(BaseConfiguration.java:419) + at celtech.roboxbase.configuration.datafileaccessors.PrinterContainer.(PrinterContainer.java:36) + at celtech.roboxbase.configuration.datafileaccessors.PrinterContainer.getCompletePrinterList(PrinterContainer.java:97) + at celtech.roboxbase.configuration.BaseConfiguration.initialise(BaseConfiguration.java:176) + at celtech.roboxremote.Root.initialize(Root.java:65) + at io.dropwizard.Application.run(Application.java:88) + at celtech.roboxremote.Root.main(Root.java:48) From 5654b3eb0bca18efa82f6a670e8bbabb560debe6 Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 13:47:53 +0000 Subject: [PATCH 3/9] getting basic camera page loading adding new camera.js file to all html files (there has to be a better way!) --- src/main/resources/assets/about.html | 1 + src/main/resources/assets/access-pin.html | 1 + src/main/resources/assets/assets/js/camera.js | 6 ++ .../resources/assets/assets/js/page-init.js | 1 + src/main/resources/assets/camera.html | 78 +++++++++++++++++++ src/main/resources/assets/console.html | 1 + src/main/resources/assets/control.html | 1 + src/main/resources/assets/error.html | 1 + src/main/resources/assets/head-eeprom.html | 3 +- src/main/resources/assets/home.html | 1 + src/main/resources/assets/index.html | 1 + src/main/resources/assets/job-progress.html | 1 + .../assets/locales/en/translation.json | 1 + .../assets/locales/fr/translation.json | 1 + src/main/resources/assets/login.html | 1 + src/main/resources/assets/menu-grid.html | 1 + src/main/resources/assets/menu-horz.html | 1 + src/main/resources/assets/print-adjust.html | 1 + src/main/resources/assets/printer-colour.html | 1 + src/main/resources/assets/printer-name.html | 1 + src/main/resources/assets/printer-select.html | 1 + src/main/resources/assets/purge-intro.html | 1 + src/main/resources/assets/purge.html | 1 + src/main/resources/assets/reprint.html | 1 + src/main/resources/assets/reset-pin.html | 1 + src/main/resources/assets/server-name.html | 1 + src/main/resources/assets/splash.html | 1 + src/main/resources/assets/usb-print.html | 1 + .../resources/assets/wireless-settings.html | 1 + 29 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/assets/assets/js/camera.js create mode 100644 src/main/resources/assets/camera.html diff --git a/src/main/resources/assets/about.html b/src/main/resources/assets/about.html index 9089bb5..9c35672 100644 --- a/src/main/resources/assets/about.html +++ b/src/main/resources/assets/about.html @@ -50,6 +50,7 @@ + diff --git a/src/main/resources/assets/access-pin.html b/src/main/resources/assets/access-pin.html index a44d39e..ce362ff 100644 --- a/src/main/resources/assets/access-pin.html +++ b/src/main/resources/assets/access-pin.html @@ -62,6 +62,7 @@

Access PIN

+ diff --git a/src/main/resources/assets/assets/js/camera.js b/src/main/resources/assets/assets/js/camera.js new file mode 100644 index 0000000..15b0d6e --- /dev/null +++ b/src/main/resources/assets/assets/js/camera.js @@ -0,0 +1,6 @@ +function cameraInit() +{ + //$('#left-button').on('click', goToPreviousPage); + + setHomeButton(); +} \ No newline at end of file diff --git a/src/main/resources/assets/assets/js/page-init.js b/src/main/resources/assets/assets/js/page-init.js index 1f3f773..3f77fb4 100644 --- a/src/main/resources/assets/assets/js/page-init.js +++ b/src/main/resources/assets/assets/js/page-init.js @@ -1,5 +1,6 @@ var pageInitMap = {'about':aboutInit, 'access-pin':accessPINInit, + 'camera':cameraInit, 'console':consoleInit, 'head-eeprom':headEEPromInit, 'home':homeInit, diff --git a/src/main/resources/assets/camera.html b/src/main/resources/assets/camera.html new file mode 100644 index 0000000..1bf2c18 --- /dev/null +++ b/src/main/resources/assets/camera.html @@ -0,0 +1,78 @@ + + + + + + + Robox :: Camera + + + + + + + + + + +
+
+
+

Camera Preview

+
+
+
+
+
+
+

Enter Serial Number:

+

Enter the last six digits of the serial number of an attached printer, then click reset to return the PIN to the default of '1111'.

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/assets/console.html b/src/main/resources/assets/console.html index d5755b6..436f88e 100644 --- a/src/main/resources/assets/console.html +++ b/src/main/resources/assets/console.html @@ -65,6 +65,7 @@ + diff --git a/src/main/resources/assets/control.html b/src/main/resources/assets/control.html index 524d1dc..2f7a07e 100644 --- a/src/main/resources/assets/control.html +++ b/src/main/resources/assets/control.html @@ -92,6 +92,7 @@

Heat

+ diff --git a/src/main/resources/assets/error.html b/src/main/resources/assets/error.html index 2046446..334778c 100644 --- a/src/main/resources/assets/error.html +++ b/src/main/resources/assets/error.html @@ -56,6 +56,7 @@ + diff --git a/src/main/resources/assets/head-eeprom.html b/src/main/resources/assets/head-eeprom.html index fd044a9..b3dfad8 100644 --- a/src/main/resources/assets/head-eeprom.html +++ b/src/main/resources/assets/head-eeprom.html @@ -57,7 +57,7 @@

H
-

 

+

 

@@ -190,6 +190,7 @@

H + diff --git a/src/main/resources/assets/home.html b/src/main/resources/assets/home.html index 9ca9a43..907833b 100644 --- a/src/main/resources/assets/home.html +++ b/src/main/resources/assets/home.html @@ -160,6 +160,7 @@

°C< + diff --git a/src/main/resources/assets/index.html b/src/main/resources/assets/index.html index d907b3f..5a8dc5e 100644 --- a/src/main/resources/assets/index.html +++ b/src/main/resources/assets/index.html @@ -46,6 +46,7 @@ + diff --git a/src/main/resources/assets/job-progress.html b/src/main/resources/assets/job-progress.html index 12bbd7b..573c415 100644 --- a/src/main/resources/assets/job-progress.html +++ b/src/main/resources/assets/job-progress.html @@ -72,6 +72,7 @@

 

+ diff --git a/src/main/resources/assets/locales/en/translation.json b/src/main/resources/assets/locales/en/translation.json index 8019fd7..4e5dff2 100644 --- a/src/main/resources/assets/locales/en/translation.json +++ b/src/main/resources/assets/locales/en/translation.json @@ -9,6 +9,7 @@ "axis-testing":"Test Axis/Speed", "b":"B", "bed-temp":"Bed", + "camera-title": "Camera Preview", "clean-nozzle-right":"Clean Right Nozzle", "clean-nozzle-left":"Clean Left Nozzle", "clean-nozzle-description":"Please wait while the nozzle is cleaned.", diff --git a/src/main/resources/assets/locales/fr/translation.json b/src/main/resources/assets/locales/fr/translation.json index 7ff8c15..5cc0742 100644 --- a/src/main/resources/assets/locales/fr/translation.json +++ b/src/main/resources/assets/locales/fr/translation.json @@ -9,6 +9,7 @@ "axis-testing":"FRTest Axis/Speed", "b":"FRB", "bed-temp":"FRBed", + "camera-title": "FRCamera Preview", "clean-nozzle-right":"FRClean Right Nozzle", "clean-nozzle-left":"FRClean Left Nozzle", "clean-nozzle-description":"FRPlease wait while the nozzle is cleaned.", diff --git a/src/main/resources/assets/login.html b/src/main/resources/assets/login.html index 6799cbc..7d90cfa 100644 --- a/src/main/resources/assets/login.html +++ b/src/main/resources/assets/login.html @@ -60,6 +60,7 @@

Login

+ diff --git a/src/main/resources/assets/menu-grid.html b/src/main/resources/assets/menu-grid.html index 6f709d3..442ca11 100644 --- a/src/main/resources/assets/menu-grid.html +++ b/src/main/resources/assets/menu-grid.html @@ -48,6 +48,7 @@ + diff --git a/src/main/resources/assets/menu-horz.html b/src/main/resources/assets/menu-horz.html index 8504210..28c0b99 100644 --- a/src/main/resources/assets/menu-horz.html +++ b/src/main/resources/assets/menu-horz.html @@ -60,6 +60,7 @@

Title

+ diff --git a/src/main/resources/assets/print-adjust.html b/src/main/resources/assets/print-adjust.html index 14ae0aa..176548a 100644 --- a/src/main/resources/assets/print-adjust.html +++ b/src/main/resources/assets/print-adjust.html @@ -167,6 +167,7 @@ + diff --git a/src/main/resources/assets/printer-colour.html b/src/main/resources/assets/printer-colour.html index 688974b..868e036 100644 --- a/src/main/resources/assets/printer-colour.html +++ b/src/main/resources/assets/printer-colour.html @@ -84,6 +84,7 @@

Printer Colour + diff --git a/src/main/resources/assets/printer-name.html b/src/main/resources/assets/printer-name.html index 1643327..d0a7ba1 100644 --- a/src/main/resources/assets/printer-name.html +++ b/src/main/resources/assets/printer-name.html @@ -49,6 +49,7 @@

Printer Name

+ diff --git a/src/main/resources/assets/printer-select.html b/src/main/resources/assets/printer-select.html index 8b019b0..eb492b7 100644 --- a/src/main/resources/assets/printer-select.html +++ b/src/main/resources/assets/printer-select.html @@ -113,6 +113,7 @@

+ diff --git a/src/main/resources/assets/purge-intro.html b/src/main/resources/assets/purge-intro.html index 2441e7e..9253f93 100644 --- a/src/main/resources/assets/purge-intro.html +++ b/src/main/resources/assets/purge-intro.html @@ -56,6 +56,7 @@

Purge

+ diff --git a/src/main/resources/assets/purge.html b/src/main/resources/assets/purge.html index a7bb3b4..5b984ec 100644 --- a/src/main/resources/assets/purge.html +++ b/src/main/resources/assets/purge.html @@ -122,6 +122,7 @@

Purge

+ diff --git a/src/main/resources/assets/reprint.html b/src/main/resources/assets/reprint.html index 9d377e9..04241bb 100644 --- a/src/main/resources/assets/reprint.html +++ b/src/main/resources/assets/reprint.html @@ -110,6 +110,7 @@

+ diff --git a/src/main/resources/assets/reset-pin.html b/src/main/resources/assets/reset-pin.html index 495f2be..50c0b5d 100644 --- a/src/main/resources/assets/reset-pin.html +++ b/src/main/resources/assets/reset-pin.html @@ -61,6 +61,7 @@

Reset PIN

+ diff --git a/src/main/resources/assets/server-name.html b/src/main/resources/assets/server-name.html index 7c56378..010a764 100644 --- a/src/main/resources/assets/server-name.html +++ b/src/main/resources/assets/server-name.html @@ -49,6 +49,7 @@

Server Name

+ diff --git a/src/main/resources/assets/splash.html b/src/main/resources/assets/splash.html index 266893c..3d216ac 100644 --- a/src/main/resources/assets/splash.html +++ b/src/main/resources/assets/splash.html @@ -42,6 +42,7 @@

+ diff --git a/src/main/resources/assets/usb-print.html b/src/main/resources/assets/usb-print.html index 7d39995..05c55d1 100644 --- a/src/main/resources/assets/usb-print.html +++ b/src/main/resources/assets/usb-print.html @@ -110,6 +110,7 @@

+ diff --git a/src/main/resources/assets/wireless-settings.html b/src/main/resources/assets/wireless-settings.html index 8ffe01f..d186cca 100644 --- a/src/main/resources/assets/wireless-settings.html +++ b/src/main/resources/assets/wireless-settings.html @@ -54,6 +54,7 @@

Wireless Se + From ded6bb251d3b1bc5dcf610055437008546d74d7b Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 15:33:37 +0000 Subject: [PATCH 4/9] adding in support to promisePostCommandToRoot for reading binary files for the camera images --- src/main/resources/assets/assets/js/camera.js | 17 +++++++- .../assets/assets/js/jquery.binary.js | 42 +++++++++++++++++++ .../assets/assets/js/promise-funcs.js | 8 ++-- src/main/resources/assets/camera.html | 6 +-- 4 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/assets/assets/js/jquery.binary.js diff --git a/src/main/resources/assets/assets/js/camera.js b/src/main/resources/assets/assets/js/camera.js index 15b0d6e..8f0320e 100644 --- a/src/main/resources/assets/assets/js/camera.js +++ b/src/main/resources/assets/assets/js/camera.js @@ -1,6 +1,21 @@ +var cameraprofilejson = {"profile":{"profileName":"Default","captureHeight":720,"captureWidth":1080,"headLightOff":true,"ambientLightOff":false,"moveBeforeCapture":true,"moveToX":50,"moveToY":50,"cameraName":"","controlSettings":{}},"camera":{"udevName":"/dev/video0","cameraName":"camera0","cameraNumber":0,"serverIP":""}}; + function cameraInit() { //$('#left-button').on('click', goToPreviousPage); + + promisePostCommandToRoot('cameraControl/0/snapshot', cameraprofilejson, true) + .then(function(result) + { + var reader = new FileReader(); + reader.onload = function() { + var b64 = reader.result + console.log("This is base64", b64) + document.getElementById("camerapreview").src = b64 + } + reader.readAsDataURL(result) + }); + setHomeButton(); -} \ No newline at end of file +} diff --git a/src/main/resources/assets/assets/js/jquery.binary.js b/src/main/resources/assets/assets/js/jquery.binary.js new file mode 100644 index 0000000..728b995 --- /dev/null +++ b/src/main/resources/assets/assets/js/jquery.binary.js @@ -0,0 +1,42 @@ +// use this transport for "binary" data type +$.ajaxTransport("+binary", function(options, originalOptions, jqXHR){ + // check for conditions and support for blob / arraybuffer response type + if (window.FormData && ((options.dataType && (options.dataType == 'binary')) || (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) || (window.Blob && options.data instanceof Blob))))) + { + return { + // create new XMLHttpRequest + send: function(headers, callback){ + // setup all variables + var xhr = new XMLHttpRequest(), + url = options.url, + type = options.type, + async = options.async || true, + // blob or arraybuffer. Default is blob + dataType = options.responseType || "blob", + data = options.data || null, + username = options.username || null, + password = options.password || null; + + xhr.addEventListener('load', function(){ + var data = {}; + data[options.dataType] = xhr.response; + // make callback and send data + callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders()); + }); + + xhr.open(type, url, async, username, password); + + // setup custom headers + for (var i in headers ) { + xhr.setRequestHeader(i, headers[i] ); + } + + xhr.responseType = dataType; + xhr.send(data); + }, + abort: function(){ + jqXHR.abort(); + } + }; + } +}); diff --git a/src/main/resources/assets/assets/js/promise-funcs.js b/src/main/resources/assets/assets/js/promise-funcs.js index 0dc9a31..c91a0f0 100644 --- a/src/main/resources/assets/assets/js/promise-funcs.js +++ b/src/main/resources/assets/assets/js/promise-funcs.js @@ -1,4 +1,4 @@ -function promiseCommandToRoot(requestType, service, dataToSend) +function promiseCommandToRoot(requestType, service, dataToSend, isBinary) { return new Promise(function(resolve, reject) { @@ -13,6 +13,8 @@ function promiseCommandToRoot(requestType, service, dataToSend) }, contentType: 'application/json', // send as JSON type: requestType, + dataType: isBinary ? "binary" : "", + processData: !isBinary, success:function (data, textStatus, jqXHR) { resolve(data); @@ -47,7 +49,7 @@ function promiseGetCommandToRoot(service, dataToSend) return promiseCommandToRoot('GET', service, dataToSend); } -function promisePostCommandToRoot(service, dataToSend) +function promisePostCommandToRoot(service, dataToSend, isBinary) { - return promiseCommandToRoot('POST', service, dataToSend); + return promiseCommandToRoot('POST', service, dataToSend, isBinary); } diff --git a/src/main/resources/assets/camera.html b/src/main/resources/assets/camera.html index 1bf2c18..5b2be97 100644 --- a/src/main/resources/assets/camera.html +++ b/src/main/resources/assets/camera.html @@ -25,9 +25,8 @@

Camera Preview

-

Enter Serial Number:

-

Enter the last six digits of the serial number of an attached printer, then click reset to return the PIN to the default of '1111'.

+ +
@@ -41,6 +40,7 @@

Camera Preview

+ From e9202f1453bff0236a51ee57ba49baff29199f2b Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 16:25:56 +0000 Subject: [PATCH 5/9] reading camera profiles in and supporting when no camera found --- src/main/resources/assets/assets/js/camera.js | 36 ++++++++++++++----- src/main/resources/assets/camera.html | 7 ++-- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/main/resources/assets/assets/js/camera.js b/src/main/resources/assets/assets/js/camera.js index 8f0320e..5045552 100644 --- a/src/main/resources/assets/assets/js/camera.js +++ b/src/main/resources/assets/assets/js/camera.js @@ -1,21 +1,41 @@ -var cameraprofilejson = {"profile":{"profileName":"Default","captureHeight":720,"captureWidth":1080,"headLightOff":true,"ambientLightOff":false,"moveBeforeCapture":true,"moveToX":50,"moveToY":50,"cameraName":"","controlSettings":{}},"camera":{"udevName":"/dev/video0","cameraName":"camera0","cameraNumber":0,"serverIP":""}}; - +//var cameraprofilejson = {"profile":{"profileName":"Default","captureHeight":720,"captureWidth":1080,"headLightOff":true,"ambientLightOff":false,"moveBeforeCapture":true,"moveToX":50,"moveToY":50,"cameraName":"","controlSettings":{}},"camera":{"udevName":"/dev/video0","cameraName":"camera0","cameraNumber":0,"serverIP":""}}; +var cameraprofilejson; function cameraInit() { - //$('#left-button').on('click', goToPreviousPage); - + $('#left-button').on('click', goToPreviousPage); - promisePostCommandToRoot('cameraControl/0/snapshot', cameraprofilejson, true) + GetCameraProfile(); + + setHomeButton(); +} + +function GetCameraProfile(){ + promiseGetCommandToRoot('discovery/listCameras', null) + .then(function(result) + { + if(result.cameras.length){ + // only supporting one for now + var camera = result.cameras[0]; + cameraprofilejson = {"profile":{},"camera":{"udevName":camera.udevName,"cameraName":camera.cameraName,"cameraNumber":camera.cameraNumber,"serverIP":""}} + setInterval(loadFrame, 1000); + } + else{ + $("#no-cameras").removeClass("hidden"); + } + }); +} + +function loadFrame(){ + if(cameraprofilejson){ + promisePostCommandToRoot('cameraControl/0/snapshot', cameraprofilejson, true) .then(function(result) { var reader = new FileReader(); reader.onload = function() { var b64 = reader.result - console.log("This is base64", b64) document.getElementById("camerapreview").src = b64 } reader.readAsDataURL(result) }); - - setHomeButton(); + } } diff --git a/src/main/resources/assets/camera.html b/src/main/resources/assets/camera.html index 5b2be97..4e03129 100644 --- a/src/main/resources/assets/camera.html +++ b/src/main/resources/assets/camera.html @@ -24,9 +24,11 @@

Camera Preview

+
- - +
@@ -74,5 +76,4 @@

Camera Preview

- \ No newline at end of file From e78e1e128c82f7985582504799871c63d32b3d9d Mon Sep 17 00:00:00 2001 From: gingemonster Date: Sun, 1 Jan 2023 20:46:17 +0000 Subject: [PATCH 6/9] improving camera loading performance adding camera to menu --- .../assets/assets/img/Icon-Camera.svg | 52 +++++++++++++++++++ src/main/resources/assets/assets/js/camera.js | 4 +- src/main/resources/assets/camera.html | 2 +- src/main/resources/assets/menu-grid.html | 2 +- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/assets/assets/img/Icon-Camera.svg diff --git a/src/main/resources/assets/assets/img/Icon-Camera.svg b/src/main/resources/assets/assets/img/Icon-Camera.svg new file mode 100644 index 0000000..4dffce4 --- /dev/null +++ b/src/main/resources/assets/assets/img/Icon-Camera.svg @@ -0,0 +1,52 @@ + +Icon-Camera + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/assets/assets/js/camera.js b/src/main/resources/assets/assets/js/camera.js index 5045552..407a393 100644 --- a/src/main/resources/assets/assets/js/camera.js +++ b/src/main/resources/assets/assets/js/camera.js @@ -1,4 +1,3 @@ -//var cameraprofilejson = {"profile":{"profileName":"Default","captureHeight":720,"captureWidth":1080,"headLightOff":true,"ambientLightOff":false,"moveBeforeCapture":true,"moveToX":50,"moveToY":50,"cameraName":"","controlSettings":{}},"camera":{"udevName":"/dev/video0","cameraName":"camera0","cameraNumber":0,"serverIP":""}}; var cameraprofilejson; function cameraInit() { @@ -17,7 +16,7 @@ function GetCameraProfile(){ // only supporting one for now var camera = result.cameras[0]; cameraprofilejson = {"profile":{},"camera":{"udevName":camera.udevName,"cameraName":camera.cameraName,"cameraNumber":camera.cameraNumber,"serverIP":""}} - setInterval(loadFrame, 1000); + loadFrame(); } else{ $("#no-cameras").removeClass("hidden"); @@ -34,6 +33,7 @@ function loadFrame(){ reader.onload = function() { var b64 = reader.result document.getElementById("camerapreview").src = b64 + loadFrame(); } reader.readAsDataURL(result) }); diff --git a/src/main/resources/assets/camera.html b/src/main/resources/assets/camera.html index 4e03129..07ebe11 100644 --- a/src/main/resources/assets/camera.html +++ b/src/main/resources/assets/camera.html @@ -37,7 +37,7 @@

Camera Preview

diff --git a/src/main/resources/assets/menu-grid.html b/src/main/resources/assets/menu-grid.html index 442ca11..9aef47e 100644 --- a/src/main/resources/assets/menu-grid.html +++ b/src/main/resources/assets/menu-grid.html @@ -30,7 +30,7 @@