Skip to content

Commit

Permalink
Release 2.0.99-b7
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeon Vinzenz Varapragasam authored and Yeon Vinzenz Varapragasam committed Jul 18, 2024
1 parent bbfc47d commit 6866996
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 72 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ledfx",
"version": "2.0.99-b6",
"version": "2.0.99-b7",
"description": "LedFx v2 - BladeMOD",
"author": "YeonV aka Blade",
"private": true,
Expand Down
124 changes: 62 additions & 62 deletions src/pages/Devices/EditVirtuals/EditMatrix/MControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ const MControls = ({
const [camMapper, setCamMapper] = useState(false)
const getVirtuals = useStore((state) => state.getVirtuals)
const getDevices = useStore((state) => state.getDevices)
const features = useStore((state) => state.features)
const [showPixelGraph, setShowPixelGraph] = useState<boolean>(false)
const pixelGraphs = useStore((state) => state.pixelGraphs)
const virtuals = useStore((state) => state.virtuals)
Expand Down Expand Up @@ -125,7 +124,7 @@ const MControls = ({
style={{ marginBottom: '1rem' }}
p={2}
>
{!camMapper && <>
<Collapse in={!camMapper}>
<Stack
direction="column"
justifyContent="flex-start"
Expand Down Expand Up @@ -260,6 +259,55 @@ const MControls = ({
</Stack>
</Stack>

<TabContext value={tab}>
<Box sx={{ borderBottom: 1, borderColor: 'divider', marginTop: '0 !important' }} className='step-2d-virtual-six'>
<TabList onChange={handleChange} aria-label="lab API tabs example">
<Tab
icon={<PanTool />}
iconPosition="start"
label="DND-Canvas"
value="1"
/>
<Tab
icon={<ControlCamera />}
iconPosition="start"
label="DND-Pixels"
value="2"
/>
</TabList>
</Box>
<TabPanel value="1" sx={{ padding: 0 }}>
<Collapse in={infoAlerts.camera}>
<Alert severity="info" sx={{ width: '100%' }} onClose={() => {
setInfoAlerts('camera', false)
}}>
<strong>DND-Canvas Mode</strong>
<ul style={{ padding: '0 1rem' }}>
<li>Use Mousewheel to Zoom</li>
<li>Use left-click with drag&drop to move around</li>
<li>Use right-click to:</li>
<ul>
<li>assign pixel or pixel-group</li>
<li>edit a pixel</li>
<li>clear a pixel</li>
<li>move a pixel-group</li>
</ul>
<li>Enter DND-Pixels mode to move pixels individually</li>
</ul>
</Alert>
</Collapse>
</TabPanel>
<TabPanel value="2">
<Collapse in={infoAlerts.pixelMode} sx={{ marginTop: '0 !important' }}>
<Alert severity="info" sx={{ width: '100%' }} onClose={()=> setInfoAlerts('pixelMode', false)}>
<strong>DND-Pixels Mode</strong>
<ul style={{ padding: '0 1rem' }}>
<li>move pixels individually with your mouse</li>
</ul>
</Alert>
</Collapse>
</TabPanel>
</TabContext>
{move ? (
<Box>
<Box className='step-2d-virtual-five'>
Expand Down Expand Up @@ -338,8 +386,8 @@ const MControls = ({
</Stack>
</Box>
) : (
<Collapse in={infoAlerts.matrixGroups} sx={{ marginTop: '0 !important' }}>
<Alert severity="info" sx={{ width: 400, marginBottom: 2 }} onClose={() => {
<Collapse in={infoAlerts.matrixGroups}>
<Alert severity="info" sx={{ width: 400, marginTop: 2 }} onClose={() => {
setInfoAlerts('matrixGroups', false)
}}>
<strong>
Expand All @@ -350,64 +398,16 @@ const MControls = ({
</Alert>
</Collapse>
)}
<TabContext value={tab}>
<Box sx={{ borderBottom: 1, borderColor: 'divider', marginTop: '0 !important' }} className='step-2d-virtual-six'>
<TabList onChange={handleChange} aria-label="lab API tabs example">
<Tab
icon={<PanTool />}
iconPosition="start"
label="DND-Canvas"
value="1"
/>
<Tab
icon={<ControlCamera />}
iconPosition="start"
label="DND-Pixels"
value="2"
/>
</TabList>
</Box>
<TabPanel value="1" sx={{ padding: 0 }}>
<Collapse in={infoAlerts.camera}>
<Alert severity="info" sx={{ width: '100%' }} onClose={() => {
setInfoAlerts('camera', false)
}}>
<strong>DND-Canvas Mode</strong>
<ul style={{ padding: '0 1rem' }}>
<li>Use Mousewheel to Zoom</li>
<li>Use left-click with drag&drop to move around</li>
<li>Use right-click to:</li>
<ul>
<li>assign pixel or pixel-group</li>
<li>edit a pixel</li>
<li>clear a pixel</li>
<li>move a pixel-group</li>
</ul>
<li>Enter DND-Pixels mode to move pixels individually</li>
</ul>
</Alert>
</Collapse>
</TabPanel>
<TabPanel value="2">
<Collapse in={infoAlerts.pixelMode} sx={{ marginTop: '0 !important' }}>
<Alert severity="info" sx={{ width: '100%' }} onClose={()=> setInfoAlerts('pixelMode', false)}>
<strong>DND-Pixels Mode</strong>
<ul style={{ padding: '0 1rem' }}>
<li>move pixels individually with your mouse</li>
</ul>
</Alert>
</Collapse>
</TabPanel>
</TabContext>
</>
}
{features.matrix_cam &&
<>
<Button sx={{ alignItems: 'center'}} onClick={()=> setCamMapper(!camMapper)}>
<EmergencyRecording sx={{ marginRight: 1}} /> Map Pixels via Camera
</Button>
{camMapper && <Webcam rowN={rowN} colN={colN} />}
</>}
</Collapse>
<Button sx={{ alignItems: 'center', textTransform: 'none'}} onClick={()=> {
getDevices()
setCamMapper(!camMapper)}
}>
<EmergencyRecording sx={{ marginRight: 1}} />{camMapper ? 'Exit CameraMapper' : 'Map Pixels via Camera'}
</Button>
<Collapse in={camMapper}>
<Webcam rowN={rowN} colN={colN} />
</Collapse>
</Stack>
)
}
Expand Down
4 changes: 0 additions & 4 deletions src/pages/Devices/EditVirtuals/PixelSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Stack, TextField } from '@mui/material'
import useStore from '../../../store/useStore'

const PixelSlider = ({ s, handleRangeSegment }: any) => {
const getDevices = useStore((state) => state.getDevices)
const devices = useStore((state) => state.devices)

const [range, setRange] = useState([s[1], s[2]])
Expand All @@ -22,9 +21,6 @@ const PixelSlider = ({ s, handleRangeSegment }: any) => {
setRange([s[1], s[2]])
}, [s])

useEffect(() => {
getDevices() // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

if (!devices[s[0]]) {
return null
Expand Down
5 changes: 0 additions & 5 deletions src/pages/Devices/EditVirtuals/Segment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect } from 'react'
import { Typography, Button, Stack } from '@mui/material'
import { ExpandLess, ExpandMore, SwapHoriz } from '@mui/icons-material'
import { swap } from '../../../utils/helpers'
Expand All @@ -8,7 +7,6 @@ import useStore from '../../../store/useStore'
import useSegmentStyles from './Segment.styles'

const Segment = ({ s, i, virtual, segments, calib }: any) => {
const getDevices = useStore((state) => state.getDevices)
const devices = useStore((state) => state.devices)

const title =
Expand Down Expand Up @@ -90,9 +88,6 @@ const Segment = ({ s, i, virtual, segments, calib }: any) => {
})
}

useEffect(() => {
getDevices()
}, [getDevices])

return (
<div
Expand Down

0 comments on commit 6866996

Please sign in to comment.