Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Database source for uel entry from CommandQueue #3287

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/data/src/main/kotlin/app/aaps/core/data/ue/Sources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum class Sources {
Aaps, // MainApp
BgFragment,
Garmin,
Database, // for PersistenceLayer
Unknown //if necessary
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ data class UserEntry(
Aaps, // MainApp
BgFragment,
Garmin,
Database, //for PersistenceLayer
Unknown //if necessary
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fun UserEntry.Sources.fromDb(): Sources =
UserEntry.Sources.Aaps -> Sources.Aaps
UserEntry.Sources.BgFragment -> Sources.BgFragment
UserEntry.Sources.Garmin -> Sources.Garmin
UserEntry.Sources.Database -> Sources.Database
UserEntry.Sources.Unknown -> Sources.Unknown
}

Expand Down Expand Up @@ -150,6 +151,7 @@ fun Sources.toDb(): UserEntry.Sources =
Sources.Aaps -> UserEntry.Sources.Aaps
Sources.BgFragment -> UserEntry.Sources.BgFragment
Sources.Garmin -> UserEntry.Sources.Garmin
Sources.Database -> UserEntry.Sources.Database
Sources.Unknown -> UserEntry.Sources.Unknown
}

Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class CommandQueueImplementation @Inject constructor(
disposable += persistenceLayer.insertOrUpdateCarbs(
carbs = detailedBolusInfo.createCarbs(),
action = Action.CARBS,
source = Sources.TreatmentDialog
source = Sources.Database
).subscribe(
{ callback?.result(instantiator.providePumpEnactResult().enacted(false).success(true))?.run() },
{ callback?.result(instantiator.providePumpEnactResult().enacted(false).success(false))?.run() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class UserEntryPresentationHelperImpl @Inject constructor(
Sources.Overview -> app.aaps.core.ui.R.drawable.ic_home
Sources.Aaps -> R.drawable.ic_aaps
Sources.Garmin -> app.aaps.core.ui.R.drawable.ic_generic_icon
Sources.Database -> app.aaps.core.ui.R.drawable.ic_database_cleanup
Sources.Unknown -> app.aaps.core.ui.R.drawable.ic_generic_icon
Sources.Random -> R.drawable.ic_aaps
Sources.BgFragment -> R.drawable.ic_aaps
Expand Down