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
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -43,7 +43,7 @@
|
||||||
"mui-tel-input": "^7.0.0",
|
"mui-tel-input": "^7.0.0",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"openweathermap-ts": "^1.2.10",
|
"openweathermap-ts": "^1.2.10",
|
||||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#dev",
|
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#hybrid_inventory_control",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-beautiful-dnd": "^13.1.1",
|
"react-beautiful-dnd": "^13.1.1",
|
||||||
"react-color": "^2.19.3",
|
"react-color": "^2.19.3",
|
||||||
|
|
@ -10993,7 +10993,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/protobuf-ts": {
|
"node_modules/protobuf-ts": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#738c7156ab9cfc46b3cf0b21d5e1a75b4f57d944",
|
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#2a787ba3e5ba69f65fac49ba6120231edb565e47",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
"mui-tel-input": "^7.0.0",
|
"mui-tel-input": "^7.0.0",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"openweathermap-ts": "^1.2.10",
|
"openweathermap-ts": "^1.2.10",
|
||||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#dev",
|
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#hybrid_inventory_control",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-beautiful-dnd": "^13.1.1",
|
"react-beautiful-dnd": "^13.1.1",
|
||||||
"react-color": "^2.19.3",
|
"react-color": "^2.19.3",
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@ export default function BinSettings(props: Props) {
|
||||||
const [inMoistureString, setInMoistureString] = useState("0");
|
const [inMoistureString, setInMoistureString] = useState("0");
|
||||||
const [tMoistureString, setTMoistureString] = useState("0");
|
const [tMoistureString, setTMoistureString] = useState("0");
|
||||||
const [moistureTargetDeviation, setMoistureTargetDeviation] = useState("0");
|
const [moistureTargetDeviation, setMoistureTargetDeviation] = useState("0");
|
||||||
|
const [autoFillThreshold, setAutoFillThreshold] = useState(0);
|
||||||
const [validInitial, setValidInitial] = useState(true);
|
const [validInitial, setValidInitial] = useState(true);
|
||||||
const [validTarget, setValidTarget] = useState(true);
|
const [validTarget, setValidTarget] = useState(true);
|
||||||
const [validDeviation, setValidDeviation] = useState(true);
|
const [validDeviation, setValidDeviation] = useState(true);
|
||||||
|
|
@ -311,6 +312,7 @@ export default function BinSettings(props: Props) {
|
||||||
setInMoistureString(initForm.inventory?.initialMoisture.toString() ?? "0");
|
setInMoistureString(initForm.inventory?.initialMoisture.toString() ?? "0");
|
||||||
setTMoistureString(initForm.inventory?.targetMoisture.toString() ?? "0");
|
setTMoistureString(initForm.inventory?.targetMoisture.toString() ?? "0");
|
||||||
setMoistureTargetDeviation(initForm.inventory?.moistureTargetDeviation.toString() ?? "0");
|
setMoistureTargetDeviation(initForm.inventory?.moistureTargetDeviation.toString() ?? "0");
|
||||||
|
setAutoFillThreshold(initForm.inventory?.autoThreshold ?? 0)
|
||||||
setActiveStep(0);
|
setActiveStep(0);
|
||||||
if (bin) {
|
if (bin) {
|
||||||
setAutoTopNode(bin.settings.autoGrainNode);
|
setAutoTopNode(bin.settings.autoGrainNode);
|
||||||
|
|
@ -405,7 +407,10 @@ export default function BinSettings(props: Props) {
|
||||||
form.highTemp = highTempC;
|
form.highTemp = highTempC;
|
||||||
form.lowTemp = lowTempC;
|
form.lowTemp = lowTempC;
|
||||||
form.autoGrainNode = autoTopNode;
|
form.autoGrainNode = autoTopNode;
|
||||||
if (form.inventory) form.inventory.inventoryControl = inventoryControl;
|
if (form.inventory) {
|
||||||
|
form.inventory.inventoryControl = inventoryControl
|
||||||
|
form.inventory.autoThreshold = autoFillThreshold
|
||||||
|
}
|
||||||
|
|
||||||
binAPI
|
binAPI
|
||||||
.addBin(form, as)
|
.addBin(form, as)
|
||||||
|
|
@ -449,7 +454,10 @@ export default function BinSettings(props: Props) {
|
||||||
form.highTemp = highTempC;
|
form.highTemp = highTempC;
|
||||||
form.lowTemp = lowTempC;
|
form.lowTemp = lowTempC;
|
||||||
form.autoGrainNode = autoTopNode;
|
form.autoGrainNode = autoTopNode;
|
||||||
if (form.inventory) form.inventory.inventoryControl = inventoryControl;
|
if (form.inventory) {
|
||||||
|
form.inventory.inventoryControl = inventoryControl
|
||||||
|
form.inventory.autoThreshold = autoFillThreshold
|
||||||
|
}
|
||||||
binAPI
|
binAPI
|
||||||
.updateBin(bin.key(), form, as)
|
.updateBin(bin.key(), form, as)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
@ -699,11 +707,14 @@ export default function BinSettings(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const inventoryControlLabel = (control: pond.BinInventoryControl) => {
|
const inventoryControlLabel = (control: pond.BinInventoryControl) => {
|
||||||
let string = "Manual";
|
switch(control){
|
||||||
if (control === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC) {
|
case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR:
|
||||||
string = "Auto";
|
return "Auto (lidar)"
|
||||||
|
case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC:
|
||||||
|
return "Auto (cable)"
|
||||||
|
default:
|
||||||
|
return "Manual"
|
||||||
}
|
}
|
||||||
return string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const inventoryForm = () => {
|
const inventoryForm = () => {
|
||||||
|
|
@ -819,6 +830,7 @@ export default function BinSettings(props: Props) {
|
||||||
<Accordion className={classes.bottomSpacing}>
|
<Accordion className={classes.bottomSpacing}>
|
||||||
<AccordionSummary expandIcon={<ExpandMore />}>
|
<AccordionSummary expandIcon={<ExpandMore />}>
|
||||||
<Grid
|
<Grid
|
||||||
|
width={"100%"}
|
||||||
container
|
container
|
||||||
direction="row"
|
direction="row"
|
||||||
alignContent="center"
|
alignContent="center"
|
||||||
|
|
@ -864,6 +876,28 @@ export default function BinSettings(props: Props) {
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</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>
|
</Accordion>
|
||||||
{empty ? (
|
{empty ? (
|
||||||
<Box marginTop={3} display="flex" flexDirection="column" alignItems="center">
|
<Box marginTop={3} display="flex" flexDirection="column" alignItems="center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue