Browse Source

V3.3.0. Stable release: Implemented cache-busting server, robust filename regex, and global ESC-key modal dismiss. Added null-guards for video-only loading and log-cfg utility.

refactor/sync-centralize
RUSHIL AMBARISH KADU 2 months ago
parent
commit
2b53a589a7
  1. 2
      steps/Visualization_Start.bat
  2. 18
      steps/annex/Changelog.html
  3. 10
      steps/index.html
  4. 29
      steps/server.py
  5. 61
      steps/tests/simple_log_cfg.py

2
steps/Visualization_Start.bat

@ -22,4 +22,4 @@ echo Server is now running on http://127.0.0.1:8000
echo Press CTRL+C at any time to stop the server.
:: Run the server command directly. We know 'python' works from our test.
python -m http.server 8000
python server.py

18
steps/annex/Changelog.html

@ -168,8 +168,24 @@
</ul>
</div>
<!-- 11. Refinement & Stability (v3.3.0) -->
<div class="card p-8 rounded-2xl shadow-2xl border-l-4 border-cyan-500">
<div class="flex items-center gap-4 mb-6">
<div class="icon-box highlight-amber text-2xl"></div>
<h2 class="text-2xl font-bold">11. Refinement & Case Resilience (v3.3.0)</h2>
</div>
<p class="text-slate-400 mb-4 text-sm italic">Focus on universal operation, zero-cache local server, and parsing robustness.</p>
<ul class="space-y-3 text-slate-300 text-sm">
<li class="flex gap-2"><span></span> <strong>Cache-Busting local server:</strong> New <code>server.py</code> with zero-cache headers.</li>
<li class="flex gap-2"><span></span> <strong>Universal Versioning:</strong> Entry points & assets versioned with <code>?v=3.3.0</code> query strings.</li>
<li class="flex gap-2"><span></span> <strong>Robust Regex:</strong> Pattern matching for generic YYYYMMDD/DDMMYYYY formats in filenames.</li>
<li class="flex gap-2"><span></span> <strong>Interactive Controls:</strong> ESC-key global dismiss for all modal windows.</li>
<li class="flex gap-2"><span></span> <strong>Error Handling:</strong> Null-guards for video-only loading states in <code>sync.js</code>.</li>
</ul>
</div>
<!-- 10. Stability & Infrastructure -->
<div class="card md:col-span-2 p-8 rounded-2xl shadow-2xl border-l-4 border-indigo-500">
<div class="card p-8 rounded-2xl shadow-2xl border-l-4 border-indigo-500">
<h2 class="text-2xl font-bold mb-6">10. Stability & Infrastructure</h2>
<div class="grid md:grid-cols-2 gap-8">
<ul class="space-y-2 text-slate-400 text-sm">

10
steps/index.html

@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Radar and Video Visualizer - Timestamp Synchronized</title>
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png?v=3.3.0" />
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<script>
@ -709,7 +709,7 @@
</div>
<!-- Iframe Content -->
<iframe id="user-manual-iframe" src="annex/User_Manual.html" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
<iframe id="user-manual-iframe" src="annex/User_Manual.html?v=3.3.0" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
</div>
</div>
@ -730,7 +730,7 @@
</div>
<!-- Iframe Content -->
<iframe id="codebase-iframe" src="annex/code-base-overview.html" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
<iframe id="codebase-iframe" src="annex/code-base-overview.html?v=3.3.0" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
</div>
</div>
@ -751,7 +751,7 @@
</div>
<!-- Iframe Content -->
<iframe id="changelog-iframe" src="annex/Changelog.html" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
<iframe id="changelog-iframe" src="annex/Changelog.html?v=3.3.0" class="flex-grow w-full border-0 rounded-b-2xl" style="min-height: 400px;"></iframe>
</div>
</div>
<div id="modal-container" class="fixed inset-0 z-50 flex items-center justify-center hidden">
@ -790,7 +790,7 @@
</div>
</div>
<script type="module" src="./src/main.js"></script>
<script type="module" src="./src/main.js?v=3.3.0"></script>
</body>
</html>

29
steps/server.py

@ -0,0 +1,29 @@
import http.server
import socketserver
import os
PORT = 8000
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
# Disable caching for all files
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
self.send_header('Pragma', 'no-cache')
self.send_header('Expires', '0')
super().end_headers()
def log_message(self, format, *args):
# Optional: cleaner logging
super().log_message(format, *args)
Handler = MyHTTPRequestHandler
print(f"Starting server on http://127.0.0.1:{PORT}")
print("Cache-busting enabled: Browser will always fetch latest files.")
with socketserver.TCPServer(("", PORT), Handler) as httpd:
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nServer stopped.")
httpd.server_close()

61
steps/tests/simple_log_cfg.py

@ -0,0 +1,61 @@
import re
import tkinter as tk
from tkinter import filedialog
import os
def extract_radar_config(log_file_path, output_file_path=None):
"""
Extract radar configuration commands from log file.
Args:
log_file_path (str): Path to input log file
output_file_path (str, optional): Path to save extracted config
"""
# Pattern to match required lines
pattern = re.compile(r'INFO\s+-\s+radar_tracker\.console_logger\s+-\s+>\s+(.*)')
extracted_commands = []
with open(log_file_path, 'r') as file:
for line in file:
match = pattern.search(line)
if match:
command = match.group(1).strip()
extracted_commands.append(command)
# Output handling
if output_file_path:
with open(output_file_path, 'w') as out_file:
for cmd in extracted_commands:
out_file.write(cmd + '\n')
print(f"[INFO] Extracted config saved to: {output_file_path}")
else:
print("\n--- Extracted Radar Config ---\n")
for cmd in extracted_commands:
print(cmd)
return extracted_commands
# Example usage
if __name__ == "__main__":
# Create and hide root tkinter window
root = tk.Tk()
root.withdraw()
# Allow user to select a .log file
log_file = filedialog.askopenfilename(
title="Select Log File",
filetypes=[("Log Files", "*.log"), ("Text Files", "*.txt"), ("All Files", "*.*")]
)
if log_file:
# Generate output file name (e.g., myscript.log -> myscript.cfg)
base_name = os.path.splitext(log_file)[0]
output_file = f"{base_name}.cfg"
extract_radar_config(log_file, output_file)
print(f"[INFO] Processing complete for {log_file}")
else:
print("[INFO] No file selected.")
Loading…
Cancel
Save