From 95d13c56833b7fb42be054ef1c7e37a75e322fc7 Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Mon, 17 Mar 2025 22:19:28 +0100 Subject: [PATCH 1/4] Merged main with the location changes --- shell.nix | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 shell.nix diff --git a/shell.nix b/shell.nix deleted file mode 100644 index d54e32421..000000000 --- a/shell.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs ? import {} }: - -pkgs.mkShell { - packages = with pkgs; [ - (python39.withPackages (ps: [ ps.pip ])) - pre-commit - ]; -} From c872394fea9ff1b9aec03fa386954cb757aff557 Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Wed, 19 Mar 2025 18:35:18 +0100 Subject: [PATCH 2/4] no ubx yet --- python/PiFinder/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/PiFinder/main.py b/python/PiFinder/main.py index 079aa480a..93bfd3735 100644 --- a/python/PiFinder/main.py +++ b/python/PiFinder/main.py @@ -889,10 +889,7 @@ def rotate_logs() -> Path: imu = importlib.import_module("PiFinder.imu_pi") cfg = config.Config() gps_type = cfg.get_option("gps_type") - if gps_type == "ublox": - gps_monitor = importlib.import_module("PiFinder.gps_ubx") - else: - gps_monitor = importlib.import_module("PiFinder.gps_gpsd") + gps_monitor = importlib.import_module("PiFinder.gps_gpsd") if args.display is not None: display_hardware = args.display.lower() From 0ec4de8b165aa8d601baa9b66ce7ae0a83c0ad2d Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Tue, 25 Mar 2025 08:13:25 +0100 Subject: [PATCH 3/4] Revert "no ubx yet" This reverts commit c872394fea9ff1b9aec03fa386954cb757aff557. --- python/PiFinder/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/PiFinder/main.py b/python/PiFinder/main.py index bd7dc548f..2911a6bdf 100644 --- a/python/PiFinder/main.py +++ b/python/PiFinder/main.py @@ -893,7 +893,10 @@ def rotate_logs() -> Path: imu = importlib.import_module("PiFinder.imu_pi") cfg = config.Config() gps_type = cfg.get_option("gps_type") - gps_monitor = importlib.import_module("PiFinder.gps_gpsd") + if gps_type == "ublox": + gps_monitor = importlib.import_module("PiFinder.gps_ubx") + else: + gps_monitor = importlib.import_module("PiFinder.gps_gpsd") if args.display is not None: display_hardware = args.display.lower() From 65bf44c523c138d77a576bc37bf790ec5123db66 Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Sun, 23 Nov 2025 23:45:09 +0100 Subject: [PATCH 4/4] Made eyepieces sortable --- python/PiFinder/server.py | 34 +++++++++++++++++ python/PiFinder/solver.py | 1 - python/views/equipment.tpl | 75 ++++++++++++++++++++++++++++++++------ 3 files changed, 97 insertions(+), 13 deletions(-) diff --git a/python/PiFinder/server.py b/python/PiFinder/server.py index 6f1bea592..012e6686c 100644 --- a/python/PiFinder/server.py +++ b/python/PiFinder/server.py @@ -640,6 +640,40 @@ def equipment_delete_eyepiece(eyepiece_id: int): success_message="Eyepiece Deleted, restart your PiFinder to remove from menu", ) + @app.route("/equipment/reorder_eyepieces", method="post") + @auth_required + def equipment_reorder_eyepieces(): + cfg = config.Config() + try: + # Get the new order from the request body + data = request.json + new_order = data.get("order", []) + + # Validate the order + if len(new_order) != len(cfg.equipment.eyepieces): + return {"success": False, "error": "Invalid order length"} + + # Reorder the eyepieces based on the new indices + reordered_eyepieces = [ + cfg.equipment.eyepieces[idx] for idx in new_order + ] + cfg.equipment.eyepieces = reordered_eyepieces + + # Update active eyepiece index if needed + if cfg.equipment.active_eyepiece_index >= 0: + # Find where the active eyepiece moved to + old_active_idx = cfg.equipment.active_eyepiece_index + new_active_idx = new_order.index(old_active_idx) + cfg.equipment.active_eyepiece_index = new_active_idx + + # Save the new order + cfg.save_equipment() + self.ui_queue.put("reload_config") + + return {"success": True} + except Exception as e: + return {"success": False, "error": str(e)} + @app.route("/equipment/edit_instrument/") @auth_required def edit_instrument(instrument_id: int): diff --git a/python/PiFinder/solver.py b/python/PiFinder/solver.py index 07a901528..31b697816 100644 --- a/python/PiFinder/solver.py +++ b/python/PiFinder/solver.py @@ -17,7 +17,6 @@ from time import perf_counter as precision_timestamp import os import threading -from PIL import Image from PiFinder import state_utils from PiFinder import utils diff --git a/python/views/equipment.tpl b/python/views/equipment.tpl index 7e3fd71ed..ace540a6e 100644 --- a/python/views/equipment.tpl +++ b/python/views/equipment.tpl @@ -110,20 +110,24 @@ % end -
Eyepieces
+
Eyepieces (drag to reorder)
- - - - - - - - - - + + + + + + + + + + + + + % for eyepiece in equipment.eyepieces: - + + @@ -147,10 +151,12 @@ % end +
MakeNameFocal Length (mm)Apparent FOVField StopActiveActions
MakeNameFocal Length (mm)Apparent FOVField StopActiveActions
drag_indicator {{eyepiece.make}} {{eyepiece.name}} {{eyepiece.focal_length_mm}}

+ % include("footer.tpl")