dana module
This commit is contained in:
parent
7fc631a729
commit
a99be409eb
267 changed files with 821 additions and 666 deletions
|
@ -242,6 +242,7 @@ dependencies {
|
||||||
wearApp project(':wear')
|
wearApp project(':wear')
|
||||||
|
|
||||||
implementation project(':core')
|
implementation project(':core')
|
||||||
|
implementation project(':dana')
|
||||||
implementation project(':danars')
|
implementation project(':danars')
|
||||||
|
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ErrorHelperActivity"
|
android:name=".activities.ErrorHelperActivity"
|
||||||
android:theme="@style/Theme.AppCompat.Translucent" />
|
android:theme="@style/Theme.AppCompat.Translucent" />
|
||||||
<activity android:name=".plugins.pump.danaR.activities.DanaRHistoryActivity" />
|
<activity android:name="info.nightscout.androidaps.dana.activities.DanaRHistoryActivity" />
|
||||||
<activity android:name=".plugins.pump.danaR.activities.DanaRUserOptionsActivity" />
|
<activity android:name="info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity" />
|
||||||
<activity android:name=".activities.TDDStatsActivity" />
|
<activity android:name=".activities.TDDStatsActivity" />
|
||||||
<activity android:name=".plugins.general.overview.activities.QuickWizardListActivity">
|
<activity android:name=".plugins.general.overview.activities.QuickWizardListActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".plugins.pump.danaRS.activities.BLEScanActivity">
|
<activity android:name="info.nightscout.androidaps.danars.activities.BLEScanActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity" />
|
<action android:name="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity" />
|
||||||
|
|
||||||
|
@ -82,9 +82,9 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".plugins.pump.danaRS.activities.PairingHelperActivity"
|
android:name="info.nightscout.androidaps.danars.activities.PairingHelperActivity"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity android:name=".plugins.pump.danaRS.activities.EnterPinActivity"
|
<activity android:name="info.nightscout.androidaps.danars.activities.EnterPinActivity"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity android:name=".plugins.general.maintenance.activities.PrefImportListActivity" />
|
<activity android:name=".plugins.general.maintenance.activities.PrefImportListActivity" />
|
||||||
<activity android:name=".historyBrowser.HistoryBrowseActivity" />
|
<activity android:name=".historyBrowser.HistoryBrowseActivity" />
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<service
|
<service
|
||||||
android:name=".plugins.pump.danaRS.services.DanaRSService"
|
android:name="info.nightscout.androidaps.danars.services.DanaRSService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
<service
|
<service
|
||||||
|
|
|
@ -37,7 +37,7 @@ import info.nightscout.androidaps.plugins.insulin.InsulinOrefFreePeakPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import info.nightscout.androidaps.Constants;
|
import info.nightscout.androidaps.Constants;
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
|
import info.nightscout.androidaps.dana.comm.RecordTypes;
|
||||||
import info.nightscout.androidaps.data.NonOverlappingIntervals;
|
import info.nightscout.androidaps.data.NonOverlappingIntervals;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.interfaces.ProfileStore;
|
import info.nightscout.androidaps.interfaces.ProfileStore;
|
||||||
|
@ -52,7 +53,6 @@ import info.nightscout.androidaps.logging.StacktraceLoggerWrapper;
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
|
||||||
|
|
|
@ -12,9 +12,9 @@ import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizar
|
||||||
import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity
|
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.dialog.RileyLinkBLEScanActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRHistoryActivity
|
import info.nightscout.androidaps.dana.activities.DanaRHistoryActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRUserOptionsActivity
|
import info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.activities.EnterPinActivity
|
import info.nightscout.androidaps.danars.activities.EnterPinActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
|
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.InsightPairingActivity
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
|
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
|
||||||
|
@ -26,8 +26,8 @@ import info.nightscout.androidaps.setupwizard.SetupWizardActivity
|
||||||
abstract class ActivitiesModule {
|
abstract class ActivitiesModule {
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun contributeBolusProgressHelperActivity(): BolusProgressHelperActivity
|
@ContributesAndroidInjector abstract fun contributeBolusProgressHelperActivity(): BolusProgressHelperActivity
|
||||||
@ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): DanaRHistoryActivity
|
@ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): info.nightscout.androidaps.dana.activities.DanaRHistoryActivity
|
||||||
@ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): DanaRUserOptionsActivity
|
@ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity
|
||||||
@ContributesAndroidInjector abstract fun contributeEnterPinActivity(): EnterPinActivity
|
@ContributesAndroidInjector abstract fun contributeEnterPinActivity(): EnterPinActivity
|
||||||
@ContributesAndroidInjector abstract fun contributeErrorHelperActivity(): ErrorHelperActivity
|
@ContributesAndroidInjector abstract fun contributeErrorHelperActivity(): ErrorHelperActivity
|
||||||
@ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity
|
@ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.dependencyInjection
|
||||||
|
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
import dagger.android.ContributesAndroidInjector
|
import dagger.android.ContributesAndroidInjector
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.comm.*
|
import info.nightscout.androidaps.danars.comm.*
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
|
|
|
@ -34,8 +34,8 @@ import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.combo.ComboFragment
|
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.RileyLinkStatusGeneralFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRFragment
|
import info.nightscout.androidaps.dana.DanaRFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.dialogs.PairingProgressDialog
|
import info.nightscout.androidaps.danars.dialogs.PairingProgressDialog
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
|
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
|
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
|
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
|
||||||
|
@ -61,7 +61,7 @@ abstract class FragmentsModule {
|
||||||
@ContributesAndroidInjector
|
@ContributesAndroidInjector
|
||||||
abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
|
abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun contributesDanaRFragment(): DanaRFragment
|
@ContributesAndroidInjector abstract fun contributesDanaRFragment(): info.nightscout.androidaps.dana.DanaRFragment
|
||||||
@ContributesAndroidInjector abstract fun contributesFoodFragment(): FoodFragment
|
@ContributesAndroidInjector abstract fun contributesFoodFragment(): FoodFragment
|
||||||
@ContributesAndroidInjector abstract fun contributesInsulinFragment(): InsulinFragment
|
@ContributesAndroidInjector abstract fun contributesInsulinFragment(): InsulinFragment
|
||||||
@ContributesAndroidInjector abstract fun contributesLocalProfileFragment(): LocalProfileFragment
|
@ContributesAndroidInjector abstract fun contributesLocalProfileFragment(): LocalProfileFragment
|
||||||
|
|
|
@ -36,7 +36,7 @@ import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin
|
import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin
|
||||||
|
|
|
@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService
|
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.services.DanaRExecutionService
|
import info.nightscout.androidaps.plugins.pump.danaR.services.DanaRExecutionService
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.services.DanaRKoreanExecutionService
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.services.DanaRKoreanExecutionService
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.services.DanaRSService
|
import info.nightscout.androidaps.danars.services.DanaRSService
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.services.DanaRv2ExecutionService
|
import info.nightscout.androidaps.plugins.pump.danaRv2.services.DanaRv2ExecutionService
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
|
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
|
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
|
||||||
|
|
|
@ -24,9 +24,9 @@ import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||||
import info.nightscout.androidaps.plugins.treatments.CarbsGenerator
|
import info.nightscout.androidaps.plugins.treatments.CarbsGenerator
|
||||||
|
@ -65,7 +65,7 @@ class ActionStringHandler @Inject constructor(
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
private val danaRv2Plugin: DanaRv2Plugin,
|
private val danaRv2Plugin: DanaRv2Plugin,
|
||||||
private val danaRSPlugin: DanaRSPlugin,
|
private val danaRSPlugin: DanaRSPlugin,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val hardLimits: HardLimits,
|
private val hardLimits: HardLimits,
|
||||||
private val carbsGenerator: CarbsGenerator,
|
private val carbsGenerator: CarbsGenerator,
|
||||||
private val dateUtil: DateUtil,
|
private val dateUtil: DateUtil,
|
||||||
|
|
|
@ -9,8 +9,11 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.BuildConfig;
|
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaPumpInterface;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRFragment;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
|
import info.nightscout.androidaps.dana.comm.RecordTypes;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
import info.nightscout.androidaps.db.ExtendedBolus;
|
import info.nightscout.androidaps.db.ExtendedBolus;
|
||||||
|
@ -36,7 +39,6 @@ import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
||||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||||
import info.nightscout.androidaps.utils.DateUtil;
|
import info.nightscout.androidaps.utils.DateUtil;
|
||||||
|
@ -52,7 +54,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||||
* Created by mike on 28.01.2018.
|
* Created by mike on 28.01.2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class AbstractDanaRPlugin extends PumpPluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface {
|
public abstract class AbstractDanaRPlugin extends PumpPluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface, DanaPumpInterface {
|
||||||
protected AbstractDanaRExecutionService sExecutionService;
|
protected AbstractDanaRExecutionService sExecutionService;
|
||||||
|
|
||||||
protected CompositeDisposable disposable = new CompositeDisposable();
|
protected CompositeDisposable disposable = new CompositeDisposable();
|
||||||
|
@ -521,4 +523,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
|
||||||
@Override
|
@Override
|
||||||
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
|
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void clearPairing() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
|
|
|
@ -9,6 +9,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
import info.nightscout.androidaps.logging.LTag;
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
import info.nightscout.androidaps.logging.StacktraceLoggerWrapper;
|
import info.nightscout.androidaps.logging.StacktraceLoggerWrapper;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
@ -23,7 +23,7 @@ class MessageHashTableR @Inject constructor(
|
||||||
rxBus: RxBusWrapper,
|
rxBus: RxBusWrapper,
|
||||||
resourceHelper: ResourceHelper,
|
resourceHelper: ResourceHelper,
|
||||||
constraintChecker: ConstraintChecker,
|
constraintChecker: ConstraintChecker,
|
||||||
danaRPump: DanaRPump,
|
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
danaRPlugin: DanaRPlugin,
|
danaRPlugin: DanaRPlugin,
|
||||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
configBuilderPlugin: ConfigBuilderPlugin,
|
configBuilderPlugin: ConfigBuilderPlugin,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class MsgBolusProgress(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -4,12 +4,12 @@ import info.nightscout.androidaps.interfaces.Constraint
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgBolusStart(
|
class MsgBolusStart(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
constraintChecker: ConstraintChecker,
|
constraintChecker: ConstraintChecker,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private var amount: Double
|
private var amount: Double
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import info.nightscout.androidaps.interfaces.Constraint
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgBolusStartWithSpeed(
|
class MsgBolusStartWithSpeed(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
constraintChecker: ConstraintChecker,
|
constraintChecker: ConstraintChecker,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private var amount: Double,
|
private var amount: Double,
|
||||||
speed: Int
|
speed: Int
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
|
@ -5,14 +5,14 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
class MsgBolusStop(
|
class MsgBolusStop(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgCheckValue(
|
class MsgCheckValue(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRPlugin: DanaRPlugin
|
private val danaRPlugin: DanaRPlugin
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class MsgCheckValue(
|
||||||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||||
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
||||||
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
||||||
if (danaRPump.hwModel != DanaRPump.EXPORT_MODEL) {
|
if (danaRPump.hwModel != info.nightscout.androidaps.dana.DanaRPump.EXPORT_MODEL) {
|
||||||
danaRPlugin.disconnect("Wrong Model")
|
danaRPlugin.disconnect("Wrong Model")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Wrong model selected")
|
aapsLogger.debug(LTag.PUMPCOMM, "Wrong model selected")
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,14 @@ import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
class MsgError(
|
class MsgError(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val nsUpload: NSUpload
|
private val nsUpload: NSUpload
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ open class MsgHistoryAll(
|
||||||
danaRHistoryRecord.setBytes(bytes)
|
danaRHistoryRecord.setBytes(bytes)
|
||||||
var messageType = ""
|
var messageType = ""
|
||||||
when (recordCode) {
|
when (recordCode) {
|
||||||
RecordTypes.RECORD_TYPE_BOLUS -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BOLUS -> {
|
||||||
danaRHistoryRecord.recordDate = datetime
|
danaRHistoryRecord.recordDate = datetime
|
||||||
when (0xF0 and paramByte8.toInt()) {
|
when (0xF0 and paramByte8.toInt()) {
|
||||||
0xA0 -> {
|
0xA0 -> {
|
||||||
|
@ -65,56 +65,56 @@ open class MsgHistoryAll(
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_DAILY -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY -> {
|
||||||
messageType += "dailyinsulin"
|
messageType += "dailyinsulin"
|
||||||
danaRHistoryRecord.recordDate = date
|
danaRHistoryRecord.recordDate = date
|
||||||
danaRHistoryRecord.recordDailyBasal = dailyBasal
|
danaRHistoryRecord.recordDailyBasal = dailyBasal
|
||||||
danaRHistoryRecord.recordDailyBolus = dailyBolus
|
danaRHistoryRecord.recordDailyBolus = dailyBolus
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_PRIME -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_PRIME -> {
|
||||||
messageType += "prime"
|
messageType += "prime"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_ERROR -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_ERROR -> {
|
||||||
messageType += "error"
|
messageType += "error"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_REFILL -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_REFILL -> {
|
||||||
messageType += "refill"
|
messageType += "refill"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_BASALHOUR -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BASALHOUR -> {
|
||||||
messageType += "basal hour"
|
messageType += "basal hour"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_TB -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_TB -> {
|
||||||
messageType += "tb"
|
messageType += "tb"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_GLUCOSE -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_GLUCOSE -> {
|
||||||
messageType += "glucose"
|
messageType += "glucose"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value
|
danaRHistoryRecord.recordValue = value
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_CARBO -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_CARBO -> {
|
||||||
messageType += "carbo"
|
messageType += "carbo"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
danaRHistoryRecord.recordValue = value
|
danaRHistoryRecord.recordValue = value
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_ALARM -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_ALARM -> {
|
||||||
messageType += "alarm"
|
messageType += "alarm"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
var strAlarm = "None"
|
var strAlarm = "None"
|
||||||
|
@ -128,7 +128,7 @@ open class MsgHistoryAll(
|
||||||
danaRHistoryRecord.recordValue = value * 0.01
|
danaRHistoryRecord.recordValue = value * 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordTypes.RECORD_TYPE_SUSPEND -> {
|
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_SUSPEND -> {
|
||||||
messageType += "suspend"
|
messageType += "suspend"
|
||||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||||
var strRecordValue = "Off"
|
var strRecordValue = "Off"
|
||||||
|
@ -136,7 +136,7 @@ open class MsgHistoryAll(
|
||||||
danaRHistoryRecord.stringRecordValue = strRecordValue
|
danaRHistoryRecord.stringRecordValue = strRecordValue
|
||||||
}
|
}
|
||||||
|
|
||||||
17.toByte() -> failed = true
|
17.toByte() -> failed = true
|
||||||
}
|
}
|
||||||
MainApp.getDbHelper().createOrUpdate(danaRHistoryRecord)
|
MainApp.getDbHelper().createOrUpdate(danaRHistoryRecord)
|
||||||
rxBus.send(EventDanaRSyncStatus(dateUtil.dateAndTimeString(danaRHistoryRecord.recordDate) + " " + messageType))
|
rxBus.send(EventDanaRSyncStatus(dateUtil.dateAndTimeString(danaRHistoryRecord.recordDate) + " " + messageType))
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgHistoryAllDone(
|
class MsgHistoryAllDone(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgHistoryDone(
|
class MsgHistoryDone(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgHistoryNewDone(
|
class MsgHistoryNewDone(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgInitConnStatusBasic(
|
class MsgInitConnStatusBasic(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -33,10 +33,10 @@ class MsgInitConnStatusBasic(
|
||||||
val extendedBolusRate = intFromBuff(bytes, 18, 2) / 100.0
|
val extendedBolusRate = intFromBuff(bytes, 18, 2) / 100.0
|
||||||
danaRPump.batteryRemaining = intFromBuff(bytes, 20, 1)
|
danaRPump.batteryRemaining = intFromBuff(bytes, 20, 1)
|
||||||
val bolusConfig = intFromBuff(bytes, 21, 1)
|
val bolusConfig = intFromBuff(bytes, 21, 1)
|
||||||
val deliveryPrime = bolusConfig and DanaRPump.DELIVERY_PRIME != 0
|
val deliveryPrime = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_PRIME != 0
|
||||||
val deliveryStepBolus = bolusConfig and DanaRPump.DELIVERY_STEP_BOLUS != 0
|
val deliveryStepBolus = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_STEP_BOLUS != 0
|
||||||
val deliveryBasal = bolusConfig and DanaRPump.DELIVERY_BASAL != 0
|
val deliveryBasal = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_BASAL != 0
|
||||||
val deliveryExtBolus = bolusConfig and DanaRPump.DELIVERY_EXT_BOLUS != 0
|
val deliveryExtBolus = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_EXT_BOLUS != 0
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Delivery prime: $deliveryPrime")
|
aapsLogger.debug(LTag.PUMPCOMM, "Delivery prime: $deliveryPrime")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Delivery step bolus: $deliveryStepBolus")
|
aapsLogger.debug(LTag.PUMPCOMM, "Delivery step bolus: $deliveryStepBolus")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Delivery basal: $deliveryBasal")
|
aapsLogger.debug(LTag.PUMPCOMM, "Delivery basal: $deliveryBasal")
|
||||||
|
|
|
@ -7,14 +7,14 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
class MsgInitConnStatusBolus(
|
class MsgInitConnStatusBolus(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -8,14 +8,14 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
class MsgInitConnStatusOption(
|
class MsgInitConnStatusOption(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val activePlugin: ActivePluginProvider
|
private val activePlugin: ActivePluginProvider
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
@ -20,7 +20,7 @@ class MsgInitConnStatusTime(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRPlugin: DanaRPlugin,
|
private val danaRPlugin: DanaRPlugin,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
private val configBuilderPlugin: ConfigBuilderPlugin,
|
private val configBuilderPlugin: ConfigBuilderPlugin,
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MsgSetCarbsEntry(
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "New message")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "New message")
|
||||||
val calendar = Calendar.getInstance()
|
val calendar = Calendar.getInstance()
|
||||||
calendar.timeInMillis = time
|
calendar.timeInMillis = time
|
||||||
AddParamByte(RecordTypes.RECORD_TYPE_CARBO)
|
AddParamByte(info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_CARBO)
|
||||||
AddParamByte((calendar[Calendar.YEAR] % 100).toByte())
|
AddParamByte((calendar[Calendar.YEAR] % 100).toByte())
|
||||||
AddParamByte((calendar[Calendar.MONTH] + 1).toByte())
|
AddParamByte((calendar[Calendar.MONTH] + 1).toByte())
|
||||||
AddParamByte(calendar[Calendar.DAY_OF_MONTH].toByte())
|
AddParamByte(calendar[Calendar.DAY_OF_MONTH].toByte())
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSetUserOptions(
|
class MsgSetUserOptions(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
danaRPump: DanaRPump
|
danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSettingActiveProfile(
|
class MsgSettingActiveProfile(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MsgSettingBasal(
|
class MsgSettingBasal(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRPlugin: DanaRPlugin
|
private val danaRPlugin: DanaRPlugin
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ import java.util.*
|
||||||
*/
|
*/
|
||||||
class MsgSettingBasalProfileAll(
|
class MsgSettingBasalProfileAll(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
override fun handleMessage(bytes: ByteArray) {
|
override fun handleMessage(bytes: ByteArray) {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mike on 05.07.2016.
|
* Created by mike on 05.07.2016.
|
||||||
*/
|
*/
|
||||||
class MsgSettingGlucose(
|
class MsgSettingGlucose(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -20,7 +20,7 @@ class MsgSettingGlucose(
|
||||||
override fun handleMessage(bytes: ByteArray) {
|
override fun handleMessage(bytes: ByteArray) {
|
||||||
danaRPump.units = intFromBuff(bytes, 0, 1)
|
danaRPump.units = intFromBuff(bytes, 0, 1)
|
||||||
danaRPump.easyBasalMode = intFromBuff(bytes, 1, 1)
|
danaRPump.easyBasalMode = intFromBuff(bytes, 1, 1)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Pump units: " + if (danaRPump.units == DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
aapsLogger.debug(LTag.PUMPCOMM, "Pump units: " + if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Easy basal mode: " + danaRPump.easyBasalMode)
|
aapsLogger.debug(LTag.PUMPCOMM, "Easy basal mode: " + danaRPump.easyBasalMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSettingMaxValues(
|
class MsgSettingMaxValues(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class MsgSettingMeal(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSettingProfileRatios(
|
class MsgSettingProfileRatios(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -15,7 +15,7 @@ class MsgSettingProfileRatios(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleMessage(bytes: ByteArray) {
|
override fun handleMessage(bytes: ByteArray) {
|
||||||
if (danaRPump.units == DanaRPump.UNITS_MGDL) {
|
if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) {
|
||||||
danaRPump.currentCIR = intFromBuff(bytes, 0, 2)
|
danaRPump.currentCIR = intFromBuff(bytes, 0, 2)
|
||||||
danaRPump.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
danaRPump.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||||
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
||||||
|
@ -28,7 +28,7 @@ class MsgSettingProfileRatios(
|
||||||
danaRPump.currentTarget = intFromBuff(bytes, 6, 2) / 100.0
|
danaRPump.currentTarget = intFromBuff(bytes, 6, 2) / 100.0
|
||||||
danaRPump.currentAIDR = intFromBuff(bytes, 8, 1)
|
danaRPump.currentAIDR = intFromBuff(bytes, 8, 1)
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Pump units (saved): " + if (danaRPump.units == DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
aapsLogger.debug(LTag.PUMPCOMM, "Pump units (saved): " + if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CIR: " + danaRPump.currentCIR)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CIR: " + danaRPump.currentCIR)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CF: " + danaRPump.currentCF)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CF: " + danaRPump.currentCF)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump AI: " + danaRPump.currentAI)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump AI: " + danaRPump.currentAI)
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSettingProfileRatiosAll(
|
class MsgSettingProfileRatiosAll(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -15,7 +15,7 @@ class MsgSettingProfileRatiosAll(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleMessage(bytes: ByteArray) {
|
override fun handleMessage(bytes: ByteArray) {
|
||||||
if (danaRPump.units == DanaRPump.UNITS_MGDL) {
|
if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) {
|
||||||
danaRPump.morningCIR = intFromBuff(bytes, 0, 2)
|
danaRPump.morningCIR = intFromBuff(bytes, 0, 2)
|
||||||
danaRPump.morningCF = intFromBuff(bytes, 2, 2).toDouble()
|
danaRPump.morningCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||||
danaRPump.afternoonCIR = intFromBuff(bytes, 4, 2)
|
danaRPump.afternoonCIR = intFromBuff(bytes, 4, 2)
|
||||||
|
@ -34,7 +34,7 @@ class MsgSettingProfileRatiosAll(
|
||||||
danaRPump.nightCIR = intFromBuff(bytes, 12, 2)
|
danaRPump.nightCIR = intFromBuff(bytes, 12, 2)
|
||||||
danaRPump.nightCF = intFromBuff(bytes, 14, 2) / 100.0
|
danaRPump.nightCF = intFromBuff(bytes, 14, 2) / 100.0
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Pump units: " + if (danaRPump.units == DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
aapsLogger.debug(LTag.PUMPCOMM, "Pump units: " + if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump morning CIR: " + danaRPump.morningCIR)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump morning CIR: " + danaRPump.morningCIR)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump morning CF: " + danaRPump.morningCF)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump morning CF: " + danaRPump.morningCF)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump afternoon CIR: " + danaRPump.afternoonCIR)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump afternoon CIR: " + danaRPump.afternoonCIR)
|
||||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MsgSettingPumpTime(
|
class MsgSettingPumpTime(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val dateUtil: DateUtil
|
private val dateUtil: DateUtil
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgSettingShippingInfo(
|
class MsgSettingShippingInfo(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MsgSettingUserOptions(
|
class MsgSettingUserOptions(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgStatus(
|
class MsgStatus(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgStatusBasic(
|
class MsgStatusBasic(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -6,14 +6,14 @@ import info.nightscout.androidaps.db.Source
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
class MsgStatusBolusExtended(
|
class MsgStatusBolusExtended(
|
||||||
private val injector: HasAndroidInjector,
|
private val injector: HasAndroidInjector,
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val activePlugin: ActivePluginProvider,
|
private val activePlugin: ActivePluginProvider,
|
||||||
private val dateUtil: DateUtil
|
private val dateUtil: DateUtil
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
class MsgStatusProfile(
|
class MsgStatusProfile(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -15,7 +15,7 @@ class MsgStatusProfile(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleMessage(bytes: ByteArray) {
|
override fun handleMessage(bytes: ByteArray) {
|
||||||
if (danaRPump.units == DanaRPump.UNITS_MGDL) {
|
if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) {
|
||||||
danaRPump.currentCIR = intFromBuff(bytes, 0, 2)
|
danaRPump.currentCIR = intFromBuff(bytes, 0, 2)
|
||||||
danaRPump.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
danaRPump.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||||
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
||||||
|
@ -26,7 +26,7 @@ class MsgStatusProfile(
|
||||||
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
||||||
danaRPump.currentTarget = intFromBuff(bytes, 6, 2) / 100.0
|
danaRPump.currentTarget = intFromBuff(bytes, 6, 2) / 100.0
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Pump units (saved): " + if (danaRPump.units == DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
aapsLogger.debug(LTag.PUMPCOMM, "Pump units (saved): " + if (danaRPump.units == info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL) "MGDL" else "MMOL")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CIR: " + danaRPump.currentCIR)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CIR: " + danaRPump.currentCIR)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CF: " + danaRPump.currentCF)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump CF: " + danaRPump.currentCF)
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Current pump AI: " + danaRPump.currentAI)
|
aapsLogger.debug(LTag.PUMPCOMM, "Current pump AI: " + danaRPump.currentAI)
|
||||||
|
|
|
@ -6,12 +6,12 @@ import info.nightscout.androidaps.db.TemporaryBasal
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
class MsgStatusTempBasal(
|
class MsgStatusTempBasal(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val activePlugin: ActivePluginProvider,
|
private val activePlugin: ActivePluginProvider,
|
||||||
private val injector: HasAndroidInjector
|
private val injector: HasAndroidInjector
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
|
@ -17,6 +17,8 @@ import javax.inject.Inject;
|
||||||
import dagger.android.DaggerService;
|
import dagger.android.DaggerService;
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
|
import info.nightscout.androidaps.dana.comm.RecordTypes;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
import info.nightscout.androidaps.events.EventAppExit;
|
import info.nightscout.androidaps.events.EventAppExit;
|
||||||
|
@ -25,7 +27,6 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged;
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||||
import info.nightscout.androidaps.logging.LTag;
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStop;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStop;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgHistoryAlarm;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgHistoryAlarm;
|
||||||
|
@ -39,7 +40,6 @@ import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgHistoryRefill;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgHistorySuspend;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgHistorySuspend;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgPCCommStart;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgPCCommStart;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgPCCommStop;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgPCCommStop;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes;
|
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.utils.DateUtil;
|
import info.nightscout.androidaps.utils.DateUtil;
|
||||||
import info.nightscout.androidaps.utils.FabricPrivacy;
|
import info.nightscout.androidaps.utils.FabricPrivacy;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaR.services;
|
package info.nightscout.androidaps.plugins.pump.danaR.services;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
|
||||||
|
@ -12,6 +11,8 @@ import javax.inject.Inject;
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.Constants;
|
import info.nightscout.androidaps.Constants;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
|
import info.nightscout.androidaps.dana.events.EventDanaRNewStatus;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
|
@ -25,14 +26,12 @@ import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||||
import info.nightscout.androidaps.logging.LTag;
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageHashTableR;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageHashTableR;
|
||||||
|
@ -62,7 +61,6 @@ import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBasic;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBasic;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBolusExtended;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBolusExtended;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusTempBasal;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusTempBasal;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.events.EventDanaRNewStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
||||||
import info.nightscout.androidaps.queue.Callback;
|
import info.nightscout.androidaps.queue.Callback;
|
||||||
import info.nightscout.androidaps.queue.commands.Command;
|
import info.nightscout.androidaps.queue.commands.Command;
|
||||||
|
@ -77,9 +75,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
|
||||||
@Inject DanaRPump danaRPump;
|
@Inject DanaRPump danaRPump;
|
||||||
@Inject DanaRPlugin danaRPlugin;
|
@Inject DanaRPlugin danaRPlugin;
|
||||||
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
||||||
@Inject ConfigBuilderPlugin configBuilderPlugin;
|
|
||||||
@Inject CommandQueueProvider commandQueue;
|
@Inject CommandQueueProvider commandQueue;
|
||||||
@Inject Context context;
|
|
||||||
@Inject MessageHashTableR messageHashTableR;
|
@Inject MessageHashTableR messageHashTableR;
|
||||||
@Inject ActivePluginProvider activePlugin;
|
@Inject ActivePluginProvider activePlugin;
|
||||||
@Inject ProfileFunction profileFunction;
|
@Inject ProfileFunction profileFunction;
|
||||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
|
@ -29,7 +30,6 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.AbstractDanaRPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaR.AbstractDanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.services.DanaRKoreanExecutionService;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.services.DanaRKoreanExecutionService;
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.*
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.*
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
|
@ -24,7 +24,7 @@ class MessageHashTableRKorean @Inject constructor(
|
||||||
rxBus: RxBusWrapper,
|
rxBus: RxBusWrapper,
|
||||||
resourceHelper: ResourceHelper,
|
resourceHelper: ResourceHelper,
|
||||||
constraintChecker: ConstraintChecker,
|
constraintChecker: ConstraintChecker,
|
||||||
danaRPump: DanaRPump,
|
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
danaRPlugin: DanaRPlugin,
|
danaRPlugin: DanaRPlugin,
|
||||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
configBuilderPlugin: ConfigBuilderPlugin,
|
configBuilderPlugin: ConfigBuilderPlugin,
|
||||||
|
|
|
@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
|
|
||||||
class MsgCheckValue_k(
|
class MsgCheckValue_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||||
|
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
@ -24,7 +24,7 @@ class MsgCheckValue_k(
|
||||||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||||
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
||||||
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
||||||
if (danaRPump.hwModel != DanaRPump.DOMESTIC_MODEL) {
|
if (danaRPump.hwModel != info.nightscout.androidaps.dana.DanaRPump.DOMESTIC_MODEL) {
|
||||||
danaRKoreanPlugin.disconnect("Wrong Model")
|
danaRKoreanPlugin.disconnect("Wrong Model")
|
||||||
aapsLogger.debug(LTag.PUMPCOMM, "Wrong model selected")
|
aapsLogger.debug(LTag.PUMPCOMM, "Wrong model selected")
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class MsgInitConnStatusBasic_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class MsgInitConnStatusBolus_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val activePlugin: ActivePluginProvider
|
private val activePlugin: ActivePluginProvider
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
|
@ -21,7 +21,7 @@ class MsgInitConnStatusTime_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRPlugin: DanaRPlugin,
|
private val danaRPlugin: DanaRPlugin,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
private val configBuilderPlugin: ConfigBuilderPlugin,
|
private val configBuilderPlugin: ConfigBuilderPlugin,
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import java.util.*
|
||||||
*/
|
*/
|
||||||
class MsgSettingBasalProfileAll_k(
|
class MsgSettingBasalProfileAll_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MsgSettingBasal_k(
|
class MsgSettingBasal_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
|
|
||||||
class MsgStatusBasic_k(
|
class MsgStatusBasic_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
|
|
||||||
class MsgStatus_k(
|
class MsgStatus_k(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRKorean.services;
|
package info.nightscout.androidaps.plugins.pump.danaRKorean.services;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
|
||||||
|
@ -11,25 +10,26 @@ import javax.inject.Inject;
|
||||||
|
|
||||||
import info.nightscout.androidaps.Constants;
|
import info.nightscout.androidaps.Constants;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
|
import info.nightscout.androidaps.dana.events.EventDanaRNewStatus;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.dialogs.BolusProgressDialog;
|
import info.nightscout.androidaps.dialogs.BolusProgressDialog;
|
||||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||||
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
|
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
|
||||||
import info.nightscout.androidaps.events.EventPumpStatusChanged;
|
import info.nightscout.androidaps.events.EventPumpStatusChanged;
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
|
||||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
|
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
|
||||||
|
import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||||
import info.nightscout.androidaps.logging.LTag;
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction;
|
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStart;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStart;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSetCarbsEntry;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSetCarbsEntry;
|
||||||
|
@ -48,14 +48,12 @@ import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingPumpTime;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingShippingInfo;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingShippingInfo;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBolusExtended;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBolusExtended;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusTempBasal;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusTempBasal;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.events.EventDanaRNewStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MessageHashTableRKorean;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MessageHashTableRKorean;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgCheckValue_k;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgCheckValue_k;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgSettingBasal_k;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgSettingBasal_k;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgStatusBasic_k;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.comm.MsgStatusBasic_k;
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
|
||||||
import info.nightscout.androidaps.queue.commands.Command;
|
import info.nightscout.androidaps.queue.commands.Command;
|
||||||
import info.nightscout.androidaps.utils.DateUtil;
|
import info.nightscout.androidaps.utils.DateUtil;
|
||||||
import info.nightscout.androidaps.utils.T;
|
import info.nightscout.androidaps.utils.T;
|
||||||
|
@ -69,9 +67,7 @@ public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService {
|
||||||
@Inject DanaRPump danaRPump;
|
@Inject DanaRPump danaRPump;
|
||||||
@Inject DanaRPlugin danaRPlugin;
|
@Inject DanaRPlugin danaRPlugin;
|
||||||
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
||||||
@Inject ConfigBuilderPlugin configBuilderPlugin;
|
|
||||||
@Inject CommandQueueProvider commandQueue;
|
@Inject CommandQueueProvider commandQueue;
|
||||||
@Inject Context context;
|
|
||||||
@Inject MessageHashTableRKorean messageHashTableRKorean;
|
@Inject MessageHashTableRKorean messageHashTableRKorean;
|
||||||
@Inject ActivePluginProvider activePlugin;
|
@Inject ActivePluginProvider activePlugin;
|
||||||
@Inject ProfileFunction profileFunction;
|
@Inject ProfileFunction profileFunction;
|
||||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector;
|
import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
|
@ -27,7 +28,6 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.AbstractDanaRPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaR.AbstractDanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.services.DanaRv2ExecutionService;
|
import info.nightscout.androidaps.plugins.pump.danaRv2.services.DanaRv2ExecutionService;
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.*
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.*
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
|
@ -27,7 +27,7 @@ class MessageHashTableRv2 @Inject constructor(
|
||||||
rxBus: RxBusWrapper,
|
rxBus: RxBusWrapper,
|
||||||
resourceHelper: ResourceHelper,
|
resourceHelper: ResourceHelper,
|
||||||
constraintChecker: ConstraintChecker,
|
constraintChecker: ConstraintChecker,
|
||||||
danaRPump: DanaRPump,
|
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
danaRPlugin: DanaRPlugin,
|
danaRPlugin: DanaRPlugin,
|
||||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
danaRv2Plugin: DanaRv2Plugin,
|
danaRv2Plugin: DanaRv2Plugin,
|
||||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
|
@ -21,7 +21,7 @@ class MsgCheckValue_v2(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val rxBus: RxBusWrapper,
|
private val rxBus: RxBusWrapper,
|
||||||
private val resourceHelper: ResourceHelper,
|
private val resourceHelper: ResourceHelper,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val danaRPlugin: DanaRPlugin,
|
private val danaRPlugin: DanaRPlugin,
|
||||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||||
private val danaRv2Plugin: DanaRv2Plugin,
|
private val danaRv2Plugin: DanaRv2Plugin,
|
||||||
|
@ -41,7 +41,7 @@ class MsgCheckValue_v2(
|
||||||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||||
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
danaRPump.protocol = intFromBuff(bytes, 1, 1)
|
||||||
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
danaRPump.productCode = intFromBuff(bytes, 2, 1)
|
||||||
if (danaRPump.hwModel != DanaRPump.EXPORT_MODEL) {
|
if (danaRPump.hwModel != info.nightscout.androidaps.dana.DanaRPump.EXPORT_MODEL) {
|
||||||
danaRPump.reset()
|
danaRPump.reset()
|
||||||
val notification = Notification(Notification.WRONG_DRIVER, resourceHelper.gs(R.string.pumpdrivercorrected), Notification.NORMAL)
|
val notification = Notification(Notification.WRONG_DRIVER, resourceHelper.gs(R.string.pumpdrivercorrected), Notification.NORMAL)
|
||||||
rxBus.send(EventNewNotification(notification))
|
rxBus.send(EventNewNotification(notification))
|
||||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
|
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
|
||||||
|
@ -74,7 +74,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
.pumpId(datetime)
|
.pumpId(datetime)
|
||||||
val status: String
|
val status: String
|
||||||
when (recordCode.toInt()) {
|
when (recordCode.toInt()) {
|
||||||
DanaRPump.TEMPSTART -> {
|
info.nightscout.androidaps.dana.DanaRPump.TEMPSTART -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
||||||
temporaryBasal.percentRate = param1
|
temporaryBasal.percentRate = param1
|
||||||
temporaryBasal.durationInMinutes = param2
|
temporaryBasal.durationInMinutes = param2
|
||||||
|
@ -82,13 +82,13 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.TEMPSTOP -> {
|
info.nightscout.androidaps.dana.DanaRPump.TEMPSTOP -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
|
||||||
treatmentsPlugin.addToHistoryTempBasal(temporaryBasal)
|
treatmentsPlugin.addToHistoryTempBasal(temporaryBasal)
|
||||||
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.EXTENDEDSTART -> {
|
info.nightscout.androidaps.dana.DanaRPump.EXTENDEDSTART -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
||||||
extendedBolus.insulin = param1 / 100.0
|
extendedBolus.insulin = param1 / 100.0
|
||||||
extendedBolus.durationInMinutes = param2
|
extendedBolus.durationInMinutes = param2
|
||||||
|
@ -96,13 +96,13 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.EXTENDEDSTOP -> {
|
info.nightscout.androidaps.dana.DanaRPump.EXTENDEDSTOP -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
||||||
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
||||||
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.BOLUS -> {
|
info.nightscout.androidaps.dana.DanaRPump.BOLUS -> {
|
||||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||||
?: DetailedBolusInfo()
|
?: DetailedBolusInfo()
|
||||||
detailedBolusInfo.date = datetime
|
detailedBolusInfo.date = datetime
|
||||||
|
@ -114,7 +114,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "BOLUS " + dateUtil.timeString(datetime)
|
status = "BOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.DUALBOLUS -> {
|
info.nightscout.androidaps.dana.DanaRPump.DUALBOLUS -> {
|
||||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||||
?: DetailedBolusInfo()
|
?: DetailedBolusInfo()
|
||||||
detailedBolusInfo.date = datetime
|
detailedBolusInfo.date = datetime
|
||||||
|
@ -126,7 +126,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.DUALEXTENDEDSTART -> {
|
info.nightscout.androidaps.dana.DanaRPump.DUALEXTENDEDSTART -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
|
||||||
extendedBolus.insulin = param1 / 100.0
|
extendedBolus.insulin = param1 / 100.0
|
||||||
extendedBolus.durationInMinutes = param2
|
extendedBolus.durationInMinutes = param2
|
||||||
|
@ -134,38 +134,38 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.DUALEXTENDEDSTOP -> {
|
info.nightscout.androidaps.dana.DanaRPump.DUALEXTENDEDSTOP -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
|
||||||
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
||||||
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.SUSPENDON -> {
|
info.nightscout.androidaps.dana.DanaRPump.SUSPENDON -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.SUSPENDOFF -> {
|
info.nightscout.androidaps.dana.DanaRPump.SUSPENDOFF -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.REFILL -> {
|
info.nightscout.androidaps.dana.DanaRPump.REFILL -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
status = "REFILL " + dateUtil.timeString(datetime)
|
status = "REFILL " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.PRIME -> {
|
info.nightscout.androidaps.dana.DanaRPump.PRIME -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
status = "PRIME " + dateUtil.timeString(datetime)
|
status = "PRIME " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.PROFILECHANGE -> {
|
info.nightscout.androidaps.dana.DanaRPump.PROFILECHANGE -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
||||||
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
DanaRPump.CARBS -> {
|
info.nightscout.androidaps.dana.DanaRPump.CARBS -> {
|
||||||
val emptyCarbsInfo = DetailedBolusInfo()
|
val emptyCarbsInfo = DetailedBolusInfo()
|
||||||
emptyCarbsInfo.carbs = param1.toDouble()
|
emptyCarbsInfo.carbs = param1.toDouble()
|
||||||
emptyCarbsInfo.date = datetime
|
emptyCarbsInfo.date = datetime
|
||||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
|
|
||||||
class MsgStatusAPS_v2(
|
class MsgStatusAPS_v2(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
class MsgStatusBolusExtended_v2(
|
class MsgStatusBolusExtended_v2(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
class MsgStatusTempBasal_v2(
|
class MsgStatusTempBasal_v2(
|
||||||
private val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
private val danaRPump: DanaRPump,
|
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||||
private val dateUtil: DateUtil
|
private val dateUtil: DateUtil
|
||||||
) : MessageBase() {
|
) : MessageBase() {
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ import dagger.android.HasAndroidInjector;
|
||||||
import info.nightscout.androidaps.Constants;
|
import info.nightscout.androidaps.Constants;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity;
|
import info.nightscout.androidaps.activities.ErrorHelperActivity;
|
||||||
|
import info.nightscout.androidaps.dana.DanaRPump;
|
||||||
|
import info.nightscout.androidaps.dana.events.EventDanaRNewStatus;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
import info.nightscout.androidaps.db.Treatment;
|
import info.nightscout.androidaps.db.Treatment;
|
||||||
|
@ -36,7 +38,6 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewB
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
import info.nightscout.androidaps.plugins.pump.danaR.SerialIOThread;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStart;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStart;
|
||||||
|
@ -62,7 +63,6 @@ import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingShippingInfo
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingUserOptions;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgSettingUserOptions;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatus;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBasic;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgStatusBasic;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.events.EventDanaRNewStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
import info.nightscout.androidaps.plugins.pump.danaR.services.AbstractDanaRExecutionService;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin;
|
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
|
@ -6,8 +6,8 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.Constraint
|
import info.nightscout.androidaps.interfaces.Constraint
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.encryption.BleEncryption
|
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
@ -47,7 +47,7 @@ class DanaRSMessageHashTableTest : DanaRSTestBase() {
|
||||||
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
||||||
|
|
||||||
val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector)
|
val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector)
|
||||||
val forTesting: DanaRS_Packet = DanaRS_Packet_APS_Set_Event_History(packetInjector, DanaRPump.CARBS, 0, 0, 0)
|
val forTesting: DanaRS_Packet = DanaRS_Packet_APS_Set_Event_History(packetInjector, info.nightscout.androidaps.dana.DanaRPump.CARBS, 0, 0, 0)
|
||||||
val testPacket: DanaRS_Packet = danaRSMessageHashTable.findMessage(forTesting.command)
|
val testPacket: DanaRS_Packet = danaRSMessageHashTable.findMessage(forTesting.command)
|
||||||
Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.getOpCode().toLong())
|
Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.getOpCode().toLong())
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.TestBaseWithProfile
|
import info.nightscout.androidaps.TestBaseWithProfile
|
||||||
import info.nightscout.androidaps.db.TemporaryBasal
|
import info.nightscout.androidaps.db.TemporaryBasal
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
|
@ -24,7 +24,7 @@ open class DanaRSTestBase : TestBaseWithProfile() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lateinit var danaRPump: DanaRPump
|
lateinit var danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||||
|
|
||||||
fun createArray(length: Int, fillWith: Byte): ByteArray {
|
fun createArray(length: Int, fillWith: Byte): ByteArray {
|
||||||
val ret = ByteArray(length)
|
val ret = ByteArray(length)
|
||||||
|
@ -55,6 +55,6 @@ open class DanaRSTestBase : TestBaseWithProfile() {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setup() {
|
fun setup() {
|
||||||
danaRPump = DanaRPump(aapsLogger, sp, injector)
|
danaRPump = info.nightscout.androidaps.dana.DanaRPump(aapsLogger, sp, injector)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
|
@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
|
@ -1,8 +1,8 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
@ -27,23 +27,23 @@ class DanaRS_Packet_APS_Set_Event_HistoryTest : DanaRSTestBase() {
|
||||||
|
|
||||||
@Test fun runTest() { // test for negative carbs
|
@Test fun runTest() { // test for negative carbs
|
||||||
val now = DateUtil.now()
|
val now = DateUtil.now()
|
||||||
var historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, DanaRPump.CARBS, now, -1, 0)
|
var historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, info.nightscout.androidaps.dana.DanaRPump.CARBS, now, -1, 0)
|
||||||
var testparams = historyTest.requestParams
|
var testparams = historyTest.requestParams
|
||||||
Assert.assertEquals(0.toByte(), testparams[8])
|
Assert.assertEquals(0.toByte(), testparams[8])
|
||||||
// 5g carbs
|
// 5g carbs
|
||||||
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, DanaRPump.CARBS, now, 5, 0)
|
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, info.nightscout.androidaps.dana.DanaRPump.CARBS, now, 5, 0)
|
||||||
testparams = historyTest.requestParams
|
testparams = historyTest.requestParams
|
||||||
Assert.assertEquals(5.toByte(), testparams[8])
|
Assert.assertEquals(5.toByte(), testparams[8])
|
||||||
// 150g carbs
|
// 150g carbs
|
||||||
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, DanaRPump.CARBS, now, 150, 0)
|
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, info.nightscout.androidaps.dana.DanaRPump.CARBS, now, 150, 0)
|
||||||
testparams = historyTest.requestParams
|
testparams = historyTest.requestParams
|
||||||
Assert.assertEquals(150.toByte(), testparams[8])
|
Assert.assertEquals(150.toByte(), testparams[8])
|
||||||
// test message generation
|
// test message generation
|
||||||
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, DanaRPump.CARBS, now, 5, 0)
|
historyTest = DanaRS_Packet_APS_Set_Event_History(packetInjector, info.nightscout.androidaps.dana.DanaRPump.CARBS, now, 5, 0)
|
||||||
testparams = historyTest.requestParams
|
testparams = historyTest.requestParams
|
||||||
Assert.assertEquals(5.toByte(), testparams[8])
|
Assert.assertEquals(5.toByte(), testparams[8])
|
||||||
Assert.assertEquals(11, testparams.size)
|
Assert.assertEquals(11, testparams.size)
|
||||||
Assert.assertEquals(DanaRPump.CARBS.toByte(), testparams[0])
|
Assert.assertEquals(info.nightscout.androidaps.dana.DanaRPump.CARBS.toByte(), testparams[0])
|
||||||
// test message decoding
|
// test message decoding
|
||||||
historyTest.handleMessage(byteArrayOf(0.toByte(), 0.toByte(), 0.toByte()))
|
historyTest.handleMessage(byteArrayOf(0.toByte(), 0.toByte(), 0.toByte()))
|
||||||
Assert.assertEquals(false, historyTest.failed)
|
Assert.assertEquals(false, historyTest.failed)
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,11 +1,10 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
|
||||||
import org.powermock.modules.junit4.PowerMockRunner
|
import org.powermock.modules.junit4.PowerMockRunner
|
||||||
|
|
||||||
@RunWith(PowerMockRunner::class)
|
@RunWith(PowerMockRunner::class)
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,8 +1,8 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
import info.nightscout.androidaps.dana.DanaRPump
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
@ -27,7 +27,7 @@ class DanaRS_Packet_Bolus_Get_CIR_CF_ArrayTest : DanaRSTestBase() {
|
||||||
// test message decoding
|
// test message decoding
|
||||||
packet.handleMessage(createArray(34, 0.toByte()))
|
packet.handleMessage(createArray(34, 0.toByte()))
|
||||||
// are pump units MG/DL ???
|
// are pump units MG/DL ???
|
||||||
Assert.assertEquals(DanaRPump.UNITS_MGDL, danaRPump.units)
|
Assert.assertEquals(info.nightscout.androidaps.dana.DanaRPump.UNITS_MGDL, danaRPump.units)
|
||||||
Assert.assertEquals(false, packet.failed)
|
Assert.assertEquals(false, packet.failed)
|
||||||
packet.handleMessage(createArray(34, 3.toByte()))
|
packet.handleMessage(createArray(34, 3.toByte()))
|
||||||
Assert.assertEquals(true, packet.failed)
|
Assert.assertEquals(true, packet.failed)
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
|
@ -1,13 +1,14 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
|
import info.nightscout.androidaps.Config
|
||||||
|
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
||||||
import info.nightscout.androidaps.interfaces.Constraint
|
import info.nightscout.androidaps.interfaces.Constraint
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
@ -54,7 +55,7 @@ class DanaRS_Packet_Bolus_Set_Step_Bolus_StartTest : DanaRSTestBase() {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun mock() {
|
fun mock() {
|
||||||
danaRSPlugin = DanaRSPlugin(HasAndroidInjector { AndroidInjector { Unit } }, aapsLogger, rxBus, context, resourceHelper, constraintChecker, profileFunction, treatmentsPlugin, sp, commandQueue, danaRPump, detailedBolusInfoStorage, fabricPrivacy, dateUtil)
|
danaRSPlugin = DanaRSPlugin(HasAndroidInjector { AndroidInjector { Unit } }, aapsLogger, rxBus, context, resourceHelper, constraintChecker, profileFunction, activePluginProvider, sp, commandQueue, danaRPump, detailedBolusInfoStorage, fabricPrivacy, dateUtil, Config())
|
||||||
Mockito.`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
Mockito.`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
||||||
}
|
}
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue