updated the api to use a new variable for whether to load all nodes, this will still use the show errors boolean for the component page
fixed issue in the filter function in the grain cable model that caused it to return empty when a top node was not set updated the bin svg to have the disabled nodes greyed out
This commit is contained in:
parent
35e8996c29
commit
23223aa1a8
10 changed files with 134 additions and 109 deletions
|
|
@ -382,20 +382,25 @@ export default function BinVisualizer(props: Props) {
|
|||
//only use the values below the top node
|
||||
//because splice mutates the original array make a clone in the cables so the svg still has all of them for display
|
||||
//also reverse it so that the node 1 (end of the cable) is in the first position
|
||||
let tempClone = cloneDeep(cable.temperatures).reverse();
|
||||
let humClone = cloneDeep(cable.humidities).reverse();
|
||||
let emcClone = cloneDeep(cable.grainMoistures).reverse();
|
||||
let filteredNodes = cable.filteredNodes(true)
|
||||
temps.push(...filteredNodes.temps)
|
||||
humids.push(...filteredNodes.humids)
|
||||
emcs.push(...filteredNodes.moistures)
|
||||
// let tempClone = cloneDeep(cable.temperatures).reverse();
|
||||
// let humClone = cloneDeep(cable.humidities).reverse();
|
||||
// let emcClone = cloneDeep(cable.grainMoistures).reverse();
|
||||
//add the cable data to the proper arrays
|
||||
if (cable.topNode > 0) {
|
||||
temps.push(...tempClone.splice(0, cable.topNode));
|
||||
humids.push(...humClone.splice(0, cable.topNode));
|
||||
emcs.push(...emcClone.splice(0, cable.topNode));
|
||||
} else {
|
||||
//if the cable has no fill set (top node) then use all of the nodes
|
||||
temps = tempClone;
|
||||
humids = humClone;
|
||||
emcs = emcClone;
|
||||
}
|
||||
// if (cable.topNode > 0) {
|
||||
// temps.push(...tempClone.splice(0, cable.topNode));
|
||||
// humids.push(...humClone.splice(0, cable.topNode));
|
||||
// emcs.push(...emcClone.splice(0, cable.topNode));
|
||||
// } else {
|
||||
// //if the cable has no fill set (top node) then use all of the nodes
|
||||
// temps = tempClone;
|
||||
// humids = humClone;
|
||||
// emcs = emcClone;
|
||||
// }
|
||||
|
||||
//add the trend data to the proper arrays if the top node is set
|
||||
let cableTrendData = binTrend.cableTrend[cable.key()];
|
||||
tempTrends.push(cableTrendData.grainCelciusTrend);
|
||||
|
|
@ -432,6 +437,7 @@ export default function BinVisualizer(props: Props) {
|
|||
};
|
||||
}
|
||||
});
|
||||
|
||||
//set the average conditions
|
||||
avgConditions = {
|
||||
tempC: average(temps),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue