diff --git a/src/App.tsx b/src/App.tsx index 6eddc30..02acf6e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -70,10 +70,11 @@ function App() { {system === 'science' && } - - - - + + + + + } diff --git a/src/components/Camera.tsx b/src/components/Camera.tsx index c95f483..ba5038a 100644 --- a/src/components/Camera.tsx +++ b/src/components/Camera.tsx @@ -1,9 +1,9 @@ import React from 'react' -export default function Camera({ name, src }) { +export default function Camera({ name, src, className }) { return (
- {src ? {name} :

Camera {name} is not connected

} + {src ? {name} :

Camera {name} is not connected

}
) } diff --git a/src/components/FullScreenView.tsx b/src/components/FullScreenView.tsx new file mode 100644 index 0000000..f134824 --- /dev/null +++ b/src/components/FullScreenView.tsx @@ -0,0 +1,15 @@ + +import MainCamera from "./OperationalView/MainCamera"; + +export default function FullScreen({camNum}) { + console.log(camNum) + const displayCam = Array.from({length: camNum}, (_, index) => { + return + }); + + return( +
+ {displayCam} +
+ ); +} \ No newline at end of file diff --git a/src/components/OperationalView.tsx b/src/components/OperationalView.tsx index d9c79dd..bfc3b8f 100644 --- a/src/components/OperationalView.tsx +++ b/src/components/OperationalView.tsx @@ -1,23 +1,23 @@ -import { useState } from "react"; -import Menu from "./OperationalView/Menu"; -import Camera from "./Camera"; import OVStatus from "./OperationalView/OVStatus"; -import MainCamera from "./OperationalView/MainCamera"; +import FullScreen from "./FullScreenView"; +import { useState } from "react"; export default function OperationalView({ commands, status }) { - const [activeCam, setActiveCam] = useState(null) - - return ( + const [camNum, setCamNum] = useState(1) + + return(
{/* left */}
- + +
- {/* main */} - {/* right */} - - {/* */} +
); } diff --git a/src/components/OperationalView/MainCamera.tsx b/src/components/OperationalView/MainCamera.tsx index 092e587..3c20089 100644 --- a/src/components/OperationalView/MainCamera.tsx +++ b/src/components/OperationalView/MainCamera.tsx @@ -1,19 +1,25 @@ -import React from "react"; import {useState} from "react" import Camera from "../Camera"; import noCam from './Main_Camera_Test.png' import cam2 from './oatmeal.gif' +import Menu from "./Menu"; //Todo: need to add more cameras //Todo: swap from div to img for cam -export default function MainCamera({mainCam}){ +export default function MainCamera(){ + const [openMenu, setOpenMenu] = useState(false) + const [activeCam, setActiveCam] = useState(null) + + const toggleMenu = () => { + setOpenMenu(true) + } var fileName = noCam; //Todo: add more cameras from rover var testCam1 = 'http://192.168.1.119:8081/' var testCam2 = 'http://192.168.1.196:8081/' - switch (mainCam) + switch (activeCam) { case 'chassis': fileName = testCam1; @@ -39,6 +45,11 @@ export default function MainCamera({mainCam}){ } return( - +
+ + +
); } \ No newline at end of file diff --git a/src/components/OperationalView/Menu.tsx b/src/components/OperationalView/Menu.tsx index 0761bde..c052edd 100644 --- a/src/components/OperationalView/Menu.tsx +++ b/src/components/OperationalView/Menu.tsx @@ -3,7 +3,11 @@ import Camera from "../Camera"; import { useState } from "react"; import { Style } from "util"; -export default function Menu({callback}) { +export default function Menu({callback, openMenu, closeMenu} ) { + const menuSelection = (title) => { + closeMenu(false) + callback(title) + } const camArray = [ {title: "chassis"}, @@ -13,15 +17,15 @@ export default function Menu({callback}) { {title: "wheel_C"}, {title: "arm"} ] - + return ( -
- {camArray.map((cam) => ( - - ))} -
+ + {camArray.map((cam) => ( + + ))} + ); } diff --git a/src/index.css b/src/index.css index d300a16..4842bdb 100644 --- a/src/index.css +++ b/src/index.css @@ -379,15 +379,18 @@ video { column-gap: 5px; height: vh; width: vw; - grid-template-columns: 1fr 2.65fr 1fr; + grid-template-columns: 0.5fr 3fr; grid-template-rows: 1fr ; } -#ov-main-cam{ +.ov-main-cam{ + flex: 1; background-repeat: no-repeat; background-size: contain; aspect-ratio: 4/3; align-items: center; overflow: hidden; + object-fit: contain; + max-height: 100%; } #ov-camera-grid{ @@ -415,15 +418,33 @@ video { height: 100vh; overflow: hidden; aspect-ratio: 4/3; + object-fit: contain; } -/* .ov-camera-toggle{ - background-image: url(/src/components/OperationalView/oatmeal.gif); - background-size: contain; - background-repeat: no-repeat; - overflow: hidden; - background-position: center; - aspect-ratio: 4/3; -} */ + +.fullscreen{ + display: flex; + /* grid-template-columns: repeat(2, 1fr); + grid-template-rows: repeat(2, 1fr); */ + width: 100%; + height: 100vh; + overflow: contain; + align-items: center; +} + +.cam-num{ + height: 40px +} + +.menu:not([open]){ + display: none; +} + +.menu{ + display:grid; + grid-template-columns: repeat(2, 1fr); + transform: translate(-50%, -50%); +} +