fix build
This commit is contained in:
@@ -188,31 +188,6 @@ function isForecastExtensionInterval(i: PlanningIntervalDto): boolean {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function syntheticForecastOnlyInterval(
|
|
||||||
interval_start: string,
|
|
||||||
pv_forecast_total_w: number | null,
|
|
||||||
): PlanningIntervalDto {
|
|
||||||
return {
|
|
||||||
interval_start,
|
|
||||||
battery_setpoint_w: null,
|
|
||||||
battery_soc_target_pct: null,
|
|
||||||
grid_setpoint_w: null,
|
|
||||||
export_limit_w: null,
|
|
||||||
export_mode: null,
|
|
||||||
deye_physical_mode: null,
|
|
||||||
ev1_setpoint_w: null,
|
|
||||||
ev2_setpoint_w: null,
|
|
||||||
heat_pump_enabled: null,
|
|
||||||
pv_a_curtailed_w: null,
|
|
||||||
expected_cost_czk: null,
|
|
||||||
effective_buy_price: null,
|
|
||||||
effective_sell_price: null,
|
|
||||||
is_predicted_price: false,
|
|
||||||
pv_forecast_total_w,
|
|
||||||
load_baseline_w: null,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function pvAProxyW(i: PlanningIntervalDto): number {
|
function pvAProxyW(i: PlanningIntervalDto): number {
|
||||||
const pv = i.pv_forecast_total_w
|
const pv = i.pv_forecast_total_w
|
||||||
if (pv != null && pv > 0) return pv
|
if (pv != null && pv > 0) return pv
|
||||||
@@ -625,7 +600,6 @@ export default function Planning() {
|
|||||||
const [selectedStart, setSelectedStart] = useState<string | null>(null)
|
const [selectedStart, setSelectedStart] = useState<string | null>(null)
|
||||||
const [tableHorizonH, setTableHorizonH] = useState<HorizonHours>(48)
|
const [tableHorizonH, setTableHorizonH] = useState<HorizonHours>(48)
|
||||||
const [chartHorizonH, setChartHorizonH] = useState<HorizonHours>(48)
|
const [chartHorizonH, setChartHorizonH] = useState<HorizonHours>(48)
|
||||||
const [forecastRefreshKey, setForecastRefreshKey] = useState(0)
|
|
||||||
|
|
||||||
const load = useCallback(async () => {
|
const load = useCallback(async () => {
|
||||||
if (siteId == null) return
|
if (siteId == null) return
|
||||||
@@ -723,7 +697,6 @@ export default function Planning() {
|
|||||||
try {
|
try {
|
||||||
await postRunPlan(siteId, 'rolling')
|
await postRunPlan(siteId, 'rolling')
|
||||||
await load()
|
await load()
|
||||||
setForecastRefreshKey((k) => k + 1)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError(axiosDetail(e) || 'Přepočet selhal')
|
setError(axiosDetail(e) || 'Přepočet selhal')
|
||||||
} finally {
|
} finally {
|
||||||
@@ -765,7 +738,6 @@ export default function Planning() {
|
|||||||
try {
|
try {
|
||||||
const r = await postRunForecast(siteId)
|
const r = await postRunForecast(siteId)
|
||||||
toast.success(`Forecast: ${r.intervals_saved} intervalů, ${r.pv_arrays} FVE polí`)
|
toast.success(`Forecast: ${r.intervals_saved} intervalů, ${r.pv_arrays} FVE polí`)
|
||||||
setForecastRefreshKey((k) => k + 1)
|
|
||||||
await runRollingReload()
|
await runRollingReload()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast.error('Forecast selhal', { description: axiosDetail(e) })
|
toast.error('Forecast selhal', { description: axiosDetail(e) })
|
||||||
@@ -789,7 +761,6 @@ export default function Planning() {
|
|||||||
)
|
)
|
||||||
const fc = await postRunForecast(siteId)
|
const fc = await postRunForecast(siteId)
|
||||||
toast.success(`Forecast: ${fc.intervals_saved} intervalů, ${fc.pv_arrays} FVE polí`)
|
toast.success(`Forecast: ${fc.intervals_saved} intervalů, ${fc.pv_arrays} FVE polí`)
|
||||||
setForecastRefreshKey((k) => k + 1)
|
|
||||||
await runRollingReload()
|
await runRollingReload()
|
||||||
toast.success('Plán přepočítán (rolling).')
|
toast.success('Plán přepočítán (rolling).')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user