Merge branch 'reverse_nodes' into staging_environment
This commit is contained in:
commit
965738fedd
4 changed files with 66 additions and 5 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -10953,7 +10953,7 @@
|
|||
},
|
||||
"node_modules/protobuf-ts": {
|
||||
"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": {
|
||||
"protobufjs": "^6.8.8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2250,11 +2250,13 @@ export default function BinSettings(props: Props) {
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
{!isCustomInventory && (
|
||||
<Box marginTop={1}>
|
||||
<Typography variant="body1" align="center" gutterBottom>
|
||||
Moisture
|
||||
</Typography>
|
||||
{isCustomInventory && (
|
||||
<Typography variant="caption">You are using a custom Grain type, the drying estimate may not be accurate</Typography>
|
||||
)}
|
||||
<Box marginTop={1}>
|
||||
<TextField
|
||||
label="Target EMC"
|
||||
|
|
@ -2346,7 +2348,7 @@ export default function BinSettings(props: Props) {
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export default function ComponentForm(props: Props) {
|
|||
length: "0",
|
||||
height: "0",
|
||||
width: "0",
|
||||
sensorDistance: "0"
|
||||
sensorDistance: "0",
|
||||
});
|
||||
const [compMode, setCompMode] = useState<any>();
|
||||
//const [numCalibrations, setNumCalibrations] = useState(0)
|
||||
|
|
@ -204,7 +204,7 @@ export default function ComponentForm(props: Props) {
|
|||
length: length.toFixed(2),
|
||||
width: width.toFixed(2),
|
||||
height: height.toFixed(2),
|
||||
sensorDistance: sensorDistance.toFixed(2)
|
||||
sensorDistance: sensorDistance.toFixed(2),
|
||||
});
|
||||
}, [component]);
|
||||
|
||||
|
|
@ -377,6 +377,12 @@ export default function ComponentForm(props: Props) {
|
|||
setForm(f);
|
||||
};
|
||||
|
||||
const toggleReverseNodes = (event: any) => {
|
||||
let f = cloneDeep(form);
|
||||
f.component.settings.reverseNodes = event.target.checked;
|
||||
setForm(f);
|
||||
};
|
||||
|
||||
const updateGrainType = (option: Option | null) => {
|
||||
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 {
|
||||
component,
|
||||
|
|
@ -975,6 +1017,7 @@ export default function ComponentForm(props: Props) {
|
|||
)}
|
||||
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE &&
|
||||
grainSelect()}
|
||||
{reverseCheck()}
|
||||
{component.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && (
|
||||
<Grid
|
||||
container
|
||||
|
|
|
|||
|
|
@ -34,6 +34,22 @@ const featureVersions: Map<string, FeatureVersionByPlatform> = new Map([
|
|||
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",
|
||||
{
|
||||
photon: "N/A",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue