set up a way to adjust the threshold for auto lidar
This commit is contained in:
parent
ccb249481a
commit
2f2015ae08
3 changed files with 43 additions and 9 deletions
|
|
@ -183,6 +183,7 @@ export default function BinSettings(props: Props) {
|
|||
const [inMoistureString, setInMoistureString] = useState("0");
|
||||
const [tMoistureString, setTMoistureString] = useState("0");
|
||||
const [moistureTargetDeviation, setMoistureTargetDeviation] = useState("0");
|
||||
const [autoFillThreshold, setAutoFillThreshold] = useState(0);
|
||||
const [validInitial, setValidInitial] = useState(true);
|
||||
const [validTarget, setValidTarget] = useState(true);
|
||||
const [validDeviation, setValidDeviation] = useState(true);
|
||||
|
|
@ -311,6 +312,7 @@ export default function BinSettings(props: Props) {
|
|||
setInMoistureString(initForm.inventory?.initialMoisture.toString() ?? "0");
|
||||
setTMoistureString(initForm.inventory?.targetMoisture.toString() ?? "0");
|
||||
setMoistureTargetDeviation(initForm.inventory?.moistureTargetDeviation.toString() ?? "0");
|
||||
setAutoFillThreshold(initForm.inventory?.autoThreshold ?? 0)
|
||||
setActiveStep(0);
|
||||
if (bin) {
|
||||
setAutoTopNode(bin.settings.autoGrainNode);
|
||||
|
|
@ -405,7 +407,10 @@ export default function BinSettings(props: Props) {
|
|||
form.highTemp = highTempC;
|
||||
form.lowTemp = lowTempC;
|
||||
form.autoGrainNode = autoTopNode;
|
||||
if (form.inventory) form.inventory.inventoryControl = inventoryControl;
|
||||
if (form.inventory) {
|
||||
form.inventory.inventoryControl = inventoryControl
|
||||
form.inventory.autoThreshold = autoFillThreshold
|
||||
}
|
||||
|
||||
binAPI
|
||||
.addBin(form, as)
|
||||
|
|
@ -449,7 +454,10 @@ export default function BinSettings(props: Props) {
|
|||
form.highTemp = highTempC;
|
||||
form.lowTemp = lowTempC;
|
||||
form.autoGrainNode = autoTopNode;
|
||||
if (form.inventory) form.inventory.inventoryControl = inventoryControl;
|
||||
if (form.inventory) {
|
||||
form.inventory.inventoryControl = inventoryControl
|
||||
form.inventory.autoThreshold = autoFillThreshold
|
||||
}
|
||||
binAPI
|
||||
.updateBin(bin.key(), form, as)
|
||||
.then(response => {
|
||||
|
|
@ -699,11 +707,14 @@ export default function BinSettings(props: Props) {
|
|||
};
|
||||
|
||||
const inventoryControlLabel = (control: pond.BinInventoryControl) => {
|
||||
let string = "Manual";
|
||||
if (control === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC) {
|
||||
string = "Auto";
|
||||
switch(control){
|
||||
case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR:
|
||||
return "Auto (lidar)"
|
||||
case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC:
|
||||
return "Auto (cable)"
|
||||
default:
|
||||
return "Manual"
|
||||
}
|
||||
return string;
|
||||
};
|
||||
|
||||
const inventoryForm = () => {
|
||||
|
|
@ -819,6 +830,7 @@ export default function BinSettings(props: Props) {
|
|||
<Accordion className={classes.bottomSpacing}>
|
||||
<AccordionSummary expandIcon={<ExpandMore />}>
|
||||
<Grid
|
||||
width={"100%"}
|
||||
container
|
||||
direction="row"
|
||||
alignContent="center"
|
||||
|
|
@ -864,6 +876,28 @@ export default function BinSettings(props: Props) {
|
|||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
{inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR &&
|
||||
<Box width="100%" padding={2}>
|
||||
<TextField
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
label="Auto Threshold Percent"
|
||||
helperText="Fill percent threshold that must be crossed to affect inventory"
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
%
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
type="number"
|
||||
value={autoFillThreshold}
|
||||
onChange={e => {
|
||||
setAutoFillThreshold(+e.target.value)
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
}
|
||||
</Accordion>
|
||||
{empty ? (
|
||||
<Box marginTop={3} display="flex" flexDirection="column" alignItems="center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue