updated the component and device api's to have as be a parameter for the function
This commit is contained in:
parent
c617ebf868
commit
b62c7dbe5c
39 changed files with 346 additions and 651 deletions
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { GetDeviceProductIcon, GetDeviceProductLabel } from "products/DeviceProduct";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { quack } from "protobuf-ts/quack";
|
||||
import { useComponentAPI, useSnackbar } from "providers";
|
||||
import { useComponentAPI, useGlobalState, useSnackbar } from "providers";
|
||||
import React, { useState } from "react";
|
||||
import DeviceSVG, { PortInformation } from "./deviceSVG";
|
||||
import { makeStyles } from "@mui/styles";
|
||||
|
|
@ -69,6 +69,7 @@ const useStyles = makeStyles((theme: Theme) => {
|
|||
|
||||
export default function DeviceWizard(props: Props) {
|
||||
const { device, components, refreshCallback } = props;
|
||||
const [{as}] = useGlobalState();
|
||||
const [componentDialogOpen, setComponentDialogOpen] = useState(false);
|
||||
const [availableOffsets, setAvailableOffsets] = useState<OffsetAvailabilityMap>(new Map());
|
||||
const [availablePositions, setAvailablePositions] = useState<DeviceAvailabilityMap>(new Map());
|
||||
|
|
@ -159,7 +160,7 @@ export default function DeviceWizard(props: Props) {
|
|||
componentSettings.reportPeriodMs = 600000;
|
||||
componentSettings.name = "Port " + selectedPort.label + " Auto Detect";
|
||||
compAPI
|
||||
.add(device.id(), componentSettings)
|
||||
.add(device.id(), componentSettings, as)
|
||||
.then(resp => {
|
||||
success("Added Auto Detect Component to Port");
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue