Merge branch 'staging_environment' into field_dashboard
This commit is contained in:
commit
7a8a010a39
28 changed files with 212 additions and 128 deletions
|
|
@ -249,9 +249,9 @@ export default function BinCard(props: Props) {
|
|||
noWrap
|
||||
style={{ fontSize: "0.85rem", fontWeight: 650, color: tempColour }}>
|
||||
{display +
|
||||
(user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_CELSIUS
|
||||
? "°C"
|
||||
: "°F")}
|
||||
(user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
|
||||
? "°F"
|
||||
: "°C")}
|
||||
</Typography>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const useStyles = makeStyles((theme: Theme) => {
|
|||
interface Props {
|
||||
interactions: Interaction[];
|
||||
interactionDevices: Map<string, number>;
|
||||
mode: pond.BinMode.BIN_MODE_DRYING | pond.BinMode.BIN_MODE_HYDRATING;
|
||||
mode: pond.BinMode;
|
||||
plenums?: Plenum[];
|
||||
ambients?: Ambient[];
|
||||
heaters?: Controller[];
|
||||
|
|
@ -94,10 +94,21 @@ export default function BinConditioningCard(props: Props) {
|
|||
return conditioningInteractions;
|
||||
};
|
||||
|
||||
const modeDisplay = () => {
|
||||
switch(mode){
|
||||
case pond.BinMode.BIN_MODE_DRYING:
|
||||
return "Drying"
|
||||
case pond.BinMode.BIN_MODE_HYDRATING:
|
||||
return "Hydrating"
|
||||
case pond.BinMode.BIN_MODE_COOLDOWN:
|
||||
return "Cooldown"
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card raised className={classes.card}>
|
||||
<Typography style={{ fontWeight: 650 }}>
|
||||
{mode === pond.BinMode.BIN_MODE_DRYING ? "Drying" : "Hydrating"} Conditions
|
||||
{modeDisplay()} Conditions
|
||||
</Typography>
|
||||
{conditionsDisplay()}
|
||||
</Card>
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ const useStyles = makeStyles((theme: Theme) => {
|
|||
sliderThumb: {
|
||||
height: 15,
|
||||
width: 15,
|
||||
marginTop: -6,
|
||||
marginLeft: -7.5,
|
||||
backgroundColor: "yellow"
|
||||
},
|
||||
sliderTrack: {
|
||||
|
|
@ -60,10 +58,10 @@ const useStyles = makeStyles((theme: Theme) => {
|
|||
backgroundColor: "white"
|
||||
},
|
||||
sliderValLabel: {
|
||||
left: "calc(-50%)",
|
||||
top: 22,
|
||||
left: -20,
|
||||
top: 40,
|
||||
background: "transparent",
|
||||
"& *": {
|
||||
background: "transparent",
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -507,9 +507,9 @@ export default function BinSVGV2(props: Props) {
|
|||
//if the cables have the same number of nodes
|
||||
if (b.temperatures.length === a.temperatures.length) {
|
||||
//sort by temp only last and any type that has humidity first
|
||||
if ((avg(a.humidities) === 0 || a.humidities.length === 0) && (avg(b.humidities) !== 0 || b.humidities.length > 0)) {
|
||||
if ((avg(a.humidities) === 0) && (avg(b.humidities) !== 0)) {
|
||||
return 1;
|
||||
} else if ((avg(b.humidities) === 0 || b.humidities.length === 0) && (avg(a.humidities) !== 0 || a.humidities.length > 0)) {
|
||||
} else if ((avg(b.humidities) === 0) && (avg(a.humidities) !== 0)) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -485,6 +485,7 @@ export default function BinSettings(props: Props) {
|
|||
form.inventory.inventoryControl = inventoryControl
|
||||
form.inventory.autoThreshold = autoFillThreshold
|
||||
}
|
||||
console.log(form)
|
||||
binAPI
|
||||
.updateBin(bin.key(), form, as)
|
||||
.then(response => {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { Bin, Component } from "models";
|
|||
import { GrainCable } from "models/GrainCable";
|
||||
import { UnitMeasurement } from "models/UnitMeasurement";
|
||||
import Co2Icon from "products/CommonIcons/co2Icon";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { pond, quack } from "protobuf-ts/pond";
|
||||
import { useBinAPI, useGlobalState, useSnackbar } from "providers";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { avg, getTemperatureUnit } from "utils";
|
||||
|
|
@ -200,33 +200,32 @@ export default function BinStorageConditions(props: Props) {
|
|||
// }
|
||||
});
|
||||
|
||||
let nodeEMCs: number[] = [];
|
||||
|
||||
filteredNodes.moistures.forEach((emc, i) => {
|
||||
if(cable.subType() !== quack.GrainCableSubtype.GRAIN_CABLE_SUBTYPE_OPI_TEMP){
|
||||
let nodeEMCs: number[] = [];
|
||||
filteredNodes.moistures.forEach((emc, i) => {
|
||||
if (bin.settings.inventory?.targetMoisture) {
|
||||
// if (i < cable.topNode) {
|
||||
nodeEMCs.push(emc);
|
||||
nodeEMCs.push(emc);
|
||||
emcCounts.total++;
|
||||
if (
|
||||
emc >
|
||||
bin.settings.inventory.targetMoisture +
|
||||
bin.settings.inventory.moistureTargetDeviation
|
||||
bin.settings.inventory.moistureTargetDeviation
|
||||
) {
|
||||
emcCounts.above++;
|
||||
} else if (
|
||||
emc <
|
||||
bin.settings.inventory.targetMoisture -
|
||||
bin.settings.inventory.moistureTargetDeviation
|
||||
bin.settings.inventory.moistureTargetDeviation
|
||||
) {
|
||||
emcCounts.below++;
|
||||
} else {
|
||||
emcCounts.onTarget++;
|
||||
}
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
cableEMCAvgs.push(avg(nodeEMCs));
|
||||
}
|
||||
cableTempAvgs.push(avg(nodeTemps));
|
||||
cableEMCAvgs.push(avg(nodeEMCs));
|
||||
}
|
||||
});
|
||||
if (cableTempAvgs.length > 0) {
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ export default function BinVisualizer(props: Props) {
|
|||
highNodeConditions = {
|
||||
tempC: filteredNodes.temps[highTempIndex],
|
||||
humidity: filteredNodes.humids[highTempIndex],
|
||||
emc: filteredNodes.humids[highTempIndex],
|
||||
emc: filteredNodes.moistures[highTempIndex],
|
||||
tempCTrend: cableTrendData.hotNodeTrend?.tempTrend ?? 0,
|
||||
humidityTrend: cableTrendData.hotNodeTrend?.humidityTrend ?? 0,
|
||||
emcTrend: cableTrendData.hotNodeTrend?.emcTrend ?? 0
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ interface Props {
|
|||
loadMore?: () => void;
|
||||
//startingTranslate: number;
|
||||
valDisplay?: "high" | "low" | "average";
|
||||
insert?: boolean
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((_theme) => {
|
||||
|
|
@ -39,7 +40,7 @@ const useStyles = makeStyles((_theme) => {
|
|||
});
|
||||
|
||||
export default function BinsList(props: Props) {
|
||||
const { bins, duplicateBin, title, gridView, loadMore, valDisplay } = props;
|
||||
const { bins, duplicateBin, title, gridView, loadMore, valDisplay, insert } = props;
|
||||
const classes = useStyles();
|
||||
// const history = useHistory();
|
||||
const navigate = useNavigate()
|
||||
|
|
@ -114,7 +115,12 @@ export default function BinsList(props: Props) {
|
|||
{bins.map((b, i) =>
|
||||
(
|
||||
<Grid
|
||||
size={{
|
||||
size={insert ? {
|
||||
xs: 6,
|
||||
sm: 6,
|
||||
md: 4,
|
||||
lg: 3,
|
||||
} : {
|
||||
xs: 6,
|
||||
sm: 4,
|
||||
md: 3,
|
||||
|
|
|
|||
|
|
@ -316,6 +316,7 @@ export default function BinyardDisplay(props: Props) {
|
|||
<Grid size={12}>
|
||||
<BinsList
|
||||
gridView
|
||||
insert
|
||||
valDisplay="average"
|
||||
bins={grainBins}
|
||||
duplicateBin={duplicateBin}
|
||||
|
|
@ -332,6 +333,7 @@ export default function BinyardDisplay(props: Props) {
|
|||
<Grid size={12}>
|
||||
<BinsList
|
||||
gridView
|
||||
insert
|
||||
valDisplay="average"
|
||||
bins={fertBins}
|
||||
duplicateBin={duplicateBin}
|
||||
|
|
@ -348,6 +350,7 @@ export default function BinyardDisplay(props: Props) {
|
|||
<Grid size={12}>
|
||||
<BinsList
|
||||
gridView
|
||||
insert
|
||||
valDisplay="average"
|
||||
bins={emptyBins}
|
||||
duplicateBin={duplicateBin}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue