From bc60bc34b38d2c751cc96428b2c7a9281aec638a Mon Sep 17 00:00:00 2001 From: Jonah Aden <151240959+adenjonah@users.noreply.github.com> Date: Tue, 21 May 2024 23:59:18 -0500 Subject: [PATCH] initdb --- server/initdb.py | 97 +++++++++++++++++++++ server/json_databases/equipment_repair.json | 2 +- server/server.py | 1 + 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/server/initdb.py b/server/initdb.py index 7453bdd..bec2382 100644 --- a/server/initdb.py +++ b/server/initdb.py @@ -245,11 +245,108 @@ "description": "Ensure module installation is correctly performed; conduct systems check to verify functionality." } ] + }, + { + "id": 5, + "title": "Cable Repair", + "steps": [ + { + "step": "COMM Tower Screen 1", + "role": "EV1", + "description": "Select Gear icon" + }, + { + "step": "COMM Tower Screen 2", + "role": "EV1", + "description": "Select Shutdown" + }, + { + "step": "COMM Tower Screen 3", + "role": "EV1", + "description": "Verify shutdown complete and notify EV2 and LMCC1" + }, + { + "step": "MMRTG 4", + "role": "EV2", + "description": "Move POWER – OFF, notify EV1 and LMCC1" + }, + { + "step": "MMRTG 5", + "role": "EV2", + "description": "Navigate to Comm Tower to retrieve one end of power cable" + }, + { + "step": "Tool box 6", + "role": "EV1", + "description": "Retrieve spare cable" + }, + { + "step": "MMRTG 7", + "role": "EV2", + "description": "Take appropriate end of cable to MMRTG, notify EV1 and LMCC1 when at MMRTG" + }, + { + "step": "Comm Tower 8", + "role": "EV1", + "description": "Disconnect damaged cable from Comm Tower, notify EV2 and LMCC1" + }, + { + "step": "MMRTG 9", + "role": "EV2", + "description": "Disconnect damaged cable from MMRTG, notify EV1 and LMCC1" + }, + { + "step": "Comm Tower 10", + "role": "EV1", + "description": "Connect new cable from Comm Tower, notify EV2 and LMCC1" + }, + { + "step": "MMRTG 11", + "role": "EV2", + "description": "Connect new cable from MMRTG, notify EV1 and LMCC1" + }, + { + "step": "MMRTG 12", + "role": "EV2", + "description": "Move POWER – ON, notify EV1 and LMCC1" + }, + { + "step": "Comm Tower 13", + "role": "EV1", + "description": "POWER – ON, notify EV2 and LMCC1" + }, + { + "step": "Comm Tower 14", + "role": "EV1", + "description": "When start up complete, notify EV2 and LMCC1" + }, + { + "step": "Comm Tower Screen 15", + "role": "EV1", + "description": "Verify channel “B” is operational, notify EV2 and LMCC1" + }, + { + "step": "ALL DCU+LMCC 16", + "role": "LMCC1", + "description": "On LMCC1 Go, switch to COM – B" + }, + { + "step": "ALL DCU+LMCC 17", + "role": "All", + "description": "Perform comm check" + }, + { + "step": "ALL DCU+LMCC 18", + "role": "All", + "description": "If Comm good, EV1/LMCC1 switch back to COM-A, EV2/LMCC2 continue COM-B, else all to COM – A" + } + ] } ] } + DEFAULT_ALERTS_DATA = { "alerts": [] } diff --git a/server/json_databases/equipment_repair.json b/server/json_databases/equipment_repair.json index d9af6f4..980d01c 100644 --- a/server/json_databases/equipment_repair.json +++ b/server/json_databases/equipment_repair.json @@ -1 +1 @@ -{"procedures": [{"id": 1, "title": "Structural Damage Repair", "steps": [{"step": "Comm Tower Base 1", "role": "EV1", "description": "Collect structural repair materials including metal patches, welding tools, and adhesives."}, {"step": "Comm Tower Base 2", "role": "EV2", "description": "Assemble safety gear for climbing and securing both crew members."}, {"step": "Comm Tower 3", "role": "EV1", "description": "Assess tower for visible structural damage."}, {"step": "Comm Tower 4", "role": "EV2", "description": "Assist in removing debris and damaged components."}, {"step": "Comm Tower 5", "role": "EV1", "description": "Apply metal patches over holes or tears using welding tools."}, {"step": "Comm Tower 6", "role": "EV2", "description": "Provide support in applying patches or adhesives."}, {"step": "Comm Tower 7", "role": "EV1", "description": "Secure larger structural issues with adhesives and temporary supports."}, {"step": "Comm Tower 8", "role": "EV2", "description": "Ensure safety protocols are followed during high or difficult access points."}]}, {"id": 2, "title": "Power System Troubleshooting and Repair", "steps": [{"step": "Tower Base PSU 1", "role": "EV1", "description": "Assemble diagnostic kit, spare batteries, solar cells, and electrical repair tools."}, {"step": "Tower Base PSU 2", "role": "EV2", "description": "Carry additional spare parts and protective equipment."}, {"step": "Tower Base PSU 3", "role": "EV1", "description": "Perform diagnostics to identify power supply issues."}, {"step": "Tower Base PSU 4", "role": "EV2", "description": "Assist in identifying damaged components."}, {"step": "Tower Base PSU 5", "role": "EV1", "description": "Replace faulty batteries or solar cells."}, {"step": "Tower Base PSU 6", "role": "EV2", "description": "Help in repairing or replacing wiring, ensuring secure connections."}, {"step": "Tower Base PSU 7", "role": "EV1", "description": "Verify power system functionality post-repair."}]}, {"id": 3, "title": "Antenna Alignment and Calibration", "steps": [{"step": "Comm Tower Antenna 1", "role": "EV1", "description": "Prepare alignment tools and calibration software on a portable device."}, {"step": "Comm Tower Antenna 2", "role": "EV2", "description": "Assemble securing gear and safety equipment for both crew members."}, {"step": "Comm Tower Antenna 3", "role": "EV1", "description": "Adjust the antenna to correct orientation using tools."}, {"step": "Comm Tower Antenna 4", "role": "EV2", "description": "Assist in antenna inspection for misalignment or damage."}, {"step": "Comm Tower Antenna 5", "role": "EV1", "description": "Secure antenna position; perform calibration test."}, {"step": "Comm Tower Antenna 6", "role": "EV2", "description": "Support in adjustment and calibration process; maintain communication with mission control."}]}, {"id": 4, "title": "Transceiver Module Replacement", "steps": [{"step": "Comm Tower Transceiver 1", "role": "EV1", "description": "Collect replacement transceiver module and non-conductive tools."}, {"step": "Comm Tower Transceiver 2", "role": "EV2", "description": "Prepare electrostatic discharge safety equipment."}, {"step": "Comm Tower Transceiver 3", "role": "EV1", "description": "Remove the faulty module."}, {"step": "Comm Tower Transceiver 4", "role": "EV2", "description": "Assist in isolating power supply."}, {"step": "Comm Tower Transceiver 5", "role": "EV1", "description": "Install the new module ensuring all connections are secure."}, {"step": "Comm Tower Transceiver 6", "role": "EV2", "description": "Ensure module installation is correctly performed; conduct systems check to verify functionality."}]}]} \ No newline at end of file +{"procedures": [{"id": 1, "title": "Structural Damage Repair", "steps": [{"step": "Comm Tower Base 1", "role": "EV1", "description": "Collect structural repair materials including metal patches, welding tools, and adhesives."}, {"step": "Comm Tower Base 2", "role": "EV2", "description": "Assemble safety gear for climbing and securing both crew members."}, {"step": "Comm Tower 3", "role": "EV1", "description": "Assess tower for visible structural damage."}, {"step": "Comm Tower 4", "role": "EV2", "description": "Assist in removing debris and damaged components."}, {"step": "Comm Tower 5", "role": "EV1", "description": "Apply metal patches over holes or tears using welding tools."}, {"step": "Comm Tower 6", "role": "EV2", "description": "Provide support in applying patches or adhesives."}, {"step": "Comm Tower 7", "role": "EV1", "description": "Secure larger structural issues with adhesives and temporary supports."}, {"step": "Comm Tower 8", "role": "EV2", "description": "Ensure safety protocols are followed during high or difficult access points."}]}, {"id": 2, "title": "Power System Troubleshooting and Repair", "steps": [{"step": "Tower Base PSU 1", "role": "EV1", "description": "Assemble diagnostic kit, spare batteries, solar cells, and electrical repair tools."}, {"step": "Tower Base PSU 2", "role": "EV2", "description": "Carry additional spare parts and protective equipment."}, {"step": "Tower Base PSU 3", "role": "EV1", "description": "Perform diagnostics to identify power supply issues."}, {"step": "Tower Base PSU 4", "role": "EV2", "description": "Assist in identifying damaged components."}, {"step": "Tower Base PSU 5", "role": "EV1", "description": "Replace faulty batteries or solar cells."}, {"step": "Tower Base PSU 6", "role": "EV2", "description": "Help in repairing or replacing wiring, ensuring secure connections."}, {"step": "Tower Base PSU 7", "role": "EV1", "description": "Verify power system functionality post-repair."}]}, {"id": 3, "title": "Antenna Alignment and Calibration", "steps": [{"step": "Comm Tower Antenna 1", "role": "EV1", "description": "Prepare alignment tools and calibration software on a portable device."}, {"step": "Comm Tower Antenna 2", "role": "EV2", "description": "Assemble securing gear and safety equipment for both crew members."}, {"step": "Comm Tower Antenna 3", "role": "EV1", "description": "Adjust the antenna to correct orientation using tools."}, {"step": "Comm Tower Antenna 4", "role": "EV2", "description": "Assist in antenna inspection for misalignment or damage."}, {"step": "Comm Tower Antenna 5", "role": "EV1", "description": "Secure antenna position; perform calibration test."}, {"step": "Comm Tower Antenna 6", "role": "EV2", "description": "Support in adjustment and calibration process; maintain communication with mission control."}]}, {"id": 4, "title": "Transceiver Module Replacement", "steps": [{"step": "Comm Tower Transceiver 1", "role": "EV1", "description": "Collect replacement transceiver module and non-conductive tools."}, {"step": "Comm Tower Transceiver 2", "role": "EV2", "description": "Prepare electrostatic discharge safety equipment."}, {"step": "Comm Tower Transceiver 3", "role": "EV1", "description": "Remove the faulty module."}, {"step": "Comm Tower Transceiver 4", "role": "EV2", "description": "Assist in isolating power supply."}, {"step": "Comm Tower Transceiver 5", "role": "EV1", "description": "Install the new module ensuring all connections are secure."}, {"step": "Comm Tower Transceiver 6", "role": "EV2", "description": "Ensure module installation is correctly performed; conduct systems check to verify functionality."}]}, {"id": 5, "title": "Cable Repair", "steps": [{"step": "COMM Tower Screen 1", "role": "EV1", "description": "Select Gear icon"}, {"step": "COMM Tower Screen 2", "role": "EV1", "description": "Select Shutdown"}, {"step": "COMM Tower Screen 3", "role": "EV1", "description": "Verify shutdown complete and notify EV2 and LMCC1"}, {"step": "MMRTG 4", "role": "EV2", "description": "Move POWER \u2013 OFF, notify EV1 and LMCC1"}, {"step": "MMRTG 5", "role": "EV2", "description": "Navigate to Comm Tower to retrieve one end of power cable"}, {"step": "Tool box 6", "role": "EV1", "description": "Retrieve spare cable"}, {"step": "MMRTG 7", "role": "EV2", "description": "Take appropriate end of cable to MMRTG, notify EV1 and LMCC1 when at MMRTG"}, {"step": "Comm Tower 8", "role": "EV1", "description": "Disconnect damaged cable from Comm Tower, notify EV2 and LMCC1"}, {"step": "MMRTG 9", "role": "EV2", "description": "Disconnect damaged cable from MMRTG, notify EV1 and LMCC1"}, {"step": "Comm Tower 10", "role": "EV1", "description": "Connect new cable from Comm Tower, notify EV2 and LMCC1"}, {"step": "MMRTG 11", "role": "EV2", "description": "Connect new cable from MMRTG, notify EV1 and LMCC1"}, {"step": "MMRTG 12", "role": "EV2", "description": "Move POWER \u2013 ON, notify EV1 and LMCC1"}, {"step": "Comm Tower 13", "role": "EV1", "description": "POWER \u2013 ON, notify EV2 and LMCC1"}, {"step": "Comm Tower 14", "role": "EV1", "description": "When start up complete, notify EV2 and LMCC1"}, {"step": "Comm Tower Screen 15", "role": "EV1", "description": "Verify channel \u201cB\u201d is operational, notify EV2 and LMCC1"}, {"step": "ALL DCU+LMCC 16", "role": "LMCC1", "description": "On LMCC1 Go, switch to COM \u2013 B"}, {"step": "ALL DCU+LMCC 17", "role": "All", "description": "Perform comm check"}, {"step": "ALL DCU+LMCC 18", "role": "All", "description": "If Comm good, EV1/LMCC1 switch back to COM-A, EV2/LMCC2 continue COM-B, else all to COM \u2013 A"}]}]} \ No newline at end of file diff --git a/server/server.py b/server/server.py index 8b0ff19..6cc33eb 100644 --- a/server/server.py +++ b/server/server.py @@ -81,6 +81,7 @@ def initialize_files(): @app.on_event("startup") async def startup_event(): initialize_files() # Ensure files are created if they do not exist + initialize_database_files() scheduler = AsyncIOScheduler() scheduler.add_job(periodic_fetch_and_store, 'interval', seconds=10) # Adjust the interval as needed scheduler.start()