added the fan picker stuff back in to the binSettings and componentForm

This commit is contained in:
csawatzky 2025-04-08 15:27:02 -06:00
parent 3475b0ff03
commit 9074120f74
2 changed files with 19 additions and 18 deletions

View file

@ -47,7 +47,7 @@ import {
RadiansToDegrees,
TriangleOppositeLength
} from "common/TrigFunctions";
// import FanPicker from "fans/fanPicker";
import FanPicker from "fans/fanPicker";
import { GrainOptions, ToGrainOption } from "grain";
import GrainDescriber from "grain/GrainDescriber";
import GrainTransaction from "grain/GrainTransaction";
@ -1109,19 +1109,18 @@ export default function BinSettings(props: Props) {
const fanPicker = () => {
return (
// <FanPicker
// updateFan={(fanId: number) => {
// if (fanId !== undefined) {
// //set the fan id in the bin settings form
// form.fanId = fanId;
// //remove the old fan from the bin
// form.fan = null;
// }
// }}
// fanID={form.fanId}
// useCardView
// />
null
<FanPicker
updateFan={(fanId: number) => {
if (fanId !== undefined) {
//set the fan id in the bin settings form
form.fanId = fanId;
//remove the old fan from the bin
form.fan = null;
}
}}
fanID={form.fanId}
useCardView
/>
);
};

View file

@ -30,6 +30,7 @@ import {
extension,
getMeasurements,
hasDimensions,
hasFan,
isController,
isMultiSensor,
primaryMeasurement
@ -45,6 +46,7 @@ import { makeStyles } from "@mui/styles";
import { getDistanceUnit } from "utils";
import { GrainOptions } from "grain";
import CompModes from "component/ComponentMode.json";
import FanPicker from "fans/fanPicker";
const useStyles = makeStyles((theme: Theme) => {
return ({
@ -874,8 +876,8 @@ export default function ComponentForm(props: Props) {
disabled={!canEdit}
/>
{/* TODO-CS: Change this to have a parameter in the extensions that gets checked rather then checking for the component type */}
{/*hasFan(component.type()) && (*/}
{/*<FanPicker
{hasFan(component.type()) && (
<FanPicker
fanID={component.settings.fanId}
updateFan={(fanID: number) => {
component.settings.fanId = fanID;
@ -890,8 +892,8 @@ export default function ComponentForm(props: Props) {
);
}
}}
/> */}
{/* )} */}
/>
)}
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE &&
grainSelect()}
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && (