From fbb621a64469a391555c85290366be337af0b25b Mon Sep 17 00:00:00 2001 From: Jonah Aden <151240959+adenjonah@users.noreply.github.com> Date: Mon, 20 May 2024 05:50:16 -0500 Subject: [PATCH] changes --- server/json_databases/DCUUIA.json | 2 +- src/components/RoverCamera.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/json_databases/DCUUIA.json b/server/json_databases/DCUUIA.json index e6b5343..55f425a 100644 --- a/server/json_databases/DCUUIA.json +++ b/server/json_databases/DCUUIA.json @@ -1 +1 @@ -{"timestamp": "2024-05-20T05:46:01.705067", "dcu": {"eva1": {"batt": false, "oxy": true, "comm": false, "fan": true, "pump": false, "co2": false}, "eva2": {"batt": false, "oxy": false, "comm": true, "fan": false, "pump": false, "co2": false}}, "uia": {"eva1_power": false, "eva1_oxy": false, "eva1_water_supply": false, "eva1_water_waste": false, "eva2_power": false, "eva2_oxy": false, "eva2_water_supply": false, "eva2_water_waste": false, "oxy_vent": false, "depress": false}} \ No newline at end of file +{"timestamp": "2024-05-20T05:50:15.085340", "dcu": {"eva1": {"batt": false, "oxy": true, "comm": false, "fan": true, "pump": false, "co2": false}, "eva2": {"batt": false, "oxy": false, "comm": true, "fan": false, "pump": false, "co2": false}}, "uia": {"eva1_power": false, "eva1_oxy": false, "eva1_water_supply": false, "eva1_water_waste": false, "eva2_power": false, "eva2_oxy": false, "eva2_water_supply": false, "eva2_water_waste": false, "oxy_vent": false, "depress": false}} \ No newline at end of file diff --git a/src/components/RoverCamera.js b/src/components/RoverCamera.js index ab0bd5e..d4dbe0b 100644 --- a/src/components/RoverCamera.js +++ b/src/components/RoverCamera.js @@ -6,6 +6,7 @@ import './rovercamera.css'; // Import the CSS file const RoverCamera = () => { const [isConnected, setIsConnected] = useState(true); const [streamUrl, setStreamUrl] = useState(''); + const [isNativeFeed, setIsNativeFeed] = useState(true); // Track the current feed type useEffect(() => { // Fetch configuration data from localhost:8000/config @@ -21,6 +22,16 @@ const RoverCamera = () => { }); }, []); + const toggleFeed = () => { + // Toggle the stream URL between native_feed and thermal_feed + setStreamUrl((prevUrl) => + prevUrl.includes('native_feed') + ? prevUrl.replace('native_feed', 'thermal_feed') + : prevUrl.replace('thermal_feed', 'native_feed') + ); + setIsNativeFeed(!isNativeFeed); // Toggle the feed type state + }; + if (!isConnected) { return (
@@ -32,8 +43,10 @@ const RoverCamera = () => { } return ( -
+
Rover Stream +

+

); };