Merge branch 'reverse_nodes' into staging_environment

This commit is contained in:
csawatzky 2025-11-14 16:25:55 -06:00
commit 965738fedd
4 changed files with 66 additions and 5 deletions

2
package-lock.json generated
View file

@ -10953,7 +10953,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#900cb83a502288a8e3115657c064520c3c9ab967", "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#221fb87c9242361c6419d3bd723a83843c60f184",
"dependencies": { "dependencies": {
"protobufjs": "^6.8.8" "protobufjs": "^6.8.8"
} }

View file

@ -2250,11 +2250,13 @@ export default function BinSettings(props: Props) {
</Grid> </Grid>
</Grid> </Grid>
</Box> </Box>
{!isCustomInventory && (
<Box marginTop={1}> <Box marginTop={1}>
<Typography variant="body1" align="center" gutterBottom> <Typography variant="body1" align="center" gutterBottom>
Moisture Moisture
</Typography> </Typography>
{isCustomInventory && (
<Typography variant="caption">You are using a custom Grain type, the drying estimate may not be accurate</Typography>
)}
<Box marginTop={1}> <Box marginTop={1}>
<TextField <TextField
label="Target EMC" label="Target EMC"
@ -2346,7 +2348,7 @@ export default function BinSettings(props: Props) {
</Grid> </Grid>
</Grid> </Grid>
</Box> </Box>
)}
</Box> </Box>
); );
}; };

View file

@ -133,7 +133,7 @@ export default function ComponentForm(props: Props) {
length: "0", length: "0",
height: "0", height: "0",
width: "0", width: "0",
sensorDistance: "0" sensorDistance: "0",
}); });
const [compMode, setCompMode] = useState<any>(); const [compMode, setCompMode] = useState<any>();
//const [numCalibrations, setNumCalibrations] = useState(0) //const [numCalibrations, setNumCalibrations] = useState(0)
@ -204,7 +204,7 @@ export default function ComponentForm(props: Props) {
length: length.toFixed(2), length: length.toFixed(2),
width: width.toFixed(2), width: width.toFixed(2),
height: height.toFixed(2), height: height.toFixed(2),
sensorDistance: sensorDistance.toFixed(2) sensorDistance: sensorDistance.toFixed(2),
}); });
}, [component]); }, [component]);
@ -377,6 +377,12 @@ export default function ComponentForm(props: Props) {
setForm(f); setForm(f);
}; };
const toggleReverseNodes = (event: any) => {
let f = cloneDeep(form);
f.component.settings.reverseNodes = event.target.checked;
setForm(f);
};
const updateGrainType = (option: Option | null) => { const updateGrainType = (option: Option | null) => {
let f = cloneDeep(form); let f = cloneDeep(form);
@ -908,6 +914,42 @@ export default function ComponentForm(props: Props) {
); );
}; };
const reverseCheck = () => {
const {reverseNodes} = form.component.settings
let ext = extension(component.type(), component.subType())
if (ext.isArray && device.featureSupported("reverseNodes")) {
return (
<Grid
container
direction="row"
justifyContent="space-between"
alignItems="center"
alignContent="center"
spacing={1}>
<Grid container size={{ xs: 4, sm: 3 }} justifyContent="center">
<FormControlLabel
control={
<Switch
checked={reverseNodes}
onChange={toggleReverseNodes}
name="nodesReversed"
aria-label="nodesReversed"
color="secondary"
/>
}
label={<Typography variant="caption">Reverse Nodes</Typography>}
labelPlacement="top"
className={classes.switchControl}
disabled={!canEdit}
/>
</Grid>
</Grid>
)
}
return
}
const generalForm = () => { const generalForm = () => {
const { const {
component, component,
@ -975,6 +1017,7 @@ export default function ComponentForm(props: Props) {
)} )}
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && {component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE &&
grainSelect()} grainSelect()}
{reverseCheck()}
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && ( {component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && (
<Grid <Grid
container container

View file

@ -34,6 +34,22 @@ const featureVersions: Map<string, FeatureVersionByPlatform> = new Map([
v2EthBlue: "2.0.44" v2EthBlue: "2.0.44"
} }
],[ ],[
"reverseNodes",
{
photon: "N/A",
electron: "N/A",
v2Wifi: "N/A",
v2Cell: "N/A",
v2WifiS3: "N/A",
v2CellS3: "N/A",
v2CellBlack: "2.1.8",
v2CellGreen: "N/A",
v2WifiBlue: "2.1.8",
v2CellBlue: "2.1.8",
v2EthBlue: "2.1.8"
}
],
[
"detectI2C", "detectI2C",
{ {
photon: "N/A", photon: "N/A",