put in all the data that will be displayed
This commit is contained in:
parent
c5a3487db0
commit
8f601b360e
6 changed files with 97 additions and 13 deletions
|
|
@ -7,9 +7,11 @@ import { useEffect, useState } from "react";
|
|||
import ScannedI2C from "./ScannedI2C";
|
||||
import ComponentForm from "component/ComponentForm";
|
||||
import { Component, Device } from "models";
|
||||
import { DeviceAvailabilityMap, OffsetAvailabilityMap } from "pbHelpers/DeviceAvailability";
|
||||
import { DeviceAvailabilityMap, FindAvailablePositions, OffsetAvailabilityMap } from "pbHelpers/DeviceAvailability";
|
||||
import ResponsiveDialog from "common/ResponsiveDialog";
|
||||
import { useComponentAPI, useDeviceAPI, useSnackbar } from "hooks";
|
||||
import { ConfigurablePin } from "pbHelpers/AddressTypes";
|
||||
import ScannedOneWirePort from "./OneWire/ScannedOneWirePort";
|
||||
|
||||
interface Props {
|
||||
scannedComponents: pond.ComponentAddressMap
|
||||
|
|
@ -251,10 +253,21 @@ export default function DeviceScannedComponents(props: Props){
|
|||
</Typography>
|
||||
<Button variant="contained" color="primary" onClick={()=>{}}>Clear Scan</Button>
|
||||
</Box>
|
||||
{scannedOneWire.map(scan => {
|
||||
{scannedOneWire.map((scan,i) => {
|
||||
let map = FindAvailablePositions([], device.settings.product).availability.get(quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY)
|
||||
let portAddress = scan.settings?.oneWireData?.port
|
||||
let portLabel = ""
|
||||
|
||||
map?.forEach(entry => {
|
||||
let pin = entry as ConfigurablePin
|
||||
if (pin.address && pin.address === portAddress) {
|
||||
portLabel = pin.label
|
||||
}
|
||||
})
|
||||
return(
|
||||
<Box>
|
||||
|
||||
<Box key={i}>
|
||||
<Typography>Port: {portLabel}</Typography>
|
||||
<ScannedOneWirePort scan={scan}/>
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue