diff --git a/flows/main.json b/flows/main.json
index f7817db..e4a79f9 100644
--- a/flows/main.json
+++ b/flows/main.json
@@ -708,78 +708,6 @@
"width": "6",
"collapse": true
},
- {
- "id": "a411788e.45a8c8",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "4322c187.e73e5",
- "order": 8,
- "width": 10,
- "height": 1
- },
- {
- "id": "d4c1caa0.890fd8",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 2,
- "width": 2,
- "height": 1
- },
- {
- "id": "79ebf4e3.1b427c",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 4,
- "width": 2,
- "height": 1
- },
- {
- "id": "75450d64.f4d56c",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 5,
- "width": 2,
- "height": 1
- },
- {
- "id": "6b099e83.09f0c8",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 6,
- "width": 2,
- "height": 1
- },
- {
- "id": "2644b2c2.9c138e",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 7,
- "width": 2,
- "height": 1
- },
- {
- "id": "fca12a17.304738",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b5d61bc7.54fe48",
- "order": 8,
- "width": 2,
- "height": 1
- },
- {
- "id": "76e8a3c5.176964",
- "type": "ui_spacer",
- "name": "spacer",
- "group": "b7919ae2.c01788",
- "order": 2,
- "width": 5,
- "height": 1
- },
{
"id": "a7d64879.38298",
"type": "ui_group",
@@ -952,6 +880,78 @@
"width": "6",
"collapse": false
},
+ {
+ "id": "a748d93b.3e49e8",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "4322c187.e73e5",
+ "order": 8,
+ "width": 10,
+ "height": 1
+ },
+ {
+ "id": "4916e0fe.8e26f8",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 2,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "366cefec.a908d8",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 4,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "635fb8ab.69d218",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 5,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "213ca819.bc3248",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 6,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "2b17d559.4543ca",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 7,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "2d0a5067.ac6518",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b5d61bc7.54fe48",
+ "order": 8,
+ "width": 2,
+ "height": 1
+ },
+ {
+ "id": "bf163cd3.8abe38",
+ "type": "ui_spacer",
+ "name": "spacer",
+ "group": "b7919ae2.c01788",
+ "order": 2,
+ "width": 5,
+ "height": 1
+ },
{
"id": "4e78af2d.90be7",
"type": "ui_ui_control",
@@ -2689,7 +2689,7 @@
"order": 9,
"width": 0,
"height": 0,
- "format": "
\n
\n \n \n Sample \n project: \n ship: \n operator: \n id: \n sampling gear: \n concentrated volume: \n gear net opening:
| \n total volume filtered:
\n \n Acquisition \n id: \n instrument: \n instrument id: \n camera: \n celltype: \n minimum mesh: \n maximum mesh: \n min esd: \n max esd: \n volume: \n magnification: \n fnumber objective: \n software: \n |
\n \n \n Object \n latitude: \n longitude: \n latitude end: \n longitude end: \n date: \n time: \n date end: \n time end: \n depth min: \n depth max:
| \n \n Process \n pixel: \n id: | \n
\n
\n
",
+ "format": "\n
\n \n \n Sample\n id: \n project: \n ship: \n operator: \n sampling gear: \n concentrated volume: \n gear net opening: \n total volume filtered: \n | \n \n Acquisition\n id: \n instrument: \n instrument id: \n camera: \n celltype: \n minimum mesh: \n maximum mesh: \n min esd: \n max esd: \n volume: \n magnification: \n fnumber objective: \n software: \n | \n
\n \n \n Object\n latitude: \n longitude: \n latitude end: \n longitude end: \n date: \n time: \n date end: \n time end: \n depth min: \n depth max: \n | \n \n Process\n pixel: \n id: \n | \n
\n
\n
",
"storeOutMessages": false,
"fwdInMessages": false,
"resendOnRefresh": false,
@@ -2919,7 +2919,7 @@
"type": "ui_slider",
"z": "bccd1f23.87219",
"name": "focus_distance",
- "label": "",
+ "label": "Focus Distance",
"tooltip": "in µm",
"group": "fbd92986.1028c8",
"order": 3,
@@ -3149,7 +3149,7 @@
"topic": "",
"payload": "100",
"payloadType": "num",
- "x": 110,
+ "x": 130,
"y": 720,
"wires": [
[
@@ -5370,8 +5370,8 @@
"fwdInMessages": true,
"resendOnRefresh": false,
"templateScope": "local",
- "x": 600,
- "y": 160,
+ "x": 440,
+ "y": 140,
"wires": [
[]
]
@@ -8167,7 +8167,7 @@
"z": "bccd1f23.87219",
"name": "",
"env": [],
- "x": 80,
+ "x": 100,
"y": 900,
"wires": [
[
diff --git a/scripts/bash/update.sh b/scripts/bash/update.sh
index ecc9644..ff52acc 100755
--- a/scripts/bash/update.sh
+++ b/scripts/bash/update.sh
@@ -19,25 +19,9 @@ function special(){
if [[ -f "/etc/udev/rules.d/99-local.rules" ]]; then
sudo rm /etc/udev/rules.d/99-local.rules
fi
- if ! hash thumbsup &> /dev/null ; then
- ${log} "thumbsup is not installed, installing now"
- sudo chown -R pi:pi /usr/lib/node_modules/
- sudo chown pi:pi /usr/bin
- if npm install -g thumbsup; then
- ${log} "Error when installing thumbsup"
- else
- ${log} "Thumbsup installed, installing dependencies now"
- sudo apt install -y libimage-exiftool-perl graphicsmagick
- sudo apt autoremove -y
- ${log} "Install complete, running thumbsup for the first time now"
- thumbsup --config /home/pi/PlanktonScope/scripts/thumbsup/config.json
- fi
- sudo chown -R root:root /usr/lib/node_modules/
- sudo chown root:root /usr/bin
- fi
if ! [[ -f "/etc/nginx/sites-available/gallery.conf" ]]; then
${log} "Nginx config is not installed, doing that now"
- sudo cp /home/pi/PlanktonScope/scripts/thumbsup/gallery.conf /etc/nginx/sites-available/gallery.conf
+ sudo cp /home/pi/PlanktonScope/scripts/gallery/gallery.conf /etc/nginx/sites-available/gallery.conf
sudo ln -s /etc/nginx/sites-available/gallery.conf /etc/nginx/sites-enabled/gallery.conf
sudo nginx -t && sudo systemctl reload nginx
fi
diff --git a/scripts/gallery/gallery.conf b/scripts/gallery/gallery.conf
new file mode 100644
index 0000000..ca7fdd4
--- /dev/null
+++ b/scripts/gallery/gallery.conf
@@ -0,0 +1,20 @@
+server {
+ listen 80;
+ listen [::]:80;
+
+ root /home/pi/data/;
+ server_name localhost;
+
+ autoindex on;
+ autoindex_format xml;
+ autoindex_exact_size off;
+ autoindex_localtime on;
+
+ location / {
+ try_files $uri @autoindex;
+ }
+
+ location @autoindex {
+ xslt_stylesheet /home/pi/PlanktonScope/scripts/gallery/nginx_template.xslt path='$uri';
+ }
+}
diff --git a/scripts/gallery/nginx_template.xlst b/scripts/gallery/nginx_template.xlst
new file mode 100644
index 0000000..85264f4
--- /dev/null
+++ b/scripts/gallery/nginx_template.xlst
@@ -0,0 +1,268 @@
+
+
+
+]>
+
+
+
+
+
+
+
+
+ B
+ K
+ M
+ G
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Home
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Home
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+ - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+ Debian Repository
+
+
+
+
+
+
+
+
+ Debian Repository
+
+
+
+
+
+
+
+
+
diff --git a/scripts/planktoscope/imager.py b/scripts/planktoscope/imager.py
index 9b43802..33282a6 100644
--- a/scripts/planktoscope/imager.py
+++ b/scripts/planktoscope/imager.py
@@ -8,9 +8,6 @@ from loguru import logger
# Library to get date and time for folder name and filename
import datetime
-# Subprocess is used to update the gallery folder
-import subprocess # nosec
-
# Library to be able to sleep for a given duration
import time
@@ -696,11 +693,6 @@ class ImagerProcess(multiprocessing.Process):
f'{{"status":"Image {self.__img_done + 1}/{self.__img_goal} has been imaged to {filename}"}}',
)
- # Update the gallery with the new image
- subprocess.Popen(
- "thumbsup --config /home/pi/PlanktonScope/scripts/thumbsup/config.json".split()
- ) # nosec
-
# Increment the counter
self.__img_done += 1
diff --git a/scripts/thumbsup/config.json b/scripts/thumbsup/config.json
deleted file mode 100644
index 47c27ca..0000000
--- a/scripts/thumbsup/config.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "input": "/home/pi/data/img",
- "output": "/home/pi/gallery",
- "title": "Planktoscope's Gallery",
- "thumb-size": 200,
- "photo-preview": "symlink",
- "video-preview": "symlink",
- "photo-download": "symlink",
- "video-download": "symlink",
- "cleanup": true,
- "albums-from": [
- "%path"
- ],
- "sort-albums-by": "title",
- "sort-media-by": "filename",
- "theme": "classic",
- "usage-stats": false
-}
\ No newline at end of file
diff --git a/scripts/thumbsup/gallery.conf b/scripts/thumbsup/gallery.conf
deleted file mode 100644
index f077f9c..0000000
--- a/scripts/thumbsup/gallery.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-server {
- listen 80;
- listen [::]:80;
-
- root /home/pi/gallery;
- server_name localhost;
- autoindex off;
-
- # index.html fallback
- location / {
- try_files $uri $uri/ /index.html;
- }
-}
\ No newline at end of file