import React, { useMemo } from 'react'; import { useCalculatorStore } from '../../store/calculatorStore'; import { calculateApproxFrequency } from '../../utils/windLogic'; export const GustFactorInput: React.FC = () => { const { wind, setWind, buildingGeometry } = useCalculatorStore(); const { gust } = wind; // Calculate approximate frequency const calculatedFreq = useMemo(() => { return calculateApproxFrequency(buildingGeometry.meanRoofHeight, gust.buildingType); }, [buildingGeometry.meanRoofHeight, gust.buildingType]); const updateGust = (updates: Partial) => { setWind({ gust: { ...gust, ...updates } }); }; const handleChange = (e: React.ChangeEvent) => { const val = e.target.type === 'number' ? parseFloat(e.target.value) : e.target.value; updateGust({ [e.target.name]: val }); }; return (
Gust Effect Factor (G)
h = {buildingGeometry.meanRoofHeight} ft (from Code tab)
{/* Approx Lower Bound Frequency Section */}
Approx Lower Bound Natural Frequency
(from ASCE 7-10+ Eq 12.8-7: Ta = Ct * h^x, na = 1/Ta)
Calc na = {calculatedFreq} Hz
{gust.type === 'Flexible' && (
Hz
)}
); };