Merge branch 'dev' into mdt_new_fix_2

This commit is contained in:
Andy Rozman 2021-06-26 21:50:00 +01:00
commit 3288eb2966
229 changed files with 17694 additions and 199 deletions

View file

@ -6,6 +6,7 @@
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" /> <option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" /> <option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" />
<option name="BLANK_LINES_AROUND_BLOCK_WHEN_BRANCHES" value="1" /> <option name="BLANK_LINES_AROUND_BLOCK_WHEN_BRANCHES" value="1" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings> </JetCodeStyleSettings>
<codeStyleSettings language="JAVA"> <codeStyleSettings language="JAVA">
<option name="METHOD_ANNOTATION_WRAP" value="0" /> <option name="METHOD_ANNOTATION_WRAP" value="0" />
@ -124,6 +125,7 @@
</arrangement> </arrangement>
</codeStyleSettings> </codeStyleSettings>
<codeStyleSettings language="kotlin"> <codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" /> <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="LINE_COMMENT_ADD_SPACE" value="true" /> <option name="LINE_COMMENT_ADD_SPACE" value="true" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" /> <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />

View file

@ -111,7 +111,7 @@ android {
defaultConfig { defaultConfig {
multiDexEnabled true multiDexEnabled true
versionCode 1500 versionCode 1500
version "2.8.2.1-dev-e5" version "2.8.2.2-dev"
buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'
@ -192,6 +192,7 @@ dependencies {
implementation project(':omnipod-common') implementation project(':omnipod-common')
implementation project(':omnipod-eros') implementation project(':omnipod-eros')
implementation project(':omnipod-dash') implementation project(':omnipod-dash')
implementation project(':diaconn')
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')

View file

@ -14,6 +14,7 @@ import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin
import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danaRv2.DanaRv2Plugin
import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.DanaRPlugin
import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSPlugin
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.events.EventRebuildTabs import info.nightscout.androidaps.events.EventRebuildTabs
@ -99,6 +100,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
@Inject lateinit var passwordCheck: PasswordCheck @Inject lateinit var passwordCheck: PasswordCheck
@Inject lateinit var nsSettingStatus: NSSettingsStatus @Inject lateinit var nsSettingStatus: NSSettingsStatus
@Inject lateinit var openHumansUploader: OpenHumansUploader @Inject lateinit var openHumansUploader: OpenHumansUploader
@Inject lateinit var diaconnG8Plugin: DiaconnG8Plugin
override fun onAttach(context: Context) { override fun onAttach(context: Context) {
AndroidSupportInjection.inject(this) AndroidSupportInjection.inject(this)
@ -173,6 +175,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
addPreferencesFromResourceIfEnabled(localInsightPlugin, rootKey, config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(localInsightPlugin, rootKey, config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(comboPlugin, rootKey, config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(comboPlugin, rootKey, config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(medtronicPumpPlugin, rootKey, config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(medtronicPumpPlugin, rootKey, config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(diaconnG8Plugin, rootKey, config.PUMPDRIVERS)
addPreferencesFromResource(R.xml.pref_pump, rootKey, config.PUMPDRIVERS) addPreferencesFromResource(R.xml.pref_pump, rootKey, config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(virtualPumpPlugin, rootKey) addPreferencesFromResourceIfEnabled(virtualPumpPlugin, rootKey)
addPreferencesFromResourceIfEnabled(insulinOrefFreePeakPlugin, rootKey) addPreferencesFromResourceIfEnabled(insulinOrefFreePeakPlugin, rootKey)

View file

@ -13,6 +13,7 @@ import info.nightscout.androidaps.danar.di.DanaRModule
import info.nightscout.androidaps.danars.di.DanaRSModule import info.nightscout.androidaps.danars.di.DanaRSModule
import info.nightscout.androidaps.database.DatabaseModule import info.nightscout.androidaps.database.DatabaseModule
import info.nightscout.androidaps.di.CoreModule import info.nightscout.androidaps.di.CoreModule
import info.nightscout.androidaps.diaconn.di.DiaconnG8Module
import info.nightscout.androidaps.insight.di.InsightDatabaseModule import info.nightscout.androidaps.insight.di.InsightDatabaseModule
import info.nightscout.androidaps.insight.di.InsightModule import info.nightscout.androidaps.insight.di.InsightModule
import info.nightscout.androidaps.plugins.pump.common.di.PumpCommonModule import info.nightscout.androidaps.plugins.pump.common.di.PumpCommonModule
@ -56,7 +57,8 @@ import javax.inject.Singleton
InsightModule::class, InsightModule::class,
InsightDatabaseModule::class, InsightDatabaseModule::class,
WorkersModule::class, WorkersModule::class,
OHUploaderModule::class OHUploaderModule::class,
DiaconnG8Module::class
] ]
) )
interface AppComponent : AndroidInjector<MainApp> { interface AppComponent : AndroidInjector<MainApp> {

View file

@ -8,6 +8,7 @@ import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin
import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danaRv2.DanaRv2Plugin
import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.DanaRPlugin
import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSPlugin
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
@ -158,6 +159,12 @@ abstract class PluginsModule {
// @IntKey(155) // @IntKey(155)
// abstract fun bindOmnipodPumpPlugin(plugin: OmnipodErosPumpPlugin): PluginBase // abstract fun bindOmnipodPumpPlugin(plugin: OmnipodErosPumpPlugin): PluginBase
@Binds
@PumpDriver
@IntoMap
@IntKey(155)
abstract fun bindDiaconnG8Plugin(plugin: DiaconnG8Plugin): PluginBase
@Binds @Binds
@NotNSClient @NotNSClient
@IntoMap @IntoMap

View file

@ -191,7 +191,7 @@ class FillDialog : DialogFragmentWithDate() {
commandQueue.bolus(detailedBolusInfo, object : Callback() { commandQueue.bolus(detailedBolusInfo, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -224,7 +224,7 @@ class InsulinDialog : DialogFragmentWithDate() {
commandQueue.bolus(detailedBolusInfo, object : Callback() { commandQueue.bolus(detailedBolusInfo, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -324,7 +324,7 @@ class LoopDialog : DaggerDialogFragment() {
commandQueue.cancelTempBasal(true, object : Callback() { commandQueue.cancelTempBasal(true, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -119,7 +119,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
val callback: Callback = object : Callback() { val callback: Callback = object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
} }
} }
} }

View file

@ -174,7 +174,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
commandQueue.bolus(detailedBolusInfo, object : Callback() { commandQueue.bolus(detailedBolusInfo, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -631,7 +631,7 @@ open class LoopPlugin @Inject constructor(
commandQueue.tempBasalAbsolute(0.0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() { commandQueue.tempBasalAbsolute(0.0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
} }
} }
}) })
@ -639,7 +639,7 @@ open class LoopPlugin @Inject constructor(
commandQueue.tempBasalPercent(0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() { commandQueue.tempBasalPercent(0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
} }
} }
}) })
@ -648,7 +648,7 @@ open class LoopPlugin @Inject constructor(
commandQueue.cancelExtended(object : Callback() { commandQueue.cancelExtended(object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.extendedbolusdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.extendedbolusdeliveryerror), R.raw.boluserror)
} }
} }
}) })
@ -666,7 +666,7 @@ open class LoopPlugin @Inject constructor(
commandQueue.cancelTempBasal(true, object : Callback() { commandQueue.cancelTempBasal(true, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -67,14 +67,15 @@ class ProfileFunctionImplementation @Inject constructor(
override fun getProfile(): Profile? = override fun getProfile(): Profile? =
getProfile(dateUtil.now()) getProfile(dateUtil.now())
@Synchronized
override fun getProfile(time: Long): Profile? { override fun getProfile(time: Long): Profile? {
val rounded = time - time % 1000 val rounded = time - time % 1000
val cached = cache[rounded] val cached = cache[rounded]
if (cached != null) { if (cached != null) {
// aapsLogger.debug("XXXXXXXXXXXXXXX HIT getProfile for $time $rounded") // aapsLogger.debug("HIT getProfile for $time $rounded")
return cached return cached
} }
// aapsLogger.debug("XXXXXXXXXXXXXXX getProfile called for $time") // aapsLogger.debug("getProfile called for $time")
val ps = repository.getEffectiveProfileSwitchActiveAt(time).blockingGet() val ps = repository.getEffectiveProfileSwitchActiveAt(time).blockingGet()
if (ps is ValueWrapper.Existing) { if (ps is ValueWrapper.Existing) {
val sealed = ProfileSealed.EPS(ps.value) val sealed = ProfileSealed.EPS(ps.value)

View file

@ -29,6 +29,7 @@ import info.nightscout.androidaps.extensions.toStringMedium
import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.extensions.toStringShort
import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.activities.HistoryBrowseActivity import info.nightscout.androidaps.activities.HistoryBrowseActivity
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Config
@ -304,7 +305,11 @@ class ActionsFragment : DaggerFragment() {
val activeBgSource = activePlugin.activeBgSource val activeBgSource = activePlugin.activeBgSource
historyBrowser?.visibility = (profile != null).toVisibility() historyBrowser?.visibility = (profile != null).toVisibility()
fill?.visibility = (pump.pumpDescription.isRefillingCapable && pump.isInitialized() && !pump.isSuspended()).toVisibility() fill?.visibility = (pump.pumpDescription.isRefillingCapable && pump.isInitialized() && !pump.isSuspended()).toVisibility()
pumpBatteryChange?.visibility = (pump.pumpDescription.isBatteryReplaceable || (pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel && pump.isBatteryChangeLoggingEnabled)).toVisibility() if(pump is DiaconnG8Plugin) {
pumpBatteryChange?.visibility = (pump.pumpDescription.isBatteryReplaceable && !pump.isBatteryChangeLoggingEnabled()).toVisibility()
} else {
pumpBatteryChange?.visibility = (pump.pumpDescription.isBatteryReplaceable || (pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel && pump.isBatteryChangeLoggingEnabled)).toVisibility()
}
tempTarget?.visibility = (profile != null && config.APS).toVisibility() tempTarget?.visibility = (profile != null && config.APS).toVisibility()
tddStats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility() tddStats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility()

View file

@ -360,10 +360,10 @@ class DataSyncSelectorImplementation @Inject constructor(
when { when {
// without nsId = create new // without nsId = create new
te.first.interfaceIDs.nightscoutId == null -> te.first.interfaceIDs.nightscoutId == null ->
nsClientPlugin.nsClientService?.dbAdd("treatments", te.first.toJson(true), DataSyncSelector.PairTherapyEvent(te.first, te.second), "$startId/$lastDbId") nsClientPlugin.nsClientService?.dbAdd("treatments", te.first.toJson(true, dateUtil), DataSyncSelector.PairTherapyEvent(te.first, te.second), "$startId/$lastDbId")
// nsId = update // nsId = update
te.first.interfaceIDs.nightscoutId != null -> te.first.interfaceIDs.nightscoutId != null ->
nsClientPlugin.nsClientService?.dbUpdate("treatments", te.first.interfaceIDs.nightscoutId, te.first.toJson(false), DataSyncSelector.PairTherapyEvent(te.first, te.second), "$startId/$lastDbId") nsClientPlugin.nsClientService?.dbUpdate("treatments", te.first.interfaceIDs.nightscoutId, te.first.toJson(false, dateUtil), DataSyncSelector.PairTherapyEvent(te.first, te.second), "$startId/$lastDbId")
} }
return true return true
} }

View file

@ -482,7 +482,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
for (pos in extendedBoluses.indices) { for (pos in extendedBoluses.indices) {
val e = extendedBoluses[pos] val e = extendedBoluses[pos]
if (e.timestamp > toTime) continue if (e.timestamp > toTime) continue
if (e.end > now) e.end = now if (e.end > now) e.duration = now - e.timestamp
val profile = profileFunction.getProfile(e.timestamp) ?: return total val profile = profileFunction.getProfile(e.timestamp) ?: return total
val calc = e.iobCalc(toTime, profile, activePlugin.activeInsulin) val calc = e.iobCalc(toTime, profile, activePlugin.activeInsulin)
total.plus(calc) total.plus(calc)
@ -551,7 +551,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
val t = temporaryBasals[pos] val t = temporaryBasals[pos]
if (t.timestamp > toTime) continue if (t.timestamp > toTime) continue
val profile = profileFunction.getProfile(t.timestamp) ?: continue val profile = profileFunction.getProfile(t.timestamp) ?: continue
if (t.end > now) t.end = now if (t.end > now) t.duration = now - t.timestamp
val calc = t.iobCalc(toTime, profile, activePlugin.activeInsulin) val calc = t.iobCalc(toTime, profile, activePlugin.activeInsulin)
//log.debug("BasalIOB " + new Date(time) + " >>> " + calc.basalIob); //log.debug("BasalIOB " + new Date(time) + " >>> " + calc.basalIob);
total.plus(calc) total.plus(calc)
@ -563,7 +563,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
val e = extendedBoluses[pos] val e = extendedBoluses[pos]
if (e.timestamp > toTime) continue if (e.timestamp > toTime) continue
val profile = profileFunction.getProfile(e.timestamp) ?: continue val profile = profileFunction.getProfile(e.timestamp) ?: continue
if (e.end > now) e.end = now if (e.end > now) e.duration = now - e.timestamp
val calc = e.iobCalc(toTime, profile, activePlugin.activeInsulin) val calc = e.iobCalc(toTime, profile, activePlugin.activeInsulin)
totalExt.plus(calc) totalExt.plus(calc)
} }
@ -586,7 +586,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
val t = temporaryBasals[pos] val t = temporaryBasals[pos]
if (t.timestamp > toTime) continue if (t.timestamp > toTime) continue
val profile = profileFunction.getProfile(t.timestamp) ?: continue val profile = profileFunction.getProfile(t.timestamp) ?: continue
if (t.end > now) t.end = now if (t.end > now) t.duration = now - t.timestamp
val calc = t.iobCalc(toTime, profile, lastAutosensResult, exercise_mode, half_basal_exercise_target, isTempTarget, activePlugin.activeInsulin) val calc = t.iobCalc(toTime, profile, lastAutosensResult, exercise_mode, half_basal_exercise_target, isTempTarget, activePlugin.activeInsulin)
//log.debug("BasalIOB " + new Date(time) + " >>> " + calc.basalIob); //log.debug("BasalIOB " + new Date(time) + " >>> " + calc.basalIob);
total.plus(calc) total.plus(calc)
@ -598,7 +598,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
val e = extendedBoluses[pos] val e = extendedBoluses[pos]
if (e.timestamp > toTime) continue if (e.timestamp > toTime) continue
val profile = profileFunction.getProfile(e.timestamp) ?: continue val profile = profileFunction.getProfile(e.timestamp) ?: continue
if (e.end > now) e.end = now if (e.end > now) e.duration = now - e.timestamp
val calc = e.iobCalc(toTime, profile, lastAutosensResult, exercise_mode, half_basal_exercise_target, isTempTarget, activePlugin.activeInsulin) val calc = e.iobCalc(toTime, profile, lastAutosensResult, exercise_mode, half_basal_exercise_target, isTempTarget, activePlugin.activeInsulin)
totalExt.plus(calc) totalExt.plus(calc)
} }

View file

@ -129,7 +129,7 @@ class LocalProfileFragment : DaggerFragment() {
binding.dia.setParams(currentProfile.dia, hardLimits.minDia(), hardLimits.maxDia(), 0.1, DecimalFormat("0.0"), false, binding.save, textWatch) binding.dia.setParams(currentProfile.dia, hardLimits.minDia(), hardLimits.maxDia(), 0.1, DecimalFormat("0.0"), false, binding.save, textWatch)
binding.dia.tag = "LP_DIA" binding.dia.tag = "LP_DIA"
TimeListEdit(context, aapsLogger, dateUtil, view, R.id.ic, "IC", resourceHelper.gs(R.string.ic_label), currentProfile.ic, null, hardLimits.minIC(), hardLimits.maxIC(), 0.1, DecimalFormat("0.0"), save) TimeListEdit(context, aapsLogger, dateUtil, view, R.id.ic, "IC", resourceHelper.gs(R.string.ic_label), currentProfile.ic, null, hardLimits.minIC(), hardLimits.maxIC(), 0.1, DecimalFormat("0.0"), save)
basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.basal_holder, "BASAL", resourceHelper.gs(R.string.basal_label) + ": " + sumLabel(), currentProfile.basal, null, pumpDescription.basalMinimumRate, 10.0, 0.01, DecimalFormat("0.00"), save) basalView = TimeListEdit(context, aapsLogger, dateUtil, view, R.id.basal_holder, "BASAL", resourceHelper.gs(R.string.basal_label) + ": " + sumLabel(), currentProfile.basal, null, pumpDescription.basalMinimumRate, pumpDescription.basalMaximumRate, 0.01, DecimalFormat("0.00"), save)
if (units == Constants.MGDL) { if (units == Constants.MGDL) {
TimeListEdit(context, aapsLogger, dateUtil, view, R.id.isf, "ISF", resourceHelper.gs(R.string.isf_label), currentProfile.isf, null, HardLimits.MIN_ISF, HardLimits.MAX_ISF, 1.0, DecimalFormat("0"), save) TimeListEdit(context, aapsLogger, dateUtil, view, R.id.isf, "ISF", resourceHelper.gs(R.string.isf_label), currentProfile.isf, null, HardLimits.MIN_ISF, HardLimits.MAX_ISF, 1.0, DecimalFormat("0"), save)
TimeListEdit(context, aapsLogger, dateUtil, view, R.id.target, "TARGET", resourceHelper.gs(R.string.target_label), currentProfile.targetLow, currentProfile.targetHigh, HardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), HardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), 1.0, DecimalFormat("0"), save) TimeListEdit(context, aapsLogger, dateUtil, view, R.id.target, "TARGET", resourceHelper.gs(R.string.target_label), currentProfile.targetLow, currentProfile.targetHigh, HardLimits.VERY_HARD_LIMIT_TARGET_BG[0].toDouble(), HardLimits.VERY_HARD_LIMIT_TARGET_BG[1].toDouble(), 1.0, DecimalFormat("0"), save)

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Dana import info.nightscout.androidaps.interfaces.Dana
import info.nightscout.androidaps.interfaces.Diaconn
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject import javax.inject.Inject
@ -22,6 +23,13 @@ class CommandLoadEvents(
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}") aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}")
callback?.result(r)?.run() callback?.result(r)?.run()
} }
if (pump is Diaconn) {
val diaconnPump = pump as Diaconn
val r = diaconnPump.loadHistory()
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}")
callback?.result(r)?.run()
}
} }
override fun status(): String = "LOAD EVENTS" override fun status(): String = "LOAD EVENTS"

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Dana import info.nightscout.androidaps.interfaces.Dana
import info.nightscout.androidaps.interfaces.Diaconn
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject import javax.inject.Inject
@ -23,6 +24,13 @@ class CommandLoadHistory(
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: " + r.success + " enacted: " + r.enacted) aapsLogger.debug(LTag.PUMPQUEUE, "Result success: " + r.success + " enacted: " + r.enacted)
callback?.result(r)?.run() callback?.result(r)?.run()
} }
if (pump is Diaconn) {
val diaconnG8Pump = pump as Diaconn
val r = diaconnG8Pump.loadHistory()
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: " + r.success + " enacted: " + r.enacted)
callback?.result(r)?.run()
}
} }
override fun status(): String = "LOAD HISTORY $type" override fun status(): String = "LOAD HISTORY $type"

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Dana import info.nightscout.androidaps.interfaces.Dana
import info.nightscout.androidaps.interfaces.Diaconn
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject import javax.inject.Inject
@ -21,6 +22,12 @@ class CommandSetUserSettings(
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}") aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}")
callback?.result(r)?.run() callback?.result(r)?.run()
} }
if (pump is Diaconn) {
val r = pump.setUserOptions()
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${r.success} enacted: ${r.enacted}")
callback?.result(r)?.run()
}
} }
override fun status(): String = "SET USER SETTINGS" override fun status(): String = "SET USER SETTINGS"

View file

@ -75,8 +75,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pomp</string> <string name="configbuilder_pump">Pomp</string>
<string name="configbuilder_pump_description">Watter pomp wil jy gebruik met AndroidAPS?</string> <string name="configbuilder_pump_description">Watter pomp wil jy gebruik met AndroidAPS?</string>
<string name="configbuilder_treatments">Behandelings</string>
<string name="configbuilder_treatments_description">Watter plugin moet gebruik word vir behandeling hantering?</string>
<string name="configbuilder_profile">Profiel</string> <string name="configbuilder_profile">Profiel</string>
<string name="configbuilder_profile_description">Watter profiel moet AndroidAPS gebruik?</string> <string name="configbuilder_profile_description">Watter profiel moet AndroidAPS gebruik?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Помпа</string> <string name="configbuilder_pump">Помпа</string>
<string name="configbuilder_pump_description">Каква помпа използвате с AndroidAPS?</string> <string name="configbuilder_pump_description">Каква помпа използвате с AndroidAPS?</string>
<string name="configbuilder_treatments">Лечения</string>
<string name="configbuilder_treatments_description">Коя приставка да използваме за леченията?</string>
<string name="configbuilder_profile">Профил</string> <string name="configbuilder_profile">Профил</string>
<string name="configbuilder_profile_description">Кой тип профил да използва AndroidAPS?</string> <string name="configbuilder_profile_description">Кой тип профил да използва AndroidAPS?</string>
<string name="configbuilder_aps">Алгоритъм за APS</string> <string name="configbuilder_aps">Алгоритъм за APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Péče</string> <string name="careportal">Péče</string>
<string name="configbuilder_pump">Pumpa</string> <string name="configbuilder_pump">Pumpa</string>
<string name="configbuilder_pump_description">Jakou pumpu chcete používat s AndroidAPS?</string> <string name="configbuilder_pump_description">Jakou pumpu chcete používat s AndroidAPS?</string>
<string name="configbuilder_treatments">Ošetření</string>
<string name="configbuilder_treatments_description">Jaký plugin chcete používat pro ukládání informací?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Jaký profil má AndroidAPS používat?</string> <string name="configbuilder_profile_description">Jaký profil má AndroidAPS používat?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -911,6 +909,8 @@
<string name="ns_receive_temp_target_summary">Přijmout dočasné cíle zadané prostřednictvím NS nebo NSClienta</string> <string name="ns_receive_temp_target_summary">Přijmout dočasné cíle zadané prostřednictvím NS nebo NSClienta</string>
<string name="ns_receive_profile_switch">Přijímat přepnutí profilu</string> <string name="ns_receive_profile_switch">Přijímat přepnutí profilu</string>
<string name="ns_receive_profile_switch_summary">Přijmout přepnutí profilu zadané prostřednictvím NS nebo NSClienta</string> <string name="ns_receive_profile_switch_summary">Přijmout přepnutí profilu zadané prostřednictvím NS nebo NSClienta</string>
<string name="ns_receive_offline_event">Přijímat události APS offline</string>
<string name="ns_receive_offline_event_summary">Přijmout APS offline události zadané prostřednictvím NS nebo NSClienta</string>
<string name="ns_receive_insulin">Přijímat inzulín</string> <string name="ns_receive_insulin">Přijímat inzulín</string>
<string name="ns_receive_insulin_summary">Přijmout inzulín vložený přes NS nebo NSClient (není dodán, pouze započítán do IOB)</string> <string name="ns_receive_insulin_summary">Přijmout inzulín vložený přes NS nebo NSClient (není dodán, pouze započítán do IOB)</string>
<string name="ns_receive_carbs">Přijímat sacharidy</string> <string name="ns_receive_carbs">Přijímat sacharidy</string>
@ -919,4 +919,6 @@
<string name="ns_receive_therapy_events_summary">Přijmout léčebné události (výměna setu, inzulínu, baterie atd.) zadané prostřednictvím NS nebo NSClienta</string> <string name="ns_receive_therapy_events_summary">Přijmout léčebné události (výměna setu, inzulínu, baterie atd.) zadané prostřednictvím NS nebo NSClienta</string>
<string name="ns_receive_cgm">Přijímat/doplňovat glykémie</string> <string name="ns_receive_cgm">Přijímat/doplňovat glykémie</string>
<string name="ns_receive_cgm_summary">Přijmout CGM data z NS</string> <string name="ns_receive_cgm_summary">Přijmout CGM data z NS</string>
<string name="sms_timeout_while_wating">Vypršel časový limit při čekání na dokončení předchozí komunikace s pumpou</string>
<string name="smscommunicator_another_bolus_in_queue">Ve frontě je další bolus. Zkuste to znovu později.</string>
</resources> </resources>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pumpe</string> <string name="configbuilder_pump">Pumpe</string>
<string name="configbuilder_pump_description">Welche Pumpe möchtest Du mit AndroidAPS nutzen?</string> <string name="configbuilder_pump_description">Welche Pumpe möchtest Du mit AndroidAPS nutzen?</string>
<string name="configbuilder_treatments">Behandlungen</string>
<string name="configbuilder_treatments_description">Welches Plugin soll zum Verarbeiten von Behandlungen genutzt werden?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Welches Profil soll AndroidAPS nutzen?</string> <string name="configbuilder_profile_description">Welches Profil soll AndroidAPS nutzen?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -918,4 +916,6 @@ Unerwartetes Verhalten.</string>
<string name="ns_receive_therapy_events_summary">Ereignisse (Kanülen-, Ampullen-, Batteriewechsel etc.) akzeptieren, die in NS oder NSClient eingegeben wurden</string> <string name="ns_receive_therapy_events_summary">Ereignisse (Kanülen-, Ampullen-, Batteriewechsel etc.) akzeptieren, die in NS oder NSClient eingegeben wurden</string>
<string name="ns_receive_cgm">Historische CGM Daten ergänzen</string> <string name="ns_receive_cgm">Historische CGM Daten ergänzen</string>
<string name="ns_receive_cgm_summary">CGM Daten von NS akzeptieren</string> <string name="ns_receive_cgm_summary">CGM Daten von NS akzeptieren</string>
<string name="sms_timeout_while_wating">Zeitüberschreitung beim Warten auf das Ende der vorherigen Kommunikation mit der Pumpe</string>
<string name="smscommunicator_another_bolus_in_queue">In der Warteschlange befindet sich ein weiterer Bolus. Bitte später erneut versuchen.</string>
</resources> </resources>

View file

@ -77,8 +77,6 @@
<string name="careportal">Φροντίδα</string> <string name="careportal">Φροντίδα</string>
<string name="configbuilder_pump">Αντλία</string> <string name="configbuilder_pump">Αντλία</string>
<string name="configbuilder_pump_description">Ποια αντλία θα θέλατε να χρησιμοποιήσετε με το AndroidAPS;</string> <string name="configbuilder_pump_description">Ποια αντλία θα θέλατε να χρησιμοποιήσετε με το AndroidAPS;</string>
<string name="configbuilder_treatments">Θεραπείες</string>
<string name="configbuilder_treatments_description">Ποια προσθήκη πρέπει να χρησιμοποιηθεί για το χειρισμό της θεραπείας;</string>
<string name="configbuilder_profile">Προφίλ</string> <string name="configbuilder_profile">Προφίλ</string>
<string name="configbuilder_profile_description">Ποιο προφίλ πρέπει να χρησιμοποιήσει το AndroidAPS;</string> <string name="configbuilder_profile_description">Ποιο προφίλ πρέπει να χρησιμοποιήσει το AndroidAPS;</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Portal de Tratamientos</string> <string name="careportal">Portal de Tratamientos</string>
<string name="configbuilder_pump">Bomba</string> <string name="configbuilder_pump">Bomba</string>
<string name="configbuilder_pump_description">¿Qué bomba quieres utilizar con AndroidAPS?</string> <string name="configbuilder_pump_description">¿Qué bomba quieres utilizar con AndroidAPS?</string>
<string name="configbuilder_treatments">Tratamientos</string>
<string name="configbuilder_treatments_description">¿Que complemento quieres usar para el manejo del tratamiento?</string>
<string name="configbuilder_profile">Perfil</string> <string name="configbuilder_profile">Perfil</string>
<string name="configbuilder_profile_description">¿Qué perfil debe usar AndroidAPS?</string> <string name="configbuilder_profile_description">¿Qué perfil debe usar AndroidAPS?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pompe</string> <string name="configbuilder_pump">Pompe</string>
<string name="configbuilder_pump_description">Quelle pompe souhaitez-vous utiliser avec AndroidAPS ?</string> <string name="configbuilder_pump_description">Quelle pompe souhaitez-vous utiliser avec AndroidAPS ?</string>
<string name="configbuilder_treatments">Traitements</string>
<string name="configbuilder_treatments_description">Quel plugin doit être utilisé pour la gestion des traitements ?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Quel profil doit utiliser AndroidAPS ?</string> <string name="configbuilder_profile_description">Quel profil doit utiliser AndroidAPS ?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -96,7 +94,7 @@
<string name="loop_aps_label">APS</string> <string name="loop_aps_label">APS</string>
<string name="loop_constraintsprocessed_label">Après traitement des restrictions</string> <string name="loop_constraintsprocessed_label">Après traitement des restrictions</string>
<string name="loop_tbrsetbypump_label">Basal temporaire défini par la pompe</string> <string name="loop_tbrsetbypump_label">Basal temporaire défini par la pompe</string>
<string name="noapsselected">Pas d\'APS séléctionné ou pas de résultat fourni</string> <string name="noapsselected">Pas d\'APS sélectionné ou pas de résultat fourni</string>
<string name="safety">Sécurité</string> <string name="safety">Sécurité</string>
<string name="openapsma_disabled">Plugin désactivé</string> <string name="openapsma_disabled">Plugin désactivé</string>
<string name="constraints_violation">Violation des restrictions</string> <string name="constraints_violation">Violation des restrictions</string>
@ -732,7 +730,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Absorption lente des glucides détectée : %2$d%% du temps. Vérifiez de nouveau votre calcul. Les GA (Glucides Actifs) peuvent être surestimés et alors plus d\'insuline pourrait être délivré !!!!!</font>]]></string> <string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Absorption lente des glucides détectée : %2$d%% du temps. Vérifiez de nouveau votre calcul. Les GA (Glucides Actifs) peuvent être surestimés et alors plus d\'insuline pourrait être délivré !!!!!</font>]]></string>
<string name="partialboluswizard">Injecter cette partie de Bolus calculée par lassistant [%]</string> <string name="partialboluswizard">Injecter cette partie de Bolus calculée par lassistant [%]</string>
<string name="deliverpartofboluswizard">L\'assistant Bolus effectue le calcul mais seulement cette partie de l\'insuline calculée est délivrée. Utile avec l\'algorithme SMB.</string> <string name="deliverpartofboluswizard">L\'assistant Bolus effectue le calcul mais seulement cette partie de l\'insuline calculée est délivrée. Utile avec l\'algorithme SMB.</string>
<string name="snooze">Report alarme</string> <string name="snooze">Masquer</string>
<string name="increasingmaxbasal">Augmentation de la valeur du débit Basal max parce que ce paramètre est inférieur au débit Basal max de votre profil</string> <string name="increasingmaxbasal">Augmentation de la valeur du débit Basal max parce que ce paramètre est inférieur au débit Basal max de votre profil</string>
<string name="smscommunicator_messagebody">Message invalide</string> <string name="smscommunicator_messagebody">Message invalide</string>
<string name="format_bg_isf">%1$s SI: %2$.1f</string> <string name="format_bg_isf">%1$s SI: %2$.1f</string>
@ -912,6 +910,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="ns_receive_temp_target_summary">Accepter les cibles temporaires entrées via NS ou NSClient</string> <string name="ns_receive_temp_target_summary">Accepter les cibles temporaires entrées via NS ou NSClient</string>
<string name="ns_receive_profile_switch">Recevoir les changements de profil</string> <string name="ns_receive_profile_switch">Recevoir les changements de profil</string>
<string name="ns_receive_profile_switch_summary">Accepter les changements de profil entrés via NS ou NSClient</string> <string name="ns_receive_profile_switch_summary">Accepter les changements de profil entrés via NS ou NSClient</string>
<string name="ns_receive_offline_event">Recevoir les événements APS hors ligne</string>
<string name="ns_receive_offline_event_summary">Accepter les événements APS hors ligne entrés via NS ou NSClient</string>
<string name="ns_receive_insulin">Recevoir l\'insuline</string> <string name="ns_receive_insulin">Recevoir l\'insuline</string>
<string name="ns_receive_insulin_summary">Acceptez l\'insuline entrée via NS ou NSClient (elle n\'est pas injectée, uniquement pour le calcul pour IA)</string> <string name="ns_receive_insulin_summary">Acceptez l\'insuline entrée via NS ou NSClient (elle n\'est pas injectée, uniquement pour le calcul pour IA)</string>
<string name="ns_receive_carbs">Recevoir les glucides</string> <string name="ns_receive_carbs">Recevoir les glucides</string>
@ -920,4 +920,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="ns_receive_therapy_events_summary">Accepter les événements de thérapie (canule, insuline, changement de batterie, etc.) entrés via NS ou NSClient</string> <string name="ns_receive_therapy_events_summary">Accepter les événements de thérapie (canule, insuline, changement de batterie, etc.) entrés via NS ou NSClient</string>
<string name="ns_receive_cgm">Recevoir/remplir les anciennes données MGC</string> <string name="ns_receive_cgm">Recevoir/remplir les anciennes données MGC</string>
<string name="ns_receive_cgm_summary">Accepter les données MGC de NS</string> <string name="ns_receive_cgm_summary">Accepter les données MGC de NS</string>
<string name="sms_timeout_while_wating">Délai d\'attente pour finir la communication précédente avec la pompe</string>
<string name="smscommunicator_another_bolus_in_queue">Un autre bolus est en file d\'attente. Réessayez plus tard.</string>
</resources> </resources>

View file

@ -35,7 +35,6 @@
<string name="sms_delta">Deilte:</string> <string name="sms_delta">Deilte:</string>
<string name="treatments">Cóireálacha</string> <string name="treatments">Cóireálacha</string>
<string name="configbuilder_pump">Caidéil</string> <string name="configbuilder_pump">Caidéil</string>
<string name="configbuilder_treatments">Cóireálacha</string>
<string name="configbuilder_profile">Próifíl</string> <string name="configbuilder_profile">Próifíl</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
<string name="configbuilder_general">Ginearálta</string> <string name="configbuilder_general">Ginearálta</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Portale</string> <string name="careportal">Portale</string>
<string name="configbuilder_pump">Micro</string> <string name="configbuilder_pump">Micro</string>
<string name="configbuilder_pump_description">Quale microinfusore desideri usare con AndroidAPS?</string> <string name="configbuilder_pump_description">Quale microinfusore desideri usare con AndroidAPS?</string>
<string name="configbuilder_treatments">Trattamenti</string>
<string name="configbuilder_treatments_description">Quale plugin dovrebbe essere usato per la gestione del trattamento?</string>
<string name="configbuilder_profile">Profilo</string> <string name="configbuilder_profile">Profilo</string>
<string name="configbuilder_profile_description">Quale profilo AndroidAPS dovrebbe usare?</string> <string name="configbuilder_profile_description">Quale profilo AndroidAPS dovrebbe usare?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -778,6 +776,7 @@
<string name="randombg_short">BG</string> <string name="randombg_short">BG</string>
<string name="tools">Strumenti</string> <string name="tools">Strumenti</string>
<string name="show_calculation">Mostra calcolo</string> <string name="show_calculation">Mostra calcolo</string>
<string name="show_removed">Mostra rimossi</string>
<string name="clearqueueconfirm">Cancellare la coda? Tutti i dati in coda andranno persi!</string> <string name="clearqueueconfirm">Cancellare la coda? Tutti i dati in coda andranno persi!</string>
<string name="ebstopsloop">L\'uso della funzione bolo esteso interromperà la modalità loop chiuso per il tempo di esecuzione del bolo esteso. Lo vuoi davvero?</string> <string name="ebstopsloop">L\'uso della funzione bolo esteso interromperà la modalità loop chiuso per il tempo di esecuzione del bolo esteso. Lo vuoi davvero?</string>
<string name="closed_loop_disabled_with_eb">Loop chiuso disabilitato a causa dell\'esecuzione di un bolo esteso</string> <string name="closed_loop_disabled_with_eb">Loop chiuso disabilitato a causa dell\'esecuzione di un bolo esteso</string>
@ -899,9 +898,27 @@
<string name="profile_max_daily_basal_value">Valore max basale (profilo)</string> <string name="profile_max_daily_basal_value">Valore max basale (profilo)</string>
<string name="current_basal_value">Valore basale corrente</string> <string name="current_basal_value">Valore basale corrente</string>
<string name="profile_carbs_ratio_value">Valore rapporto CHO (profilo)</string> <string name="profile_carbs_ratio_value">Valore rapporto CHO (profilo)</string>
<string name="full_sync">Sincronizzazione completa</string>
<string name="prime">Caricamento</string>
<string name="ns_sync_options">Sincronizzazione</string>
<string name="ns_upload_summary">Profili, boli, CHO, basali temporanee vengono caricati su NS</string>
<string name="ns_upload">Carica dati su NS</string>
<string name="ns_receive_profile_store">Ricevi \"store\" profilo</string>
<string name="ns_receive_profile_store_summary">Sincronizza i profili da NS al profilo locale</string>
<string name="ns_receive_temp_target">Ricevi target temporanei</string> <string name="ns_receive_temp_target">Ricevi target temporanei</string>
<string name="ns_receive_temp_target_summary">Accetta target temporanei inseriti tramite NS o NSClient</string>
<string name="ns_receive_profile_switch">Ricevi cambi profilo</string> <string name="ns_receive_profile_switch">Ricevi cambi profilo</string>
<string name="ns_receive_profile_switch_summary">Accetta cambi profilo inseriti tramite NS o NSClient</string>
<string name="ns_receive_offline_event">Ricevi eventi APS offline</string>
<string name="ns_receive_offline_event_summary">Accetta eventi APS offline inseriti tramite NS o NSClient</string>
<string name="ns_receive_insulin">Ricevi insulina</string> <string name="ns_receive_insulin">Ricevi insulina</string>
<string name="ns_receive_insulin_summary">Accetta insulina inserita tramite NS o NSClient (non viene erogata, solo calcolata per IOB)</string>
<string name="ns_receive_carbs">Ricevi CHO</string> <string name="ns_receive_carbs">Ricevi CHO</string>
<string name="ns_receive_carbs_summary">Accetta CHO inseriti tramite NS o NSClient</string>
<string name="ns_receive_therapy_events">Ricevi eventi terapia</string>
<string name="ns_receive_therapy_events_summary">Accetta eventi terapia (cambio cannula, insulina, batteria, ecc.) inseriti tramite NS o NSClient</string>
<string name="ns_receive_cgm">Ricevi/riempi dati CGM</string>
<string name="ns_receive_cgm_summary">Accetta dati CGM da NS</string> <string name="ns_receive_cgm_summary">Accetta dati CGM da NS</string>
<string name="sms_timeout_while_wating">Timeout nell\'attesa della fine della precedente comunicazione col micro.</string>
<string name="smscommunicator_another_bolus_in_queue">C\'è un altro bolo in coda. Riprova più tardi.</string>
</resources> </resources>

View file

@ -81,8 +81,6 @@
<string name="careportal">פורטל טיפולים</string> <string name="careportal">פורטל טיפולים</string>
<string name="configbuilder_pump">משאבה</string> <string name="configbuilder_pump">משאבה</string>
<string name="configbuilder_pump_description">עם איזו משאבה אתם מעוניינים להשתמש ב-AndroidAPS?</string> <string name="configbuilder_pump_description">עם איזו משאבה אתם מעוניינים להשתמש ב-AndroidAPS?</string>
<string name="configbuilder_treatments">טיפולים</string>
<string name="configbuilder_treatments_description">איזה תוסף ישמש לתפעול הטיפולים?</string>
<string name="configbuilder_profile">פרופיל</string> <string name="configbuilder_profile">פרופיל</string>
<string name="configbuilder_profile_description">באיזה פרופיל על AndroidAPS להשתמש?</string> <string name="configbuilder_profile_description">באיזה פרופיל על AndroidAPS להשתמש?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -911,6 +909,8 @@
<string name="ns_receive_temp_target_summary">קבלת ערכי מטרה זמניים שהוגדרו בנייטסקאוט או ב-NSClient</string> <string name="ns_receive_temp_target_summary">קבלת ערכי מטרה זמניים שהוגדרו בנייטסקאוט או ב-NSClient</string>
<string name="ns_receive_profile_switch">קבלת החלפות פרופיל</string> <string name="ns_receive_profile_switch">קבלת החלפות פרופיל</string>
<string name="ns_receive_profile_switch_summary">קבלת החלפות פרופיל שהוגדרו בנייטסקאוט או ב-NSClient</string> <string name="ns_receive_profile_switch_summary">קבלת החלפות פרופיל שהוגדרו בנייטסקאוט או ב-NSClient</string>
<string name="ns_receive_offline_event">אחזר אירועים לא מקוונים</string>
<string name="ns_receive_offline_event_summary">קבל אירועים לא מקוונים שנרשמו דרך נייטסקאוט או NSClient</string>
<string name="ns_receive_insulin">קבלת אינסולין</string> <string name="ns_receive_insulin">קבלת אינסולין</string>
<string name="ns_receive_insulin_summary">קבלת אינסולין שהוזן באמצעות נייטסקאוט או NSClient (הוא לא מוזרק, רק מחושב רק כאינסולין פעיל)</string> <string name="ns_receive_insulin_summary">קבלת אינסולין שהוזן באמצעות נייטסקאוט או NSClient (הוא לא מוזרק, רק מחושב רק כאינסולין פעיל)</string>
<string name="ns_receive_carbs">קבלת פחמימות</string> <string name="ns_receive_carbs">קבלת פחמימות</string>
@ -919,4 +919,6 @@
<string name="ns_receive_therapy_events_summary">קבלת אירועי טיפול (צינורית, אינסולין, החלפת סוללה) שצוינו באמצעות נייטסקאוט או NSClient</string> <string name="ns_receive_therapy_events_summary">קבלת אירועי טיפול (צינורית, אינסולין, החלפת סוללה) שצוינו באמצעות נייטסקאוט או NSClient</string>
<string name="ns_receive_cgm">קבלת\\טעינת נתוני סנסור</string> <string name="ns_receive_cgm">קבלת\\טעינת נתוני סנסור</string>
<string name="ns_receive_cgm_summary">קבלת נתוני סנסור מנייטסקאוט</string> <string name="ns_receive_cgm_summary">קבלת נתוני סנסור מנייטסקאוט</string>
<string name="sms_timeout_while_wating">בהמתנה עד לסיום תקשורת קודמת עם המשאבה</string>
<string name="smscommunicator_another_bolus_in_queue">ישנו בולוס נוסף בתור. נסו שוב מאוחר יותר.</string>
</resources> </resources>

View file

@ -77,8 +77,6 @@
<string name="careportal">케어포털</string> <string name="careportal">케어포털</string>
<string name="configbuilder_pump">펌프</string> <string name="configbuilder_pump">펌프</string>
<string name="configbuilder_pump_description">어떤 펌프를 AndroidAPS에서 사용하시겠습니까?</string> <string name="configbuilder_pump_description">어떤 펌프를 AndroidAPS에서 사용하시겠습니까?</string>
<string name="configbuilder_treatments">관리</string>
<string name="configbuilder_treatments_description">관리를 위해서 어떤 플러그인을 사용합니까?</string>
<string name="configbuilder_profile">프로파일</string> <string name="configbuilder_profile">프로파일</string>
<string name="configbuilder_profile_description">어떤 프로파일을 AndroidAPS에서 사용합니까?</string> <string name="configbuilder_profile_description">어떤 프로파일을 AndroidAPS에서 사용합니까?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -80,8 +80,6 @@
<string name="careportal">Priežiūra</string> <string name="careportal">Priežiūra</string>
<string name="configbuilder_pump">Pompa</string> <string name="configbuilder_pump">Pompa</string>
<string name="configbuilder_pump_description">Kokią pompą naudosite su AndroidAPS?</string> <string name="configbuilder_pump_description">Kokią pompą naudosite su AndroidAPS?</string>
<string name="configbuilder_treatments">Terapija</string>
<string name="configbuilder_treatments_description">Kuris įskiepis bus naudojamas terapijos tvarkymui?</string>
<string name="configbuilder_profile">Profilis</string> <string name="configbuilder_profile">Profilis</string>
<string name="configbuilder_profile_description">Kurį profilį naudos AndroidAPS?</string> <string name="configbuilder_profile_description">Kurį profilį naudos AndroidAPS?</string>
<string name="configbuilder_aps">DKS</string> <string name="configbuilder_aps">DKS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pomp</string> <string name="configbuilder_pump">Pomp</string>
<string name="configbuilder_pump_description">Welke pomp wil je gaan gebruiken met AndroidAPS?</string> <string name="configbuilder_pump_description">Welke pomp wil je gaan gebruiken met AndroidAPS?</string>
<string name="configbuilder_treatments">Behandelingen</string>
<string name="configbuilder_treatments_description">Welke plugin moet worden gebruikt voor de Behandelingen?</string>
<string name="configbuilder_profile">Profiel</string> <string name="configbuilder_profile">Profiel</string>
<string name="configbuilder_profile_description">Welk profiel moet AndroidAPS gebruiken?</string> <string name="configbuilder_profile_description">Welk profiel moet AndroidAPS gebruiken?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pumpe</string> <string name="configbuilder_pump">Pumpe</string>
<string name="configbuilder_pump_description">Hvilken pumpe ønsker du å bruke sammen med AndroidAPS?</string> <string name="configbuilder_pump_description">Hvilken pumpe ønsker du å bruke sammen med AndroidAPS?</string>
<string name="configbuilder_treatments">Behandlinger</string>
<string name="configbuilder_treatments_description">Hvilken plugin burde brukes til håndtering av behandlinger?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Hvilken profil bør AndroidAPS bruke?</string> <string name="configbuilder_profile_description">Hvilken profil bør AndroidAPS bruke?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -778,6 +776,7 @@
<string name="randombg_short">BS</string> <string name="randombg_short">BS</string>
<string name="tools">Verktøy</string> <string name="tools">Verktøy</string>
<string name="show_calculation">Vis beregning</string> <string name="show_calculation">Vis beregning</string>
<string name="show_removed">Vis slettede</string>
<string name="clearqueueconfirm">Slett køen? All data i køen vil gå tapt!</string> <string name="clearqueueconfirm">Slett køen? All data i køen vil gå tapt!</string>
<string name="ebstopsloop">Bruk av forlenget bolus funksjon vil deaktivere lukket loop i perioden med forlenget bolus. Vil du virkelig dette?</string> <string name="ebstopsloop">Bruk av forlenget bolus funksjon vil deaktivere lukket loop i perioden med forlenget bolus. Vil du virkelig dette?</string>
<string name="closed_loop_disabled_with_eb">Lukket loop deaktivert på grunn av forlenget bolus</string> <string name="closed_loop_disabled_with_eb">Lukket loop deaktivert på grunn av forlenget bolus</string>
@ -899,4 +898,25 @@
<string name="profile_max_daily_basal_value">Profil maksimal basal dose</string> <string name="profile_max_daily_basal_value">Profil maksimal basal dose</string>
<string name="current_basal_value">Aktiv basal dose</string> <string name="current_basal_value">Aktiv basal dose</string>
<string name="profile_carbs_ratio_value">Profil karbohydratfaktor (IK)</string> <string name="profile_carbs_ratio_value">Profil karbohydratfaktor (IK)</string>
<string name="full_sync">Full synkronisering</string>
<string name="prime">Prime</string>
<string name="ns_sync_options">Synkronisering</string>
<string name="ns_upload_summary">Profiler, boluser, karbohydrater, midlertidige basaler lastes opp til NS</string>
<string name="ns_upload">Last opp data til NS</string>
<string name="ns_receive_profile_store">Hent lagrede profiler</string>
<string name="ns_receive_profile_store_summary">Synkroniser profiler fra NS til lokal profil</string>
<string name="ns_receive_temp_target">Motta midlertidige BS mål</string>
<string name="ns_receive_temp_target_summary">Aksepter midlertidige mål angitt med NS eller NSClient</string>
<string name="ns_receive_profile_switch">Motta profilbytter</string>
<string name="ns_receive_profile_switch_summary">Aksepter profilbytter som er angitt via NS eller NSClient</string>
<string name="ns_receive_offline_event">Motta APS offline hendelser</string>
<string name="ns_receive_offline_event_summary">Aksepter APS offline hendelser lagt inn gjennom NS eller NSKlient</string>
<string name="ns_receive_insulin">Motta insulin</string>
<string name="ns_receive_insulin_summary">Aksepter insulin angitt via NS eller NSClient (enhetene er ikke dosert, kun beregnet mot IOB)</string>
<string name="ns_receive_carbs">Motta karbohydrater</string>
<string name="ns_receive_carbs_summary">Aksepter karbohydrater angitt med NS eller NSClient</string>
<string name="ns_receive_therapy_events">Motta behandlingshendelser</string>
<string name="ns_receive_therapy_events_summary">Godta behandlingshendelser (kanyle, insulin, batteribytte osv.) som er lagt inn gjennom NS eller NSClient</string>
<string name="ns_receive_cgm">Motta/tilbakefyll CGM data</string>
<string name="ns_receive_cgm_summary">Aksepter CGM data fra NS</string>
</resources> </resources>

View file

@ -81,8 +81,6 @@
<string name="careportal">PortalOpieki</string> <string name="careportal">PortalOpieki</string>
<string name="configbuilder_pump">Pompa</string> <string name="configbuilder_pump">Pompa</string>
<string name="configbuilder_pump_description">Którą pompę chcesz wykorzystać do AndroidAPS?</string> <string name="configbuilder_pump_description">Którą pompę chcesz wykorzystać do AndroidAPS?</string>
<string name="configbuilder_treatments">Terapia</string>
<string name="configbuilder_treatments_description">Która wtyczka powinna być używana do obsługi leczenia?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Który profil będzie używany w AndroidAPS?</string> <string name="configbuilder_profile_description">Który profil będzie używany w AndroidAPS?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -78,8 +78,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Bomba</string> <string name="configbuilder_pump">Bomba</string>
<string name="configbuilder_pump_description">Qual a bomba que gostaria de usar com AndroidAPS?</string> <string name="configbuilder_pump_description">Qual a bomba que gostaria de usar com AndroidAPS?</string>
<string name="configbuilder_treatments">Tratamentos</string>
<string name="configbuilder_treatments_description">Qual o plugin que deve ser usado para os tratamentos?</string>
<string name="configbuilder_profile">Perfil</string> <string name="configbuilder_profile">Perfil</string>
<string name="configbuilder_profile_description">Qual perfil o AndroidAPS deve usar?</string> <string name="configbuilder_profile_description">Qual perfil o AndroidAPS deve usar?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Bomba</string> <string name="configbuilder_pump">Bomba</string>
<string name="configbuilder_pump_description">Qual a bomba que gostaria de utilizar com AndroidAPS?</string> <string name="configbuilder_pump_description">Qual a bomba que gostaria de utilizar com AndroidAPS?</string>
<string name="configbuilder_treatments">Tratamentos</string>
<string name="configbuilder_treatments_description">Qual o plugin que deve ser usado para os tratamentos?</string>
<string name="configbuilder_profile">Perfil</string> <string name="configbuilder_profile">Perfil</string>
<string name="configbuilder_profile_description">Que perfil deverá ser usado pelo AndroidAPS?</string> <string name="configbuilder_profile_description">Que perfil deverá ser usado pelo AndroidAPS?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pompă</string> <string name="configbuilder_pump">Pompă</string>
<string name="configbuilder_pump_description">Ce pompă doriți să folosiți cu AndroidAPS?</string> <string name="configbuilder_pump_description">Ce pompă doriți să folosiți cu AndroidAPS?</string>
<string name="configbuilder_treatments">Tratamente</string>
<string name="configbuilder_treatments_description">Ce plugin doriți să folosiți pentru gestionarea tratamentelor?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Ce profil doriți să folosească AndroidAPS?</string> <string name="configbuilder_profile_description">Ce profil doriți să folosească AndroidAPS?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -81,8 +81,6 @@
<string name="careportal">Портал лечения / назначений</string> <string name="careportal">Портал лечения / назначений</string>
<string name="configbuilder_pump">помпа</string> <string name="configbuilder_pump">помпа</string>
<string name="configbuilder_pump_description">Какой помпой вы хотели бы пользоваться с AndroidAPS?</string> <string name="configbuilder_pump_description">Какой помпой вы хотели бы пользоваться с AndroidAPS?</string>
<string name="configbuilder_treatments">назначения</string>
<string name="configbuilder_treatments_description">Каким плагином пользоваться для выполнения назначений?</string>
<string name="configbuilder_profile">профиль</string> <string name="configbuilder_profile">профиль</string>
<string name="configbuilder_profile_description">Какой профиль следует использовать в AndroidAPS?</string> <string name="configbuilder_profile_description">Какой профиль следует использовать в AndroidAPS?</string>
<string name="configbuilder_aps">система ИПЖ</string> <string name="configbuilder_aps">система ИПЖ</string>
@ -921,4 +919,6 @@ Context | Edit Context</string>
<string name="ns_receive_therapy_events_summary">Принимать события терапии (катетер, инсулин, изменение батареи и т. д.) через NS или NSClient</string> <string name="ns_receive_therapy_events_summary">Принимать события терапии (катетер, инсулин, изменение батареи и т. д.) через NS или NSClient</string>
<string name="ns_receive_cgm">Получать/заполнять данные мониторинга CGM</string> <string name="ns_receive_cgm">Получать/заполнять данные мониторинга CGM</string>
<string name="ns_receive_cgm_summary">Принимать данные мониторинга CGM из NS</string> <string name="ns_receive_cgm_summary">Принимать данные мониторинга CGM из NS</string>
<string name="sms_timeout_while_wating">Таймаут во время ожидания окончания предыдущего соединения с помпой</string>
<string name="smscommunicator_another_bolus_in_queue">В очереди есть еще один болюс. Повторите попытку позже.</string>
</resources> </resources>

View file

@ -81,8 +81,6 @@
<string name="careportal">Starostlivosť</string> <string name="careportal">Starostlivosť</string>
<string name="configbuilder_pump">Pumpa</string> <string name="configbuilder_pump">Pumpa</string>
<string name="configbuilder_pump_description">Akú pumpu chcete používať s AndroidAPS?</string> <string name="configbuilder_pump_description">Akú pumpu chcete používať s AndroidAPS?</string>
<string name="configbuilder_treatments">Ošetrenia</string>
<string name="configbuilder_treatments_description">Aký modul chcete používať pre spracovanie ošetrení?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Aký profil má používať AndroidAPS?</string> <string name="configbuilder_profile_description">Aký profil má používať AndroidAPS?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>
@ -911,6 +909,8 @@
<string name="ns_receive_temp_target_summary">Prijať dočasné ciele zadané prostredníctvom NS, alebo NSClienta</string> <string name="ns_receive_temp_target_summary">Prijať dočasné ciele zadané prostredníctvom NS, alebo NSClienta</string>
<string name="ns_receive_profile_switch">Prijímať prepnutia profilov</string> <string name="ns_receive_profile_switch">Prijímať prepnutia profilov</string>
<string name="ns_receive_profile_switch_summary">Prijať prepnutia profilov zadané prostredníctvom NS, alebo NSClienta</string> <string name="ns_receive_profile_switch_summary">Prijať prepnutia profilov zadané prostredníctvom NS, alebo NSClienta</string>
<string name="ns_receive_offline_event">Prijímať udalosti APS offline</string>
<string name="ns_receive_offline_event_summary">Prijať APS offline udalosti zadané prostredníctvom NS, alebo NSClienta</string>
<string name="ns_receive_insulin">Prijímať inzulín</string> <string name="ns_receive_insulin">Prijímať inzulín</string>
<string name="ns_receive_insulin_summary">Prijať inzulín vložený cez NS, alebo NSClient (nie je dodaný, iba započítaný do IOB)</string> <string name="ns_receive_insulin_summary">Prijať inzulín vložený cez NS, alebo NSClient (nie je dodaný, iba započítaný do IOB)</string>
<string name="ns_receive_carbs">Prijímať sacharidy</string> <string name="ns_receive_carbs">Prijímať sacharidy</string>

View file

@ -82,8 +82,6 @@ Eversense-appen.</string>
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pump</string> <string name="configbuilder_pump">Pump</string>
<string name="configbuilder_pump_description">Vilken pump vill du använda med AndroidAPS?</string> <string name="configbuilder_pump_description">Vilken pump vill du använda med AndroidAPS?</string>
<string name="configbuilder_treatments">Behandlingar</string>
<string name="configbuilder_treatments_description">Vilket insticksprogram ska användas för att hantera behandlingar?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Vilken profil ska AndroidAPS använda?</string> <string name="configbuilder_profile_description">Vilken profil ska AndroidAPS använda?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -73,8 +73,6 @@
<string name="careportal">Careportal</string> <string name="careportal">Careportal</string>
<string name="configbuilder_pump">Pompa</string> <string name="configbuilder_pump">Pompa</string>
<string name="configbuilder_pump_description">Hangi pompa ile AndroidAPS kullanmak istersiniz?</string> <string name="configbuilder_pump_description">Hangi pompa ile AndroidAPS kullanmak istersiniz?</string>
<string name="configbuilder_treatments">Tedaviler</string>
<string name="configbuilder_treatments_description">Hangi eklenti tedavi işleme için kullanılsın?</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_profile_description">Hangi profili AndroidAPS kullanmalı?</string> <string name="configbuilder_profile_description">Hangi profili AndroidAPS kullanmalı?</string>
<string name="configbuilder_aps">APS (YPS)</string> <string name="configbuilder_aps">APS (YPS)</string>

View file

@ -74,8 +74,6 @@
<string name="careportal">护理记录</string> <string name="careportal">护理记录</string>
<string name="configbuilder_pump">胰岛素泵</string> <string name="configbuilder_pump">胰岛素泵</string>
<string name="configbuilder_pump_description">你想用 AndroidAPS连接哪个胰岛素泵</string> <string name="configbuilder_pump_description">你想用 AndroidAPS连接哪个胰岛素泵</string>
<string name="configbuilder_treatments">治疗</string>
<string name="configbuilder_treatments_description">什么插件应该用于治疗处理?</string>
<string name="configbuilder_profile">配置文件</string> <string name="configbuilder_profile">配置文件</string>
<string name="configbuilder_profile_description">AndroidAPS 应该使用哪个配置文件?</string> <string name="configbuilder_profile_description">AndroidAPS 应该使用哪个配置文件?</string>
<string name="configbuilder_aps">APS</string> <string name="configbuilder_aps">APS</string>

View file

@ -8,13 +8,6 @@ apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle" apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')
implementation project(':database') implementation project(':database')

View file

@ -3,9 +3,9 @@
<string name="automation_short">Auto</string> <string name="automation_short">Auto</string>
<string name="automation">Automatisation</string> <string name="automation">Automatisation</string>
<string name="automation_description">Tâches d\'automatisation définies par l\'utilisateur</string> <string name="automation_description">Tâches d\'automatisation définies par l\'utilisateur</string>
<string name="automation_missing_task_name">Merci d\'entrer le nom de la tâche.</string> <string name="automation_missing_task_name">Veuillez entrer un nom pour la tâche.</string>
<string name="automation_missing_trigger">Merci de spécifier au moins un déclencheur.</string> <string name="automation_missing_trigger">Veuillez spécifier au moins un déclencheur.</string>
<string name="automation_missing_action">Merci de spécifier au moins une action.</string> <string name="automation_missing_action">Veuillez spécifier au moins une action.</string>
<string name="alarm_message">Alarme: %1$s</string> <string name="alarm_message">Alarme: %1$s</string>
<string name="alarm_short">Alarme:</string> <string name="alarm_short">Alarme:</string>
<string name="message_short">Mess :</string> <string name="message_short">Mess :</string>

View file

@ -33,7 +33,7 @@ buildscript {
dexmakerVersion = "1.2" dexmakerVersion = "1.2"
retrofit2Version = '2.9.0' retrofit2Version = '2.9.0'
okhttp3Version = '4.9.0' okhttp3Version = '4.9.0'
byteBuddyVersion = '1.11.3' byteBuddyVersion = '1.11.5'
androidx_junit = '1.1.2' androidx_junit = '1.1.2'
androidx_rules = '1.4.0-alpha04' androidx_rules = '1.4.0-alpha04'
@ -44,12 +44,9 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2 maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2
} }
dependencies { dependencies {
// Update to 4.2.1 is not possible because it forces use build-tools 30.0.2 classpath 'com.android.tools.build:gradle:7.1.0-alpha02'
// and this is not available in travis so far classpath 'com.google.gms:google-services:4.3.8'
// see https://issuetracker.google.com/issues/162255866 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View file

@ -8,13 +8,6 @@ apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle" apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')
} }

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="description_pump_combo">Intégration des pompes Accu-Chek Combo il faut avoir Ruffy installé</string> <string name="description_pump_combo">Pour l\'intégration des pompes Accu-Chek Combo, il faut d\'abord installer Ruffy</string>
<string name="combo_programming_bolus">Programmer la pompe pour injecter un bolus</string> <string name="combo_programming_bolus">Programmation de la pompe pour injecter un bolus</string>
<string name="combo_pump_state_label">État</string> <string name="combo_pump_state_label">État</string>
<string name="combo_pump_activity_label">Activité</string> <string name="combo_pump_activity_label">Activité</string>
<string name="combo_no_pump_connection">Pas de connexion depuis %1$d min</string> <string name="combo_no_pump_connection">Pas de connexion depuis %1$d min</string>
@ -10,13 +10,13 @@
<string name="combo_pump_state_suspended_due_to_error">Arrêté pour cause d\'erreur</string> <string name="combo_pump_state_suspended_due_to_error">Arrêté pour cause d\'erreur</string>
<string name="combo_pump_state_suspended_by_user">Arrêté par l\'utilisateur</string> <string name="combo_pump_state_suspended_by_user">Arrêté par l\'utilisateur</string>
<string name="combo_pump_state_running">En cours d\'exécution</string> <string name="combo_pump_state_running">En cours d\'exécution</string>
<string name="combo_pump_action_cancelling_tbr">Annulation en cours du TBR</string> <string name="combo_pump_action_cancelling_tbr">Annulation du DBT</string>
<string name="combo_pump_action_setting_tbr">Paramétrer TBR (%1$d%% / %2$d min) </string> <string name="combo_pump_action_setting_tbr">Réglage DBT (%1$d%% / %2$d min)</string>
<string name="combo_pump_action_bolusing">Injection du Bolus en cours (%1$.1f U)</string> <string name="combo_pump_action_bolusing">Injection du Bolus en cours (%1$.1f U)</string>
<string name="combo_pump_action_refreshing">Actualisation en cours</string> <string name="combo_pump_action_refreshing">Actualisation en cours</string>
<string name="combo_pump_unsupported_operation">L\'opération demandée n\'est pas prise en charge par la pompe</string> <string name="combo_pump_unsupported_operation">L\'opération demandée n\'est pas prise en charge par la pompe</string>
<string name="combo_low_suspend_forced_notification">Utilisation dangereuse : les bolus étendus ou carrés sont actifs. Le mode Boucle a été programmé pour des suspensions seulement pour 6 heures. Uniquement les bolus normaux sont pris en charge par le mode Boucle</string> <string name="combo_low_suspend_forced_notification">Utilisation dangereuse : les bolus étendus ou carrés sont actifs. Le mode Boucle a été programmé pour des suspensions seulement pour 6 heures. Uniquement les bolus normaux sont pris en charge par le mode Boucle</string>
<string name="combo_force_disabled_notification">Utilisation dangereuse : la pompe utilise un profil avec taux basal différent de celui du premier. Le mode Boucle a été désactivé. Sélectionner le premier profil sur la pompe et rafraîchir.</string> <string name="combo_force_disabled_notification">Utilisation dangereuse : la pompe utilise un profil avec un taux basal différent du premier. Le mode Boucle a été désactivé. Sélectionner le premier profil sur la pompe et rafraîchir.</string>
<string name="bolus_frequency_exceeded">Un bolus avec la même quantité dinsuline a été demandé au cours de la dernière minute. Pour prévenir ladministration accidentelle de deux bolus à la fois et pour protéger contre les bugs, ceci (bolus) n\'est pas autorisé.</string> <string name="bolus_frequency_exceeded">Un bolus avec la même quantité dinsuline a été demandé au cours de la dernière minute. Pour prévenir ladministration accidentelle de deux bolus à la fois et pour protéger contre les bugs, ceci (bolus) n\'est pas autorisé.</string>
<string name="combo_pump_connected_now">Maintenant</string> <string name="combo_pump_connected_now">Maintenant</string>
<string name="combo_activity_reading_pump_history">Lecture historique pompe</string> <string name="combo_activity_reading_pump_history">Lecture historique pompe</string>
@ -37,13 +37,13 @@
<string name="combo_invalid_setup">Paramétrage de la pompe invalide. Vérifiez la documentation et le menu QUICK INFO en utilisant le logiciel de configuration 360.</string> <string name="combo_invalid_setup">Paramétrage de la pompe invalide. Vérifiez la documentation et le menu QUICK INFO en utilisant le logiciel de configuration 360.</string>
<string name="combo_actvity_reading_basal_profile">Lecture du profil basal</string> <string name="combo_actvity_reading_basal_profile">Lecture du profil basal</string>
<string name="combo_bolus_rejected_due_to_pump_history_change">L\'historique de la pompe a été modifié depuis le calcul du bolus. Le bolus n\'a pas été administré. Merci de recalculer le bolus s\'il est toujours nécessaire.</string> <string name="combo_bolus_rejected_due_to_pump_history_change">L\'historique de la pompe a été modifié depuis le calcul du bolus. Le bolus n\'a pas été administré. Merci de recalculer le bolus s\'il est toujours nécessaire.</string>
<string name="combo_error_updating_treatment_record">Le bolus a été délivré mais il n\'a pas pu être ajouté à l\'historique des traitements. Ceci peut se produire lorsque deux petits bolus de la même taille sont gérés dans les deux dernières minutes. Merci de vérifier l\'historique de la pompe et les entrées de traitements puis utilisez le Careportal pour y ajouter les entrées manquantes. Assurez-vous de ne pas ajouter des entrées au cours de la même minute et pour la même quantité d\'insuline.</string> <string name="combo_error_updating_treatment_record">Le bolus a été délivré mais il n\'a pas pu être ajouté à l\'historique des traitements. Ceci peut se produire lorsque deux petits bolus de même taille sont injectés dans les deux dernières minutes. Veuillez vérifier l\'historique de la pompe et les entrées de traitements puis utilisez Careportal pour y ajouter les entrées manquantes. Assurez-vous de ne pas ajouter d\'entrées au cours de la même minute et pour la même quantité d\'insuline.</string>
<string name="combo_high_temp_rejected_due_to_pump_history_changes">Rejet cible temporaire haute parce que le calcul ne prend pas en compte les changements récents de l\'historique pompe</string> <string name="combo_high_temp_rejected_due_to_pump_history_changes">Rejet cible temporaire haute parce que le calcul ne prend pas en compte les changements récents de l\'historique pompe</string>
<string name="combo_activity_checking_pump_state">Actualisation de l\'état de la pompe</string> <string name="combo_activity_checking_pump_state">Actualisation de l\'état de la pompe</string>
<string name="combo_warning_pump_basal_rate_changed">Le taux basal de la pompe a été modifié et sera bientôt actualisé</string> <string name="combo_warning_pump_basal_rate_changed">Le taux basal de la pompe a été modifié et sera bientôt actualisé</string>
<string name="combo_error_failure_reading_changed_basal_rate">Le pourcentage de basal a changé dans la pompe mais sa lecture a échoué</string> <string name="combo_error_failure_reading_changed_basal_rate">Le pourcentage de basal a changé dans la pompe mais sa lecture a échoué</string>
<string name="combo_activity_checking_for_history_changes">Vérification des modifications de l\'historique</string> <string name="combo_activity_checking_for_history_changes">Vérification des modifications de l\'historique</string>
<string name="combo_error_multiple_boluses_with_identical_timestamp">De multiples bolus similaires viennent d\'être importés dans la même minute. Un seul enregistrement a pu être ajouté aux traitements. Merci de vérifier la pompe et d\'ajouter manuellement un enregistrement de bolus en utilisant l\'onglet Careportal. Assurez vous de créer ce bolus avec un temps différent de tous les autres Bolus.</string> <string name="combo_error_multiple_boluses_with_identical_timestamp">De multiples bolus similaires viennent d\'être importés dans la même minute. Un seul enregistrement a pu être ajouté aux traitements. Veuillez vérifier la pompe et d\'ajouter manuellement un enregistrement de bolus en utilisant l\'onglet Careportal. Assurez vous de créer ce bolus avec un temps différent de tous les autres Bolus.</string>
<string name="about_link_urls">\n\ndocumentation :\nhttps://androidaps.readthedocs.io/fr/latest/\n\nfacebook :\nhttps://www.facebook.com/groups/AndroidAPSUsers</string> <string name="about_link_urls">\n\ndocumentation :\nhttps://androidaps.readthedocs.io/fr/latest/\n\nfacebook :\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
<string name="combo_check_date">Le dernier bolus enregistré date d\'il y a plus de 24h ou est dans le futur. Vérifiez que la date dans la pompe est correctement définie.</string> <string name="combo_check_date">Le dernier bolus enregistré date d\'il y a plus de 24h ou est dans le futur. Vérifiez que la date dans la pompe est correctement définie.</string>
<string name="combo_suspious_bolus_time">L\'heure/date sur la pompe du dernier bolus administré semble erroné. L\'IA est probablement incorrecte. Vérifiez l\'heure/date de la pompe.</string> <string name="combo_suspious_bolus_time">L\'heure/date sur la pompe du dernier bolus administré semble erroné. L\'IA est probablement incorrecte. Vérifiez l\'heure/date de la pompe.</string>

View file

@ -9,12 +9,6 @@ apply from: "${project.rootDir}/gradle/android_dependencies.gradle"
apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle" apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle" apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies { dependencies {
implementation project(':database') implementation project(':database')

View file

@ -26,6 +26,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
@ -232,11 +233,15 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun loadDataFromDB() { private fun loadDataFromDB() {
historyList.clear() historyList.clear()
historyList.addAll(repository.getLastTotalDailyDoses(10, false).blockingGet()) // timestamp DESC sorting!
historyList.addAll(repository.getLastTotalDailyDoses(10, true).blockingGet())
//only use newest 10 //only use newest 10
historyList = historyList.subList(0, min(10, historyList.size)) historyList = historyList.subList(0, min(10, historyList.size))
// dummies reset
dummies.clear()
//fill single gaps //fill single gaps
val df: DateFormat = SimpleDateFormat("dd.MM.", Locale.getDefault()) val df: DateFormat = SimpleDateFormat("dd.MM.", Locale.getDefault())
for (i in 0 until historyList.size - 1) { for (i in 0 until historyList.size - 1) {
@ -425,7 +430,7 @@ class TDDStatsActivity : NoSplashAppCompatActivity() {
private fun isOldData(historyList: List<TotalDailyDose>): Boolean { private fun isOldData(historyList: List<TotalDailyDose>): Boolean {
val type = activePlugin.activePump.pumpDescription.pumpType val type = activePlugin.activePump.pumpDescription.pumpType
val startsYesterday = type == PumpType.DANA_R || type == PumpType.DANA_RS || type == PumpType.DANA_RV2 || type == PumpType.DANA_R_KOREAN || type == PumpType.ACCU_CHEK_INSIGHT_VIRTUAL val startsYesterday = type == PumpType.DANA_R || type == PumpType.DANA_RS || type == PumpType.DANA_RV2 || type == PumpType.DANA_R_KOREAN || type == PumpType.ACCU_CHEK_INSIGHT_VIRTUAL || type == PumpType.DIACONN_G8
val df: DateFormat = SimpleDateFormat("dd.MM.", Locale.getDefault()) val df: DateFormat = SimpleDateFormat("dd.MM.", Locale.getDefault())
return historyList.size < 3 || df.format(Date(historyList[0].timestamp)) != df.format(Date(System.currentTimeMillis() - if (startsYesterday) 1000 * 60 * 60 * 24 else 0)) return historyList.size < 3 || df.format(Date(historyList[0].timestamp)) != df.format(Date(System.currentTimeMillis() - if (startsYesterday) 1000 * 60 * 60 * 24 else 0))
} }

View file

@ -97,11 +97,11 @@ fun therapyEventFromJson(jsonObject: JSONObject): TherapyEvent? {
return te return te
} }
fun TherapyEvent.toJson(isAdd: Boolean): JSONObject = fun TherapyEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject =
JSONObject() JSONObject()
.put("eventType", type.text) .put("eventType", type.text)
.put("isValid", isValid) .put("isValid", isValid)
.put("created_at", timestamp) .put("created_at", dateUtil.toISOString(timestamp))
.put("enteredBy", enteredBy) .put("enteredBy", enteredBy)
.put("units", if (glucoseUnit == TherapyEvent.GlucoseUnit.MGDL) Constants.MGDL else Constants.MMOL) .put("units", if (glucoseUnit == TherapyEvent.GlucoseUnit.MGDL) Constants.MGDL else Constants.MMOL)
.also { .also {

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.interfaces
import info.nightscout.androidaps.data.PumpEnactResult
interface Diaconn {
fun loadHistory(): PumpEnactResult // for history browser
fun setUserOptions(): PumpEnactResult // pump etc settings
}

View file

@ -9,5 +9,6 @@ enum class ManufacturerType(val description: String) {
Animas("Animas"), Animas("Animas"),
Cellnovo("Cellnovo"), Cellnovo("Cellnovo"),
Roche("Roche"), Roche("Roche"),
Ypsomed("Ypsomed"); Ypsomed("Ypsomed"),
G2e("G2e");
} }

View file

@ -23,6 +23,7 @@ enum class PumpCapability {
MedtronicCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD)), MedtronicCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD)),
OmnipodCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, BasalRate30min)), OmnipodCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, BasalRate30min)),
YpsomedCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), // BasalRates (separately grouped) YpsomedCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), // BasalRates (separately grouped)
DiaconnCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), //
BasalRate_Duration15minAllowed, BasalRate_Duration15minAllowed,
BasalRate_Duration30minAllowed, BasalRate_Duration30minAllowed,
BasalRate_Duration15and30minAllowed(arrayOf(BasalRate_Duration15minAllowed, BasalRate_Duration30minAllowed)), BasalRate_Duration15and30minAllowed(arrayOf(BasalRate_Duration15minAllowed, BasalRate_Duration30minAllowed)),

View file

@ -284,7 +284,23 @@ enum class PumpType {
model = "USER", model = "USER",
tbrSettings = DoseSettings(1.0, 15, 24 * 60, 0.0, 500.0), tbrSettings = DoseSettings(1.0, 15, 24 * 60, 0.0, 500.0),
extendedBolusSettings = DoseSettings(0.1, 15, 12 * 60, 0.1), extendedBolusSettings = DoseSettings(0.1, 15, 12 * 60, 0.1),
pumpCapability = PumpCapability.MDI); pumpCapability = PumpCapability.MDI),
//Diaconn Pump
DIACONN_G8(description = "DiaconnG8",
manufacturer = ManufacturerType.G2e,
model = "Diaconn G8",
bolusSize = 0.01,
specialBolusSize = null,
extendedBolusSettings = DoseSettings(0.05, 10, 5 * 60, 0.05),
pumpTempBasalType = PumpTempBasalType.Absolute,
tbrSettings = DoseSettings(0.01, 30, 24 * 60, 0.0, 6.0),
specialBasalDurations = PumpCapability.BasalRate_Duration30minAllowed,
baseBasalMinValue = 0.05,
baseBasalMaxValue = 3.0,
baseBasalStep = 0.01,
baseBasalSpecialSteps = null,
pumpCapability = PumpCapability.DanaWithHistoryCapabilities);
val description: String val description: String
var manufacturer: ManufacturerType? = null var manufacturer: ManufacturerType? = null
@ -444,5 +460,6 @@ enum class PumpType {
YPSOPUMP -> InterfaceIDs.PumpType.YPSOPUMP YPSOPUMP -> InterfaceIDs.PumpType.YPSOPUMP
MDI -> InterfaceIDs.PumpType.MDI MDI -> InterfaceIDs.PumpType.MDI
USER -> InterfaceIDs.PumpType.USER USER -> InterfaceIDs.PumpType.USER
DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8
} }
} }

View file

@ -62,6 +62,7 @@
<string name="eventtype">Тип събитие</string> <string name="eventtype">Тип събитие</string>
<string name="mgdl">мг/дл</string> <string name="mgdl">мг/дл</string>
<string name="mmol">ммол/л</string> <string name="mmol">ммол/л</string>
<string name="shortgram">гр.</string>
<string name="advancedsettings_title">Допълнителни настройки</string> <string name="advancedsettings_title">Допълнителни настройки</string>
<string name="bluetooth">Bluetooth</string> <string name="bluetooth">Bluetooth</string>
<string name="btwatchdog_title">BT ограничения</string> <string name="btwatchdog_title">BT ограничения</string>
@ -202,6 +203,7 @@
<string name="wear">Часовник</string> <string name="wear">Часовник</string>
<string name="automation">Автоматизация</string> <string name="automation">Автоматизация</string>
<string name="custom">По избор</string> <string name="custom">По избор</string>
<string name="pump">Помпа</string>
<string name="loop">Кръг - Loop</string> <string name="loop">Кръг - Loop</string>
<!-- Command--> <!-- Command-->
<string name="connectiontimedout">Времето за връзка изтече</string> <string name="connectiontimedout">Времето за връзка изтече</string>
@ -285,6 +287,13 @@
<string name="saturday_short">С</string> <string name="saturday_short">С</string>
<string name="sunday_short">Н</string> <string name="sunday_short">Н</string>
<!-- User Entry --> <!-- User Entry -->
<string name="uel_cancel_bolus">СПРИ БОЛУС</string>
<string name="ue_source">Източник</string>
<string name="ue_action">Действие</string>
<plurals name="hours">
<item quantity="one">%1$d час</item>
<item quantity="other">%1$d часа</item>
</plurals>
<plurals name="minutes"> <plurals name="minutes">
<item quantity="one">%1$d минутa</item> <item quantity="one">%1$d минутa</item>
<item quantity="other">%1$d минути</item> <item quantity="other">%1$d минути</item>

View file

@ -382,6 +382,9 @@
<string name="ue_timestamp">Datum</string> <string name="ue_timestamp">Datum</string>
<string name="ue_none">Žádné jednotky</string> <string name="ue_none">Žádné jednotky</string>
<string name="ue_export_to_csv">Exportovat uživatelské záznamy do Excelu (csv)</string> <string name="ue_export_to_csv">Exportovat uživatelské záznamy do Excelu (csv)</string>
<string name="uel_loop_change">SMYČKA ZMĚNĚNA</string>
<string name="uel_loop_removed">SMYČKA ODEBRÁNA</string>
<string name="uel_other">JINÉ</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d den</item> <item quantity="one">%1$d den</item>
<item quantity="few">%1$d dnů</item> <item quantity="few">%1$d dnů</item>

View file

@ -11,7 +11,7 @@
<string name="tempbasaldeliveryerror">Erreur injection basal temporaire</string> <string name="tempbasaldeliveryerror">Erreur injection basal temporaire</string>
<string name="goingtodeliver">%1$.2f U vont être injectées</string> <string name="goingtodeliver">%1$.2f U vont être injectées</string>
<string name="waitingforpump">Attente connection pompe</string> <string name="waitingforpump">Attente connection pompe</string>
<string name="connectingfor">Connexion à %1$d en cours</string> <string name="connectingfor">Connexion en cours : %1$d sec.</string>
<string name="bolusdelivering">%1$.2f U ont été injectées</string> <string name="bolusdelivering">%1$.2f U ont été injectées</string>
<string name="handshaking">Connexion</string> <string name="handshaking">Connexion</string>
<string name="connecting">Connection en cours</string> <string name="connecting">Connection en cours</string>
@ -382,6 +382,9 @@
<string name="ue_timestamp">Horodatage</string> <string name="ue_timestamp">Horodatage</string>
<string name="ue_none">Aucune unité</string> <string name="ue_none">Aucune unité</string>
<string name="ue_export_to_csv">Exporter les entrées utilisateur vers Excel (csv)</string> <string name="ue_export_to_csv">Exporter les entrées utilisateur vers Excel (csv)</string>
<string name="uel_loop_change">BOUCLE CHANGÉE</string>
<string name="uel_loop_removed">BOUCLE SUPPRIMÉE</string>
<string name="uel_other">AUTRE</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d jour</item> <item quantity="one">%1$d jour</item>
<item quantity="other">%1$d jours</item> <item quantity="other">%1$d jours</item>

View file

@ -105,6 +105,7 @@
<string name="notes_label">Note</string> <string name="notes_label">Note</string>
<string name="remove_button">Rimuovi</string> <string name="remove_button">Rimuovi</string>
<string name="addnew">Aggiungi nuovo</string> <string name="addnew">Aggiungi nuovo</string>
<string name="wrong_pump_data">I dati arrivano da un micro differente. Cambia il driver del micro per resettarne lo stato.</string>
<!-- Constraints--> <!-- Constraints-->
<string name="limitingbasalratio">Limitazione max velocità basale a %1$.2f U/h a causa di: %2$s</string> <string name="limitingbasalratio">Limitazione max velocità basale a %1$.2f U/h a causa di: %2$s</string>
<string name="pumplimit">limite micro</string> <string name="pumplimit">limite micro</string>
@ -211,6 +212,7 @@
<string name="pump">Micro</string> <string name="pump">Micro</string>
<string name="loop">Loop</string> <string name="loop">Loop</string>
<string name="ns">NS</string> <string name="ns">NS</string>
<string name="record">Record</string>
<!-- Command--> <!-- Command-->
<string name="connectiontimedout">Time out connessione</string> <string name="connectiontimedout">Time out connessione</string>
<!-- PumpEnactResult--> <!-- PumpEnactResult-->
@ -300,6 +302,7 @@
<string name="uel_carbs">CHO</string> <string name="uel_carbs">CHO</string>
<string name="uel_extended_carbs">CHO ESTESI</string> <string name="uel_extended_carbs">CHO ESTESI</string>
<string name="uel_temp_basal">BASALE TEMPORANEA</string> <string name="uel_temp_basal">BASALE TEMPORANEA</string>
<string name="uel_tt">TARGET TEMPORANEO</string>
<string name="uel_new_profile">NUOVO PROFILO</string> <string name="uel_new_profile">NUOVO PROFILO</string>
<string name="uel_clone_profile">CLONA PROFILO</string> <string name="uel_clone_profile">CLONA PROFILO</string>
<string name="uel_store_profile">MEMORIZZA PROFILO</string> <string name="uel_store_profile">MEMORIZZA PROFILO</string>
@ -318,21 +321,25 @@
<string name="uel_clear_pairing_keys">CANCELLA CHIAVI DI ASSOCIAZIONE</string> <string name="uel_clear_pairing_keys">CANCELLA CHIAVI DI ASSOCIAZIONE</string>
<string name="uel_accepts_temp_basal">ACCETTA BASALE TEMPORANEA</string> <string name="uel_accepts_temp_basal">ACCETTA BASALE TEMPORANEA</string>
<string name="uel_cancel_temp_basal">CANCELLA BASALE TEMPORANEA</string> <string name="uel_cancel_temp_basal">CANCELLA BASALE TEMPORANEA</string>
<string name="uel_cancel_bolus">CANCELLA BOLO</string>
<string name="uel_cancel_extended_bolus">CANCELLA BOLO ESTESO</string> <string name="uel_cancel_extended_bolus">CANCELLA BOLO ESTESO</string>
<string name="uel_cancel_tt">CANCELLA TARGET TEMPORANEO</string>
<string name="uel_careportal">PORTALE</string> <string name="uel_careportal">PORTALE</string>
<string name="uel_site_change">CAMBIO POSIZIONE CANNULA</string> <string name="uel_site_change">CAMBIO POSIZIONE CANNULA</string>
<string name="uel_reservoir_change">CAMBIO SERBATOIO</string> <string name="uel_reservoir_change">CAMBIO SERBATOIO</string>
<string name="uel_calibration">CALIBRAZIONE</string> <string name="uel_calibration">CALIBRAZIONE</string>
<string name="uel_prime_bolus">BOLO DI CARICAMENTO</string> <string name="uel_prime_bolus">BOLO DI CARICAMENTO</string>
<string name="uel_treatment">TRATTAMENTO</string> <string name="uel_treatment">TRATTAMENTO</string>
<string name="uel_careportal_ns_refresh">PORTALE NS AGGIORNAMENTO</string> <string name="uel_careportal_ns_refresh">PORTALE NS: AGGIORNAMENTO</string>
<string name="uel_profile_switch_ns_refresh">CAMBIO PROFILO NS AGGIORNAMENTO</string> <string name="uel_profile_switch_ns_refresh">CAMBIO PROFILO NS: AGGIORNAMENTO</string>
<string name="uel_treatments_ns_refresh">TRATTAMENTI NS AGGIORNAMENTO</string> <string name="uel_treatments_ns_refresh">TRATTAMENTI NS: AGGIORNAMENTO</string>
<string name="uel_tt_ns_refresh">TARGET TEMPORANEO NS: AGGIORNAMENTO</string>
<string name="uel_automation_removed">AUTOMAZIONE RIMOSSA</string> <string name="uel_automation_removed">AUTOMAZIONE RIMOSSA</string>
<string name="uel_bg_removed">BG RIMOSSO</string> <string name="uel_bg_removed">BG RIMOSSO</string>
<string name="uel_careportal_removed">PORTALE RIMOSSO</string> <string name="uel_careportal_removed">PORTALE RIMOSSO</string>
<string name="uel_bolus_removed">BOLO RIMOSSO</string> <string name="uel_bolus_removed">BOLO RIMOSSO</string>
<string name="uel_carbs_removed">CHO RIMOSSI</string> <string name="uel_carbs_removed">CHO RIMOSSI</string>
<string name="uel_temp_basal_removed">BASALE TEMPORANEA RIMOSSA</string>
<string name="uel_extended_bolus_removed">BOLO ESTESO RIMOSSO</string> <string name="uel_extended_bolus_removed">BOLO ESTESO RIMOSSO</string>
<string name="uel_food">CIBO</string> <string name="uel_food">CIBO</string>
<string name="uel_food_removed">CIBO RIMOSSO</string> <string name="uel_food_removed">CIBO RIMOSSO</string>
@ -340,6 +347,7 @@
<string name="uel_profile_switch_removed">CAMBIO PROFILO RIMOSSO</string> <string name="uel_profile_switch_removed">CAMBIO PROFILO RIMOSSO</string>
<string name="uel_restart_events_removed">EVENTI DI RIAVVIO RIMOSSI</string> <string name="uel_restart_events_removed">EVENTI DI RIAVVIO RIMOSSI</string>
<string name="uel_treatment_removed">TRATTAMENTO RIMOSSO</string> <string name="uel_treatment_removed">TRATTAMENTO RIMOSSO</string>
<string name="uel_tt_removed">TARGET TEMPORANEO RIMOSSO</string>
<string name="uel_ns_paused">NS IN PAUSA</string> <string name="uel_ns_paused">NS IN PAUSA</string>
<string name="uel_ns_resume">NS RIPRESA</string> <string name="uel_ns_resume">NS RIPRESA</string>
<string name="uel_ns_queue_cleared">CODA NS CANCELLATA</string> <string name="uel_ns_queue_cleared">CODA NS CANCELLATA</string>
@ -360,12 +368,23 @@
<string name="uel_import_databases">IMPORTA DATABASE</string> <string name="uel_import_databases">IMPORTA DATABASE</string>
<string name="uel_otp_export">ESPORTAZIONE OTP</string> <string name="uel_otp_export">ESPORTAZIONE OTP</string>
<string name="uel_otp_reset">RESET OTP</string> <string name="uel_otp_reset">RESET OTP</string>
<string name="uel_stop_sms">STOP SMS</string>
<string name="uel_export_csv">ESPORTA VOCI UTENTE</string> <string name="uel_export_csv">ESPORTA VOCI UTENTE</string>
<string name="uel_start_aaps">AVVIA AAPS</string>
<string name="uel_exit_aaps">USCITA AAPS</string>
<string name="uel_plugin_enabled">PLUGIN ABILITATO</string>
<string name="uel_plugin_disabled">PLUGIN DISABILITATO</string>
<string name="uel_unknown">SCONOSCIUTO</string> <string name="uel_unknown">SCONOSCIUTO</string>
<string name="ue_string">Stringa</string> <string name="ue_string">Stringa</string>
<string name="ue_source">Fonte</string> <string name="ue_source">Fonte</string>
<string name="ue_utc_offset">Offset UTC</string>
<string name="ue_action">Azione</string> <string name="ue_action">Azione</string>
<string name="ue_timestamp">Data e ora</string>
<string name="ue_none">Nessuna unità</string>
<string name="ue_export_to_csv">Esporta voci utente in Excel (csv)</string> <string name="ue_export_to_csv">Esporta voci utente in Excel (csv)</string>
<string name="uel_loop_change">LOOP CAMBIATO</string>
<string name="uel_loop_removed">LOOP RIMOSSO</string>
<string name="uel_other">ALTRO</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d giorno</item> <item quantity="one">%1$d giorno</item>
<item quantity="other">%1$d giorni</item> <item quantity="other">%1$d giorni</item>

View file

@ -382,6 +382,9 @@
<string name="ue_timestamp">חתימת זמן</string> <string name="ue_timestamp">חתימת זמן</string>
<string name="ue_none">ללא יחידה</string> <string name="ue_none">ללא יחידה</string>
<string name="ue_export_to_csv">יצוא ערכי משתמש לאקסל (csv)</string> <string name="ue_export_to_csv">יצוא ערכי משתמש לאקסל (csv)</string>
<string name="uel_loop_change">הלולאה שונתה</string>
<string name="uel_loop_removed">הלולאה הוסרה</string>
<string name="uel_other">אחר</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d יום</item> <item quantity="one">%1$d יום</item>
<item quantity="two">%1$d ימים</item> <item quantity="two">%1$d ימים</item>

View file

@ -105,6 +105,7 @@
<string name="notes_label">Merknader</string> <string name="notes_label">Merknader</string>
<string name="remove_button">Fjern</string> <string name="remove_button">Fjern</string>
<string name="addnew">Legg til ny</string> <string name="addnew">Legg til ny</string>
<string name="wrong_pump_data">Data kommer fra forskjellige pumper. Bytt pumpevalg for å nullstille pumpens tilstand.</string>
<!-- Constraints--> <!-- Constraints-->
<string name="limitingbasalratio">Begrenser maks basal dose til %1$.2f E/t på grunn av %2$s</string> <string name="limitingbasalratio">Begrenser maks basal dose til %1$.2f E/t på grunn av %2$s</string>
<string name="pumplimit">pumpebegrensning</string> <string name="pumplimit">pumpebegrensning</string>
@ -208,6 +209,10 @@
<string name="wear">Wear</string> <string name="wear">Wear</string>
<string name="automation">Automatisering</string> <string name="automation">Automatisering</string>
<string name="custom">Egendefinert</string> <string name="custom">Egendefinert</string>
<string name="pump">Pumpe</string>
<string name="loop">Loop</string>
<string name="ns">NS</string>
<string name="record">Registrer</string>
<!-- Command--> <!-- Command-->
<string name="connectiontimedout">Tilkoblingen ble tidsavbrutt</string> <string name="connectiontimedout">Tilkoblingen ble tidsavbrutt</string>
<!-- PumpEnactResult--> <!-- PumpEnactResult-->
@ -297,6 +302,7 @@
<string name="uel_carbs">KARBO</string> <string name="uel_carbs">KARBO</string>
<string name="uel_extended_carbs">FORLENGET KARBO</string> <string name="uel_extended_carbs">FORLENGET KARBO</string>
<string name="uel_temp_basal">TEMP BASAL</string> <string name="uel_temp_basal">TEMP BASAL</string>
<string name="uel_tt">MIDLERTIDIG BS MÅL</string>
<string name="uel_new_profile">NY PROFIL</string> <string name="uel_new_profile">NY PROFIL</string>
<string name="uel_clone_profile">KOPIER PROFIL</string> <string name="uel_clone_profile">KOPIER PROFIL</string>
<string name="uel_store_profile">LAGRE PROFIL</string> <string name="uel_store_profile">LAGRE PROFIL</string>
@ -315,23 +321,33 @@
<string name="uel_clear_pairing_keys">NULLSTILL PARRINGS NØKLER</string> <string name="uel_clear_pairing_keys">NULLSTILL PARRINGS NØKLER</string>
<string name="uel_accepts_temp_basal">AKSEPTER TEMP BASAL</string> <string name="uel_accepts_temp_basal">AKSEPTER TEMP BASAL</string>
<string name="uel_cancel_temp_basal">AVBRYT TEMP BASAL</string> <string name="uel_cancel_temp_basal">AVBRYT TEMP BASAL</string>
<string name="uel_cancel_bolus">AVBRYT BOLUS</string>
<string name="uel_cancel_extended_bolus">AVBRYT FORLENGET BOLUS</string> <string name="uel_cancel_extended_bolus">AVBRYT FORLENGET BOLUS</string>
<string name="uel_cancel_tt">AVBRYT MIDLERTIDIG BS MÅL</string>
<string name="uel_careportal">CAREPORTAL</string> <string name="uel_careportal">CAREPORTAL</string>
<string name="uel_site_change">BYTTE SLANGESETT</string>
<string name="uel_reservoir_change">BYTTE RESERVOAR</string>
<string name="uel_calibration">KALIBRERING</string> <string name="uel_calibration">KALIBRERING</string>
<string name="uel_prime_bolus">PRIME BOLUS</string> <string name="uel_prime_bolus">PRIME BOLUS</string>
<string name="uel_treatment">BEHANDLING</string> <string name="uel_treatment">BEHANDLING</string>
<string name="uel_careportal_ns_refresh">CAREPORTAL NS OPPDATER</string> <string name="uel_careportal_ns_refresh">CAREPORTAL NS OPPDATER</string>
<string name="uel_profile_switch_ns_refresh">PROFILBYTTE NS OPPDATER</string> <string name="uel_profile_switch_ns_refresh">PROFILBYTTE NS OPPDATER</string>
<string name="uel_treatments_ns_refresh">BEHANDLINGER NS OPPDATER</string> <string name="uel_treatments_ns_refresh">BEHANDLINGER NS OPPDATER</string>
<string name="uel_tt_ns_refresh">OPPDATER MIDLERTIDIG BS MÅL NS</string>
<string name="uel_automation_removed">AUTOMASJON FJERNET</string> <string name="uel_automation_removed">AUTOMASJON FJERNET</string>
<string name="uel_bg_removed">BS FJERNET</string> <string name="uel_bg_removed">BS FJERNET</string>
<string name="uel_careportal_removed">CAREPORTAL FJERNET</string> <string name="uel_careportal_removed">CAREPORTAL FJERNET</string>
<string name="uel_bolus_removed">BOLUS FJERNET</string>
<string name="uel_carbs_removed">KARBO FJERNET</string>
<string name="uel_temp_basal_removed">MIDLERTIDIG BS MÅL FJERNET</string>
<string name="uel_extended_bolus_removed">FORLENGET BOLUS FJERNET</string> <string name="uel_extended_bolus_removed">FORLENGET BOLUS FJERNET</string>
<string name="uel_food">MAT</string>
<string name="uel_food_removed">MÅLTID FJERNET</string> <string name="uel_food_removed">MÅLTID FJERNET</string>
<string name="uel_profile_removed">PROFIL FJERNET</string> <string name="uel_profile_removed">PROFIL FJERNET</string>
<string name="uel_profile_switch_removed">PROFILBYTTE FJERNET</string> <string name="uel_profile_switch_removed">PROFILBYTTE FJERNET</string>
<string name="uel_restart_events_removed">RESTART HENDELSER FJERNET</string> <string name="uel_restart_events_removed">RESTART HENDELSER FJERNET</string>
<string name="uel_treatment_removed">BEHANDLING FJERNET</string> <string name="uel_treatment_removed">BEHANDLING FJERNET</string>
<string name="uel_tt_removed">MIDLERTIDIG BS MÅL FJERNET</string>
<string name="uel_ns_paused">NS PAUSET</string> <string name="uel_ns_paused">NS PAUSET</string>
<string name="uel_ns_resume">GJENOPPTA NS</string> <string name="uel_ns_resume">GJENOPPTA NS</string>
<string name="uel_ns_queue_cleared">NS KØ SLETTET</string> <string name="uel_ns_queue_cleared">NS KØ SLETTET</string>
@ -352,9 +368,23 @@
<string name="uel_import_databases">IMPORTER DATABASER</string> <string name="uel_import_databases">IMPORTER DATABASER</string>
<string name="uel_otp_export">OTP EKSPORT</string> <string name="uel_otp_export">OTP EKSPORT</string>
<string name="uel_otp_reset">OTP RESET</string> <string name="uel_otp_reset">OTP RESET</string>
<string name="uel_stop_sms">STOPP SMS</string>
<string name="uel_export_csv">EKSPORTER BRUKEROPPFØRINGER</string> <string name="uel_export_csv">EKSPORTER BRUKEROPPFØRINGER</string>
<string name="uel_start_aaps">START AAPS</string>
<string name="uel_exit_aaps">AVSLUTT AAPS</string>
<string name="uel_plugin_enabled">PLUGIN AKTIVERT</string>
<string name="uel_plugin_disabled">PLUGIN DEAKTIVERT</string>
<string name="uel_unknown">UKJENT</string> <string name="uel_unknown">UKJENT</string>
<string name="ue_string">Tekst</string>
<string name="ue_source">Kildekode</string>
<string name="ue_utc_offset">UTC tid forskyvning</string>
<string name="ue_action">Handling</string>
<string name="ue_timestamp">Tidspunkt</string>
<string name="ue_none">Ingen enhet</string>
<string name="ue_export_to_csv">Eksporter brukeroppføringer til Excel (csv)</string> <string name="ue_export_to_csv">Eksporter brukeroppføringer til Excel (csv)</string>
<string name="uel_loop_change">LOOP ENDRET</string>
<string name="uel_loop_removed">LOOP FJERNET</string>
<string name="uel_other">ANNET</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d dag</item> <item quantity="one">%1$d dag</item>
<item quantity="other">%1$d dager</item> <item quantity="other">%1$d dager</item>

View file

@ -382,6 +382,9 @@
<string name="ue_timestamp">Časová pečiatka</string> <string name="ue_timestamp">Časová pečiatka</string>
<string name="ue_none">Žiadna jednotka</string> <string name="ue_none">Žiadna jednotka</string>
<string name="ue_export_to_csv">Exportovať užívateľské záznamy do Excelu (csv)</string> <string name="ue_export_to_csv">Exportovať užívateľské záznamy do Excelu (csv)</string>
<string name="uel_loop_change">UZAVRETÝ OKRUH ZMENENÝ</string>
<string name="uel_loop_removed">UZAVRETÝ OKRUH ODSTRÁNENÝ</string>
<string name="uel_other">INÉ</string>
<plurals name="days"> <plurals name="days">
<item quantity="one">%1$d deň</item> <item quantity="one">%1$d deň</item>
<item quantity="few">%1$d dní</item> <item quantity="few">%1$d dní</item>

View file

@ -39,3 +39,5 @@ files:
translation: /insight/src/main/res/values-%android_code%/exceptions.xml translation: /insight/src/main/res/values-%android_code%/exceptions.xml
- source: /automation/src/main/res/values/strings.xml - source: /automation/src/main/res/values/strings.xml
translation: /automation/src/main/res/values-%android_code%/strings.xml translation: /automation/src/main/res/values-%android_code%/strings.xml
- source: /diaconn/src/main/res/values/strings.xml
translation: /diaconn/src/main/res/values-%android_code%/strings.xml

View file

@ -10,8 +10,6 @@ apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android { android {
defaultConfig { defaultConfig {
versionCode 1
versionName "1.0"
kapt { kapt {
arguments { arguments {
arg("room.incremental", "true") arg("room.incremental", "true")

View file

@ -406,7 +406,8 @@ class DanaPump @Inject constructor(
0x05 -> PumpType.DANA_RS 0x05 -> PumpType.DANA_RS
0x06 -> PumpType.DANA_RS_KOREAN 0x06 -> PumpType.DANA_RS_KOREAN
0x07 -> PumpType.DANA_I 0x07 -> PumpType.DANA_I
else -> PumpType.DANA_R 0x09 -> PumpType.DANA_I
else -> PumpType.USER
} }
companion object { companion object {

View file

@ -43,7 +43,7 @@
<string name="gettingpumpsettings">Obtenir les paramètres pompe</string> <string name="gettingpumpsettings">Obtenir les paramètres pompe</string>
<string name="gettingpumptime">Obtenir l\'heure de la pompe</string> <string name="gettingpumptime">Obtenir l\'heure de la pompe</string>
<string name="largetimedifftitle">Différence horaire importante</string> <string name="largetimedifftitle">Différence horaire importante</string>
<string name="largetimediff">Différence horaire importante:\nL\'heure de la pompe est en écart de plus d\'une heure et demi.\nMerci d\'ajuster manuellement l\'heure de la pompe et assurez-vous que la lecture de l\'historique de la pompe ne cause pas de dysfonctionnements.\nSi possible, effacez l\'historique de la pompe avant de modifier l\'heure ou désactivez la Boucle Fermée pour une DAI après la dernière entrée erronée de l\'historique et au minimum une DAI à partir de maintenant.</string> <string name="largetimediff">Différence horaire importante:\nL\'heure de la pompe est en écart de plus d\'une heure et demi.\nVeuillez ajuster manuellement l\'heure de la pompe et assurez-vous que la lecture de l\'historique de la pompe ne cause pas de dysfonctionnements.\nSi possible, effacez l\'historique de la pompe avant de modifier l\'heure ou désactivez la Boucle Fermée pour une DAI après la dernière entrée erronée de l\'historique et au minimum une DAI à partir de maintenant.</string>
<string name="pairfirst">Veuillez appairer votre pompe avec votre téléphone !</string> <string name="pairfirst">Veuillez appairer votre pompe avec votre téléphone !</string>
<string name="approachingdailylimit">Limite quotidienne d\'insuline proche</string> <string name="approachingdailylimit">Limite quotidienne d\'insuline proche</string>
<string name="startingbolus">Injection du bolus démarrée</string> <string name="startingbolus">Injection du bolus démarrée</string>

View file

@ -7,12 +7,6 @@ apply from: "${project.rootDir}/gradle/android_dependencies.gradle"
apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle" apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle" apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.danaRv2.comm package info.nightscout.androidaps.danaRv2.comm
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.R
import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.danar.comm.MessageBase
import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.events.EventPumpStatusChanged
@ -69,7 +70,7 @@ class MsgHistoryEvents_v2 constructor(
val param2 = intFromBuff(bytes, 9, 2) val param2 = intFromBuff(bytes, 9, 2)
val status: String val status: String
when (recordCode.toInt()) { when (recordCode.toInt()) {
info.nightscout.androidaps.dana.DanaPump.TEMPSTART -> { DanaPump.TEMPSTART -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
val temporaryBasalInfo = temporaryBasalStorage.findTemporaryBasal(datetime, param1.toDouble()) val temporaryBasalInfo = temporaryBasalStorage.findTemporaryBasal(datetime, param1.toDouble())
pumpSync.syncTemporaryBasalWithPumpId( pumpSync.syncTemporaryBasalWithPumpId(
@ -84,7 +85,7 @@ class MsgHistoryEvents_v2 constructor(
status = "TEMPSTART " + dateUtil.timeString(datetime) status = "TEMPSTART " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.TEMPSTOP -> { DanaPump.TEMPSTOP -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime)) aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
pumpSync.syncStopTemporaryBasalWithPumpId( pumpSync.syncStopTemporaryBasalWithPumpId(
timestamp = datetime, timestamp = datetime,
@ -94,7 +95,7 @@ class MsgHistoryEvents_v2 constructor(
status = "TEMPSTOP " + dateUtil.timeString(datetime) status = "TEMPSTOP " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.EXTENDEDSTART -> { DanaPump.EXTENDEDSTART -> {
val newRecord = pumpSync.syncExtendedBolusWithPumpId( val newRecord = pumpSync.syncExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
amount = param1 / 100.0, amount = param1 / 100.0,
@ -107,7 +108,7 @@ class MsgHistoryEvents_v2 constructor(
status = "EXTENDEDSTART " + dateUtil.timeString(datetime) status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.EXTENDEDSTOP -> { DanaPump.EXTENDEDSTOP -> {
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId( val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
endPumpId = datetime, endPumpId = datetime,
@ -117,7 +118,7 @@ class MsgHistoryEvents_v2 constructor(
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime) status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.BOLUS -> { DanaPump.BOLUS -> {
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0) val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
val newRecord = pumpSync.syncBolusWithPumpId( val newRecord = pumpSync.syncBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
@ -130,7 +131,7 @@ class MsgHistoryEvents_v2 constructor(
status = "BOLUS " + dateUtil.timeString(datetime) status = "BOLUS " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.DUALBOLUS -> { DanaPump.DUALBOLUS -> {
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0) val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
val newRecord = pumpSync.syncBolusWithPumpId( val newRecord = pumpSync.syncBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
@ -143,7 +144,7 @@ class MsgHistoryEvents_v2 constructor(
status = "DUALBOLUS " + dateUtil.timeString(datetime) status = "DUALBOLUS " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.DUALEXTENDEDSTART -> { DanaPump.DUALEXTENDEDSTART -> {
val newRecord = pumpSync.syncExtendedBolusWithPumpId( val newRecord = pumpSync.syncExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
amount = param1 / 100.0, amount = param1 / 100.0,
@ -156,7 +157,7 @@ class MsgHistoryEvents_v2 constructor(
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime) status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.DUALEXTENDEDSTOP -> { DanaPump.DUALEXTENDEDSTOP -> {
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId( val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
endPumpId = datetime, endPumpId = datetime,
@ -166,32 +167,32 @@ class MsgHistoryEvents_v2 constructor(
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime) status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.SUSPENDON -> { DanaPump.SUSPENDON -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
status = "SUSPENDON " + dateUtil.timeString(datetime) status = "SUSPENDON " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.SUSPENDOFF -> { DanaPump.SUSPENDOFF -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
status = "SUSPENDOFF " + dateUtil.timeString(datetime) status = "SUSPENDOFF " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.REFILL -> { DanaPump.REFILL -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
status = "REFILL " + dateUtil.timeString(datetime) status = "REFILL " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.PRIME -> { DanaPump.PRIME -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
status = "PRIME " + dateUtil.timeString(datetime) status = "PRIME " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.PROFILECHANGE -> { DanaPump.PROFILECHANGE -> {
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h") aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
status = "PROFILECHANGE " + dateUtil.timeString(datetime) status = "PROFILECHANGE " + dateUtil.timeString(datetime)
} }
info.nightscout.androidaps.dana.DanaPump.CARBS -> { DanaPump.CARBS -> {
val newRecord = pumpSync.syncCarbsWithTimestamp( val newRecord = pumpSync.syncCarbsWithTimestamp(
timestamp = datetime, timestamp = datetime,
amount = param1.toDouble(), amount = param1.toDouble(),

View file

@ -11,8 +11,6 @@ android {
ndkVersion "21.1.6352462" ndkVersion "21.1.6352462"
defaultConfig { defaultConfig {
versionCode 1
versionName "1.0"
ndk { ndk {
moduleName "BleCommandUtil" moduleName "BleCommandUtil"

View file

@ -9,13 +9,15 @@ import android.text.format.DateFormat
import androidx.preference.Preference import androidx.preference.Preference
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.dana.comm.RecordTypes
import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange
import info.nightscout.androidaps.danars.services.DanaRSService import info.nightscout.androidaps.danars.services.DanaRSService
import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.events.EventAppExit import info.nightscout.androidaps.events.EventAppExit
import info.nightscout.androidaps.events.EventConfigBuilderChange import info.nightscout.androidaps.events.EventConfigBuilderChange
import info.nightscout.androidaps.extensions.convertedToAbsolute
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
@ -31,8 +33,6 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.T.Companion.mins import info.nightscout.androidaps.utils.T.Companion.mins
import info.nightscout.androidaps.extensions.convertedToAbsolute
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.sharedPreferences.SP
@ -622,7 +622,7 @@ class DanaRSPlugin @Inject constructor(
} }
override val isFakingTempsByExtendedBoluses: Boolean = false override val isFakingTempsByExtendedBoluses: Boolean = false
override fun loadTDDs(): PumpEnactResult = loadHistory(info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY) override fun loadTDDs(): PumpEnactResult = loadHistory(RecordTypes.RECORD_TYPE_DAILY)
override fun canHandleDST(): Boolean = false override fun canHandleDST(): Boolean = false
override fun clearPairing() { override fun clearPairing() {
sp.remove(resourceHelper.gs(R.string.key_danars_pairingkey) + mDeviceName) sp.remove(resourceHelper.gs(R.string.key_danars_pairingkey) + mDeviceName)

View file

@ -137,7 +137,7 @@ open class DanaRSPacketAPSHistoryEvents(
isAbsolute = false, isAbsolute = false,
type = temporaryBasalInfo?.type, type = temporaryBasalInfo?.type,
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
status = "TEMPSTART " + dateUtil.timeString(datetime) status = "TEMPSTART " + dateUtil.timeString(datetime)
@ -147,7 +147,7 @@ open class DanaRSPacketAPSHistoryEvents(
val newRecord = pumpSync.syncStopTemporaryBasalWithPumpId( val newRecord = pumpSync.syncStopTemporaryBasalWithPumpId(
timestamp = datetime, timestamp = datetime,
endPumpId = pumpId, endPumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
status = "TEMPSTOP " + dateUtil.timeString(datetime) status = "TEMPSTOP " + dateUtil.timeString(datetime)
@ -160,7 +160,7 @@ open class DanaRSPacketAPSHistoryEvents(
duration = T.mins(param2.toLong()).msecs(), duration = T.mins(param2.toLong()).msecs(),
isEmulatingTB = false, isEmulatingTB = false,
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
status = "EXTENDEDSTART " + dateUtil.timeString(datetime) status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
@ -170,7 +170,7 @@ open class DanaRSPacketAPSHistoryEvents(
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId( val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
endPumpId = pumpId, endPumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime) status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
@ -183,7 +183,7 @@ open class DanaRSPacketAPSHistoryEvents(
amount = param1 / 100.0, amount = param1 / 100.0,
type = detailedBolusInfo?.bolusType, type = detailedBolusInfo?.bolusType,
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U ") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U ")
status = "BOLUS " + dateUtil.timeString(datetime) status = "BOLUS " + dateUtil.timeString(datetime)
@ -196,7 +196,7 @@ open class DanaRSPacketAPSHistoryEvents(
amount = param1 / 100.0, amount = param1 / 100.0,
type = detailedBolusInfo?.bolusType, type = detailedBolusInfo?.bolusType,
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
status = "DUALBOLUS " + dateUtil.timeString(datetime) status = "DUALBOLUS " + dateUtil.timeString(datetime)
@ -209,7 +209,7 @@ open class DanaRSPacketAPSHistoryEvents(
duration = T.mins(param2.toLong()).msecs(), duration = T.mins(param2.toLong()).msecs(),
isEmulatingTB = false, isEmulatingTB = false,
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime) status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
@ -219,7 +219,7 @@ open class DanaRSPacketAPSHistoryEvents(
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId( val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
timestamp = datetime, timestamp = datetime,
endPumpId = pumpId, endPumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime) status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
@ -264,7 +264,7 @@ open class DanaRSPacketAPSHistoryEvents(
timestamp = datetime, timestamp = datetime,
amount = param1.toDouble(), amount = param1.toDouble(),
pumpId = pumpId, pumpId = pumpId,
pumpType = PumpType.DANA_RS, pumpType = danaPump.pumpType(),
pumpSerial = danaPump.serialNumber) pumpSerial = danaPump.serialNumber)
aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g") aapsLogger.debug(LTag.PUMPCOMM, "[" + pumpId + "] " + (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g")
status = "CARBS " + dateUtil.timeString(datetime) status = "CARBS " + dateUtil.timeString(datetime)

View file

@ -2,12 +2,13 @@ package info.nightscout.androidaps.danars.comm
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.DanaRSTestBase
import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.danars.encryption.BleEncryption
import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
import info.nightscout.androidaps.danars.DanaRSTestBase
import org.junit.Assert import org.junit.Assert
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -47,7 +48,7 @@ class DanaRsMessageHashTableTest : DanaRSTestBase() {
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0)) `when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector) val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector)
val forTesting: DanaRSPacket = DanaRSPacketAPSSetEventHistory(packetInjector, info.nightscout.androidaps.dana.DanaPump.CARBS, 0, 0, 0) val forTesting: DanaRSPacket = DanaRSPacketAPSSetEventHistory(packetInjector, DanaPump.CARBS, 0, 0, 0)
val testPacket: DanaRSPacket = danaRSMessageHashTable.findMessage(forTesting.command) val testPacket: DanaRSPacket = danaRSMessageHashTable.findMessage(forTesting.command)
Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.opCode.toLong()) Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.opCode.toLong())
} }

View file

@ -7,8 +7,6 @@ apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
android { android {
defaultConfig { defaultConfig {
versionCode 1
versionName "1.0"
kapt { kapt {
arguments { arguments {
arg("room.incremental", "true") arg("room.incremental", "true")

View file

@ -43,6 +43,7 @@ data class InterfaceIDs(
TANDEM_T_SLIM_X2, TANDEM_T_SLIM_X2,
YPSOPUMP, YPSOPUMP,
MDI, MDI,
DIACONN_G8,
USER; USER;
companion object { companion object {

30
diaconn/build.gradle Normal file
View file

@ -0,0 +1,30 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.hiya.jacoco-android'
apply from: "${project.rootDir}/gradle/android_dependencies.gradle"
apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
kapt {
arguments {
arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}
}
dependencies {
implementation project(':core')
api "androidx.room:room-ktx:$room_version"
api "androidx.room:room-runtime:$room_version"
api "androidx.room:room-rxjava2:$room_version"
kapt "androidx.room:room-compiler:$room_version"
}

View file

21
diaconn/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1,92 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "698b023da2f9efdc0351236c43eb20b6",
"entities": [
{
"tableName": "diaconnHistory",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`timestamp` INTEGER NOT NULL, `code` INTEGER NOT NULL, `value` REAL NOT NULL, `bolusType` TEXT NOT NULL, `stringValue` TEXT NOT NULL, `duration` INTEGER NOT NULL, `dailyBasal` REAL NOT NULL, `dailyBolus` REAL NOT NULL, `alarm` TEXT NOT NULL, PRIMARY KEY(`timestamp`))",
"fields": [
{
"fieldPath": "timestamp",
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "code",
"columnName": "code",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "value",
"columnName": "value",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "bolusType",
"columnName": "bolusType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "stringValue",
"columnName": "stringValue",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "duration",
"columnName": "duration",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "dailyBasal",
"columnName": "dailyBasal",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "dailyBolus",
"columnName": "dailyBolus",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "alarm",
"columnName": "alarm",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"timestamp"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_diaconnHistory_code_timestamp",
"unique": false,
"columnNames": [
"code",
"timestamp"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_diaconnHistory_code_timestamp` ON `${TABLE_NAME}` (`code`, `timestamp`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '698b023da2f9efdc0351236c43eb20b6')"
]
}
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.androidaps.diaconn">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application>
<activity android:name="info.nightscout.androidaps.diaconn.activities.DiaconnG8HistoryActivity" />
<activity android:name="info.nightscout.androidaps.diaconn.activities.DiaconnG8UserOptionsActivity" />
<activity android:name="info.nightscout.androidaps.diaconn.activities.DiaconnG8BLEScanActivity">
<intent-filter>
<action android:name="info.nightscout.androidaps.plugins.PumpDiaconnG8.activities.DiaconnG8BLEScanActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name="info.nightscout.androidaps.diaconn.service.DiaconnG8Service"
android:enabled="true"
android:exported="false"/>
</application>
</manifest>

View file

@ -0,0 +1,198 @@
package info.nightscout.androidaps.diaconn
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.activities.TDDStatsActivity
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8FragmentBinding
import info.nightscout.androidaps.diaconn.events.EventDiaconnG8NewStatus
import info.nightscout.androidaps.events.EventExtendedBolusChange
import info.nightscout.androidaps.events.EventInitializationChanged
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.events.EventTempBasalChange
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Pump
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.queue.events.EventQueueChanged
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.WarnColors
import io.reactivex.rxkotlin.plusAssign
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import javax.inject.Inject
class DiaconnG8Fragment : DaggerFragment() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var sp: SP
@Inject lateinit var warnColors: WarnColors
@Inject lateinit var dateUtil: DateUtil
private var disposable: CompositeDisposable = CompositeDisposable()
private val loopHandler = Handler()
private lateinit var refreshLoop: Runnable
private var _binding: DiaconnG8FragmentBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
init {
refreshLoop = Runnable {
activity?.runOnUiThread { updateGUI() }
loopHandler.postDelayed(refreshLoop, T.mins(1).msecs())
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
_binding = DiaconnG8FragmentBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.diaconnG8Pumpstatus.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder))
binding.history.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.diaconn.activities.DiaconnG8HistoryActivity::class.java)) }
binding.stats.setOnClickListener { startActivity(Intent(context, TDDStatsActivity::class.java)) }
binding.userOptions.setOnClickListener { startActivity(Intent(context, info.nightscout.androidaps.diaconn.activities.DiaconnG8UserOptionsActivity::class.java)) }
binding.btconnection.setOnClickListener {
aapsLogger.debug(LTag.PUMP, "Clicked connect to pump")
diaconnG8Pump.lastConnection = 0
commandQueue.readStatus("Clicked connect to pump", null)
}
}
@Synchronized
override fun onResume() {
super.onResume()
loopHandler.postDelayed(refreshLoop, T.mins(1).msecs())
disposable += rxBus
.toObservable(EventInitializationChanged::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGUI() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventDiaconnG8NewStatus::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGUI() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventExtendedBolusChange::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGUI() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventTempBasalChange::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGUI() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventQueueChanged::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGUI() }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventPumpStatusChanged::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
when (it.status) {
EventPumpStatusChanged.Status.CONNECTING ->
@Suppress("SetTextI18n")
binding.btconnection.text = "{fa-bluetooth-b spin} ${it.secondsElapsed}s"
EventPumpStatusChanged.Status.CONNECTED ->
@Suppress("SetTextI18n")
binding.btconnection.text = "{fa-bluetooth}"
EventPumpStatusChanged.Status.DISCONNECTED ->
@Suppress("SetTextI18n")
binding.btconnection.text = "{fa-bluetooth-b}"
else -> {}
}
if (it.getStatus(resourceHelper) != "") {
binding.diaconnG8Pumpstatus.text = it.getStatus(resourceHelper)
binding.diaconnG8Pumpstatuslayout.visibility = View.VISIBLE
} else {
binding.diaconnG8Pumpstatuslayout.visibility = View.GONE
}
}, fabricPrivacy::logException)
updateGUI()
}
@Synchronized
override fun onPause() {
super.onPause()
disposable.clear()
loopHandler.removeCallbacks(refreshLoop)
}
@Synchronized
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
@SuppressLint("SetTextI18n")
@Synchronized
fun updateGUI() {
if (_binding == null) return
val pump = diaconnG8Pump
val plugin: Pump = activePlugin.activePump
if (pump.lastConnection != 0L) {
val agoMsec = System.currentTimeMillis() - pump.lastConnection
val agoMin = (agoMsec.toDouble() / 60.0 / 1000.0).toInt()
binding.lastconnection.text = dateUtil.timeString(pump.lastConnection) + " (" + resourceHelper.gs(R.string.minago, agoMin) + ")"
warnColors.setColor(binding.lastconnection, agoMin.toDouble(), 16.0, 31.0)
}
if (pump.lastBolusTime != 0L) {
val agoMsec = System.currentTimeMillis() - pump.lastBolusTime
val agoHours = agoMsec.toDouble() / 60.0 / 60.0 / 1000.0
if (agoHours < 6)
// max 6h back
binding.lastbolus.text = dateUtil.timeString(pump.lastBolusTime) + " " + dateUtil.sinceString(pump.lastBolusTime, resourceHelper) + " " + resourceHelper.gs(R.string.formatinsulinunits, pump.lastBolusAmount)
else
binding.lastbolus.text = ""
}
val todayInsulinAmount = (pump.todayBaseAmount + pump.todaySnackAmount + pump.todayMealAmount)
val todayInsulinLimitAmount = (pump.maxBasal.toInt() * 24) + pump.maxBolusePerDay.toInt()
binding.dailyunits.text = resourceHelper.gs(R.string.reservoirvalue, todayInsulinAmount, todayInsulinLimitAmount)
warnColors.setColor(binding.dailyunits, todayInsulinAmount, todayInsulinLimitAmount * 0.75, todayInsulinLimitAmount * 0.9)
binding.basabasalrate.text = pump.baseInjAmount.toString() +" / "+ resourceHelper.gs(R.string.pump_basebasalrate, plugin.baseBasalRate)
binding.tempbasal.text = diaconnG8Pump.temporaryBasalToString()
binding.extendedbolus.text = diaconnG8Pump.extendedBolusToString()
binding.reservoir.text = resourceHelper.gs(R.string.reservoirvalue, pump.systemRemainInsulin, 307)
warnColors.setColorInverse(binding.reservoir, pump.systemRemainInsulin , 50.0, 20.0)
binding.battery.text = "{fa-battery-" + pump.systemRemainBattery / 25 + "}" + " ("+ pump.systemRemainBattery + " %)"
warnColors.setColorInverse(binding.battery, pump.systemRemainBattery.toDouble(), 51.0, 26.0)
binding.firmware.text = resourceHelper.gs(R.string.diaconn_g8_pump) + "\nVersion: " + pump.majorVersion.toString() + "." + pump.minorVersion.toString() + "\nCountry: "+pump.country.toString() + "\nProductType: "+ pump.productType.toString() + "\nManufacture: " + pump.makeYear + "." + pump.makeMonth + "." + pump.makeDay
binding.basalstep.text = pump.basalStep.toString()
binding.bolusstep.text = pump.bolusStep.toString()
binding.serialNumber.text = pump.serialNo.toString()
val status = commandQueue.spannedStatus()
if (status.toString() == "") {
binding.queue.visibility = View.GONE
} else {
binding.queue.visibility = View.VISIBLE
binding.queue.text = status
}
binding.userOptions.visibility = View.VISIBLE
}
}

View file

@ -0,0 +1,593 @@
package info.nightscout.androidaps.diaconn
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.IBinder
import android.text.format.DateFormat
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange
import info.nightscout.androidaps.diaconn.service.DiaconnG8Service
import info.nightscout.androidaps.events.EventAppExit
import info.nightscout.androidaps.events.EventConfigBuilderChange
import info.nightscout.androidaps.extensions.convertedToAbsolute
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.common.ManufacturerType
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction
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.events.EventOverviewBolusProgress
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers
import org.json.JSONException
import org.json.JSONObject
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.abs
import kotlin.math.max
@Singleton
class DiaconnG8Plugin @Inject constructor(
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
private val rxBus: RxBusWrapper,
private val context: Context,
resourceHelper: ResourceHelper,
private val constraintChecker: ConstraintChecker,
private val profileFunction: ProfileFunction,
private val sp: SP,
commandQueue: CommandQueueProvider,
private val diaconnG8Pump: DiaconnG8Pump,
private val pumpSync: PumpSync,
private val detailedBolusInfoStorage: DetailedBolusInfoStorage,
private val temporaryBasalStorage: TemporaryBasalStorage,
private val fabricPrivacy: FabricPrivacy,
private val dateUtil: DateUtil
) : PumpPluginBase(PluginDescription()
.mainType(PluginType.PUMP)
.fragmentClass(DiaconnG8Fragment::class.java.name)
.pluginIcon(R.drawable.ic_diaconn_g8)
.pluginName(R.string.diaconn_g8_pump)
.shortName(R.string.diaconn_g8_pump_shortname)
.preferencesId(R.xml.pref_diaconn)
.description(R.string.description_pump_diaconn_g8),
injector, aapsLogger, resourceHelper, commandQueue
), Pump, Diaconn, Constraints {
private val disposable = CompositeDisposable()
private var diaconnG8Service: DiaconnG8Service? = null
private var mDeviceAddress = ""
var mDeviceName = ""
override val pumpDescription = PumpDescription(PumpType.DIACONN_G8)
override fun onStart() {
super.onStart()
val intent = Intent(context, DiaconnG8Service::class.java)
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE)
disposable.add(rxBus
.toObservable(EventAppExit::class.java)
.observeOn(Schedulers.io())
.subscribe({ context.unbindService(mConnection) }) { fabricPrivacy.logException(it) }
)
disposable.add(rxBus
.toObservable(EventConfigBuilderChange::class.java)
.observeOn(Schedulers.io())
.subscribe { diaconnG8Pump.reset() }
)
disposable.add(rxBus
.toObservable(EventDiaconnG8DeviceChange::class.java)
.observeOn(Schedulers.io())
.subscribe({ changePump() }) { fabricPrivacy.logException(it) }
)
changePump() // load device name
}
override fun onStop() {
context.unbindService(mConnection)
disposable.clear()
super.onStop()
}
private val mConnection: ServiceConnection = object : ServiceConnection {
override fun onServiceDisconnected(name: ComponentName) {
aapsLogger.debug(LTag.PUMP, "Service is disconnected")
diaconnG8Service = null
}
override fun onServiceConnected(name: ComponentName, service: IBinder) {
aapsLogger.debug(LTag.PUMP, "Service is connected")
val mLocalBinder = service as DiaconnG8Service.LocalBinder
diaconnG8Service = mLocalBinder.serviceInstance
}
}
fun changePump() {
mDeviceAddress = sp.getString(R.string.key_diaconn_g8_address, "")
mDeviceName = sp.getString(R.string.key_diaconn_g8_name, "")
diaconnG8Pump.reset()
commandQueue.readStatus("DeviceChanged", null)
}
override fun connect(reason: String) {
aapsLogger.debug(LTag.PUMP, "Diaconn G8 connect from: $reason")
if(diaconnG8Service != null && mDeviceAddress != "" && mDeviceName != "") {
val success = diaconnG8Service?.connect(reason, mDeviceAddress) ?: false
if(!success) ToastUtils.showToastInUiThread(context, resourceHelper.gs(R.string.ble_not_supported))
}
}
override fun isConnected(): Boolean = diaconnG8Service?.isConnected ?: false
override fun isConnecting(): Boolean = diaconnG8Service?.isConnecting ?: false
override fun isHandshakeInProgress(): Boolean = false
override fun disconnect(reason: String) {
aapsLogger.debug(LTag.PUMP, "Diaconn G8 disconnect from: $reason")
diaconnG8Service?.disconnect(reason)
}
override fun stopConnecting() {
diaconnG8Service?.stopConnecting()
}
override fun getPumpStatus(reason: String) {
diaconnG8Service?.readPumpStatus()
pumpDescription.basalStep = diaconnG8Pump.basalStep
pumpDescription.bolusStep = diaconnG8Pump.bolusStep
pumpDescription.basalMaximumRate = diaconnG8Pump.maxBasalPerHours
}
// Diaconn Pump Interface
override fun loadHistory(): PumpEnactResult {
return diaconnG8Service?.loadHistory() ?: PumpEnactResult(injector).success(false)
}
override fun setUserOptions(): PumpEnactResult {
return diaconnG8Service?.setUserSettings() ?: PumpEnactResult(injector).success(false)
}
// Constraints interface
override fun applyBasalConstraints(absoluteRate: Constraint<Double>, profile: Profile): Constraint<Double> {
absoluteRate.setIfSmaller(aapsLogger, diaconnG8Pump.maxBasal, resourceHelper.gs(R.string.limitingbasalratio, diaconnG8Pump.maxBasal, resourceHelper.gs(R.string.pumplimit)), this)
return absoluteRate
}
override fun applyBasalPercentConstraints(percentRate: Constraint<Int>, profile: Profile): Constraint<Int> {
percentRate.setIfGreater(aapsLogger, 0, resourceHelper.gs(R.string.limitingpercentrate, 0, resourceHelper.gs(R.string.itmustbepositivevalue)), this)
percentRate.setIfSmaller(aapsLogger, pumpDescription.maxTempPercent, resourceHelper.gs(R.string.limitingpercentrate, pumpDescription.maxTempPercent, resourceHelper.gs(R.string.pumplimit)), this)
return percentRate
}
override fun applyBolusConstraints(insulin: Constraint<Double>): Constraint<Double> {
insulin.setIfSmaller(aapsLogger, diaconnG8Pump.maxBolus, resourceHelper.gs(R.string.limitingbolus, diaconnG8Pump.maxBolus, resourceHelper.gs(R.string.pumplimit)), this)
return insulin
}
override fun applyExtendedBolusConstraints(insulin: Constraint<Double>): Constraint<Double> {
return applyBolusConstraints(insulin)
}
// Pump interface
override fun isInitialized(): Boolean =
diaconnG8Pump.lastConnection > 0 && diaconnG8Pump.maxBasal > 0
override fun isSuspended(): Boolean =
diaconnG8Pump.basePauseStatus == 1
override fun isBusy(): Boolean =
diaconnG8Service?.isConnected ?: false || diaconnG8Service?.isConnecting ?: false
override fun setNewBasalProfile(profile: Profile): PumpEnactResult {
val result = PumpEnactResult(injector)
if (!isInitialized()) {
val notification = Notification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, resourceHelper.gs(R.string.pumpNotInitializedProfileNotSet), Notification.URGENT)
rxBus.send(EventNewNotification(notification))
result.comment = resourceHelper.gs(R.string.pumpNotInitializedProfileNotSet)
return result
} else {
rxBus.send(EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED))
}
return if (diaconnG8Service?.updateBasalsInPump(profile) != true) {
val notification = Notification(Notification.FAILED_UPDATE_PROFILE, resourceHelper.gs(R.string.failedupdatebasalprofile), Notification.URGENT)
rxBus.send(EventNewNotification(notification))
result.comment = resourceHelper.gs(R.string.failedupdatebasalprofile)
result
} else {
rxBus.send(EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED))
rxBus.send(EventDismissNotification(Notification.FAILED_UPDATE_PROFILE))
val notification = Notification(Notification.PROFILE_SET_OK, resourceHelper.gs(R.string.profile_set_ok), Notification.INFO, 60)
rxBus.send(EventNewNotification(notification))
result.success = true
result.enacted = true
result.comment = "OK"
result
}
}
override fun isThisProfileSet(profile: Profile): Boolean {
if (!isInitialized()) return true // TODO: not sure what's better. so far TRUE to prevent too many SMS
if (diaconnG8Pump.pumpProfiles == null) return true // TODO: not sure what's better. so far TRUE to prevent too many SMS
val basalValues = 24
val basalIncrement = 60 * 60
for (h in 0 until basalValues) {
val pumpValue = diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][h]
val profileValue = profile.getBasalTimeFromMidnight(h * basalIncrement)
if (abs(pumpValue - profileValue) > pumpDescription.basalStep) {
aapsLogger.debug(LTag.PUMP, "Diff found. Hour: $h Pump: $pumpValue Profile: $profileValue")
return false
}
}
return true
}
override fun lastDataTime(): Long = diaconnG8Pump.lastConnection
override val baseBasalRate: Double
get() = diaconnG8Pump.baseAmount
override val reservoirLevel: Double
get() = diaconnG8Pump.systemRemainInsulin
override val batteryLevel: Int
get() = diaconnG8Pump.systemRemainBattery
@Synchronized
override fun deliverTreatment(detailedBolusInfo: DetailedBolusInfo): PumpEnactResult {
detailedBolusInfo.insulin = constraintChecker.applyBolusConstraints(Constraint(detailedBolusInfo.insulin)).value()
return if (detailedBolusInfo.insulin > 0 || detailedBolusInfo.carbs > 0) {
val carbs = detailedBolusInfo.carbs
detailedBolusInfo.carbs = 0.0
var carbTimeStamp = detailedBolusInfo.carbsTimestamp ?: detailedBolusInfo.timestamp
if (carbTimeStamp == detailedBolusInfo.timestamp) carbTimeStamp -= T.mins(1).msecs() // better set 1 min back to prevents clash with insulin
detailedBolusInfoStorage.add(detailedBolusInfo) // will be picked up on reading history
val t = EventOverviewBolusProgress.Treatment(0.0, 0, detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB)
var connectionOK = false
if (detailedBolusInfo.insulin > 0 || carbs > 0) connectionOK = diaconnG8Service?.bolus(detailedBolusInfo.insulin, carbs.toInt(), carbTimeStamp, t)
?: false
val result = PumpEnactResult(injector)
result.success = connectionOK
result.bolusDelivered = t.insulin
result.carbsDelivered = detailedBolusInfo.carbs
if(result.success) result.enacted = true
if (!result.success) {
setErrorMsg(diaconnG8Pump.resultErrorCode, result)
} else result.comment = resourceHelper.gs(R.string.ok)
aapsLogger.debug(LTag.PUMP, "deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.bolusDelivered)
result
} else {
val result = PumpEnactResult(injector)
result.success = false
result.bolusDelivered = 0.0
result.carbsDelivered = 0.0
result.comment = resourceHelper.gs(R.string.invalidinput)
aapsLogger.error("deliverTreatment: Invalid input")
result
}
}
override fun stopBolusDelivering() {
diaconnG8Service?.bolusStop()
}
// This is called from APS
@Synchronized
override fun setTempBasalAbsolute(absoluteRate: Double, durationInMinutes: Int, profile: Profile, enforceNew: Boolean, tbrType: PumpSync.TemporaryBasalType): PumpEnactResult {
val result = PumpEnactResult(injector)
var absoluteAfterConstrain = constraintChecker.applyBasalConstraints(Constraint(absoluteRate), profile).value()
val doTempOff = baseBasalRate - absoluteAfterConstrain == 0.0
val doLowTemp = absoluteAfterConstrain < baseBasalRate
val doHighTemp = absoluteAfterConstrain > baseBasalRate
if (doTempOff) {
// If temp in progress
if (diaconnG8Pump.isTempBasalInProgress) {
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Stopping temp basal (doTempOff)")
return cancelTempBasal(false)
}
result.success = true
result.enacted = false
result.absolute = baseBasalRate
result.isPercent = false
result.isTempCancel = true
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: doTempOff OK")
return result
}
if (doLowTemp || doHighTemp) {
// Check if some temp is already in progress
if(absoluteAfterConstrain > 6.0) absoluteAfterConstrain = 6.0 // pumpLimit
//val activeTemp = activePluginProvider.activeTreatments.getTempBasalFromHistory(System.currentTimeMillis())
if (diaconnG8Pump.isTempBasalInProgress) {
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: currently running")
// Correct basal already set ?
if (diaconnG8Pump.tempBasalAbsoluteRate == absoluteAfterConstrain && diaconnG8Pump.tempBasalRemainingMin > 4) {
if (!enforceNew) {
result.success = true
result.absolute = absoluteAfterConstrain
result.enacted = false
result.duration = diaconnG8Pump.tempBasalRemainingMin
result.isPercent = false
result.isTempCancel = false
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Correct temp basal already set (doLowTemp || doHighTemp)")
return result
}
}
}
temporaryBasalStorage.add(PumpSync.PumpState.TemporaryBasal(dateUtil.now(), T.mins(durationInMinutes.toLong()).msecs(), absoluteRate, true, tbrType, 0L, 0L))
// Convert duration from minutes to hours
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting temp basal $absoluteAfterConstrain U for $durationInMinutes mins (doLowTemp || doHighTemp)")
val connectionOK: Boolean = if (durationInMinutes == 15 || durationInMinutes == 30) {
diaconnG8Service?.tempBasalShortDuration(absoluteAfterConstrain, durationInMinutes) ?: false
} else {
val durationInHours = max(durationInMinutes / 60.0, 1.0)
diaconnG8Service?.tempBasal(absoluteAfterConstrain, durationInHours) ?: false
}
if (connectionOK && diaconnG8Pump.isTempBasalInProgress && diaconnG8Pump.tempBasalAbsoluteRate == absoluteAfterConstrain) {
result.enacted = true
result.success = true
result.comment = resourceHelper.gs(R.string.ok)
result.isTempCancel = false
result.duration = diaconnG8Pump.tempBasalRemainingMin
result.absolute = diaconnG8Pump.tempBasalAbsoluteRate
result.isPercent = false
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: OK")
return result
}
}
result.enacted = false
result.success = false
result.comment = resourceHelper.gs(R.string.tempbasaldeliveryerror)
aapsLogger.error("setTempBasalAbsolute: Failed to set temp basal")
return result
}
@Synchronized
override fun setTempBasalPercent(percent: Int, durationInMinutes: Int, profile: Profile, enforceNew: Boolean, tbrType: PumpSync.TemporaryBasalType): PumpEnactResult {
return if (percent == 0) {
setTempBasalAbsolute(0.0, durationInMinutes, profile, enforceNew, tbrType)
} else {
var absoluteValue = profile.getBasal() * (percent / 100.0)
absoluteValue = pumpDescription.pumpType.determineCorrectBasalSize(absoluteValue)
aapsLogger.warn(LTag.PUMP, "setTempBasalPercent [DiaconnG8Plugin] - You are trying to use setTempBasalPercent with percent other then 0% ($percent). This will start setTempBasalAbsolute, with calculated value ($absoluteValue). Result might not be 100% correct.")
setTempBasalAbsolute(absoluteValue, durationInMinutes, profile, enforceNew, tbrType)
}
}
@Synchronized
override fun setExtendedBolus(insulin: Double, durationInMinutes: Int): PumpEnactResult {
var insulinAfterConstraint = constraintChecker.applyExtendedBolusConstraints(Constraint(insulin)).value()
// needs to be rounded
insulinAfterConstraint = Round.roundTo(insulinAfterConstraint, pumpDescription.extendedBolusStep)
val result = PumpEnactResult(injector)
if (diaconnG8Pump.isExtendedInProgress && abs(diaconnG8Pump.extendedBolusAmount - insulinAfterConstraint) < pumpDescription.extendedBolusStep) {
result.enacted = false
result.success = true
result.comment = resourceHelper.gs(R.string.ok)
result.duration = diaconnG8Pump.extendedBolusRemainingMinutes
result.absolute = diaconnG8Pump.extendedBolusAbsoluteRate
result.isPercent = false
result.isTempCancel = false
aapsLogger.debug(LTag.PUMP, "setExtendedBolus: Correct extended bolus already set. Current: " + diaconnG8Pump.extendedBolusAmount + " Asked: " + insulinAfterConstraint)
return result
}
val connectionOK = diaconnG8Service?.extendedBolus(insulinAfterConstraint, durationInMinutes)
?: false
if (connectionOK) {
result.enacted = true
result.success = true
result.comment = resourceHelper.gs(R.string.ok)
result.isTempCancel = false
result.duration = diaconnG8Pump.extendedBolusRemainingMinutes
result.absolute = diaconnG8Pump.extendedBolusAbsoluteRate
result.bolusDelivered = diaconnG8Pump.extendedBolusAmount
result.isPercent = false
aapsLogger.debug(LTag.PUMP, "setExtendedBolus: OK")
return result
}
result.enacted = false
result.success = false
setErrorMsg(diaconnG8Pump.resultErrorCode, result)
aapsLogger.error("setExtendedBolus: Failed to extended bolus")
return result
}
@Synchronized
override fun cancelTempBasal(enforceNew: Boolean): PumpEnactResult {
val result = PumpEnactResult(injector)
if (diaconnG8Pump.isTempBasalInProgress) {
diaconnG8Service?.tempBasalStop()
result.success = !diaconnG8Pump.isTempBasalInProgress
result.enacted = true
result.isTempCancel = true
if(!result.success) setErrorMsg(diaconnG8Pump.resultErrorCode, result)
} else {
result.success = true
result.enacted = false
result.isTempCancel = true
result.comment = resourceHelper.gs(R.string.ok)
aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK")
}
return result
}
@Synchronized override fun cancelExtendedBolus(): PumpEnactResult {
val result = PumpEnactResult(injector)
if (diaconnG8Pump.isExtendedInProgress) {
diaconnG8Service?.extendedBolusStop()
result.success = !diaconnG8Pump.isExtendedInProgress
result.enacted = true
if(!result.success) {
setErrorMsg(diaconnG8Pump.resultErrorCode, result)
diaconnG8Service?.readPumpStatus()
}
} else {
result.success = true
result.enacted = false
result.comment = resourceHelper.gs(R.string.ok)
aapsLogger.debug(LTag.PUMP, "cancelExtendedBolus: OK")
}
return result
}
override fun getJSONStatus(profile: Profile, profileName: String, version: String): JSONObject {
val now = System.currentTimeMillis()
if (diaconnG8Pump.lastConnection + 60 * 60 * 1000L < System.currentTimeMillis()) {
return JSONObject()
}
val pumpJson = JSONObject()
val battery = JSONObject()
val status = JSONObject()
val extended = JSONObject()
try {
battery.put("percent", diaconnG8Pump.systemRemainBattery)
status.put("status", if (diaconnG8Pump.pumpSuspended) "suspended" else "normal")
status.put("timestamp", dateUtil.toISOString(diaconnG8Pump.lastConnection))
extended.put("Version", version)
if (diaconnG8Pump.lastBolusTime != 0L) {
extended.put("LastBolus", dateUtil.dateAndTimeString(diaconnG8Pump.lastBolusTime))
extended.put("LastBolusAmount", diaconnG8Pump.lastBolusAmount)
}
val tb = pumpSync.expectedPumpState().temporaryBasal
if (tb != null) {
extended.put("TempBasalAbsoluteRate", tb.convertedToAbsolute(now, profile))
extended.put("TempBasalStart", dateUtil.dateAndTimeString(tb.timestamp))
extended.put("TempBasalRemaining", tb.plannedRemainingMinutes)
}
val eb = pumpSync.expectedPumpState().extendedBolus
if (eb != null) {
extended.put("ExtendedBolusAbsoluteRate", eb.rate)
extended.put("ExtendedBolusStart", dateUtil.dateAndTimeString(eb.timestamp))
extended.put("ExtendedBolusRemaining", eb.plannedRemainingMinutes)
}
extended.put("BaseBasalRate", baseBasalRate)
try {
extended.put("ActiveProfile", profileFunction.getProfileName())
} catch (e: Exception) {
aapsLogger.error("Unhandled exception", e)
}
pumpJson.put("battery", battery)
pumpJson.put("status", status)
pumpJson.put("extended", extended)
pumpJson.put("reservoir", diaconnG8Pump.systemRemainInsulin.toInt())
pumpJson.put("clock", dateUtil.toISOString(now))
} catch (e: JSONException) {
aapsLogger.error("Unhandled exception", e)
}
return pumpJson
}
override fun manufacturer(): ManufacturerType {
return ManufacturerType.G2e
}
override fun model(): PumpType {
return PumpType.DIACONN_G8
}
override fun serialNumber(): String {
return diaconnG8Pump.serialNo.toString()
}
override fun shortStatus(veryShort: Boolean): String {
var ret = ""
if (diaconnG8Pump.lastConnection != 0L) {
val agoMillis = System.currentTimeMillis() - diaconnG8Pump.lastConnection
val agoMin = (agoMillis / 60.0 / 1000.0).toInt()
ret += "LastConn: $agoMin minago\n"
}
if (diaconnG8Pump.lastBolusTime != 0L)
ret += "LastBolus: ${DecimalFormatter.to2Decimal(diaconnG8Pump.lastBolusAmount)}U @${DateFormat.format("HH:mm", diaconnG8Pump.lastBolusTime)}"
if (diaconnG8Pump.isTempBasalInProgress)
ret += "Temp: ${diaconnG8Pump.temporaryBasalToString()}"
if (diaconnG8Pump.isExtendedInProgress)
ret += "Extended: ${diaconnG8Pump.extendedBolusToString()}\n"
if (!veryShort) {
ret += "TDD: ${DecimalFormatter.to0Decimal(diaconnG8Pump.dailyTotalUnits)} / ${diaconnG8Pump.maxDailyTotalUnits} U"
}
ret += "Reserv: ${DecimalFormatter.to0Decimal(diaconnG8Pump.systemRemainInsulin)} U"
ret += "Batt: ${diaconnG8Pump.systemRemainBattery}"
return ret
}
override val isFakingTempsByExtendedBoluses: Boolean = false
override fun loadTDDs(): PumpEnactResult = loadHistory()
override fun getCustomActions(): List<CustomAction>? = null
override fun executeCustomAction(customActionType: CustomActionType) {}
override fun canHandleDST(): Boolean = false
fun isBatteryChangeLoggingEnabled():Boolean {
return sp.getBoolean(R.string.key_diaconn_g8_logbatterychange, false)
}
fun isInsulinChangeLoggingEnabled():Boolean {
return sp.getBoolean(R.string.key_diaconn_g8_loginsulinchange, false)
}
@Synchronized
fun setErrorMsg(errorCode: Int, result: PumpEnactResult) {
when (errorCode) {
1 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_1)
2 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_2)
3 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_3)
4 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_4)
6 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_6)
7 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_7)
8 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_8)
9 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_9)
10 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_10)
11 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_11)
12 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_12)
13 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_13)
14 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_14)
15 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_15)
32 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_32)
33 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_33)
34 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_34)
35 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_35)
36 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_36)
else -> result.comment = "not defined Error code: $errorCode"
}
}
override fun preprocessPreferences(preferenceFragment: PreferenceFragmentCompat) {
val bolusSpeedPreference: Preference? = preferenceFragment.findPreference(resourceHelper.gs(R.string.key_diaconn_g8_bolusspeed))
bolusSpeedPreference?.setOnPreferenceChangeListener { _, newValue ->
val intBolusSpeed = newValue.toString().toInt()
diaconnG8Pump.bolusSpeed = intBolusSpeed
diaconnG8Pump.speed = intBolusSpeed
diaconnG8Pump.setUserOptionType = DiaconnG8Pump.BOLUS_SPEED
sp.putBoolean("diaconn_g8_isbolusspeedsync", false)
true
}
}
}

View file

@ -0,0 +1,374 @@
package info.nightscout.androidaps.diaconn
import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.interfaces.PumpSync
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.androidaps.utils.T
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.max
import kotlin.math.min
import kotlin.math.roundToInt
@Singleton
class DiaconnG8Pump @Inject constructor(
private val aapsLogger: AAPSLogger,
private val dateUtil: DateUtil
) {
var maxBolusePerDay: Double = 0.0
var pumpIncarnationNum: Int = 65536
var isPumpVersionGe2_63: Boolean = false // is pumpVersion higher then 2.63
var insulinWarningGrade: Int =0
var insulinWarningProcess: Int =0
var insulinWarningRemain: Int =0
var batteryWaningGrade: Int = 0
var batteryWaningProcess: Int = 0
var batteryWaningRemain: Int = 0
var injectionBlockType: Int =0
var injectionBlockRemainAmount: Double = 0.0
var injectionBlockProcess: Int = 0
var injectionBlockGrade: Int = 0
var lastConnection: Long = 0
var lastSettingsRead: Long = 0
// time
private var pumpTime: Long = 0
fun setPumpTime(value: Long) {
pumpTime = value
}
fun getPumpTime() = pumpTime
// Status
var pumpSuspended = false
var dailyTotalUnits = 0.0
var maxDailyTotalUnits = 0
var bolusStep = 0.01
var basalStep = 0.01
var iob = 0.0
var bolusBlocked = false
var lastBolusTime: Long = 0
var lastBolusAmount = 0.0
/*
* TEMP BASALS
*/
var tempBasalStart: Long = 0
var tempBasalDuration: Long = 0 // in milliseconds
var tempBasalAbsoluteRate: Double = 0.0
var tempBasalPercent: Int = 0
var tempBasalTotalSec: Long
set(durationInSec) {
tempBasalDuration = T.secs(durationInSec).msecs()
}
get() = T.msecs(tempBasalDuration).mins()
var isTempBasalInProgress: Boolean
get() = tempBasalStart != 0L && dateUtil.now() in tempBasalStart..tempBasalStart + tempBasalDuration
set(isRunning) {
if (isRunning) throw IllegalArgumentException("Use to cancel TBR only")
else {
tempBasalStart = 0L
tempBasalDuration = 0L
tempBasalAbsoluteRate = 0.0
}
}
val tempBasalRemainingMin: Int
get() = max(T.msecs(tempBasalStart + tempBasalDuration - dateUtil.now()).mins().toInt(), 0)
fun temporaryBasalToString(): String {
if (!isTempBasalInProgress) return ""
val passedMin = ((min(dateUtil.now(), tempBasalStart + tempBasalDuration) - tempBasalStart) / 60.0 / 1000).roundToInt()
return tempBasalAbsoluteRate.toString() + "U/h @" +
dateUtil.timeString(tempBasalStart) +
" " + passedMin + "/" + T.msecs(tempBasalDuration).mins() + "'"
}
fun fromTemporaryBasal(tbr: PumpSync.PumpState.TemporaryBasal?) {
if (tbr == null) {
tempBasalStart = 0
tempBasalDuration = 0
tempBasalAbsoluteRate = 0.0
} else {
tempBasalStart = tbr.timestamp
tempBasalDuration = tbr.duration
tempBasalAbsoluteRate = tbr.rate
}
}
/*
* EXTENDED BOLUSES
*/
var extendedBolusStart: Long = 0
var extendedBolusDuration: Long = 0
var extendedBolusAmount = 0.0
var isExtendedInProgress: Boolean
get() = extendedBolusStart != 0L && dateUtil.now() in extendedBolusStart..extendedBolusStart + extendedBolusDuration
set(isRunning) {
if (isRunning) throw IllegalArgumentException("Use to cancel EB only")
else {
extendedBolusStart = 0L
extendedBolusDuration = 0L
extendedBolusAmount = 0.0
}
}
val extendedBolusPassedMinutes:Int
get() = T.msecs(max(0, dateUtil.now() - extendedBolusStart)).mins().toInt()
val extendedBolusRemainingMinutes: Int
get() = max(T.msecs(extendedBolusStart + extendedBolusDuration - dateUtil.now()).mins().toInt(), 0)
private val extendedBolusDurationInMinutes: Int
get() = T.msecs(extendedBolusDuration).mins().toInt()
var extendedBolusAbsoluteRate: Double
get() = extendedBolusAmount * T.hours(1).msecs() / extendedBolusDuration
set(rate) {
extendedBolusAmount = rate * extendedBolusDuration / T.hours(1).msecs()
}
fun extendedBolusToString(): String {
if (!isExtendedInProgress) return ""
//return "E "+ DecimalFormatter.to2Decimal(extendedBolusDeliveredSoFar) +"/" + DecimalFormatter.to2Decimal(extendedBolusAbsoluteRate) + "U/h @" +
// " " + extendedBolusPassedMinutes + "/" + extendedBolusMinutes + "'"
return "E "+ DecimalFormatter.to2Decimal(extendedBolusAbsoluteRate) + "U/h @" +
dateUtil.timeString(extendedBolusStart) +
" " + extendedBolusPassedMinutes + "/" + extendedBolusDurationInMinutes + "'"
}
fun fromExtendedBolus(eb: PumpSync.PumpState.ExtendedBolus?) {
if (eb == null) {
extendedBolusStart = 0
extendedBolusDuration = 0
extendedBolusAmount = 0.0
} else {
extendedBolusStart = eb.timestamp
extendedBolusDuration = eb.duration
extendedBolusAmount = eb.amount
}
}
// Profile
var units = 0
var activeProfile = 0
var pumpProfiles: Array<Array<Double>>? = null
//Limits
var maxBolus = 0.0
var maxBasal = 0.0
// User settings
var setUserOptionType = 0 // ALARM:0, LCD:1, LANG:2, BOLUS_SPEED:3
var beepAndAlarm = 0
var alarmIntesity = 0
var lcdOnTimeSec = 0
var selectedLanguage = 0
var bolusSpeed = 0
var resultErrorCode: Int = 0 // last start bolus erroCode
// Bolus settings
var historyDoneReceived: Boolean = false // true when last history message is received
var bolusingTreatment: EventOverviewBolusProgress.Treatment? = null // actually delivered treatment
var bolusAmountToBeDelivered = 0.0 // amount to be delivered
var bolusProgressLastTimeStamp: Long = 0 // timestamp of last bolus progress message
var bolusStopped = false // bolus finished
var bolusStopForced = false // bolus forced to stop by user
var bolusDone = false // success end
// LGS Status
var lgsStatus: Int = 0 // LGS Status(1=LGS_ON, 2=LGS_OFF)
var lgsTime:Int = 0 // LGS Setting time (0~255 min)
var lgsElapsedTime:Int = 0 // LGS Passed Time (0~255 min)
fun buildDiaconnG8ProfileRecord(nsProfile: Profile): Array<Double> {
val record = Array(24) { 0.0 }
for (hour in 0..23) {
//Some values get truncated to the next lower one.
// -> round them to two decimals and make sure we are a small delta larger (that will get truncated)
val value = (100.0 * nsProfile.getBasalTimeFromMidnight((hour * 60 * 60))).roundToInt() / 100.0 + 0.00001
aapsLogger.debug(LTag.PUMP, "NS basal value for $hour:00 is $value")
record[hour] = value
//aapsLogger.debug(LTag.PUMP, "NS basal value * 100 for $hour:00 is $value")
}
return record
}
fun reset() {
aapsLogger.debug(LTag.PUMP, "Diaconn G8 Pump reset")
lastConnection = 0
lastSettingsRead = 0
}
// G8 pump
var result:Int = 0 // 조회결과
// 1. pump setting info
var systemRemainInsulin = 0.0 // 인슐린 잔량
var systemRemainBattery = 0 // 배터리 잔량(0~100%)
var systemBasePattern = 0 // 기저주입 패턴(0=없음, 1=기본, 2=생활1, 3=생활2, 4=생활3, 5=닥터1, 6=닥터2)
var systemTbStatus = 0 // 임시기저 상태(1=임시기저 중, 2=임시기저 해제)
var systemInjectionMealStatus = 0 // 식사주입 상태(1=주입중, 2=주입상태아님)
var systemInjectionSnackStatus = 0 // 일반간식 주입 상태(1=주입중, 2=주입상태아님)
var systemInjectionSquareStatue = 0 // 스퀘어회식 주입 상태(1=주입중, 2=주입상태아님)
var systemInjectionDualStatus = 0 // 더블회식 주입 상태(1=주입중, 2=주입상태아님)
// 2. basal injection suspend status (1:stop, 2:release)
var basePauseStatus = 0 // 상태(1=정지,2=해제)
// 3. Pump time
var year = 0 // 년 (18~99)
var month = 0 // 월 (1~12)
var day = 0 // 일 (1~31)
var hour = 0 // 시 (0~23)
var minute = 0 // 분 (0~59)
var second = 0 // 초 (0~59)
// 4. pump system info
var country = 0 // 생산국(K, C), ASCII
var productType = 0 // 제품종류(A ~ Z), ASCII
var makeYear = 0 // 제조년
var makeMonth = 0 // 제조월
var makeDay = 0 // 제조일
var lotNo = 0 // LOT NO
var serialNo = 0 // SERIAL NO
var majorVersion = 0 // Major 버전
var minorVersion = 0 // Minor 버전
// 5. pump log status
var pumpLastLogNum = 0 // 마지막 저장 로그 번호(0~9999)
var pumpWrappingCount = 0 // wrapping 카운트(0~255)
var apslastLogNum = 0 // 앱에서 처리한 마지막 로그 번호.
var apsWrappingCount = 0 // 앱에서 처리한 마지막 로그 번호.
var isProgressPumpLogSync = false // 로그 동기화 진행 여부
// 6. bolus speed status.
var speed = 0 // 주입 속도(1 ~ 8)
var maxBasalPerHours = 0.0
// 7. Tempbasal status
var tbStatus = 0 // 임시기저 상태 (1 : running, 2:not running )
var tbTime = 0 // 임시기저 시간
var tbInjectRateRatio = 0 // 임시기저 주입량/률 1000(0.00U)~1600(6.00U), 50000(0%)~50200(200%), 50000이상이면 주입률로 판정
var tbElapsedTime = 0 // 임시기저 경과 시간(0~1425분)
var tbInjectAbsoluteValue = 0.0 // 임시기저 주입량/률 1000(0.00U)~1600(6.00U)
// 8. Basal status
var baseStatus = 0 // 주입상태
var baseHour = 0 // 현재주입시간(0~23)
var baseAmount = 0.0 // 주입설정량(량*100, 23.25->2325, 15.2->1520)
var baseInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
// 9. meal bolus status
var mealKind = 0 // 주입종류(1=아침,2=점심,3=저녁)
var mealStartTime = 0 // 식사주입 시작시간(time_t)
var mealStatus = 0 // 주입상태(1=주입중,2=주입상태아님)
var mealAmount = 0.0 // 주입설정량(량*100, 23.25->2325, 15.2->1520)
var mealInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
var mealSpeed = 0 // 주입속도(1~8)
// 10. snack bolus status
var snackStatus = 0 // 주입상태(1=주입중,2=주입상태아님)
var snackAmount = 0.0 // 주입설정량(량*100, 23.25->2325, 15.2->1520)
var snackInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
var snackSpeed = 0 // 주입속도(1~8)
// 11. square(extended) bolus status
var squareStatus = 0 // 주입상태
var squareTime = 0 // 설정 주입시간(10~300분)
var squareInjTime = 0 // 경과 주입시간(10~300분)
var squareAmount = 0.0 // 주입 설정량
var squareInjAmount = 0.0 // 현재 주입량
// 12. daul bolus status
var dualStatus = 0 // 주입상태
var dualAmount = 0.0 // 일반주입 설정량
var dualInjAmount = 0.0 // 일반주입량
var dualSquareTime = 0 // 스퀘어주입 설정시간(10~300분)
var dualInjSquareTime = 0 // 스퀘어주입 경과시간(10~300분)
var dualSquareAmount = 0.0 // 스퀘어주입 설정량
var dualInjSquareAmount = 0.0 // 스퀘어주입량
// 13. last injection status
var recentKind1 = 0 // 최근-1 주입 종류(1=식사, 2=일반간식, 3=스퀘어회식, 4=더블회식)
var recentTime1 = 0 // 최근-1 주입 시간
var recentAmount1 = 0.0 // 최근-1 주입량
var recentKind2 = 0 // 최근-2 주입 종류(1=식사, 2=일반간식, 3=스퀘어회식, 4=더블회식)
var recentTime2 = 0 // 최근-2 주입 시간
var recentAmount2 = 0.0 // 최근-2 주입량
// 14. daily injection status
var todayBaseAmount = 0.0 // 기저주입 총량
var todayMealAmount = 0.0 // 식사주입 총량
var todaySnackAmount = 0.0 // 회식주입 총량
// 15. meat setting status
var morningHour = 0 // 아침 개시 시간(0~23)
var morningAmount = 0.0 // 아침 식전량
var lunchHour = 0 // 점심 개시 시간(0~23)
var lunchAmount = 0.0 // 점심 식전량
var dinnerHour = 0 // 저녁 개시 시간(0~23)
var dinnerAmount = 0.0 // 저녁 식전량
// 16. basal injection status at this hour
var currentBasePattern = 0 // 패턴 종류 (1=기본, 2=생활1, 3=생활2, 4=생활3, 5=닥터1, 6=닥터2)
var currentBaseHour = 0 // 현재주입시간(0~23)
var currentBaseTbBeforeAmount = 0.0 // 해당시간의 임시기저 계산 전 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750)
var currentBaseTbAfterAmount = 0.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750)
// 17. saved basal pattern status
var baseAmount1 = 0.00// 주입량 1(량*100, 23.25->2325, 15.2->1520)
var baseAmount2 = 0.0// 주입량 2(량*100, 23.25->2325, 15.2->1520)
var baseAmount3 = 0.0 // 주입량 3(량*100, 23.25->2325, 15.2->1520)
var baseAmount4 = 0.0 // 주입량 4(량*100, 23.25->2325, 15.2->1520)
var baseAmount5 = 0.0 // 주입량 5(량*100, 23.25->2325, 15.2->1520)
var baseAmount6 = 0.0 // 주입량 6(량*100, 23.25->2325, 15.2->1520)
var baseAmount7 = 0.0 // 주입량 7(량*100, 23.25->2325, 15.2->1520)
var baseAmount8 = 0.0 // 주입량 8(량*100, 23.25->2325, 15.2->1520)
var baseAmount9 = 0.0 // 주입량 9(량*100, 23.25->2325, 15.2->1520)
var baseAmount10 = 0.0 // 주입량 10(량*100, 23.25->2325, 15.2->1520)
var baseAmount11 = 0.0 // 주입량 11(량*100, 23.25->2325, 15.2->1520)
var baseAmount12 = 0.0 // 주입량 12(량*100, 23.25->2325, 15.2->1520)
var baseAmount13 = 0.0 // 주입량 13(량*100, 23.25->2325, 15.2->1520)
var baseAmount14 = 0.0 // 주입량 14(량*100, 23.25->2325, 15.2->1520)
var baseAmount15 = 0.0 // 주입량 15(량*100, 23.25->2325, 15.2->1520)
var baseAmount16 = 0.0 // 주입량 16(량*100, 23.25->2325, 15.2->1520)
var baseAmount17 = 0.0 // 주입량 17(량*100, 23.25->2325, 15.2->1520)
var baseAmount18 = 0.0 // 주입량 18(량*100, 23.25->2325, 15.2->1520)
var baseAmount19 = 0.0 // 주입량 19(량*100, 23.25->2325, 15.2->1520)
var baseAmount20 = 0.0 // 주입량 20(량*100, 23.25->2325, 15.2->1520)
var baseAmount21 = 0.0 // 주입량 21(량*100, 23.25->2325, 15.2->1520)
var baseAmount22 = 0.0 // 주입량 22(량*100, 23.25->2325, 15.2->1520)
var baseAmount23 = 0.0 // 주입량 23(량*100, 23.25->2325, 15.2->1520)
var baseAmount24 = 0.0 // 주입량 24(량*100, 23.25->2325, 15.2->1520)
var otpNumber = 0
companion object {
// User settings
const val ALARM = 0
const val LCD = 1
const val LANG = 2
const val BOLUS_SPEED = 3
}
}

View file

@ -0,0 +1,184 @@
package info.nightscout.androidaps.diaconn.activities
import android.annotation.SuppressLint
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.le.BluetoothLeScanner
import android.bluetooth.le.ScanCallback
import android.bluetooth.le.ScanFilter
import android.bluetooth.le.ScanResult
import android.bluetooth.le.ScanSettings
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.os.Handler
import android.os.ParcelUuid
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange
import info.nightscout.androidaps.diaconn.R
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8BlescannerActivityBinding
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck
import info.nightscout.androidaps.utils.sharedPreferences.SP
import java.util.*
import javax.inject.Inject
class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() {
@Inject lateinit var sp: SP
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var blePreCheck: BlePreCheck
private var listAdapter: ListAdapter? = null
private val devices = ArrayList<BluetoothDeviceItem>()
private var bluetoothLeScanner: BluetoothLeScanner? = null
private val serviceUUID = UUID.fromString("6e400001-b5a3-f393-e0a9-e50e24dcca9e") // BLE GATT Service UUID
private lateinit var binding: DiaconnG8BlescannerActivityBinding
@SuppressLint("SourceLockedOrientationActivity")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DiaconnG8BlescannerActivityBinding.inflate(layoutInflater)
setContentView(binding.root)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
blePreCheck.prerequisitesCheck(this)
listAdapter = ListAdapter()
binding.blescannerListview.emptyView = binding.blescannerNodevice
binding.blescannerListview.adapter = listAdapter
listAdapter?.notifyDataSetChanged()
}
override fun onResume() {
super.onResume()
BluetoothAdapter.getDefaultAdapter()?.let { bluetoothAdapter ->
if (!bluetoothAdapter.isEnabled) bluetoothAdapter.enable()
bluetoothLeScanner = bluetoothAdapter.bluetoothLeScanner
startScan()
}
}
override fun onPause() {
super.onPause()
stopScan()
}
private fun startScan() =
try {
val filters: MutableList<ScanFilter> = ArrayList()
val scan_filter = ScanFilter.Builder()
.setServiceUuid(ParcelUuid(serviceUUID))
.build()
filters.add(scan_filter)
val settings = ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build()
bluetoothLeScanner?.startScan(filters, settings, mBleScanCallback)
} catch (e: IllegalStateException) {
} // ignore BT not on
private fun stopScan() =
try {
bluetoothLeScanner?.stopScan(mBleScanCallback)
} catch (e: IllegalStateException) {
} // ignore BT not on
private fun addBleDevice(device: BluetoothDevice?) {
if (device == null || device.name == null || device.name == "") {
return
}
val item = BluetoothDeviceItem(device)
if (devices.contains(item)) {
return
}
devices.add(item)
Handler().post { listAdapter!!.notifyDataSetChanged() }
}
private val mBleScanCallback: ScanCallback = object : ScanCallback() {
override fun onScanResult(callbackType: Int, result: ScanResult) {
addBleDevice(result.device)
}
}
internal inner class ListAdapter : BaseAdapter() {
override fun getCount(): Int = devices.size
override fun getItem(i: Int): BluetoothDeviceItem = devices[i]
override fun getItemId(i: Int): Long = 0
override fun getView(i: Int, convertView: View?, parent: ViewGroup?): View {
var v = convertView
val holder: ViewHolder
if (v == null) {
v = View.inflate(applicationContext, R.layout.diaconn_g8_blescanner_item, null)
holder = ViewHolder(v)
v.tag = holder
} else {
// reuse view if already exists
holder = v.tag as ViewHolder
}
val item = getItem(i)
holder.setData(item)
return v!!
}
private inner class ViewHolder(v: View) : View.OnClickListener {
private lateinit var item: BluetoothDeviceItem
private val name: TextView = v.findViewById(R.id.ble_name)
private val address: TextView = v.findViewById(R.id.ble_address)
init {
v.setOnClickListener(this@ViewHolder)
}
override fun onClick(v: View) {
sp.putString(R.string.key_diaconn_g8_address, item.device.address)
sp.putString(R.string.key_diaconn_g8_name, name.text.toString())
item.device.createBond()
rxBus.send(EventDiaconnG8DeviceChange())
finish()
}
fun setData(data: BluetoothDeviceItem) {
var tTitle = data.device.name
if (tTitle == null || tTitle == "") {
tTitle = "(unknown)"
}
name.text = tTitle
address.text = data.device.address
item = data
}
}
}
//
inner class BluetoothDeviceItem internal constructor(val device: BluetoothDevice) {
override fun equals(other: Any?): Boolean {
if (other !is BluetoothDeviceItem) {
return false
}
return stringEquals(device.address, other.device.address)
}
private fun stringEquals(arg1: String, arg2: String): Boolean {
return try {
arg1 == arg2
} catch (e: Exception) {
false
}
}
override fun hashCode(): Int = device.hashCode()
}
}

View file

@ -0,0 +1,257 @@
package info.nightscout.androidaps.diaconn.activities
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.diaconn.R
import info.nightscout.androidaps.diaconn.common.RecordTypes
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecord
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecordDao
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8HistoryActivityBinding
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign
import java.util.*
import javax.inject.Inject
class DiaconnG8HistoryActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var diaconnHistoryRecordDao: DiaconnHistoryRecordDao
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var aapsSchedulers: AapsSchedulers
private val disposable = CompositeDisposable()
private var showingType = RecordTypes.RECORD_TYPE_ALARM
private var historyList: List<DiaconnHistoryRecord> = ArrayList()
class TypeList internal constructor(var type: Byte, var name: String) {
override fun toString(): String = name
}
private lateinit var binding: DiaconnG8HistoryActivityBinding
override fun onResume() {
super.onResume()
disposable += rxBus
.toObservable(EventPumpStatusChanged::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({ binding.status.text = it.getStatus(resourceHelper) }) { fabricPrivacy.logException(it) }
swapAdapter(showingType)
}
override fun onPause() {
super.onPause()
disposable.clear()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DiaconnG8HistoryActivityBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(this)
binding.recyclerview.adapter = RecyclerViewAdapter(historyList)
binding.status.visibility = View.GONE
// Types
val typeList = ArrayList<TypeList>()
typeList.add(TypeList(RecordTypes.RECORD_TYPE_ALARM, resourceHelper.gs(R.string.diaconn_g8_history_alarm)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_BASALHOUR, resourceHelper.gs(R.string.diaconn_g8_history_basalhours)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_BOLUS, resourceHelper.gs(R.string.diaconn_g8_history_bolus)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_TB, resourceHelper.gs(R.string.diaconn_g8_history_tempbasal)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_DAILY, resourceHelper.gs(R.string.diaconn_g8_history_dailyinsulin)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_REFILL, resourceHelper.gs(R.string.diaconn_g8_history_refill)))
typeList.add(TypeList(RecordTypes.RECORD_TYPE_SUSPEND, resourceHelper.gs(R.string.diaconn_g8_history_suspend)))
binding.spinner.adapter = ArrayAdapter(this, R.layout.spinner_centered, typeList)
binding.reload.setOnClickListener {
val selected = binding.spinner.selectedItem as TypeList?
?: return@setOnClickListener
runOnUiThread {
binding.reload.visibility = View.GONE
binding.status.visibility = View.VISIBLE
}
clearCardView()
commandQueue.loadHistory(selected.type, object : Callback() {
override fun run() {
swapAdapter(selected.type)
runOnUiThread {
binding.reload.visibility = View.VISIBLE
binding.status.visibility = View.GONE
}
}
})
}
binding.spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
val selected = typeList[position]
swapAdapter(selected.type)
showingType = selected.type
}
override fun onNothingSelected(parent: AdapterView<*>?) {
clearCardView()
}
}
}
inner class RecyclerViewAdapter internal constructor(private var historyList: List<DiaconnHistoryRecord>) : RecyclerView.Adapter<RecyclerViewAdapter.HistoryViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): HistoryViewHolder =
HistoryViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.diaconn_g8_history_item, viewGroup, false))
override fun onBindViewHolder(holder: HistoryViewHolder, position: Int) {
val record = historyList[position]
holder.time.text = dateUtil.dateAndTimeString(record.timestamp)
holder.value.text = DecimalFormatter.to2Decimal(record.value)
holder.stringValue.text = record.stringValue
holder.bolusType.text = record.bolusType
holder.duration.text = DecimalFormatter.to0Decimal(record.duration.toDouble())
holder.alarm.text = record.alarm
when (showingType) {
RecordTypes.RECORD_TYPE_ALARM -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.VISIBLE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.GONE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.VISIBLE
}
RecordTypes.RECORD_TYPE_BOLUS -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.VISIBLE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.VISIBLE
holder.duration.visibility = View.VISIBLE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.GONE
}
RecordTypes.RECORD_TYPE_DAILY -> {
holder.dailyBasal.text = resourceHelper.gs(R.string.formatinsulinunits, record.dailyBasal)
holder.dailyBolus.text = resourceHelper.gs(R.string.formatinsulinunits, record.dailyBolus)
holder.dailyTotal.text = resourceHelper.gs(R.string.formatinsulinunits, record.dailyBolus + record.dailyBasal)
holder.time.text = dateUtil.dateString(record.timestamp)
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.GONE
holder.stringValue.visibility = View.GONE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.GONE
holder.dailyBasal.visibility = View.VISIBLE
holder.dailyBolus.visibility = View.VISIBLE
holder.dailyTotal.visibility = View.VISIBLE
holder.alarm.visibility = View.GONE
}
RecordTypes.RECORD_TYPE_BASALHOUR -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.VISIBLE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.GONE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.GONE
}
RecordTypes.RECORD_TYPE_REFILL -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.VISIBLE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.GONE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.GONE
}
RecordTypes.RECORD_TYPE_TB -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.VISIBLE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.VISIBLE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.GONE
}
RecordTypes.RECORD_TYPE_SUSPEND -> {
holder.time.visibility = View.VISIBLE
holder.value.visibility = View.GONE
holder.stringValue.visibility = View.VISIBLE
holder.bolusType.visibility = View.GONE
holder.duration.visibility = View.GONE
holder.dailyBasal.visibility = View.GONE
holder.dailyBolus.visibility = View.GONE
holder.dailyTotal.visibility = View.GONE
holder.alarm.visibility = View.GONE
}
}
}
override fun getItemCount(): Int {
return historyList.size
}
inner class HistoryViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var time: TextView = itemView.findViewById(R.id.diaconn_g8_history_time)
var value: TextView = itemView.findViewById(R.id.diaconn_g8_history_value)
var bolusType: TextView = itemView.findViewById(R.id.diaconn_g8_history_bolustype)
var stringValue: TextView = itemView.findViewById(R.id.diaconn_g8_history_stringvalue)
var duration: TextView = itemView.findViewById(R.id.diaconn_g8_history_duration)
var dailyBasal: TextView = itemView.findViewById(R.id.diaconn_g8_history_dailybasal)
var dailyBolus: TextView = itemView.findViewById(R.id.diaconn_g8_history_dailybolus)
var dailyTotal: TextView = itemView.findViewById(R.id.diaconn_g8_history_dailytotal)
var alarm: TextView = itemView.findViewById(R.id.diaconn_g8_history_alarm)
}
}
private fun swapAdapter(type: Byte) {
disposable += diaconnHistoryRecordDao
.allFromByType(dateUtil.now() - T.months(1).msecs(), type)
.subscribeOn(aapsSchedulers.io)
.observeOn(aapsSchedulers.main)
.subscribe { historyList -> binding.recyclerview.swapAdapter(RecyclerViewAdapter(historyList), false) }
}
private fun clearCardView() = binding.recyclerview.swapAdapter(RecyclerViewAdapter(ArrayList()), false)
}

View file

@ -0,0 +1,192 @@
package info.nightscout.androidaps.diaconn.activities
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import info.nightscout.androidaps.activities.ErrorHelperActivity
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.diaconn.R
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8UserOptionsActivityBinding
import info.nightscout.androidaps.interfaces.ActivePlugin
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.disposables.CompositeDisposable
import java.text.DecimalFormat
import javax.inject.Inject
class DiaconnG8UserOptionsActivity : NoSplashAppCompatActivity() {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var context: Context
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
@Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var commandQueue: CommandQueueProvider
@Inject lateinit var sp: SP
private val disposable = CompositeDisposable()
private lateinit var binding: DiaconnG8UserOptionsActivityBinding
@Synchronized
override fun onResume() {
super.onResume()
}
@Synchronized
override fun onPause() {
disposable.clear()
super.onPause()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DiaconnG8UserOptionsActivityBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.saveAlarm.setOnClickListener { onSaveAlarmClick() }
binding.saveLcdOnTime.setOnClickListener { onSavelcdOnTimeClick() }
binding.saveLang.setOnClickListener { onSaveLangClick() }
binding.saveBolusSpeed.setOnClickListener { onSaveBolusSpeedClick() }
val spBolusSpeed = sp.getString("g8_bolusspeed", "5")
binding.bolusSpeed.setParams(spBolusSpeed.toDouble(), 1.0, 8.0, 1.0, DecimalFormat("1"), true, binding.saveBolusSpeed)
aapsLogger.debug(LTag.PUMP,
"UserOptionsLoaded:" + (System.currentTimeMillis() - diaconnG8Pump.lastConnection) / 1000 + " s ago"
+ "\nbeepAndAlarm:" + diaconnG8Pump.beepAndAlarm
+ "\nalarmIntesity:" + diaconnG8Pump.alarmIntesity
+ "\nlanguage:" + diaconnG8Pump.selectedLanguage
+ "\nlcdOnTimeSec:" + diaconnG8Pump.lcdOnTimeSec)
fillSoundCategory()
fillSoundSubCategory()
binding.beepAndAlarm.setSelection(diaconnG8Pump.beepAndAlarm - 1)
binding.alarmIntesity.setSelection(diaconnG8Pump.alarmIntesity - 1)
binding.beepAndAlarm.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
binding.alarmIntesity.visibility = if("silent" == binding.beepAndAlarm.getItemAtPosition(position).toString()) View.GONE else View.VISIBLE
}
override fun onNothingSelected(parent: AdapterView<*>?) {}
}
when (diaconnG8Pump.lcdOnTimeSec) {
1 -> binding.pumpscreentimeout10.isChecked = true
2 -> binding.pumpscreentimeout20.isChecked = true
3 -> binding.pumpscreentimeout30.isChecked = true
}
when (diaconnG8Pump.selectedLanguage) {
1 -> binding.pumplangChiness.isChecked = true
2 -> binding.pumplangKorean.isChecked = true
3 -> binding.pumplangEnglish.isChecked = true
}
}
private fun onSaveAlarmClick() {
diaconnG8Pump.setUserOptionType = DiaconnG8Pump.ALARM
diaconnG8Pump.beepAndAlarm = binding.beepAndAlarm.selectedItemPosition + 1
diaconnG8Pump.alarmIntesity = binding.alarmIntesity.selectedItemPosition + 1
onSaveClick()
}
private fun onSavelcdOnTimeClick() {
diaconnG8Pump.setUserOptionType = DiaconnG8Pump.LCD
diaconnG8Pump.lcdOnTimeSec = when {
binding.pumpscreentimeout10.isChecked -> 1
binding.pumpscreentimeout20.isChecked -> 2
binding.pumpscreentimeout30.isChecked -> 3
else -> 1
}
onSaveClick()
}
private fun onSaveLangClick() {
diaconnG8Pump.setUserOptionType = DiaconnG8Pump.LANG
diaconnG8Pump.selectedLanguage = when {
binding.pumplangChiness.isChecked -> 1
binding.pumplangKorean.isChecked -> 2
binding.pumplangEnglish.isChecked -> 3
else -> 2
}
onSaveClick()
}
private fun onSaveBolusSpeedClick() {
val intSpeed = binding.bolusSpeed.value.toInt()
diaconnG8Pump.bolusSpeed = intSpeed
diaconnG8Pump.speed = intSpeed
diaconnG8Pump.setUserOptionType = DiaconnG8Pump.BOLUS_SPEED
sp.putString("g8_bolusspeed", intSpeed.toString())
sp.putBoolean("diaconn_g8_isbolusspeedsync", false)
ToastUtils.okToast(context, "Save Success!")
}
private fun onSaveClick() {
commandQueue.setUserOptions(object : Callback() {
override fun run() {
if (!result.success) {
val i = Intent(context, ErrorHelperActivity::class.java)
i.putExtra("soundid", R.raw.boluserror)
i.putExtra("status", result.comment)
i.putExtra("title", resourceHelper.gs(R.string.pumperror))
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
}
}
})
finish()
}
private fun fillSoundCategory() {
val categories = ArrayList<String>()
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_sound))
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_vibrate))
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_silent))
context.let { context ->
val adapterCategories = ArrayAdapter(context, R.layout.spinner_centered, categories)
binding.beepAndAlarm.adapter = adapterCategories
}
}
private fun fillSoundSubCategory() {
val categories = ArrayList<String>()
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_intensity_low))
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_intensity_middle))
categories.add(resourceHelper.gs(R.string.diaconn_g8_pumpalarm_intensity_high))
context.let { context ->
val adapterCategories = ArrayAdapter(context, R.layout.spinner_centered, categories)
binding.alarmIntesity.adapter = adapterCategories
}
}
}

View file

@ -0,0 +1,11 @@
package info.nightscout.androidaps.diaconn.common
object RecordTypes {
const val RECORD_TYPE_BOLUS = 0x01.toByte()
const val RECORD_TYPE_DAILY = 0x02.toByte()
const val RECORD_TYPE_ALARM = 0x03.toByte()
const val RECORD_TYPE_REFILL = 0x04.toByte()
const val RECORD_TYPE_SUSPEND = 0x05.toByte()
const val RECORD_TYPE_BASALHOUR = 0x06.toByte()
const val RECORD_TYPE_TB = 0x07.toByte()
}

View file

@ -0,0 +1,32 @@
package info.nightscout.androidaps.diaconn.database
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
const val TABLE_DIACONN_HISTORY = "diaconnHistory"
@Database(
entities = [DiaconnHistoryRecord::class],
exportSchema = true,
version = DiaconnHistoryDatabase.VERSION
)
abstract class DiaconnHistoryDatabase : RoomDatabase() {
abstract fun historyRecordDao(): DiaconnHistoryRecordDao
companion object {
const val VERSION = 1
fun build(context: Context) =
Room.databaseBuilder(
context.applicationContext,
DiaconnHistoryDatabase::class.java,
"diaconn_database.db"
)
.fallbackToDestructiveMigration()
.build()
}
}

View file

@ -0,0 +1,19 @@
package info.nightscout.androidaps.diaconn.database
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
@Entity(tableName = TABLE_DIACONN_HISTORY,
indices = [Index("code", "timestamp")])
data class DiaconnHistoryRecord(
@PrimaryKey var timestamp: Long,
var code: Byte = 0x0F,
var value: Double = 0.0,
var bolusType: String = "None",
var stringValue: String = "",
var duration: Int = 0,
var dailyBasal: Double = 0.0,
var dailyBolus: Double = 0.0,
var alarm: String = ""
)

View file

@ -0,0 +1,17 @@
package info.nightscout.androidaps.diaconn.database
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import io.reactivex.Single
@Dao
abstract class DiaconnHistoryRecordDao {
@Query("SELECT * from $TABLE_DIACONN_HISTORY WHERE timestamp >= :timestamp AND code = :type")
abstract fun allFromByType(timestamp: Long, type: Byte): Single<List<DiaconnHistoryRecord>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract fun createOrUpdate(diaconnHistoryRecord: DiaconnHistoryRecord)
}

View file

@ -0,0 +1,17 @@
package info.nightscout.androidaps.diaconn.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Fragment
import info.nightscout.androidaps.diaconn.activities.DiaconnG8BLEScanActivity
import info.nightscout.androidaps.diaconn.activities.DiaconnG8HistoryActivity
import info.nightscout.androidaps.diaconn.activities.DiaconnG8UserOptionsActivity
@Module
@Suppress("unused")
abstract class DiaconnG8ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesDiaconnG8Fragment(): DiaconnG8Fragment
@ContributesAndroidInjector abstract fun contributesDiaconnG8HistoryActivity(): DiaconnG8HistoryActivity
@ContributesAndroidInjector abstract fun contributesDiaconnG8UserOptionsActivity(): DiaconnG8UserOptionsActivity
@ContributesAndroidInjector abstract fun contributesDiaconnG8BLEScanActivity(): DiaconnG8BLEScanActivity
}

View file

@ -0,0 +1,12 @@
package info.nightscout.androidaps.diaconn.di
import dagger.Module
@Module(includes = [
DiaconnG8ActivitiesModule::class,
DiaconnG8ServiceModule::class,
DiaconnG8PacketModule::class,
DiaconnHistoryModule::class
])
open class DiaconnG8Module

View file

@ -0,0 +1,83 @@
package info.nightscout.androidaps.diaconn.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.diaconn.packet.*
@Module
@Suppress("unused")
abstract class DiaconnG8PacketModule {
@ContributesAndroidInjector abstract fun contributesDiaconnG8Packet(): DiaconnG8Packet
@ContributesAndroidInjector abstract fun contributesAppCancelSettingPacket(): AppCancelSettingPacket
@ContributesAndroidInjector abstract fun contributesAppCancelSettingResponsePacket(): AppCancelSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesAppConfirmSettingPacket(): AppConfirmSettingPacket
@ContributesAndroidInjector abstract fun contributesAppConfirmSettingResponsePacket(): AppConfirmSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesSneckLimitInquirePacket(): SneckLimitInquirePacket
@ContributesAndroidInjector abstract fun contributesBasalLimitInquirePacket(): BasalLimitInquirePacket
@ContributesAndroidInjector abstract fun contributesSneckLimitInquireResponsePacket(): SneckLimitInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBasalLimitInquireResponsePacket(): BasalLimitInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBasalPauseReportPacket(): BasalPauseReportPacket
@ContributesAndroidInjector abstract fun contributesBasalPauseSettingPacket(): BasalPauseSettingPacket
@ContributesAndroidInjector abstract fun contributesBasalPauseSettingResponsePacket(): BasalPauseSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesBasalSettingPacket(): BasalSettingPacket
@ContributesAndroidInjector abstract fun contributesBasalSettingReportPacket(): BasalSettingReportPacket
@ContributesAndroidInjector abstract fun contributesBasalSettingResponsePacket(): BasalSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesBigMainInfoInquirePacket(): BigMainInfoInquirePacket
@ContributesAndroidInjector abstract fun contributesBigMainInfoInquireResponsePacket(): BigMainInfoInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBigLogInquirePacket(): BigLogInquirePacket
@ContributesAndroidInjector abstract fun contributesBigLogInquireResponsePacket(): BigLogInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesConfirmReportPacket(): ConfirmReportPacket
@ContributesAndroidInjector abstract fun contributesInjectionBasalSettingPacket(): InjectionBasalSettingPacket
@ContributesAndroidInjector abstract fun contributesInjectionBasalSettingResponsePacket(): InjectionBasalSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionSnackResultReportPacket(): InjectionSnackResultReportPacket
@ContributesAndroidInjector abstract fun contributesInjectionSnactSettingPacket(): InjectionSnackSettingPacket
@ContributesAndroidInjector abstract fun contributesInjectionSnackSettingResponsePacket(): InjectionSnackSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionExtendedBolusResultReportPacket(): InjectionExtendedBolusResultReportPacket
@ContributesAndroidInjector abstract fun contributesInjectionExtendedBolusSettingPacket(): InjectionExtendedBolusSettingPacket
@ContributesAndroidInjector abstract fun contributesInjectionExtendedBolusSettingResponsePacket(): InjectionExtendedBolusSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionBasalReportPacket(): InjectionBasalReportPacket
@ContributesAndroidInjector abstract fun contributesInjectionSnackInquirePacket(): InjectionSnackInquirePacket
@ContributesAndroidInjector abstract fun contributesInjectionSnackInquireResponsePacket(): InjectionSnackInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesRejectReportPacket(): RejectReportPacket
@ContributesAndroidInjector abstract fun contributesTempBasalReportPacket(): TempBasalReportPacket
@ContributesAndroidInjector abstract fun contributesTempBasalSettingPacket(): TempBasalSettingPacket
@ContributesAndroidInjector abstract fun contributesTempBasalSettingResponsePacket(): TempBasalSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesTempBasalInquirePacket(): TempBasalInquirePacket
@ContributesAndroidInjector abstract fun contributesTempBasalInquireResponsePacket(): TempBasalInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesTimeInquirePacket(): TimeInquirePacket
@ContributesAndroidInjector abstract fun contributesTimeInquireResponsePacket(): TimeInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesTimeReportPacket(): TimeReportPacket
@ContributesAndroidInjector abstract fun contributesTimeSettingPacket(): TimeSettingPacket
@ContributesAndroidInjector abstract fun contributesTimeSettingResponsePacket(): TimeSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesLogStatusInquirePacket(): LogStatusInquirePacket
@ContributesAndroidInjector abstract fun contributesLogStatusInquireResponsePacket(): LogStatusInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionCancelSettingPacket(): InjectionCancelSettingPacket
@ContributesAndroidInjector abstract fun contributesInjectionCancelSettingResponsePacket(): InjectionCancelSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesSoundSettingPacket(): SoundSettingPacket
@ContributesAndroidInjector abstract fun contributesSoundSettingResponsePacket(): SoundSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesDisplayTimeoutSettingPacket(): DisplayTimeoutSettingPacket
@ContributesAndroidInjector abstract fun contributesDisplayTimeoutSettingResponsePacket(): DisplayTimeoutSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesLanguageSettingPacket(): LanguageSettingPacket
@ContributesAndroidInjector abstract fun contributesLanguageSettingResponsePacket(): LanguageSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionBlockReportPacket(): InjectionBlockReportPacket
@ContributesAndroidInjector abstract fun contributesBatteryWarningReportPacket(): BatteryWarningReportPacket
@ContributesAndroidInjector abstract fun contributesInsulinLackReportPacket(): InsulinLackReportPacket
@ContributesAndroidInjector abstract fun contributesIncarnationInquirePacket(): IncarnationInquirePacket
@ContributesAndroidInjector abstract fun contributesIncarnationInquireResponsePacket(): IncarnationInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBolusSpeedSettingPacket(): BolusSpeedSettingPacket
@ContributesAndroidInjector abstract fun contributesBolusSpeedSettingResponsePacket(): BolusSpeedSettingResponsePacket
@ContributesAndroidInjector abstract fun contributesInjectionSpeedInquirePacket(): BolusSpeedInquirePacket
@ContributesAndroidInjector abstract fun contributesInjectionSpeedInquireResponsePacket(): BolusSpeedInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBolusSpeedSettingReportPacket(): BolusSpeedSettingReportPacket
@ContributesAndroidInjector abstract fun contributesSoundInquirePacket(): SoundInquirePacket
@ContributesAndroidInjector abstract fun contributesSoundInquireResponsePacket(): SoundInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesDisplayTimeInquirePacket(): DisplayTimeInquirePacket
@ContributesAndroidInjector abstract fun contributesDisplayTimeInquireResponsePacket(): DisplayTimeInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesLanguageInquirePacket(): LanguageInquirePacket
@ContributesAndroidInjector abstract fun contributesLanguageInquireResponsePacket(): LanguageInquireResponsePacket
@ContributesAndroidInjector abstract fun contributesBigAPSMainInfoInquirePacket(): BigAPSMainInfoInquirePacket
@ContributesAndroidInjector abstract fun contributesBigAPSMainInfoInquireResponsePacket(): BigAPSMainInfoInquireResponsePacket
}

View file

@ -0,0 +1,11 @@
package info.nightscout.androidaps.diaconn.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.diaconn.service.DiaconnG8Service
@Module
@Suppress("unused")
abstract class DiaconnG8ServiceModule {
@ContributesAndroidInjector abstract fun contributesDiaconnG8Service(): DiaconnG8Service
}

View file

@ -0,0 +1,21 @@
package info.nightscout.androidaps.diaconn.di
import android.content.Context
import dagger.Module
import dagger.Provides
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecordDao
import javax.inject.Singleton
@Module
class DiaconnHistoryModule {
@Provides
@Singleton
internal fun provideDatabase(context: Context): DiaconnHistoryDatabase = DiaconnHistoryDatabase.build(context)
@Provides
@Singleton
internal fun provideHistoryRecordDao(diaconnHistoryDatabase: DiaconnHistoryDatabase): DiaconnHistoryRecordDao =
diaconnHistoryDatabase.historyRecordDao()
}

View file

@ -0,0 +1,5 @@
package info.nightscout.androidaps.diaconn.events
import info.nightscout.androidaps.events.Event
class EventDiaconnG8DeviceChange : Event()

View file

@ -0,0 +1,5 @@
package info.nightscout.androidaps.diaconn.events
import info.nightscout.androidaps.events.Event
class EventDiaconnG8NewStatus : Event()

View file

@ -0,0 +1,32 @@
package info.nightscout.androidaps.diaconn.packet
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
/**
* AppCancelSettingPacket
*/
class AppCancelSettingPacket(
injector: HasAndroidInjector,
private var reqMsgType: Byte,
) : DiaconnG8Packet(injector ) {
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
init {
msgType = 0x29
aapsLogger.debug(LTag.PUMPCOMM, "AppCancelSettingPacket init")
}
override fun encode(msgSeq:Int): ByteArray {
val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END)
buffer.put(reqMsgType) // 명령코드
return suffixEncode(buffer)
}
override fun getFriendlyName(): String {
return "PUMP_APP_CANCEL_SETTING"
}
}

View file

@ -0,0 +1,44 @@
package info.nightscout.androidaps.diaconn.packet
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
/**
* AppCancelSettingResponsePacket
*/
class AppCancelSettingResponsePacket(
injector: HasAndroidInjector
) : DiaconnG8Packet(injector ) {
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
var result =0
init {
msgType = 0xA9.toByte()
aapsLogger.debug(LTag.PUMPCOMM, "AppCancelSettingResPacket init ")
}
override fun handleMessage(data: ByteArray?) {
val defectCheck = defect(data)
if (defectCheck != 0) {
aapsLogger.debug(LTag.PUMPCOMM, "AppCancelSettingResponsePacket Got some Error")
failed = true
return
} else failed = false
val bufferData = prefixDecode(data)
result = getByteToInt(bufferData)
if(!isSuccSettingResponseResult(result)) {
diaconnG8Pump.resultErrorCode = result
failed = true
return
}
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}")
}
override fun getFriendlyName(): String {
return "PUMP_APP_CANCEL_SETTING_RESPONSE"
}
}

View file

@ -0,0 +1,39 @@
package info.nightscout.androidaps.diaconn.packet
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
/**
* AppConfirmSettingPacket
*/
class AppConfirmSettingPacket(
injector: HasAndroidInjector,
private var reqMsgType: Byte, // 명령코드
private var otp: Int // 응답시 전달받은 opt (random 6 digit numbner)
) : DiaconnG8Packet(injector ) {
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
init {
msgType = 0x37
aapsLogger.debug(LTag.PUMPCOMM, "AppConfirmSettingPacket init")
}
override fun encode(msgSeq:Int): ByteArray {
val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END);
buffer.put(reqMsgType) // 명령코드
buffer.putInt(otp) // 응답시 전달받은 opt (random 6digit numbner)
aapsLogger.debug(LTag.PUMPCOMM, "reqMsgType -> ${reqMsgType}")
aapsLogger.debug(LTag.PUMPCOMM, "otp -> ${otp}")
return suffixEncode(buffer)
}
override fun getFriendlyName(): String {
return "PUMP_APP_CONFRIM_SETTING"
}
}

View file

@ -0,0 +1,43 @@
package info.nightscout.androidaps.diaconn.packet
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
/**
* AppConfirmSettingResponsePacket
*/
class AppConfirmSettingResponsePacket(
injector: HasAndroidInjector
) : DiaconnG8Packet(injector ) {
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
var result =0
init {
msgType = 0xB7.toByte()
aapsLogger.debug(LTag.PUMPCOMM, "AppConfirmSettingReqPacket Response ")
}
override fun handleMessage(data: ByteArray?) {
val defectCheck = defect(data)
if (defectCheck != 0) {
aapsLogger.debug(LTag.PUMPCOMM, "AppConfirmSettingResponsePacket Got some Error")
failed = true
return
} else failed = false
val bufferData = prefixDecode(data)
result = getByteToInt(bufferData)
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}")
if(!isSuccSettingResponseResult(result)) {
diaconnG8Pump.resultErrorCode = result
failed = true
return
}
}
override fun getFriendlyName(): String {
return "PUMP_APP_CONFIRM_SETTING_RESPONSE"
}
}

View file

@ -0,0 +1,30 @@
package info.nightscout.androidaps.diaconn.packet
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.diaconn.DiaconnG8Pump
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
/**
* BasalLimitInquirePacket
*/
class BasalLimitInquirePacket(
injector: HasAndroidInjector
) : DiaconnG8Packet(injector ) {
@Inject lateinit var diaconnG8Pump: DiaconnG8Pump
init {
msgType = 0x52.toByte()
aapsLogger.debug(LTag.PUMPCOMM, "BasalLimitInquirePacket init")
}
override fun encode(msgSeq:Int): ByteArray {
val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END);
return suffixEncode(buffer)
}
override fun getFriendlyName(): String {
return "PUMP_BASAL_LIMIT_INQUIRE"
}
}

Some files were not shown because too many files have changed in this diff Show more