diff --git a/packages/web/components/WorkbookView.tsx b/packages/web/components/WorkbookView.tsx index b1bdd91..10f237d 100644 --- a/packages/web/components/WorkbookView.tsx +++ b/packages/web/components/WorkbookView.tsx @@ -789,6 +789,9 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: const isMonthExpanded = expandedMonths.has(monthKey); const solarMo = hasSolar ? computeMonthTotal(year, month, true) : 0; const windMo = hasWind ? computeMonthTotal(year, month, false) : 0; + // Average profile for month + const solarProfileMo = hasSolarProfile ? computeMonthAvgProfile(year, month, hourly_solar_profile) : 0; + const windProfileMo = hasWindProfile ? computeMonthAvgProfile(year, month, hourly_wind_profile) : 0; const totalReMo = hasTotalRe ? computeMonthTotalNew(year, month, hourly_total_re) : 0; const clientEndMo = hasClientEnd ? computeMonthTotalNew(year, month, hourly_client_end) : 0; const loadMo = hasLoad ? computeMonthTotalNew(year, month, hourly_load) : 0; @@ -803,11 +806,16 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: > {isMonthExpanded ? "▼" : "▶"} {monthLabel} - {hasSolar && {Math.round(solarMo).toLocaleString()} MWh} - {hasWind && {Math.round(windMo).toLocaleString()} MWh} - {hasTotalRe && {Math.round(totalReMo).toLocaleString()} MWh} - {hasClientEnd && {Math.round(clientEndMo).toLocaleString()} MWh} - {hasLoad && {Math.round(loadMo).toLocaleString()} MWh} + {/* Month: avg profile %, DC MW, sum MWh */} + {hasSolar && {(solarProfileMo * 100).toFixed(1)}%} + {hasSolar && {solarDCMW || '-'}} + {hasSolar && {Math.round(solarMo).toLocaleString()}} + {hasWind && -} + {hasWind && {windMW || '-'}} + {hasWind && {Math.round(windMo).toLocaleString()}} + {hasTotalRe && {Math.round(totalReMo).toLocaleString()}} + {hasClientEnd && {Math.round(clientEndMo).toLocaleString()}} + {hasLoad && {Math.round(loadMo).toLocaleString()}} {/* Day rows (expandable) */} @@ -817,6 +825,9 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: const isDayExpanded = expandedDays.has(dayKey); const solarDy = hasSolar ? computeDayTotal(year, month, day, true) : 0; const windDy = hasWind ? computeDayTotal(year, month, day, false) : 0; + // Average profile for day + const solarProfileDay = hasSolarProfile ? computeDayAvgProfile(year, month, day, hourly_solar_profile) : 0; + const windProfileDay = hasWindProfile ? computeDayAvgProfile(year, month, day, hourly_wind_profile) : 0; const totalReDy = hasTotalRe ? computeDayTotalNew(year, month, day, hourly_total_re) : 0; const clientEndDy = hasClientEnd ? computeDayTotalNew(year, month, day, hourly_client_end) : 0; const loadDy = hasLoad ? computeDayTotalNew(year, month, day, hourly_load) : 0; @@ -829,11 +840,16 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: > {isDayExpanded ? "▼" : "▶"} {monthLabel} {day} - {hasSolar && {Math.round(solarDy).toLocaleString()}} - {hasWind && {Math.round(windDy).toLocaleString()}} - {hasTotalRe && {Math.round(totalReDy).toLocaleString()}} - {hasClientEnd && {Math.round(clientEndDy).toLocaleString()}} - {hasLoad && {Math.round(loadDy).toLocaleString()}} + {/* Day: average profile %, DC MW, sum MWh */} + {hasSolar && {(solarProfileDay * 100).toFixed(1)}%} + {hasSolar && {solarDCMW || '-'}} + {hasSolar && {Math.round(solarDy)}} + {hasWind && -} + {hasWind && {windMW || '-'}} + {hasWind && {Math.round(windDy)}} + {hasTotalRe && {Math.round(totalReDy)}} + {hasClientEnd && {Math.round(clientEndDy)}} + {hasLoad && {Math.round(loadDy)}} {/* Hour values - vertical stack */} @@ -844,7 +860,12 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: const hourIdx = (day - 1) * 24 + hour; const solarHr = hasSolar ? getDayData(year, month, day, true)[hourIdx % 24] : 0; const windHr = hasWind ? getDayData(year, month, day, false)[hourIdx % 24] : 0; - // Get new column data by hour index + // Raw profile values + const yearDataProfile = getYearProfile(year, hourly_solar_profile); + const hourProfile = yearDataProfile.length > hourIdx ? yearDataProfile[hourIdx] : 0; + const yearDataProfileW = getYearProfile(year, hourly_wind_profile); + const hourProfileW = yearDataProfileW.length > hourIdx ? yearDataProfileW[hourIdx] : 0; + // Total RE and Client End const yearDataNew = getYearDataNew(year, hourly_total_re); const hourDataTotalRe = yearDataNew.length > hourIdx ? yearDataNew[hourIdx] : 0; const yearDataClient = getYearDataNew(year, hourly_client_end); @@ -854,11 +875,18 @@ function HourlyGenerationSheet({ hourly, codYear, solarDCMW, windMW }: { hourly: return (