From ba2f8dd4bb372d262485c7186918983e9861507f Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 23 Apr 2024 15:41:12 +0200 Subject: [PATCH] Add tstops for more timeseries --- core/src/model.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/src/model.jl b/core/src/model.jl index 6c20d31d6..602503dd6 100644 --- a/core/src/model.jl +++ b/core/src/model.jl @@ -78,12 +78,19 @@ function Model(config::Config)::Model end # tell the solver to stop when new data comes in - # TODO add all time tables here - time_flow_boundary = load_structvector(db, config, FlowBoundaryTimeV1) tstops = Vector{Float64}[] - push!(tstops, get_tstops(time_flow_boundary.time, config.starttime)) - time_user_demand = load_structvector(db, config, UserDemandTimeV1) - push!(tstops, get_tstops(time_user_demand.time, config.starttime)) + for schema_version in [ + FlowBoundaryTimeV1, + LevelBoundaryTimeV1, + UserDemandTimeV1, + LevelDemandTimeV1, + FlowDemandTimeV1, + TabulatedRatingCurveTimeV1, + PidControlTimeV1, + ] + time_schema = load_structvector(db, config, schema_version) + push!(tstops, get_tstops(time_schema.time, config.starttime)) + end # use state state = load_structvector(db, config, BasinStateV1)