Inicio

Servicios Técnicos e Insumos Biológicos y Agrícolas.

Productos ecológicos.

Consultoría en nutrición vegetal.

Manejo de suelos para mejora continua.

Linea de fertilizantes solubles

Balance solUp

import React, { useState, useEffect, useMemo } from ‘react’; import { InputField } from ‘./components/InputField’; import { StatCard } from ‘./components/StatCard’; import { CalculationInputs, CalculationResults, Stage } from ‘./types’; import { DEFAULT_INPUTS, STAGE_WATER_USAGE, STAGE_LABELS } from ‘./constants’; import { Sprout, Droplets, Ruler, Zap, AlertTriangle, Settings, Waves, Flower2, Timer } from ‘lucide-react’; const App: React.FC = () => { const [inputs, setInputs] = useState(DEFAULT_INPUTS); const [results, setResults] = useState(null); const handleInputChange = (name: string, value: number) => { setInputs((prev) => ({ …prev, [name]: value })); }; // Main Calculation Logic useEffect(() => { const calculate = () => { // 1. Total Plants // Plants per bed = (Length / Plant Separation) * Rows // Note: Assuming bed length allows for plants up to the edge or floor division. const plantsPerBed = Math.floor(inputs.bedLength / inputs.plantSeparation) * inputs.rowsPerBed; const totalPlants = plantsPerBed * inputs.totalBeds; // 2. System Flow Rate Demand (Consumption) // Droppers per bed = Length / Dropper Separation const droppersPerBed = Math.ceil(inputs.bedLength / inputs.dropperSeparation); const totalDroppers = droppersPerBed * inputs.totalBeds; // Assuming 1 drip line per bed usually, but calculating total droppers in field // Total Flow in LPH = Total Droppers * Dropper Flow const totalSystemFlowLPH = totalDroppers * inputs.dropperFlowRate; const systemDemandLPS = totalSystemFlowLPH / 3600; // 3. Pipe Supply Capacity // Formula: Diameter^2 * Efficiency(as fraction?) -> User said “multiply by efficiency %”. // Interpreting strictly: (Diameter^2) * (Efficiency / 100) // Example: 2^2 * 0.90 = 3.6 lps. const efficiencyFactor = inputs.irrigationEfficiency / 100; const pipeSupplyLPS = Math.pow(inputs.pipeDiameter, 2) * efficiencyFactor; // Check Alert const isFlowInsufficient = systemDemandLPS > pipeSupplyLPS; // 4. Water Volume Requirements const waterPerPlantMl = STAGE_WATER_USAGE[inputs.selectedStage as Stage] || 0; const totalWaterNeededLiters = (totalPlants * waterPerPlantMl) / 1000; // 5. Fertilizers // Constant factor: 0.909931903090629 const DIVISOR_CONST = 0.909931903090629; // Balance solUp Fresa: (Total Liters * EC * 0.6495) / 1000 / CONST const fertilizerBalanceKg = ((totalWaterNeededLiters * inputs.electricalConductivity * 0.6495) / 1000) / DIVISOR_CONST; // Nitrato de Calcio: (Total Liters * EC * 0.3505) / 1000 / CONST const fertilizerNitrateKg = ((totalWaterNeededLiters * inputs.electricalConductivity * 0.3505) / 1000) / DIVISOR_CONST; // 6. Irrigation Time // Time (Hours) = Total Water Needed (Liters) / Total System Flow (LPH) // Avoid division by zero const timeHours = totalSystemFlowLPH > 0 ? totalWaterNeededLiters / totalSystemFlowLPH : 0; const irrigationTimeMinutes = timeHours * 60; setResults({ totalPlants, totalWaterNeededLiters, systemDemandLPS, pipeSupplyLPS, isFlowInsufficient, fertilizerBalanceKg, fertilizerNitrateKg, irrigationTimeMinutes, waterPerPlantMl }); }; calculate(); }, [inputs]); return (
{/* Header */}

Calculadora de Fresa

Sistema experto para cálculo de dosis de fertilización y parámetros hidráulicos.

v1.0.0
{/* Content Grid */}
{/* Left Column: Inputs */}
{/* Agronomic Data */}

Dimensiones del Cultivo

{/* Hydraulic Data */}

Sistema de Riego

{/* Application Parameters */}

Parámetros de Aplicación

{[1, 2, 3].map((stageNum) => { const stage = stageNum as Stage; return ( ); })}
{/* Right Column: Results */}
{/* Alert Banner */} {results && results.isFlowInsufficient && (

¡Alerta de Caudal Insuficiente!

El consumo del huerto ({results.systemDemandLPS.toFixed(2)} lps) supera la capacidad de la tubería ({results.pipeSupplyLPS.toFixed(2)} lps). Por favor aumente el diámetro o mejore la eficiencia.

)} {/* Main Stats Grid */} {results && (
} /> } />
)} {/* Fertilization Section */} {results && (

Resultados de Fertilización

Base EC: {inputs.electricalConductivity}

Balance solUp Fresa

{results.fertilizerBalanceKg.toFixed(4)} kg

Nitrato de Calcio

{results.fertilizerNitrateKg.toFixed(4)} kg
)} {/* Hydraulics Detail */} {results && (

Detalles Hidráulicos

Consumo (Demanda) {results.systemDemandLPS.toFixed(3)} LPS
Aporte Tubería (Oferta) {results.pipeSupplyLPS.toFixed(3)} LPS
)}
); }; export default App;

Carrito de compra