-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from SJSURoboticsTeam/Michael-Fullscreen-view
Michael fullscreen view
- Loading branch information
Showing
7 changed files
with
93 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
|
||
export default function Camera({ name, src }) { | ||
export default function Camera({ name, src, className }) { | ||
return ( | ||
<div> | ||
{src ? <img className='camera' src={src} alt={name} /> : <p>Camera {name} is not connected</p>} | ||
{src ? <img className={className} src={src} alt={name} /> : <p>Camera {name} is not connected</p>} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <MainCamera key={index}/> | ||
}); | ||
|
||
return( | ||
<div className="fullscreen"> | ||
{displayCam} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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( | ||
<div className="operational-view"> | ||
{/* left */} | ||
<div id = "ov-tools"> | ||
<OVStatus status = {status}/> | ||
<OVStatus status = {status}/> | ||
<select className="cam-num" onChange={(e) => {setCamNum(parseInt(e.target.value))}}> | ||
<option className='btn btn__primary' value={1}>1 cam</option> | ||
<option className='btn btn__primary' value={2}>2 cam</option> | ||
<option className='btn btn__primary' value={3}>3 cam</option> | ||
</select> | ||
</div> | ||
{/* main */} | ||
<MainCamera mainCam = {activeCam}/> | ||
{/* right */} | ||
<Menu callback= {setActiveCam}/> | ||
{/* <Camera name="primary" src="http://192.168.1.153:8081/" /> */} | ||
<FullScreen camNum = {camNum}/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters