#!/bin/bash
pkill screen >/dev/null
cd /home/svc-zsaf/zoox/driving # bcd

echo "Starting ZSAF landing page app"
screen -dm -S homepage "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_zsaf_homepage.sh"
sleep 1

echo "Starting PCP error visualization app"
screen -dm -S pcperr "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_pcp_err_viz.sh"
sleep 1

echo "Starting CIF dashboard app"
screen -dm -S cifdash "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_cif_dashboard.sh"
sleep 1

echo "Starting CIF dashboard (legacy) app"
screen -dm -S ciflegacy "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_cif_dashboard_legacy.sh"
sleep 1

# echo "Starting Safety PCP correlation study app"
# screen -dm -S spcpcorr "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_spcp_err_corr.sh"
# sleep 1

echo "Starting Pose fault injection visualization app"
screen -dm -S pose_fault "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_loc_fault_injection.sh"
sleep 1

# echo "Starting Sim 3D verification app"
# screen -dm -S sim3dV "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_sim3d_verification.sh"
# sleep 1

echo "Starting Sim performance metrics app"
screen -dm -S sim_perf "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_sim_perf_dashboard.sh"
sleep 1

echo "Starting MLflow"
screen -dm -S mlflow "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_mlflow.sh"
sleep 1

echo "Starting Airflow webserver"
screen -dm -S airflow_webserver "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_airflow_webserver.sh"
sleep 1

echo "Starting Airflow scheduler"
screen -dm -S airflow_scheduler "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_airflow_scheduler.sh"
sleep 1

echo "Starting ZEGO visualizer app"
screen -dm -S zegoviz "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_zego_visualizer.sh"
sleep 1

echo "Starting ZSAF database browser app"
screen -dm -S dbbrowser "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_zsaf_db_browser.sh"
sleep 1

echo "Starting BOREAL visualizer app"
screen -dm -S borealviz "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_boreal_visualizer.sh"
sleep 1

echo "Starting Interactive config generator app"
screen -dm -S intgenerator "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_interactive_generator.sh"
sleep 1

echo "Starting Pipeline tracker app"
screen -dm -S pipelinetracker "/home/svc-zsaf/zoox/driving/zsaf/server/bash_scripts/run_pipeline_tracker.sh"
sleep 1

screen -list
