added function to the bin model to get the bushels from either the settings or the status based on the inventory control and replaced the instances in the bin card and visualizer where it was getting it from the settings with the function
This commit is contained in:
parent
acbd49b907
commit
b197f34f33
5 changed files with 132 additions and 109 deletions
|
|
@ -125,11 +125,23 @@ export class Bin {
|
|||
return colour;
|
||||
}
|
||||
|
||||
public bushels(): number {
|
||||
let bushels = this.settings.inventory?.grainBushels || 0
|
||||
if (this.settings.inventory?.inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR){
|
||||
bushels = this.status.grainBushels
|
||||
}
|
||||
return bushels
|
||||
}
|
||||
|
||||
public fillPercent(): number {
|
||||
let fill = 0;
|
||||
if (this.settings.inventory && this.settings.specs) {
|
||||
let bushels = this.settings.inventory.grainBushels
|
||||
if (this.settings.inventory.inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR){
|
||||
bushels = this.status.grainBushels
|
||||
}
|
||||
fill = Math.round(
|
||||
(this.settings.inventory.grainBushels / this.settings.specs.bushelCapacity) * 100
|
||||
(bushels / this.settings.specs.bushelCapacity) * 100
|
||||
);
|
||||
}
|
||||
return fill;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue