diff --git a/src/client/pages/YieldStudyDashboard.tsx b/src/client/pages/YieldStudyDashboard.tsx index 8871316..3ad93d4 100644 --- a/src/client/pages/YieldStudyDashboard.tsx +++ b/src/client/pages/YieldStudyDashboard.tsx @@ -298,11 +298,12 @@ export const YieldStudyDashboard: React.FC = () => { const weightInTons = Number(cat.weight) || 0; const yieldPerTon = Number(cat.historicalYield) || 0; const rawVal = Number(cat.efficiency); - const val = !isNaN(rawVal) ? rawVal : 20; + const effVal = !isNaN(rawVal) && rawVal > 0 ? rawVal : 80; - const isLegacyEfficiency = val > 60; - const efficiencyDecimal = isLegacyEfficiency ? val / 100 : (100 - val) / 100; - const lossFactor = efficiencyDecimal > 0 ? 1 / efficiencyDecimal : 1; + // Eficiência de Aplicação (%): 100% = sem perda (lossFactor = 1.0), 80% = 20% perda (lossFactor = 1.25), etc. + const effPercent = Math.min(Math.max(effVal, 1), 100); + const efficiencyDecimal = effPercent / 100; + const lossFactor = 1 / efficiencyDecimal; // Cálculo por PESO (L/t) - Não usa mais o fator de eficiência/perda const litrosPeso = weightInTons * yieldPerTon; @@ -706,10 +707,10 @@ export const YieldStudyDashboard: React.FC = () => { onChange={e => { const selectedName = e.target.value; const geoType = geometryTypes.find(g => g.name === selectedName); - // Update name and auto-set efficiency (loss) if found + // Update name and auto-set efficiency if found (100% - loss%) updateCategory(cat.id, { name: selectedName, - ...(geoType && { efficiency: geoType.efficiencyLoss || 20 }) + ...(geoType && { efficiency: Math.max(10, 100 - (geoType.efficiencyLoss || 20)) }) }); }} > @@ -788,11 +789,13 @@ export const YieldStudyDashboard: React.FC = () => { updateCategory(cat.id, { efficiency: Number(e.target.value) })} - title="Percentual de Eficiência/Perda (Aplica-se apenas ao cálculo por Área)" - placeholder="20" + title="Eficiência de Aplicação (%) - 100% representa zero perda" + placeholder="80" />