updated ai

This commit is contained in:
david rice
2026-04-08 14:19:31 +01:00
parent d0e23c4e01
commit 15dc295ae1
6 changed files with 175 additions and 59 deletions

View File

@@ -14,6 +14,7 @@ import requests
import threading
from datetime import datetime
import ai_mgmt
import analyze_captures
# --- Configuration ---
URL = "http://192.168.45.8:5000/display"
@@ -251,6 +252,9 @@ def _configure_for_lp():
scope.write(f":CHANnel{ch}:SCALe {LP_V_SCALE:.3f}")
scope.write(f":CHANnel{ch}:OFFSet {LP_V_OFFSET:.3f}")
time.sleep(0.05)
# Trigger on DAT0+ (Ch3) — CLK is continuous HS so it never reaches LP-11 (1.2 V).
# DAT0 has LP-11 between bursts, so Ch3 falling at 0.6 V catches LP-11 → LP-01.
scope.write(":TRIGger:EDGE:SOURce CHANnel3")
scope.write(":TRIGger:EDGE:SLOPe NEGative")
scope.write(f":TRIGger:EDGE:LEVel {LP_TRIG_LEVEL:.3f}")
time.sleep(0.1)
@@ -262,6 +266,7 @@ def _restore_hs_config():
scope.write(f":CHANnel{ch}:SCALe 0.1")
scope.write(f":CHANnel{ch}:OFFSet 0.0")
time.sleep(0.05)
scope.write(":TRIGger:EDGE:SOURce CHANnel1")
scope.write(":TRIGger:EDGE:SLOPe POSitive")
scope.write(f":TRIGger:EDGE:LEVel 0.05")
time.sleep(0.1)
@@ -331,8 +336,13 @@ def mgmt_worker():
try:
copied, failed = ai_mgmt.transfer_csv_files()
print(f"[MGMT] TRANSFERRED {copied} FILE(S) TO DATA FOLDER. {failed} FAILED.")
if copied > 0:
try:
analyze_captures.run_analysis()
except Exception as e:
print(f"[MGMT] ANALYSIS ERROR: {e}")
except Exception as e:
print(f"[MGMT] ERROR: {e}")
print(f"[MGMT] TRANSFER ERROR: {e}")
finally:
resume_event.set()
print("[MGMT] RESUMING TEST.\n")