diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2a3dd58566..98043e941c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -64,8 +64,8 @@
-
-
+
+
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/APSModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/APSModule.kt
index 7315329ab2..0e55e30b85 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/APSModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/APSModule.kt
@@ -17,12 +17,10 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobThread
abstract class APSModule {
@ContributesAndroidInjector abstract fun loggerCallbackInjector(): LoggerCallback
- @ContributesAndroidInjector abstract fun apsResultInjector(): APSResult
@ContributesAndroidInjector abstract fun determineBasalResultSMBInjector(): DetermineBasalResultSMB
@ContributesAndroidInjector abstract fun determineBasalResultAMAInjector(): DetermineBasalResultAMA
@ContributesAndroidInjector abstract fun determineBasalAdapterAMAJSInjector(): DetermineBasalAdapterAMAJS
@ContributesAndroidInjector abstract fun determineBasalAdapterSMBJSInjector(): DetermineBasalAdapterSMBJS
- @ContributesAndroidInjector abstract fun autosensDataInjector(): AutosensData
@ContributesAndroidInjector abstract fun iobCobThreadInjector(): IobCobThread
@ContributesAndroidInjector abstract fun iobCobOref1ThreadInjector(): IobCobOref1Thread
}
\ No newline at end of file
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt
index a1c5f342d8..6174bcdf64 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ActivitiesModule.kt
@@ -4,7 +4,6 @@ import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.MainActivity
import info.nightscout.androidaps.activities.*
-import info.nightscout.androidaps.activities.ErrorHelperActivity
import info.nightscout.androidaps.historyBrowser.HistoryBrowseActivity
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImportListActivity
@@ -12,9 +11,6 @@ import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizar
import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity
import info.nightscout.androidaps.plugins.pump.common.dialog.RileyLinkBLEScanActivity
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
-import info.nightscout.androidaps.dana.activities.DanaRHistoryActivity
-import info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity
-import info.nightscout.androidaps.danars.activities.EnterPinActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
@@ -25,10 +21,6 @@ import info.nightscout.androidaps.setupwizard.SetupWizardActivity
@Suppress("unused")
abstract class ActivitiesModule {
- @ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): DanaRHistoryActivity
- @ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): DanaRUserOptionsActivity
- @ContributesAndroidInjector abstract fun contributeEnterPinActivity(): EnterPinActivity
- @ContributesAndroidInjector abstract fun contributeErrorHelperActivity(): ErrorHelperActivity
@ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity
@ContributesAndroidInjector abstract fun contributesInsightAlertActivity(): InsightAlertActivity
@ContributesAndroidInjector abstract fun contributesInsightPairingActivity(): InsightPairingActivity
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppComponent.kt
index ad1c3e435b..24dadb14d1 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppComponent.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppComponent.kt
@@ -5,9 +5,10 @@ import dagger.Component
import dagger.android.AndroidInjectionModule
import dagger.android.AndroidInjector
import info.nightscout.androidaps.MainApp
-import info.nightscout.androidaps.core.dependencyInjection.CoreModule
-import info.nightscout.androidaps.danars.dependencyInjection.DanaRSActivitiesModule
-import info.nightscout.androidaps.danars.dependencyInjection.DanaRSCommModule
+import info.nightscout.androidaps.core.di.CoreModule
+import info.nightscout.androidaps.dana.di.DanaModule
+import info.nightscout.androidaps.danar.di.DanaRServicesModule
+import info.nightscout.androidaps.danars.di.DanaRSModule
import javax.inject.Singleton
@Singleton
@@ -33,8 +34,9 @@ import javax.inject.Singleton
SMSModule::class,
UIModule::class,
CoreModule::class,
- DanaRSCommModule::class,
- DanaRSActivitiesModule::class
+ DanaModule::class,
+ DanaRServicesModule::class,
+ DanaRSModule::class
]
)
interface AppComponent : AndroidInjector {
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt
index c6f1303866..4fb00e9bb5 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt
@@ -10,17 +10,12 @@ import info.nightscout.androidaps.Config
import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.db.DatabaseHelperProvider
import info.nightscout.androidaps.interfaces.*
-import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
-import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctionImplementation
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.queue.CommandQueue
-import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.androidNotification.NotificationHolder
-import info.nightscout.androidaps.utils.resources.ResourceHelper
-import info.nightscout.androidaps.utils.sharedPreferences.SP
import info.nightscout.androidaps.utils.storage.FileStorage
import info.nightscout.androidaps.utils.storage.Storage
import javax.inject.Singleton
@@ -30,12 +25,6 @@ import javax.inject.Singleton
])
open class AppModule {
- @Provides
- @Singleton
- fun provideProfileFunction(injector: HasAndroidInjector, aapsLogger: AAPSLogger, sp: SP, resourceHelper: ResourceHelper, activePlugin: ActivePluginProvider, fabricPrivacy: FabricPrivacy): ProfileFunction {
- return ProfileFunctionImplementation(injector, aapsLogger, sp, resourceHelper, activePlugin, fabricPrivacy)
- }
-
@Provides
fun providesPlugins(configInterface: ConfigInterface,
@PluginsModule.AllConfigs allConfigs: Map<@JvmSuppressWildcards Int, @JvmSuppressWildcards PluginBase>,
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/CommandQueueModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/CommandQueueModule.kt
index b0850bacc2..e9339e187b 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/CommandQueueModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/CommandQueueModule.kt
@@ -2,7 +2,6 @@ package info.nightscout.androidaps.dependencyInjection
import dagger.Module
import dagger.android.ContributesAndroidInjector
-import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.queue.CommandQueue
import info.nightscout.androidaps.queue.commands.*
@@ -10,8 +9,6 @@ import info.nightscout.androidaps.queue.commands.*
@Suppress("unused")
abstract class CommandQueueModule {
- @ContributesAndroidInjector abstract fun pumpEnactResultInjector(): PumpEnactResult
-
@ContributesAndroidInjector abstract fun commandQueueInjector(): CommandQueue
@ContributesAndroidInjector abstract fun commandBolusInjector(): CommandBolus
@ContributesAndroidInjector abstract fun commandCancelExtendedBolusInjector(): CommandCancelExtendedBolus
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/DataClassesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/DataClassesModule.kt
index 536454413c..2441f34314 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/DataClassesModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/DataClassesModule.kt
@@ -19,17 +19,7 @@ import info.nightscout.androidaps.utils.wizard.QuickWizardEntry
@Suppress("unused")
abstract class DataClassesModule {
- @ContributesAndroidInjector abstract fun profileInjector(): Profile
@ContributesAndroidInjector abstract fun glucoseStatusInjector(): GlucoseStatus
- @ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStore
-
- // TODO move to Core
- @ContributesAndroidInjector abstract fun bgReadingInjector(): BgReading
- @ContributesAndroidInjector abstract fun treatmentInjector(): Treatment
- @ContributesAndroidInjector abstract fun profileSwitchInjector(): ProfileSwitch
- @ContributesAndroidInjector abstract fun temporaryBasalInjector(): TemporaryBasal
- @ContributesAndroidInjector abstract fun careportalEventInjector(): CareportalEvent
- @ContributesAndroidInjector abstract fun extendedBolusInjector(): ExtendedBolus
@ContributesAndroidInjector abstract fun treatmentServiceInjector(): TreatmentService
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
index 9f65841adc..4535f6820b 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
@@ -32,7 +32,6 @@ import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment
import info.nightscout.androidaps.plugins.pump.combo.ComboFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
-import info.nightscout.androidaps.dana.DanaRFragment
import info.nightscout.androidaps.danars.dialogs.PairingProgressDialog
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
@@ -58,7 +57,6 @@ abstract class FragmentsModule {
@ContributesAndroidInjector
abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
- @ContributesAndroidInjector abstract fun contributesDanaRFragment(): DanaRFragment
@ContributesAndroidInjector abstract fun contributesFoodFragment(): FoodFragment
@ContributesAndroidInjector abstract fun contributesInsulinFragment(): InsulinFragment
@ContributesAndroidInjector abstract fun contributesLocalProfileFragment(): LocalProfileFragment
@@ -87,8 +85,6 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesVirtualPumpFragment(): VirtualPumpFragment
- @ContributesAndroidInjector abstract fun contributesPairingProgressDialog(): PairingProgressDialog
- @ContributesAndroidInjector abstract fun contributesBolusProgressDialog(): BolusProgressDialog
@ContributesAndroidInjector abstract fun contributesCalibrationDialog(): CalibrationDialog
@ContributesAndroidInjector abstract fun contributesCarbsDialog(): CarbsDialog
@ContributesAndroidInjector abstract fun contributesCareDialog(): CareDialog
@@ -99,7 +95,6 @@ abstract class FragmentsModule {
@ContributesAndroidInjector
abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog
- @ContributesAndroidInjector abstract fun contributesErrorDialog(): ErrorDialog
@ContributesAndroidInjector abstract fun contributesExtendedBolusDialog(): ExtendedBolusDialog
@ContributesAndroidInjector abstract fun contributesFillDialog(): FillDialog
@ContributesAndroidInjector abstract fun contributesChooseActionDialog(): ChooseActionDialog
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt
index 0921ed7cd0..a54665f8d2 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ReceiversModule.kt
@@ -14,7 +14,6 @@ abstract class ReceiversModule {
@ContributesAndroidInjector abstract fun contributesChargingStateReceiver(): ChargingStateReceiver
@ContributesAndroidInjector abstract fun contributesDataReceiver(): DataReceiver
@ContributesAndroidInjector abstract fun contributesKeepAliveReceiver(): KeepAliveReceiver
- @ContributesAndroidInjector abstract fun contributesNetworkChangeReceiver(): NetworkChangeReceiver
@ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): RileyLinkBluetoothStateReceiver
@ContributesAndroidInjector abstract fun contributesSmsReceiver(): SmsReceiver
@ContributesAndroidInjector abstract fun contributesTimeDateOrTZChangeReceiver(): TimeDateOrTZChangeReceiver
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt
index 70258c66e5..f961c3a863 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/ServicesModule.kt
@@ -7,11 +7,6 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Dismiss
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService
-import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService
-import info.nightscout.androidaps.danar.services.DanaRExecutionService
-import info.nightscout.androidaps.danaRKorean.services.DanaRKoreanExecutionService
-import info.nightscout.androidaps.danars.services.DanaRSService
-import info.nightscout.androidaps.danaRv2.services.DanaRv2ExecutionService
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService
@@ -24,17 +19,12 @@ import info.nightscout.androidaps.services.LocationService
@Suppress("unused")
abstract class ServicesModule {
- @ContributesAndroidInjector abstract fun contributesAbstractDanaRExecutionService(): info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService
@ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService
@ContributesAndroidInjector abstract fun contributesDataService(): DataService
@ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService
@ContributesAndroidInjector abstract fun contributesDummyService(): DummyService
@ContributesAndroidInjector abstract fun contributesLocationService(): LocationService
@ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService
- @ContributesAndroidInjector abstract fun contributesDanaRSService(): DanaRSService
- @ContributesAndroidInjector abstract fun contributesDanaRv2ExecutionService(): DanaRv2ExecutionService
- @ContributesAndroidInjector abstract fun contributesDanaRExecutionService(): DanaRExecutionService
- @ContributesAndroidInjector abstract fun contributesDanaRKoreanExecutionService(): DanaRKoreanExecutionService
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService
@ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService
@ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService
diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/dependency-injection-todo.txt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/dependency-injection-todo.txt
deleted file mode 100644
index 6ee0c902dc..0000000000
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/dependency-injection-todo.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-PreferenceActivity is an Example how to make an Activity injectable.
-We might undo that as we don't actually have us inject things.
-
-MyPreferencesFragment is an injectable Fragment. Here we actually have Dagger2 provide us an InsulinOrefFreePeakPlugin instance.
-
-If we use multiple Fragments, we should generate a base-class. Then we only have to add a "provides***Fragment" to the FragmentsModule and derive from that class.
-
-InsulinOrefFreePeakPlugin is an example how to get things injected via the constructor.
-You could call "new InsulinOrefFreePeakPlugin(new SPImpl(SPImpl(PreferenceManager.getDefaultSharedPreferences(context))), new ResourceHelper())"... but Dagger will resolve that for you in MainApp. :)
-
-SPImpl is an example how to bind an implementation to an Interface via Dagger.
-
-ResourceHelper is an example how to generate simple classes that Dagger can auto-resolve how to inject them. No need for a provider here.
-ResourceHelper might have a weak reference at some point and not a static dependency on MainApp... but at least we reduced the static dependencies within a plugin.
-
-In order to Test: Any dependency of InsulinOrefFreePeakPlugin is passed via the constructor. Instead of static mocking MainApp you now can Mock ResourceHelper with a very small interface.
\ No newline at end of file
diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt
index 3e6a2c374e..14f0897cc5 100644
--- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt
@@ -89,19 +89,19 @@ class TempBasalDialog : DialogFragmentWithDate() {
if (isPercentPump) {
val basalPercentInput = SafeParse.stringToInt(actions_tempbasal_basalpercentinput.text)
percent = constraintChecker.applyBasalPercentConstraints(Constraint(basalPercentInput), profile).value()
- actions.add(resourceHelper.gs(R.string.pump_tempbasal_label) + ": $percent%")
+ actions.add(resourceHelper.gs(R.string.tempbasal_label) + ": $percent%")
actions.add(resourceHelper.gs(R.string.duration) + ": " + resourceHelper.gs(R.string.format_mins, durationInMinutes))
if (percent != basalPercentInput) actions.add(resourceHelper.gs(R.string.constraintapllied))
} else {
val basalAbsoluteInput = SafeParse.stringToDouble(actions_tempbasal_basalabsoluteinput.text)
absolute = constraintChecker.applyBasalConstraints(Constraint(basalAbsoluteInput), profile).value()
- actions.add(resourceHelper.gs(R.string.pump_tempbasal_label) + ": " + resourceHelper.gs(R.string.pump_basebasalrate, absolute))
+ actions.add(resourceHelper.gs(R.string.tempbasal_label) + ": " + resourceHelper.gs(R.string.pump_basebasalrate, absolute))
actions.add(resourceHelper.gs(R.string.duration) + ": " + resourceHelper.gs(R.string.format_mins, durationInMinutes))
if (abs(absolute - basalAbsoluteInput) > 0.01)
actions.add("" + resourceHelper.gs(R.string.constraintapllied) + "")
}
activity?.let { activity ->
- OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.pump_tempbasal_label), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable {
+ OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.tempbasal_label), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable {
val callback: Callback = object : Callback() {
override fun run() {
if (!result.success) {
diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt
index d2e9c0454f..a16c6ac471 100644
--- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt
@@ -16,7 +16,6 @@ import info.nightscout.androidaps.db.TempTarget
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
-import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
@@ -123,7 +122,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
val duration = overview_temptarget_duration.value.toInt()
if (target != 0.0 && duration != 0) {
actions.add(resourceHelper.gs(R.string.reason) + ": " + reason)
- actions.add(resourceHelper.gs(R.string.nsprofileview_target_label) + ": " + Profile.toCurrentUnitsString(profileFunction, target) + " " + resourceHelper.gs(unitResId))
+ actions.add(resourceHelper.gs(R.string.target_label) + ": " + Profile.toCurrentUnitsString(profileFunction, target) + " " + resourceHelper.gs(unitResId))
actions.add(resourceHelper.gs(R.string.duration) + ": " + resourceHelper.gs(R.string.format_mins, duration))
} else {
actions.add(resourceHelper.gs(R.string.stoptemptarget))
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
index bda7d5b249..c257431ebf 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
@@ -346,7 +346,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
val lastRun = loopPlugin.lastRun
loopPlugin.invoke("Accept temp button", false)
if (lastRun?.lastAPSRun != null && lastRun.constraintsProcessed?.isChangeRequested == true) {
- OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.pump_tempbasal_label), lastRun.constraintsProcessed?.toSpanned()
+ OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.tempbasal_label), lastRun.constraintsProcessed?.toSpanned()
?: "".toSpanned(), Runnable {
aapsLogger.debug("USER ENTRY: ACCEPT TEMP BASAL")
overview_accepttempbutton?.visibility = View.GONE
@@ -664,9 +664,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overview_basebasal?.text = activeTemp?.let { if (resourceHelper.shortTextMode()) "T:" + activeTemp.toStringVeryShort() else activeTemp.toStringFull() }
?: resourceHelper.gs(R.string.pump_basebasalrate, profile.basal)
overview_basal_llayout?.setOnClickListener {
- var fullText = "${resourceHelper.gs(R.string.pump_basebasalrate_label)}: ${resourceHelper.gs(R.string.pump_basebasalrate, profile.basal)}"
+ var fullText = "${resourceHelper.gs(R.string.basebasalrate_label)}: ${resourceHelper.gs(R.string.pump_basebasalrate, profile.basal)}"
if (activeTemp != null)
- fullText += "\n" + resourceHelper.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull()
+ fullText += "\n" + resourceHelper.gs(R.string.tempbasal_label) + ": " + activeTemp.toStringFull()
activity?.let {
OKDialog.show(it, resourceHelper.gs(R.string.basal), fullText)
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt
index 69c6f84cb2..1cc60f0400 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt
@@ -206,7 +206,7 @@ class OverviewMenus @Inject constructor(
R.id.overview_activeprofile -> {
menu.setHeaderTitle(resourceHelper.gs(R.string.profile))
- menu.add(resourceHelper.gs(R.string.danar_viewprofile))
+ menu.add(resourceHelper.gs(R.string.viewprofile))
if (activePlugin.activeProfileInterface.profile != null) {
menu.add(resourceHelper.gs(R.string.careportal_profileswitch))
}
@@ -341,18 +341,18 @@ class OverviewMenus @Inject constructor(
return true
}
- resourceHelper.gs(R.string.disconnectpumpfor3h) -> {
+ resourceHelper.gs(R.string.disconnectpumpfor3h) -> {
aapsLogger.debug("USER ENTRY: DISCONNECT 3h")
loopPlugin.disconnectPump(180, profile)
rxBus.send(EventRefreshOverview("suspendmenu"))
return true
}
- resourceHelper.gs(R.string.careportal_profileswitch) -> {
+ resourceHelper.gs(R.string.careportal_profileswitch) -> {
ProfileSwitchDialog().show(manager, "Overview")
}
- resourceHelper.gs(R.string.danar_viewprofile) -> {
+ resourceHelper.gs(R.string.viewprofile) -> {
val args = Bundle()
args.putLong("time", DateUtil.now())
args.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal)
@@ -361,7 +361,7 @@ class OverviewMenus @Inject constructor(
pvd.show(manager, "ProfileViewDialog")
}
- resourceHelper.gs(R.string.eatingsoon) -> {
+ resourceHelper.gs(R.string.eatingsoon) -> {
aapsLogger.debug("USER ENTRY: TEMP TARGET EATING SOON")
val target = Profile.toMgdl(defaultValueHelper.determineEatingSoonTT(), profileFunction.getUnits())
val tempTarget = TempTarget()
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt
index 1fd3222cbf..29ed323ee1 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt
@@ -7,7 +7,7 @@ import info.nightscout.androidaps.Config
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.R
-import info.nightscout.androidaps.dana.DanaRPump
+import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.db.CareportalEvent
@@ -65,7 +65,7 @@ class ActionStringHandler @Inject constructor(
private val danaRKoreanPlugin: DanaRKoreanPlugin,
private val danaRv2Plugin: DanaRv2Plugin,
private val danaRSPlugin: DanaRSPlugin,
- private val danaRPump: DanaRPump,
+ private val danaPump: DanaPump,
private val hardLimits: HardLimits,
private val carbsGenerator: CarbsGenerator,
private val dateUtil: DateUtil,
@@ -326,7 +326,7 @@ class ActionStringHandler @Inject constructor(
message += "Today: " + DecimalFormatter.to2Decimal(tdd) + "U " + (DecimalFormatter.to0Decimal(100 * tdd / refTDD) + "%") + "\n"
message += "\n"
} else if (pump is DanaRPlugin) {
- val tdd = danaRPump.dailyTotalUnits
+ val tdd = danaPump.dailyTotalUnits
message += "Today: " + DecimalFormatter.to2Decimal(tdd) + "U " + (DecimalFormatter.to0Decimal(100 * tdd / refTDD) + "%") + "\n"
message += "\n"
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt
index ef64d4a690..057fe53ee0 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt
@@ -45,7 +45,7 @@ class LocalProfileFragment : DaggerFragment() {
private val save = Runnable {
doEdit()
- basalView?.updateLabel(resourceHelper.gs(R.string.nsprofileview_basal_label) + ": " + sumLabel())
+ basalView?.updateLabel(resourceHelper.gs(R.string.basal_label) + ": " + sumLabel())
}
private val textWatch = object : TextWatcher {
@@ -106,14 +106,14 @@ class LocalProfileFragment : DaggerFragment() {
localprofile_name.addTextChangedListener(textWatch)
localprofile_dia.setParams(localProfilePlugin.currentProfile().dia, hardLimits.MINDIA, hardLimits.MAXDIA, 0.1, DecimalFormat("0.0"), false, localprofile_save, textWatch)
localprofile_dia.tag = "LP_DIA"
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_ic, "IC", resourceHelper.gs(R.string.nsprofileview_ic_label), localProfilePlugin.currentProfile().ic, null, hardLimits.MINIC, hardLimits.MAXIC, 0.1, DecimalFormat("0.0"), save)
- basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_basal, "BASAL", resourceHelper.gs(R.string.nsprofileview_basal_label) + ": " + sumLabel(), localProfilePlugin.currentProfile().basal, null, pumpDescription.basalMinimumRate, 10.0, 0.01, DecimalFormat("0.00"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_ic, "IC", resourceHelper.gs(R.string.ic_label), localProfilePlugin.currentProfile().ic, null, hardLimits.MINIC, hardLimits.MAXIC, 0.1, DecimalFormat("0.0"), save)
+ basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_basal, "BASAL", resourceHelper.gs(R.string.basal_label) + ": " + sumLabel(), localProfilePlugin.currentProfile().basal, null, pumpDescription.basalMinimumRate, 10.0, 0.01, DecimalFormat("0.00"), save)
if (units == Constants.MGDL) {
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.nsprofileview_isf_label), localProfilePlugin.currentProfile().isf, null, hardLimits.MINISF, hardLimits.MAXISF, 1.0, DecimalFormat("0"), save)
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.nsprofileview_target_label), localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, hardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), hardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), 1.0, DecimalFormat("0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.isf_label), localProfilePlugin.currentProfile().isf, null, hardLimits.MINISF, hardLimits.MAXISF, 1.0, DecimalFormat("0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.target_label), localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, hardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), hardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), 1.0, DecimalFormat("0"), save)
} else {
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.nsprofileview_isf_label), localProfilePlugin.currentProfile().isf, null, Profile.fromMgdlToUnits(hardLimits.MINISF, Constants.MMOL), Profile.fromMgdlToUnits(hardLimits.MAXISF, Constants.MMOL), 0.1, DecimalFormat("0.0"), save)
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.nsprofileview_target_label), localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, Profile.fromMgdlToUnits(hardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), Constants.MMOL), Profile.fromMgdlToUnits(hardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), Constants.MMOL), 0.1, DecimalFormat("0.0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.isf_label), localProfilePlugin.currentProfile().isf, null, Profile.fromMgdlToUnits(hardLimits.MINISF, Constants.MMOL), Profile.fromMgdlToUnits(hardLimits.MAXISF, Constants.MMOL), 0.1, DecimalFormat("0.0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.target_label), localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, Profile.fromMgdlToUnits(hardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), Constants.MMOL), Profile.fromMgdlToUnits(hardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), Constants.MMOL), 0.1, DecimalFormat("0.0"), save)
}
// Spinner
@@ -190,10 +190,10 @@ class LocalProfileFragment : DaggerFragment() {
localprofile_units.text = resourceHelper.gs(R.string.units_colon) + " " + (if (localProfilePlugin.currentProfile().mgdl) resourceHelper.gs(R.string.mgdl) else resourceHelper.gs(R.string.mmol))
localprofile_dia.setParams(localProfilePlugin.currentProfile().dia, MIN_DIA, 12.0, 0.1, DecimalFormat("0.0"), false, localprofile_save, textWatch)
localprofile_dia.tag = "LP_DIA"
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_ic, "IC", resourceHelper.gs(R.string.nsprofileview_ic_label) + ":", localProfilePlugin.currentProfile().ic, null, 0.5, 50.0, 0.1, DecimalFormat("0.0"), save)
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.nsprofileview_isf_label) + ":", localProfilePlugin.currentProfile().isf, null, 0.5, 500.0, 0.1, DecimalFormat("0.0"), save)
- basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_basal, "BASAL", resourceHelper.gs(R.string.nsprofileview_basal_label) + ": " + sumLabel(), localProfilePlugin.currentProfile().basal, null, pumpDescription.basalMinimumRate, 10.0, 0.01, DecimalFormat("0.00"), save)
- TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.nsprofileview_target_label) + ":", localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, 3.0, 200.0, 0.1, DecimalFormat("0.0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_ic, "IC", resourceHelper.gs(R.string.ic_label) + ":", localProfilePlugin.currentProfile().ic, null, 0.5, 50.0, 0.1, DecimalFormat("0.0"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_isf, "ISF", resourceHelper.gs(R.string.isf_label) + ":", localProfilePlugin.currentProfile().isf, null, 0.5, 500.0, 0.1, DecimalFormat("0.0"), save)
+ basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_basal, "BASAL", resourceHelper.gs(R.string.basal_label) + ": " + sumLabel(), localProfilePlugin.currentProfile().basal, null, pumpDescription.basalMinimumRate, 10.0, 0.01, DecimalFormat("0.00"), save)
+ TimeListEdit(context, aapsLogger, dateUtil, view, R.id.localprofile_target, "TARGET", resourceHelper.gs(R.string.target_label) + ":", localProfilePlugin.currentProfile().targetLow, localProfilePlugin.currentProfile().targetHigh, 3.0, 200.0, 0.1, DecimalFormat("0.0"), save)
updateGUI()
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java
index 2c1c9b6e91..cc4cdd9516 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java
@@ -269,7 +269,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick
private void getBatteryStatusItem(List statusItems) {
if (localInsightPlugin.getBatteryStatus() == null) return;
- statusItems.add(getStatusItem(resourceHelper.gs(R.string.pump_battery_label),
+ statusItems.add(getStatusItem(resourceHelper.gs(R.string.battery_label),
localInsightPlugin.getBatteryStatus().getBatteryAmount() + "%"));
}
@@ -280,7 +280,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick
if (cartridgeStatus.isInserted())
status = DecimalFormatter.to2Decimal(localInsightPlugin.getCartridgeStatus().getRemainingAmount()) + "U";
else status = resourceHelper.gs(R.string.not_inserted);
- statusItems.add(getStatusItem(resourceHelper.gs(R.string.pump_reservoir_label), status));
+ statusItems.add(getStatusItem(resourceHelper.gs(R.string.reservoir_label), status));
}
private void getTDDItems(List statusItems) {
@@ -294,14 +294,14 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick
private void getBaseBasalRateItem(List statusItems) {
if (localInsightPlugin.getActiveBasalRate() == null) return;
ActiveBasalRate activeBasalRate = localInsightPlugin.getActiveBasalRate();
- statusItems.add(getStatusItem(resourceHelper.gs(R.string.pump_basebasalrate_label),
+ statusItems.add(getStatusItem(resourceHelper.gs(R.string.basebasalrate_label),
DecimalFormatter.to2Decimal(activeBasalRate.getActiveBasalRate()) + " U/h (" + activeBasalRate.getActiveBasalProfileName() + ")"));
}
private void getTBRItem(List statusItems) {
if (localInsightPlugin.getActiveTBR() == null) return;
ActiveTBR activeTBR = localInsightPlugin.getActiveTBR();
- statusItems.add(getStatusItem(resourceHelper.gs(R.string.pump_tempbasal_label),
+ statusItems.add(getStatusItem(resourceHelper.gs(R.string.tempbasal_label),
resourceHelper.gs(R.string.tbr_formatter, activeTBR.getPercentage(), activeTBR.getInitialDuration() - activeTBR.getRemainingDuration(), activeTBR.getInitialDuration())));
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsCareportalFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsCareportalFragment.kt
index 191957a8f3..26165ec661 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsCareportalFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsCareportalFragment.kt
@@ -133,7 +133,7 @@ class TreatmentsCareportalFragment : DaggerFragment() {
remove.setOnClickListener { v: View ->
val careportalEvent = v.tag as CareportalEvent
activity?.let { activity ->
- val text = resourceHelper.gs(R.string.careportal_newnstreatment_eventtype) + ": " + translator.translate(careportalEvent.eventType) + "\n" +
+ val text = resourceHelper.gs(R.string.eventtype) + ": " + translator.translate(careportalEvent.eventType) + "\n" +
resourceHelper.gs(R.string.careportal_newnstreatment_notes_label) + ": " + careportalEvent.notes + "\n" +
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(careportalEvent.date)
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
index 8b8aee6b91..fed0ba1137 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
@@ -162,7 +162,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
context?.let {
showConfirmation(it, resourceHelper.gs(R.string.removerecord),
"""
- ${resourceHelper.gs(R.string.pump_tempbasal_label)}: ${tempBasal.toStringFull()}
+ ${resourceHelper.gs(R.string.tempbasal_label)}: ${tempBasal.toStringFull()}
${resourceHelper.gs(R.string.date)}: ${dateUtil.dateAndTimeString(tempBasal.date)}
""".trimIndent(),
DialogInterface.OnClickListener { _: DialogInterface?, _: Int ->
diff --git a/app/src/main/res/layout/actions_fragment.xml b/app/src/main/res/layout/actions_fragment.xml
index 588bde9ab8..0290c1cf8a 100644
--- a/app/src/main/res/layout/actions_fragment.xml
+++ b/app/src/main/res/layout/actions_fragment.xml
@@ -290,7 +290,7 @@
android:drawableTop="@drawable/icon_danarstats"
android:paddingLeft="0dp"
android:paddingRight="0dp"
- android:text="@string/danar_stats_tdd"
+ android:text="@string/tdd"
app:layout_column="1"
app:layout_columnWeight="1"
diff --git a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
index 4251efd3a2..a501e70a77 100644
--- a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
+++ b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
@@ -233,7 +233,7 @@
diff --git a/app/src/main/res/layout/dialog_temptarget.xml b/app/src/main/res/layout/dialog_temptarget.xml
index be4258ec5c..d03413a237 100644
--- a/app/src/main/res/layout/dialog_temptarget.xml
+++ b/app/src/main/res/layout/dialog_temptarget.xml
@@ -81,7 +81,7 @@
android:layout_gravity="center_vertical"
android:width="120dp"
android:padding="10dp"
- android:text="@string/nsprofileview_target_label"
+ android:text="@string/target_label"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textStyle="bold" />
diff --git a/app/src/main/res/layout/medtronic_fragment.xml b/app/src/main/res/layout/medtronic_fragment.xml
index a67872fa5d..af16dd26cb 100644
--- a/app/src/main/res/layout/medtronic_fragment.xml
+++ b/app/src/main/res/layout/medtronic_fragment.xml
@@ -164,7 +164,7 @@
android:layout_weight="1.5"
android:gravity="end"
android:paddingRight="5dp"
- android:text="@string/pump_battery_label"
+ android:text="@string/battery_label"
android:textSize="14sp" />
+ android:text="@string/pumphistory" />
+ android:text="@string/tempbasal_label" />
+ android:text="@string/tdd" />
+ android:text="@string/cumulative_tdd" />
+ android:text="@string/expweight" />
+ android:text="@string/warning_Message" />
+ android:text="@string/stop" />
diff --git a/core/src/main/res/layout/dialog_profileviewer.xml b/core/src/main/res/layout/dialog_profileviewer.xml
index d39364279e..9434d828f0 100644
--- a/core/src/main/res/layout/dialog_profileviewer.xml
+++ b/core/src/main/res/layout/dialog_profileviewer.xml
@@ -127,7 +127,7 @@
android:layout_weight="2"
android:gravity="end"
android:layout_marginEnd="5dp"
- android:text="@string/nsprofileview_units_label"
+ android:text="@string/units_label"
android:textSize="14sp" />
Please wait…
Mute
Reload
- STOP PRESSED
- Stop
+ STOP PRESSED
+ Stop
Carbs
Invalid profile !!!
NO PROFILE SET
Date
- Units
- DIA
- IC
- ISF
- Basal
- Target
+ Units
+ DIA
+ IC
+ ISF
+ Basal
+ Target
Initializing ...
Serial number
- Battery
- Last connection
- Last bolus
- Daily units
- Base basal rate
- Temp basal
+ Battery
+ Last connection
+ Last bolus
+ Daily units
+ Base basal rate
+ Temp basal
Extended bolus
- Reservoir
- Pump history
- View profile
- Event type
+ Reservoir
+ Pump history
+ View profile
+ Event type
mg/dl
mmol/l
Advanced Settings
@@ -103,8 +103,8 @@
DISMISS
- Bluetooth Low Energy not supported.
- Bluetooth not enabled.
+ Bluetooth Low Energy not supported.
+ Bluetooth not enabled.
Location Is Not Enabled
For Bluetooth discovery to work on newer devices, location must be enabled. AAPS does not track your location and it can be disabled after pairing is successful.
@@ -139,7 +139,7 @@
No profile selected
- * Only discrete values no ranges are supported as granularity for basal/bolus in virtual pump.
+ * Only discrete values no ranges are supported as granularity for basal/bolus in virtual pump.
Cancel temp basal
@@ -200,20 +200,19 @@
SMB
- DanaR Stats
- Cumulative TDD
- Exponentially Weighted TDD
- Basal
- Bolus
- TDD
- Date
- Ratio
- # Days
- Weight
- Possibly inaccurate if using boluses for priming/filling!
- Old Data Please Press "RELOAD"
- Total Base Basal
- TBB * 2
+ Stats
+ Cumulative TDD
+ Exponentially Weighted TDD
+ Basal
+ Bolus
+ TDD
+ Ratio
+ # Days
+ Weight
+ Possibly inaccurate if using boluses for priming/filling!
+ Old Data Please Press "RELOAD"
+ Total Base Basal
+ TBB * 2
Time detection
diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/DanaRFragment.kt b/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt
similarity index 95%
rename from dana/src/main/java/info/nightscout/androidaps/dana/DanaRFragment.kt
rename to dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt
index b71304dfaf..4585b80aa7 100644
--- a/dana/src/main/java/info/nightscout/androidaps/dana/DanaRFragment.kt
+++ b/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt
@@ -8,7 +8,6 @@ import android.view.View
import android.view.ViewGroup
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.activities.TDDStatsActivity
-import info.nightscout.androidaps.dana.R
import info.nightscout.androidaps.dialogs.ProfileViewerDialog
import info.nightscout.androidaps.events.EventExtendedBolusChange
import info.nightscout.androidaps.events.EventInitializationChanged
@@ -35,13 +34,13 @@ import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.danar_fragment.*
import javax.inject.Inject
-class DanaRFragment : DaggerFragment() {
+class DanaFragment : DaggerFragment() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var activePlugin: ActivePluginProvider
- @Inject lateinit var danaRPump: DanaRPump
+ @Inject lateinit var danaPump: DanaPump
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var sp: SP
@Inject lateinit var warnColors: WarnColors
@@ -69,11 +68,11 @@ class DanaRFragment : DaggerFragment() {
dana_pumpstatus.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder))
- danar_history.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.dana.activities.DanaRHistoryActivity::class.java)) }
+ danar_history.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.dana.activities.DanaHistoryActivity::class.java)) }
danar_viewprofile.setOnClickListener {
- val profile = danaRPump.createConvertedProfile()?.getDefaultProfile()
+ val profile = danaPump.createConvertedProfile()?.getDefaultProfile()
?: return@setOnClickListener
- val profileName = danaRPump.createConvertedProfile()?.getDefaultProfileName()
+ val profileName = danaPump.createConvertedProfile()?.getDefaultProfileName()
?: return@setOnClickListener
val args = Bundle()
args.putLong("time", DateUtil.now())
@@ -86,10 +85,10 @@ class DanaRFragment : DaggerFragment() {
pvd.show(childFragmentManager, "ProfileViewDialog")
}
danar_stats.setOnClickListener { startActivity(Intent(context, TDDStatsActivity::class.java)) }
- danar_user_options.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity::class.java)) }
+ danar_user_options.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity::class.java)) }
danar_btconnection.setOnClickListener {
aapsLogger.debug(LTag.PUMP, "Clicked connect to pump")
- danaRPump.lastConnection = 0
+ danaPump.lastConnection = 0
commandQueue.readStatus("Clicked connect to pump", null)
}
if (activePlugin.activePump.pumpDescription.pumpType == PumpType.DanaRS)
@@ -163,7 +162,7 @@ class DanaRFragment : DaggerFragment() {
@Synchronized
fun updateGUI() {
if (danar_dailyunits == null) return
- val pump = danaRPump
+ val pump = danaPump
val plugin: PumpInterface = activePlugin.activePump
if (pump.lastConnection != 0L) {
val agoMsec = System.currentTimeMillis() - pump.lastConnection
diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/DanaRPump.kt b/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt
similarity index 99%
rename from dana/src/main/java/info/nightscout/androidaps/dana/DanaRPump.kt
rename to dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt
index 519f713479..9d664faa06 100644
--- a/dana/src/main/java/info/nightscout/androidaps/dana/DanaRPump.kt
+++ b/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt
@@ -19,7 +19,7 @@ import javax.inject.Singleton
* Created by mike on 04.07.2016.
*/
@Singleton
-class DanaRPump @Inject constructor(
+class DanaPump @Inject constructor(
private val aapsLogger: AAPSLogger,
private val sp: SP,
private val injector: HasAndroidInjector
diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRHistoryActivity.kt b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt
similarity index 99%
rename from dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRHistoryActivity.kt
rename to dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt
index ef8d78b2f4..05dbba234c 100644
--- a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRHistoryActivity.kt
+++ b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt
@@ -37,7 +37,7 @@ import kotlinx.android.synthetic.main.danar_historyactivity.*
import java.util.*
import javax.inject.Inject
-class DanaRHistoryActivity : NoSplashAppCompatActivity() {
+class DanaHistoryActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var resourceHelper: ResourceHelper
diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRUserOptionsActivity.kt b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt
similarity index 64%
rename from dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRUserOptionsActivity.kt
rename to dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt
index 42f101283d..be38978236 100644
--- a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaRUserOptionsActivity.kt
+++ b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt
@@ -6,7 +6,7 @@ import android.os.Bundle
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.activities.ErrorHelperActivity
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
-import info.nightscout.androidaps.dana.DanaRPump
+import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.dana.R
import info.nightscout.androidaps.events.EventInitializationChanged
import info.nightscout.androidaps.interfaces.ActivePluginProvider
@@ -27,13 +27,13 @@ import javax.inject.Inject
import kotlin.math.max
import kotlin.math.min
-class DanaRUserOptionsActivity : NoSplashAppCompatActivity() {
+class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var context: Context
- @Inject lateinit var danaRPump: DanaRPump
+ @Inject lateinit var danaPump: DanaPump
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var commandQueue: CommandQueueProvider
@@ -66,20 +66,20 @@ class DanaRUserOptionsActivity : NoSplashAppCompatActivity() {
save_user_options.setOnClickListener { onSaveClick() }
aapsLogger.debug(LTag.PUMP,
- "UserOptionsLoaded:" + (System.currentTimeMillis() - danaRPump.lastConnection) / 1000 + " s ago"
- + "\ntimeDisplayType:" + danaRPump.timeDisplayType
- + "\nbuttonScroll:" + danaRPump.buttonScrollOnOff
- + "\ntimeDisplayType:" + danaRPump.timeDisplayType
- + "\nlcdOnTimeSec:" + danaRPump.lcdOnTimeSec
- + "\nbackLight:" + danaRPump.backlightOnTimeSec
- + "\npumpUnits:" + danaRPump.units
- + "\nlowReservoir:" + danaRPump.lowReservoirRate)
+ "UserOptionsLoaded:" + (System.currentTimeMillis() - danaPump.lastConnection) / 1000 + " s ago"
+ + "\ntimeDisplayType:" + danaPump.timeDisplayType
+ + "\nbuttonScroll:" + danaPump.buttonScrollOnOff
+ + "\ntimeDisplayType:" + danaPump.timeDisplayType
+ + "\nlcdOnTimeSec:" + danaPump.lcdOnTimeSec
+ + "\nbackLight:" + danaPump.backlightOnTimeSec
+ + "\npumpUnits:" + danaPump.units
+ + "\nlowReservoir:" + danaPump.lowReservoirRate)
- danar_screentimeout.setParams(danaRPump.lcdOnTimeSec.toDouble(), 5.0, 240.0, 5.0, DecimalFormat("1"), false, save_user_options)
- danar_backlight.setParams(danaRPump.backlightOnTimeSec.toDouble(), 1.0, 60.0, 1.0, DecimalFormat("1"), false, save_user_options)
- danar_shutdown.setParams(danaRPump.shutdownHour.toDouble(), 0.0, 24.0, 1.0, DecimalFormat("1"), true, save_user_options)
- danar_lowreservoir.setParams(danaRPump.lowReservoirRate.toDouble(), 10.0, 60.0, 10.0, DecimalFormat("10"), false, save_user_options)
- when (danaRPump.beepAndAlarm) {
+ danar_screentimeout.setParams(danaPump.lcdOnTimeSec.toDouble(), 5.0, 240.0, 5.0, DecimalFormat("1"), false, save_user_options)
+ danar_backlight.setParams(danaPump.backlightOnTimeSec.toDouble(), 1.0, 60.0, 1.0, DecimalFormat("1"), false, save_user_options)
+ danar_shutdown.setParams(danaPump.shutdownHour.toDouble(), 0.0, 24.0, 1.0, DecimalFormat("1"), true, save_user_options)
+ danar_lowreservoir.setParams(danaPump.lowReservoirRate.toDouble(), 10.0, 60.0, 10.0, DecimalFormat("10"), false, save_user_options)
+ when (danaPump.beepAndAlarm) {
0x01 -> danar_pumpalarm_sound.isChecked = true
0x02 -> danar_pumpalarm_vibrate.isChecked = true
0x11 -> danar_pumpalarm_both.isChecked = true
@@ -99,20 +99,20 @@ class DanaRUserOptionsActivity : NoSplashAppCompatActivity() {
danar_beep.isChecked = true
}
}
- if (danaRPump.lastSettingsRead == 0L)
+ if (danaPump.lastSettingsRead == 0L)
aapsLogger.error(LTag.PUMP, "No settings loaded from pump!") else setData()
}
fun setData() {
// in DanaRS timeDisplay values are reversed
- danar_timeformat.isChecked = !isRS() && danaRPump.timeDisplayType != 0 || isRS() && danaRPump.timeDisplayType == 0
- danar_buttonscroll.isChecked = danaRPump.buttonScrollOnOff != 0
- danar_beep.isChecked = danaRPump.beepAndAlarm > 4
- danar_screentimeout.value = danaRPump.lcdOnTimeSec.toDouble()
- danar_backlight.value = danaRPump.backlightOnTimeSec.toDouble()
- danar_units.isChecked = danaRPump.getUnits() == Constants.MMOL
- danar_shutdown.value = danaRPump.shutdownHour.toDouble()
- danar_lowreservoir.value = danaRPump.lowReservoirRate.toDouble()
+ danar_timeformat.isChecked = !isRS() && danaPump.timeDisplayType != 0 || isRS() && danaPump.timeDisplayType == 0
+ danar_buttonscroll.isChecked = danaPump.buttonScrollOnOff != 0
+ danar_beep.isChecked = danaPump.beepAndAlarm > 4
+ danar_screentimeout.value = danaPump.lcdOnTimeSec.toDouble()
+ danar_backlight.value = danaPump.backlightOnTimeSec.toDouble()
+ danar_units.isChecked = danaPump.getUnits() == Constants.MMOL
+ danar_shutdown.value = danaPump.shutdownHour.toDouble()
+ danar_lowreservoir.value = danaPump.lowReservoirRate.toDouble()
}
private fun onSaveClick() {
@@ -120,30 +120,30 @@ class DanaRUserOptionsActivity : NoSplashAppCompatActivity() {
if (!isRS() && !isDanaR() && !isDanaRv2()) return
if (isRS()) // displayTime on RS is reversed
- danaRPump.timeDisplayType = if (danar_timeformat.isChecked) 0 else 1
+ danaPump.timeDisplayType = if (danar_timeformat.isChecked) 0 else 1
else
- danaRPump.timeDisplayType = if (danar_timeformat.isChecked) 1 else 0
+ danaPump.timeDisplayType = if (danar_timeformat.isChecked) 1 else 0
- danaRPump.buttonScrollOnOff = if (danar_buttonscroll.isChecked) 1 else 0
- danaRPump.beepAndAlarm = when {
+ danaPump.buttonScrollOnOff = if (danar_buttonscroll.isChecked) 1 else 0
+ danaPump.beepAndAlarm = when {
danar_pumpalarm_sound.isChecked -> 1
danar_pumpalarm_vibrate.isChecked -> 2
danar_pumpalarm_both.isChecked -> 3
else -> 1
}
- if (danar_beep.isChecked) danaRPump.beepAndAlarm += 4
+ if (danar_beep.isChecked) danaPump.beepAndAlarm += 4
// step is 5 seconds, 5 to 240
- danaRPump.lcdOnTimeSec = min(max(danar_screentimeout.value.toInt() / 5 * 5, 5), 240)
+ danaPump.lcdOnTimeSec = min(max(danar_screentimeout.value.toInt() / 5 * 5, 5), 240)
// 1 to 60
- danaRPump.backlightOnTimeSec = min(max(danar_backlight.value.toInt(), 1), 60)
+ danaPump.backlightOnTimeSec = min(max(danar_backlight.value.toInt(), 1), 60)
- danaRPump.units = if (danar_units.isChecked) 1 else 0
+ danaPump.units = if (danar_units.isChecked) 1 else 0
- danaRPump.shutdownHour = min(danar_shutdown.value.toInt(), 24)
+ danaPump.shutdownHour = min(danar_shutdown.value.toInt(), 24)
// 10 to 50
- danaRPump.lowReservoirRate = min(max(danar_lowreservoir.value.toInt() * 10 / 10, 10), 50)
+ danaPump.lowReservoirRate = min(max(danar_lowreservoir.value.toInt() * 10 / 10, 10), 50)
commandQueue.setUserOptions(object : Callback() {
override fun run() {
diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/di/DanaModule.kt b/dana/src/main/java/info/nightscout/androidaps/dana/di/DanaModule.kt
new file mode 100644
index 0000000000..224838979b
--- /dev/null
+++ b/dana/src/main/java/info/nightscout/androidaps/dana/di/DanaModule.kt
@@ -0,0 +1,17 @@
+package info.nightscout.androidaps.dana.di
+
+import dagger.Module
+import dagger.android.ContributesAndroidInjector
+import info.nightscout.androidaps.dana.DanaFragment
+import info.nightscout.androidaps.dana.activities.DanaHistoryActivity
+import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity
+
+@Module
+@Suppress("unused")
+abstract class DanaModule {
+
+ @ContributesAndroidInjector abstract fun contributesDanaRFragment(): DanaFragment
+ @ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): DanaHistoryActivity
+ @ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): DanaUserOptionsActivity
+
+}
\ No newline at end of file
diff --git a/dana/src/main/res/layout/danar_fragment.xml b/dana/src/main/res/layout/danar_fragment.xml
index aa18472171..2720862609 100644
--- a/dana/src/main/res/layout/danar_fragment.xml
+++ b/dana/src/main/res/layout/danar_fragment.xml
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="5dp"
- tools:context="info.nightscout.androidaps.dana.DanaRFragment">
+ tools:context="info.nightscout.androidaps.dana.DanaFragment">
+ android:text="@string/viewprofile" />
+ android:text="@string/pumphistory" />
+ android:text="@string/stats" />