mowing and properties
This commit is contained in:
@@ -373,11 +373,10 @@ const History = () => {
|
||||
const meters = (log.total_distance_meters || log.gpsTrack?.totalDistance || log.gps_track?.totalDistance || 0) || 0;
|
||||
const totalDistanceFeet = meters * 3.28084;
|
||||
const plannedArea = Number(log.total_area || 0);
|
||||
if (totalDistanceFeet === 0 || plannedArea === 0) return 0;
|
||||
let equipmentWidth = 6; // default mower deck width in ft
|
||||
const name = (log.equipment_name || '').toLowerCase();
|
||||
if (name.includes('30"') || name.includes('30 in')) equipmentWidth = 2.5;
|
||||
const theoreticalCoverageArea = totalDistanceFeet * equipmentWidth;
|
||||
const widthInches = parseFloat(log.cutting_width_inches || 0);
|
||||
const widthFeet = isNaN(widthInches) ? 0 : (widthInches / 12);
|
||||
if (totalDistanceFeet === 0 || plannedArea === 0 || widthFeet === 0) return 0;
|
||||
const theoreticalCoverageArea = totalDistanceFeet * widthFeet;
|
||||
return Math.min(100, Math.round((theoreticalCoverageArea / plannedArea) * 100));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user