GaugeModelActor
actor GaugeModelActor
Actor for managing Gauge
models.
Note
Initialize the actor inTask.detached
to avoid blocking the main thread.
-
Undocumented
Declaration
Swift
init( container: ModelContainer = Database.sharedModelContainer)
-
Undocumented
Declaration
Swift
func getFavorites() throws -> [Gauge]
-
Undocumented
Declaration
Swift
func seedBritishColumbiaGauges() throws
-
Undocumented
Declaration
Swift
func seedOntarioGauges() throws
-
Undocumented
Declaration
Swift
func seedUSGS() throws
-
Undocumented
Declaration
Swift
func seedUSState(_ usState: String) throws
-
Undocumented
Declaration
Swift
func seedLawa() throws
-
Undocumented
Declaration
Swift
func save() throws
-
Undocumented
Declaration
Swift
func toggleFavorite(_ gaugeID: PersistentIdentifier) throws
-
Undocumented
Declaration
Swift
func togglePrimary(_ gaugeID: PersistentIdentifier) throws
-
Undocumented
Declaration
Swift
func deleteAllReadings() throws
-
Undocumented
Declaration
Swift
func deleteOldReadings(_ gaugeID: PersistentIdentifier? = nil) throws
-
Undocumented
Declaration
Swift
func getAvailableMetrics(for siteID: String) throws -> [GaugeMetric]
-
Undocumented
Declaration
Swift
func getGaugeReadings(siteID: String) throws -> [GaugeReading]
-
sync(_:
Asynchronous) Undocumented
Declaration
Swift
func sync(_ gaugeID: PersistentIdentifier) async throws -> Result<Gauge, Error>
-
Undocumented
Declaration
Swift
func getLatestReadings(for siteID: String) throws -> (latestDischarge: GaugeReading?, latestHeight: GaugeReading?)