added the expansion line to the card for scanned components
This commit is contained in:
parent
c263f16346
commit
edb162614c
3 changed files with 8 additions and 7 deletions
|
|
@ -40,7 +40,7 @@ export default function DeviceScannedComponents(props: Props){
|
|||
const [openDialog, setOpenDialog] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
console.log(scannedComponents)
|
||||
//console.log(scannedComponents)
|
||||
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
|
||||
//makes the array empty for testing
|
||||
// if (scannedComponents.i2c) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ interface Props {
|
|||
sensorNum?: number
|
||||
}
|
||||
|
||||
export default function ScannedI2C(props: Props){
|
||||
export default function ScannedI2C(props: Props){
|
||||
const {addressData, deviceProduct, componentSelectionCallback, availablePositions, sensorNum} = props
|
||||
const [types, setTypes] = useState<quack.ComponentType[]>([])
|
||||
const [subtypeOptions, setSubtypeOptions] = useState<Array<Subtype>>([])
|
||||
|
|
@ -107,6 +107,7 @@ export default function ScannedI2C(props: Props){
|
|||
return (
|
||||
<Box sx={{marginY: 1}}>
|
||||
{sensorNum && <Typography>Sensor {sensorNum}</Typography>}
|
||||
<Typography variant="caption">{addressData.expansionLine !== 0 && "Expansion Line: " + addressData.expansionLine}</Typography>
|
||||
{types.length > 0 ?
|
||||
<React.Fragment>
|
||||
<Grid2 container direction="row" alignItems="center" justifyContent="space-between">
|
||||
|
|
@ -145,7 +146,7 @@ export default function ScannedI2C(props: Props){
|
|||
}}
|
||||
select>
|
||||
{subtypeOptions.map(s => (
|
||||
<MenuItem value={s.key}>{s.friendlyName}</MenuItem>
|
||||
<MenuItem key={s.key} value={s.key}>{s.friendlyName}</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue