From c2e1484cfd978c7891dc3736141ad315dc0deea8 Mon Sep 17 00:00:00 2001 From: i-jey Date: Thu, 3 Oct 2024 11:24:17 +0200 Subject: [PATCH 1/2] Reorder the site list to move the environment variable specified site to the front. Note this site location must already be included in the SITE_LIST constant --- ulc_mm_package/QtGUI/gui_constants.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ulc_mm_package/QtGUI/gui_constants.py b/ulc_mm_package/QtGUI/gui_constants.py index c80350ebd..ec571c197 100644 --- a/ulc_mm_package/QtGUI/gui_constants.py +++ b/ulc_mm_package/QtGUI/gui_constants.py @@ -1,5 +1,5 @@ import enum - +import os from pathlib import Path from ulc_mm_package.neural_nets.neural_network_constants import YOGO_CLASS_IDX_MAP @@ -49,6 +49,13 @@ class ERROR_BEHAVIORS(enum.Enum): "Goodlife Musanze", ] +# Reorder the site list to move the environment variable specified default site to the first location +env_var = os.getenv("DEFAULT_SITE") + +if env_var in SITE_LIST: + SITE_LIST.insert(0, SITE_LIST.pop(SITE_LIST.index(env_var))) + + CLINICAL_SAMPLE = "Whole blood (clinical, P. falciparum endemic)" CULTURED_SAMPLE = "Lab cultured P. falciparum" SAMPLE_LIST = [ From 0f7ea22adebeebaeac88218c1f48a1e38b4b9271 Mon Sep 17 00:00:00 2001 From: i-jey Date: Thu, 3 Oct 2024 11:28:13 +0200 Subject: [PATCH 2/2] Add instruction to OS_flash.md --- OS_instructions/OS_flash.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OS_instructions/OS_flash.md b/OS_instructions/OS_flash.md index 8c9dd265c..32ce3b39d 100644 --- a/OS_instructions/OS_flash.md +++ b/OS_instructions/OS_flash.md @@ -62,4 +62,7 @@ cp .bash_aliases /home/pi The commands in the file can now be run from the terminal. At the time of writing (2022-12-09), the following commands are available: - `lfm_run` - runs `oracle.py` - `lfm_dev` - runs `dev_run.py` -- `send_address` - runs `email_utils.py` (attempts to send the ngrok address to `lfmscope@gmail.com`) \ No newline at end of file +- `send_address` - runs `email_utils.py` (attempts to send the ngrok address to `lfmscope@gmail.com`) + +### Setting a default location +- In `~/.bashrc` add the following environment variable at the bottom of the file: `DEFAULT_SITE='NAME_OF_SITE'`. Note: the specified site MUST already be listed in `ulc_mm_package/QtGUI/gui_constants.py`'s `SITE_LIST` constant. \ No newline at end of file