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')
|
||||
|
||||
implementation project(':core')
|
||||
implementation project(':dana')
|
||||
implementation project(':danars')
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
<activity
|
||||
android:name=".activities.ErrorHelperActivity"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" />
|
||||
<activity android:name=".plugins.pump.danaR.activities.DanaRHistoryActivity" />
|
||||
<activity android:name=".plugins.pump.danaR.activities.DanaRUserOptionsActivity" />
|
||||
<activity android:name="info.nightscout.androidaps.dana.activities.DanaRHistoryActivity" />
|
||||
<activity android:name="info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity" />
|
||||
<activity android:name=".activities.TDDStatsActivity" />
|
||||
<activity android:name=".plugins.general.overview.activities.QuickWizardListActivity">
|
||||
<intent-filter>
|
||||
|
@ -74,7 +74,7 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".plugins.pump.danaRS.activities.BLEScanActivity">
|
||||
<activity android:name="info.nightscout.androidaps.danars.activities.BLEScanActivity">
|
||||
<intent-filter>
|
||||
<action android:name="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity" />
|
||||
|
||||
|
@ -82,9 +82,9 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".plugins.pump.danaRS.activities.PairingHelperActivity"
|
||||
android:name="info.nightscout.androidaps.danars.activities.PairingHelperActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity android:name=".plugins.pump.danaRS.activities.EnterPinActivity"
|
||||
<activity android:name="info.nightscout.androidaps.danars.activities.EnterPinActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity android:name=".plugins.general.maintenance.activities.PrefImportListActivity" />
|
||||
<activity android:name=".historyBrowser.HistoryBrowseActivity" />
|
||||
|
@ -166,7 +166,7 @@
|
|||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
<service
|
||||
android:name=".plugins.pump.danaRS.services.DanaRSService"
|
||||
android:name="info.nightscout.androidaps.danars.services.DanaRSService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<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.danaR.DanaRPlugin
|
||||
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.insight.LocalInsightPlugin
|
||||
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.MainApp;
|
||||
import info.nightscout.androidaps.dana.comm.RecordTypes;
|
||||
import info.nightscout.androidaps.data.NonOverlappingIntervals;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
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.general.nsclient.NSUpload;
|
||||
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.InsightHistoryOffset;
|
||||
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.pump.common.dialog.RileyLinkBLEScanActivity
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRHistoryActivity
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRUserOptionsActivity
|
||||
import info.nightscout.androidaps.plugins.pump.danaRS.activities.EnterPinActivity
|
||||
import info.nightscout.androidaps.dana.activities.DanaRHistoryActivity
|
||||
import info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity
|
||||
import info.nightscout.androidaps.danars.activities.EnterPinActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
|
||||
|
@ -26,8 +26,8 @@ import info.nightscout.androidaps.setupwizard.SetupWizardActivity
|
|||
abstract class ActivitiesModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributeBolusProgressHelperActivity(): BolusProgressHelperActivity
|
||||
@ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): DanaRHistoryActivity
|
||||
@ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): DanaRUserOptionsActivity
|
||||
@ContributesAndroidInjector abstract fun contributeDanaRHistoryActivity(): info.nightscout.androidaps.dana.activities.DanaRHistoryActivity
|
||||
@ContributesAndroidInjector abstract fun contributeDanaRUserOptionsActivity(): info.nightscout.androidaps.dana.activities.DanaRUserOptionsActivity
|
||||
@ContributesAndroidInjector abstract fun contributeEnterPinActivity(): EnterPinActivity
|
||||
@ContributesAndroidInjector abstract fun contributeErrorHelperActivity(): ErrorHelperActivity
|
||||
@ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity
|
||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.dependencyInjection
|
|||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.danaRS.comm.*
|
||||
import info.nightscout.androidaps.danars.comm.*
|
||||
|
||||
@Module
|
||||
@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.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRFragment
|
||||
import info.nightscout.androidaps.plugins.pump.danaRS.dialogs.PairingProgressDialog
|
||||
import info.nightscout.androidaps.dana.DanaRFragment
|
||||
import info.nightscout.androidaps.danars.dialogs.PairingProgressDialog
|
||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
|
||||
|
@ -61,7 +61,7 @@ abstract class FragmentsModule {
|
|||
@ContributesAndroidInjector
|
||||
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 contributesInsulinFragment(): InsulinFragment
|
||||
@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.danaR.DanaRPlugin
|
||||
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.insight.LocalInsightPlugin
|
||||
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.DanaRExecutionService
|
||||
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.insight.InsightAlertService
|
||||
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.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
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.danaRS.DanaRSPlugin
|
||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||
import info.nightscout.androidaps.plugins.treatments.CarbsGenerator
|
||||
|
@ -65,7 +65,7 @@ class ActionStringHandler @Inject constructor(
|
|||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
private val danaRv2Plugin: DanaRv2Plugin,
|
||||
private val danaRSPlugin: DanaRSPlugin,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val hardLimits: HardLimits,
|
||||
private val carbsGenerator: CarbsGenerator,
|
||||
private val dateUtil: DateUtil,
|
||||
|
|
|
@ -9,8 +9,11 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.BuildConfig;
|
||||
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.PumpEnactResult;
|
||||
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.EventNewNotification;
|
||||
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.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
|
@ -52,7 +54,7 @@ import io.reactivex.schedulers.Schedulers;
|
|||
* 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 CompositeDisposable disposable = new CompositeDisposable();
|
||||
|
@ -521,4 +523,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
|
|||
@Override
|
||||
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
|
||||
}
|
||||
|
||||
@Override public void clearPairing() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.dana.DanaRPump;
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import info.nightscout.androidaps.dana.DanaRPump;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
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.general.nsclient.NSUpload
|
||||
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.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -23,7 +23,7 @@ class MessageHashTableR @Inject constructor(
|
|||
rxBus: RxBusWrapper,
|
||||
resourceHelper: ResourceHelper,
|
||||
constraintChecker: ConstraintChecker,
|
||||
danaRPump: DanaRPump,
|
||||
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
danaRPlugin: DanaRPlugin,
|
||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
configBuilderPlugin: ConfigBuilderPlugin,
|
||||
|
|
|
@ -5,7 +5,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
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 kotlin.math.min
|
||||
|
||||
|
@ -13,7 +13,7 @@ class MsgBolusProgress(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -4,12 +4,12 @@ import info.nightscout.androidaps.interfaces.Constraint
|
|||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgBolusStart(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
constraintChecker: ConstraintChecker,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private var amount: Double
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import info.nightscout.androidaps.interfaces.Constraint
|
|||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgBolusStartWithSpeed(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
constraintChecker: ConstraintChecker,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private var amount: Double,
|
||||
speed: Int
|
||||
) : MessageBase() {
|
||||
|
|
|
@ -5,14 +5,14 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
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
|
||||
|
||||
class MsgBolusStop(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgCheckValue(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRPlugin: DanaRPlugin
|
||||
) : MessageBase() {
|
||||
|
||||
|
@ -22,7 +22,7 @@ class MsgCheckValue(
|
|||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||
danaRPump.protocol = intFromBuff(bytes, 1, 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")
|
||||
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.general.nsclient.NSUpload
|
||||
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
|
||||
|
||||
class MsgError(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val nsUpload: NSUpload
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ open class MsgHistoryAll(
|
|||
danaRHistoryRecord.setBytes(bytes)
|
||||
var messageType = ""
|
||||
when (recordCode) {
|
||||
RecordTypes.RECORD_TYPE_BOLUS -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BOLUS -> {
|
||||
danaRHistoryRecord.recordDate = datetime
|
||||
when (0xF0 and paramByte8.toInt()) {
|
||||
0xA0 -> {
|
||||
|
@ -65,56 +65,56 @@ open class MsgHistoryAll(
|
|||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_DAILY -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY -> {
|
||||
messageType += "dailyinsulin"
|
||||
danaRHistoryRecord.recordDate = date
|
||||
danaRHistoryRecord.recordDailyBasal = dailyBasal
|
||||
danaRHistoryRecord.recordDailyBolus = dailyBolus
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_PRIME -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_PRIME -> {
|
||||
messageType += "prime"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_ERROR -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_ERROR -> {
|
||||
messageType += "error"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_REFILL -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_REFILL -> {
|
||||
messageType += "refill"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_BASALHOUR -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BASALHOUR -> {
|
||||
messageType += "basal hour"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_TB -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_TB -> {
|
||||
messageType += "tb"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_GLUCOSE -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_GLUCOSE -> {
|
||||
messageType += "glucose"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_CARBO -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_CARBO -> {
|
||||
messageType += "carbo"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
danaRHistoryRecord.recordValue = value
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_ALARM -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_ALARM -> {
|
||||
messageType += "alarm"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
var strAlarm = "None"
|
||||
|
@ -128,7 +128,7 @@ open class MsgHistoryAll(
|
|||
danaRHistoryRecord.recordValue = value * 0.01
|
||||
}
|
||||
|
||||
RecordTypes.RECORD_TYPE_SUSPEND -> {
|
||||
info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_SUSPEND -> {
|
||||
messageType += "suspend"
|
||||
danaRHistoryRecord.recordDate = datetimewihtsec
|
||||
var strRecordValue = "Off"
|
||||
|
@ -136,7 +136,7 @@ open class MsgHistoryAll(
|
|||
danaRHistoryRecord.stringRecordValue = strRecordValue
|
||||
}
|
||||
|
||||
17.toByte() -> failed = true
|
||||
17.toByte() -> failed = true
|
||||
}
|
||||
MainApp.getDbHelper().createOrUpdate(danaRHistoryRecord)
|
||||
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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgHistoryAllDone(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgHistoryDone(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgHistoryNewDone(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgInitConnStatusBasic(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
@ -33,10 +33,10 @@ class MsgInitConnStatusBasic(
|
|||
val extendedBolusRate = intFromBuff(bytes, 18, 2) / 100.0
|
||||
danaRPump.batteryRemaining = intFromBuff(bytes, 20, 1)
|
||||
val bolusConfig = intFromBuff(bytes, 21, 1)
|
||||
val deliveryPrime = bolusConfig and DanaRPump.DELIVERY_PRIME != 0
|
||||
val deliveryStepBolus = bolusConfig and DanaRPump.DELIVERY_STEP_BOLUS != 0
|
||||
val deliveryBasal = bolusConfig and DanaRPump.DELIVERY_BASAL != 0
|
||||
val deliveryExtBolus = bolusConfig and DanaRPump.DELIVERY_EXT_BOLUS != 0
|
||||
val deliveryPrime = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_PRIME != 0
|
||||
val deliveryStepBolus = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_STEP_BOLUS != 0
|
||||
val deliveryBasal = bolusConfig and info.nightscout.androidaps.dana.DanaRPump.DELIVERY_BASAL != 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 step bolus: $deliveryStepBolus")
|
||||
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.EventNewNotification
|
||||
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
|
||||
|
||||
class MsgInitConnStatusBolus(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
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.EventNewNotification
|
||||
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
|
||||
|
||||
class MsgInitConnStatusOption(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val activePlugin: ActivePluginProvider
|
||||
) : 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.notifications.Notification
|
||||
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.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -20,7 +20,7 @@ class MsgInitConnStatusTime(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRPlugin: DanaRPlugin,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
private val configBuilderPlugin: ConfigBuilderPlugin,
|
||||
|
|
|
@ -15,7 +15,7 @@ class MsgSetCarbsEntry(
|
|||
aapsLogger.debug(LTag.PUMPBTCOMM, "New message")
|
||||
val calendar = Calendar.getInstance()
|
||||
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.MONTH] + 1).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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSetUserOptions(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
danaRPump: DanaRPump
|
||||
danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSettingActiveProfile(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
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.*
|
||||
|
||||
class MsgSettingBasal(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRPlugin: DanaRPlugin
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,7 @@ import java.util.*
|
|||
*/
|
||||
class MsgSettingBasalProfileAll(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
/**
|
||||
* Created by mike on 05.07.2016.
|
||||
*/
|
||||
class MsgSettingGlucose(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
@ -20,7 +20,7 @@ class MsgSettingGlucose(
|
|||
override fun handleMessage(bytes: ByteArray) {
|
||||
danaRPump.units = intFromBuff(bytes, 0, 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)
|
||||
}
|
||||
}
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSettingMaxValues(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
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.EventNewNotification
|
||||
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.utils.resources.ResourceHelper
|
||||
|
||||
|
@ -16,7 +16,7 @@ class MsgSettingMeal(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSettingProfileRatios(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
@ -15,7 +15,7 @@ class MsgSettingProfileRatios(
|
|||
}
|
||||
|
||||
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.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
||||
|
@ -28,7 +28,7 @@ class MsgSettingProfileRatios(
|
|||
danaRPump.currentTarget = intFromBuff(bytes, 6, 2) / 100.0
|
||||
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 CF: " + danaRPump.currentCF)
|
||||
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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSettingProfileRatiosAll(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
@ -15,7 +15,7 @@ class MsgSettingProfileRatiosAll(
|
|||
}
|
||||
|
||||
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.morningCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||
danaRPump.afternoonCIR = intFromBuff(bytes, 4, 2)
|
||||
|
@ -34,7 +34,7 @@ class MsgSettingProfileRatiosAll(
|
|||
danaRPump.nightCIR = intFromBuff(bytes, 12, 2)
|
||||
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 CF: " + danaRPump.morningCF)
|
||||
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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import org.joda.time.DateTime
|
||||
import java.util.*
|
||||
|
||||
class MsgSettingPumpTime(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val dateUtil: DateUtil
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgSettingShippingInfo(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import java.util.*
|
||||
|
||||
class MsgSettingUserOptions(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgStatus(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgStatusBasic(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -6,14 +6,14 @@ import info.nightscout.androidaps.db.Source
|
|||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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 kotlin.math.ceil
|
||||
|
||||
class MsgStatusBolusExtended(
|
||||
private val injector: HasAndroidInjector,
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val activePlugin: ActivePluginProvider,
|
||||
private val dateUtil: DateUtil
|
||||
) : MessageBase() {
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
|
||||
class MsgStatusProfile(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
@ -15,7 +15,7 @@ class MsgStatusProfile(
|
|||
}
|
||||
|
||||
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.currentCF = intFromBuff(bytes, 2, 2).toDouble()
|
||||
danaRPump.currentAI = intFromBuff(bytes, 4, 2) / 100.0
|
||||
|
@ -26,7 +26,7 @@ class MsgStatusProfile(
|
|||
danaRPump.currentAI = intFromBuff(bytes, 4, 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 CF: " + danaRPump.currentCF)
|
||||
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.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import kotlin.math.ceil
|
||||
|
||||
class MsgStatusTempBasal(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val activePlugin: ActivePluginProvider,
|
||||
private val injector: HasAndroidInjector
|
||||
) : MessageBase() {
|
||||
|
|
|
@ -17,6 +17,8 @@ import javax.inject.Inject;
|
|||
import dagger.android.DaggerService;
|
||||
import dagger.android.HasAndroidInjector;
|
||||
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.PumpEnactResult;
|
||||
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.LTag;
|
||||
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.MsgBolusStop;
|
||||
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.MsgPCCommStart;
|
||||
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.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.danaR.services;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.SystemClock;
|
||||
|
||||
|
@ -12,6 +11,8 @@ import javax.inject.Inject;
|
|||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
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.PumpEnactResult;
|
||||
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.LTag;
|
||||
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.general.nsclient.NSUpload;
|
||||
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.notifications.Notification;
|
||||
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.comm.MessageBase;
|
||||
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.MsgStatusBolusExtended;
|
||||
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.queue.Callback;
|
||||
import info.nightscout.androidaps.queue.commands.Command;
|
||||
|
@ -77,9 +75,7 @@ public class DanaRExecutionService extends AbstractDanaRExecutionService {
|
|||
@Inject DanaRPump danaRPump;
|
||||
@Inject DanaRPlugin danaRPlugin;
|
||||
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
||||
@Inject ConfigBuilderPlugin configBuilderPlugin;
|
||||
@Inject CommandQueueProvider commandQueue;
|
||||
@Inject Context context;
|
||||
@Inject MessageHashTableR messageHashTableR;
|
||||
@Inject ActivePluginProvider activePlugin;
|
||||
@Inject ProfileFunction profileFunction;
|
||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.dana.DanaRPump;
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
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.pump.common.defs.PumpType;
|
||||
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.db.Treatment;
|
||||
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.general.nsclient.NSUpload
|
||||
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.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
|
@ -24,7 +24,7 @@ class MessageHashTableRKorean @Inject constructor(
|
|||
rxBus: RxBusWrapper,
|
||||
resourceHelper: ResourceHelper,
|
||||
constraintChecker: ConstraintChecker,
|
||||
danaRPump: DanaRPump,
|
||||
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
danaRPlugin: DanaRPlugin,
|
||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
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.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.danaRKorean.DanaRKoreanPlugin
|
||||
|
||||
class MsgCheckValue_k(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||
|
||||
) : MessageBase() {
|
||||
|
@ -24,7 +24,7 @@ class MsgCheckValue_k(
|
|||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||
danaRPump.protocol = intFromBuff(bytes, 1, 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")
|
||||
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.EventNewNotification
|
||||
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.utils.resources.ResourceHelper
|
||||
|
||||
|
@ -15,7 +15,7 @@ class MsgInitConnStatusBasic_k(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
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.EventNewNotification
|
||||
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.utils.resources.ResourceHelper
|
||||
|
||||
|
@ -16,7 +16,7 @@ class MsgInitConnStatusBolus_k(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val activePlugin: ActivePluginProvider
|
||||
) : 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.notifications.Notification
|
||||
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.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
|
@ -21,7 +21,7 @@ class MsgInitConnStatusTime_k(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRPlugin: DanaRPlugin,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
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.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 java.util.*
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.*
|
|||
*/
|
||||
class MsgSettingBasalProfileAll_k(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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.danaRKorean.DanaRKoreanPlugin
|
||||
import java.util.*
|
||||
|
||||
class MsgSettingBasal_k(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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
|
||||
|
||||
class MsgStatusBasic_k(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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
|
||||
|
||||
class MsgStatus_k(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.danaRKorean.services;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.SystemClock;
|
||||
|
||||
|
@ -11,25 +10,26 @@ import javax.inject.Inject;
|
|||
|
||||
import info.nightscout.androidaps.Constants;
|
||||
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.PumpEnactResult;
|
||||
import info.nightscout.androidaps.db.Treatment;
|
||||
import info.nightscout.androidaps.dialogs.BolusProgressDialog;
|
||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||
import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
|
||||
import info.nightscout.androidaps.events.EventPumpStatusChanged;
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
|
||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
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.interfaces.ProfileFunction;
|
||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||
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.comm.MsgBolusStart;
|
||||
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.MsgStatusBolusExtended;
|
||||
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.danaRKorean.DanaRKoreanPlugin;
|
||||
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.MsgSettingBasal_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.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.T;
|
||||
|
@ -69,9 +67,7 @@ public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService {
|
|||
@Inject DanaRPump danaRPump;
|
||||
@Inject DanaRPlugin danaRPlugin;
|
||||
@Inject DanaRKoreanPlugin danaRKoreanPlugin;
|
||||
@Inject ConfigBuilderPlugin configBuilderPlugin;
|
||||
@Inject CommandQueueProvider commandQueue;
|
||||
@Inject Context context;
|
||||
@Inject MessageHashTableRKorean messageHashTableRKorean;
|
||||
@Inject ActivePluginProvider activePlugin;
|
||||
@Inject ProfileFunction profileFunction;
|
||||
|
|
|
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.dana.DanaRPump;
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
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.defs.PumpType;
|
||||
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.db.Treatment;
|
||||
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.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||
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.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||
|
@ -27,7 +27,7 @@ class MessageHashTableRv2 @Inject constructor(
|
|||
rxBus: RxBusWrapper,
|
||||
resourceHelper: ResourceHelper,
|
||||
constraintChecker: ConstraintChecker,
|
||||
danaRPump: DanaRPump,
|
||||
danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
danaRPlugin: DanaRPlugin,
|
||||
danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
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.notifications.Notification
|
||||
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.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin
|
||||
|
@ -21,7 +21,7 @@ class MsgCheckValue_v2(
|
|||
private val aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val resourceHelper: ResourceHelper,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val danaRPlugin: DanaRPlugin,
|
||||
private val danaRKoreanPlugin: DanaRKoreanPlugin,
|
||||
private val danaRv2Plugin: DanaRv2Plugin,
|
||||
|
@ -41,7 +41,7 @@ class MsgCheckValue_v2(
|
|||
danaRPump.hwModel = intFromBuff(bytes, 0, 1)
|
||||
danaRPump.protocol = intFromBuff(bytes, 1, 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()
|
||||
val notification = Notification(Notification.WRONG_DRIVER, resourceHelper.gs(R.string.pumpdrivercorrected), Notification.NORMAL)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
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.danaRv2.DanaRv2Plugin
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
|
||||
|
@ -74,7 +74,7 @@ class MsgHistoryEvents_v2 constructor(
|
|||
.pumpId(datetime)
|
||||
val status: String
|
||||
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")
|
||||
temporaryBasal.percentRate = param1
|
||||
temporaryBasal.durationInMinutes = param2
|
||||
|
@ -82,13 +82,13 @@ class MsgHistoryEvents_v2 constructor(
|
|||
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
||||
}
|
||||
|
||||
DanaRPump.TEMPSTOP -> {
|
||||
info.nightscout.androidaps.dana.DanaRPump.TEMPSTOP -> {
|
||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
|
||||
treatmentsPlugin.addToHistoryTempBasal(temporaryBasal)
|
||||
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")
|
||||
extendedBolus.insulin = param1 / 100.0
|
||||
extendedBolus.durationInMinutes = param2
|
||||
|
@ -96,13 +96,13 @@ class MsgHistoryEvents_v2 constructor(
|
|||
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")
|
||||
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
||||
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||
}
|
||||
|
||||
DanaRPump.BOLUS -> {
|
||||
info.nightscout.androidaps.dana.DanaRPump.BOLUS -> {
|
||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||
?: DetailedBolusInfo()
|
||||
detailedBolusInfo.date = datetime
|
||||
|
@ -114,7 +114,7 @@ class MsgHistoryEvents_v2 constructor(
|
|||
status = "BOLUS " + dateUtil.timeString(datetime)
|
||||
}
|
||||
|
||||
DanaRPump.DUALBOLUS -> {
|
||||
info.nightscout.androidaps.dana.DanaRPump.DUALBOLUS -> {
|
||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||
?: DetailedBolusInfo()
|
||||
detailedBolusInfo.date = datetime
|
||||
|
@ -126,7 +126,7 @@ class MsgHistoryEvents_v2 constructor(
|
|||
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")
|
||||
extendedBolus.insulin = param1 / 100.0
|
||||
extendedBolus.durationInMinutes = param2
|
||||
|
@ -134,38 +134,38 @@ class MsgHistoryEvents_v2 constructor(
|
|||
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")
|
||||
treatmentsPlugin.addToHistoryExtendedBolus(extendedBolus)
|
||||
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||
}
|
||||
|
||||
DanaRPump.SUSPENDON -> {
|
||||
info.nightscout.androidaps.dana.DanaRPump.SUSPENDON -> {
|
||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + 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 + ")")
|
||||
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")
|
||||
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")
|
||||
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")
|
||||
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
||||
}
|
||||
|
||||
DanaRPump.CARBS -> {
|
||||
info.nightscout.androidaps.dana.DanaRPump.CARBS -> {
|
||||
val emptyCarbsInfo = DetailedBolusInfo()
|
||||
emptyCarbsInfo.carbs = param1.toDouble()
|
||||
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.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.MessageBase
|
||||
|
||||
class MsgStatusAPS_v2(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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 kotlin.math.ceil
|
||||
|
||||
class MsgStatusBolusExtended_v2(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump
|
||||
) : MessageBase() {
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm
|
|||
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
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.utils.DateUtil
|
||||
import kotlin.math.ceil
|
||||
|
||||
class MsgStatusTempBasal_v2(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val danaRPump: DanaRPump,
|
||||
private val danaRPump: info.nightscout.androidaps.dana.DanaRPump,
|
||||
private val dateUtil: DateUtil
|
||||
) : MessageBase() {
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ import dagger.android.HasAndroidInjector;
|
|||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.R;
|
||||
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.PumpEnactResult;
|
||||
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.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
||||
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.comm.MessageBase;
|
||||
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.MsgStatus;
|
||||
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.danaRKorean.DanaRKoreanPlugin;
|
||||
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.HasAndroidInjector
|
||||
|
@ -6,8 +6,8 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
|||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.plugins.pump.danaRS.encryption.BleEncryption
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
@ -47,7 +47,7 @@ class DanaRSMessageHashTableTest : DanaRSTestBase() {
|
|||
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
||||
|
||||
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)
|
||||
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.HasAndroidInjector
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
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 org.junit.Before
|
||||
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 {
|
||||
val ret = ByteArray(length)
|
||||
|
@ -55,6 +55,6 @@ open class DanaRSTestBase : TestBaseWithProfile() {
|
|||
|
||||
@Before
|
||||
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.HasAndroidInjector
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
||||
package info.nightscout.androidaps.danars.comm
|
||||
|
||||
import android.content.Context
|
||||
import dagger.android.AndroidInjector
|
||||
|
@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
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 org.junit.Assert
|
||||
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.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
@ -27,23 +27,23 @@ class DanaRS_Packet_APS_Set_Event_HistoryTest : DanaRSTestBase() {
|
|||
|
||||
@Test fun runTest() { // test for negative carbs
|
||||
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
|
||||
Assert.assertEquals(0.toByte(), testparams[8])
|
||||
// 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
|
||||
Assert.assertEquals(5.toByte(), testparams[8])
|
||||
// 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
|
||||
Assert.assertEquals(150.toByte(), testparams[8])
|
||||
// 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
|
||||
Assert.assertEquals(5.toByte(), testparams[8])
|
||||
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
|
||||
historyTest.handleMessage(byteArrayOf(0.toByte(), 0.toByte(), 0.toByte()))
|
||||
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.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.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.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.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.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.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.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.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.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.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.HasAndroidInjector
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@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.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.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump
|
||||
import info.nightscout.androidaps.dana.DanaRPump
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
@ -27,7 +27,7 @@ class DanaRS_Packet_Bolus_Get_CIR_CF_ArrayTest : DanaRSTestBase() {
|
|||
// test message decoding
|
||||
packet.handleMessage(createArray(34, 0.toByte()))
|
||||
// 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)
|
||||
packet.handleMessage(createArray(34, 3.toByte()))
|
||||
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.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.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.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.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.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.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.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.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.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.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.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.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.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.HasAndroidInjector
|
|
@ -1,13 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.pump.danaRS.comm
|
||||
package info.nightscout.androidaps.danars.comm
|
||||
|
||||
import android.content.Context
|
||||
import dagger.android.AndroidInjector
|
||||
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.Constraint
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
@ -54,7 +55,7 @@ class DanaRS_Packet_Bolus_Set_Step_Bolus_StartTest : DanaRSTestBase() {
|
|||
|
||||
@Before
|
||||
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))
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue