Merge branch 'dev' of github.com:MilosKozak/AndroidAPS into skip-neutral-temps

This commit is contained in:
Tim Gunn 2020-05-25 21:16:32 +12:00
commit 7622d272c3
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C
103 changed files with 978 additions and 553 deletions

View file

@ -407,6 +407,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
, 'bg': bg
, 'tick': tick
, 'eventualBG': eventualBG
, 'targetBG': target_bg
, 'insulinReq': 0
, 'reservoir' : reservoir_data // The expected reservoir volume at which to deliver the microbolus (the reservoir volume from right before the last pumphistory run)
, 'deliverAt' : deliverAt // The time at which the microbolus should be delivered

View file

@ -49,7 +49,7 @@ import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicato
import info.nightscout.androidaps.setupwizard.SetupWizardActivity
import info.nightscout.androidaps.utils.AndroidPermission
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.buildHelper.BuildHelper
import info.nightscout.androidaps.utils.extensions.isRunningRealPumpTest

View file

@ -37,7 +37,7 @@ import info.nightscout.androidaps.receivers.NetworkChangeReceiver;
import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver;
import info.nightscout.androidaps.services.Intents;
import info.nightscout.androidaps.utils.ActivityMonitor;
import info.nightscout.androidaps.utils.LocaleHelper;
import info.nightscout.androidaps.utils.locale.LocaleHelper;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
public class MainApp extends DaggerApplication {

View file

@ -5,7 +5,7 @@ import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen
import info.nightscout.androidaps.R
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
import info.nightscout.androidaps.utils.resources.ResourceHelper
import javax.inject.Inject

View file

@ -9,7 +9,7 @@ import dagger.android.support.DaggerAppCompatActivity
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.PluginBase
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import javax.inject.Inject

View file

@ -1531,7 +1531,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
//add last one without duration
ProfileSwitch last = getLastProfileSwitchWithoutDuration();
if (last != null) {
if (!profileSwitches.contains(last))
if (!isInList(profileSwitches, last))
profileSwitches.add(last);
}
return profileSwitches;
@ -1541,6 +1541,13 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
return new ArrayList<>();
}
boolean isInList(List<ProfileSwitch> profileSwitches, ProfileSwitch last) {
for (ProfileSwitch ps : profileSwitches) {
if (ps.isEqual(last)) return true;
}
return false;
}
@Nullable
private ProfileSwitch getLastProfileSwitchWithoutDuration() {
try {

View file

@ -64,7 +64,7 @@ abstract class PluginsModule {
abstract fun bindIobCobCalculatorPlugin(plugin: IobCobCalculatorPlugin): PluginBase
@Binds
@NotNSClient
@AllConfigs
@IntoMap
@IntKey(20)
abstract fun bindActionsPlugin(plugin: ActionsPlugin): PluginBase

View file

@ -49,7 +49,8 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var iobCobStaticCalculatorPlugin: IobCobStaticCalculatorPlugin
@Inject lateinit var iobCobCalculatorPluginHistory: IobCobCalculatorPluginHistory
@Inject lateinit var treatmentsPluginHistory: TreatmentsPluginHistory
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var buildHelper: BuildHelper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@ -148,7 +149,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
public override fun onPause() {
super.onPause()
disposable.clear()
iobCobStaticCalculatorPlugin.stopCalculation("onPause")
iobCobCalculatorPluginHistory.stopCalculation("onPause")
}
public override fun onResume() {
@ -157,7 +158,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
.toObservable(EventAutosensCalculationFinished::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ event: EventAutosensCalculationFinished ->
// catch only events from iobCobStaticCalculatorPlugin
// catch only events from iobCobCalculatorPluginHistory
if (event.cause === eventCustomCalculationFinished) {
aapsLogger.debug(LTag.AUTOSENS, "EventAutosensCalculationFinished")
updateGUI("EventAutosensCalculationFinished")
@ -220,10 +221,11 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
}
private fun runCalculation(from: String) {
treatmentsPluginHistory.initializeData(start - T.hours(8).msecs())
val end = start + T.hours(rangeToDisplay.toLong()).msecs()
iobCobStaticCalculatorPlugin.stopCalculation(from)
iobCobStaticCalculatorPlugin.clearCache()
iobCobStaticCalculatorPlugin.runCalculation(from, end, true, false, eventCustomCalculationFinished)
iobCobCalculatorPluginHistory.stopCalculation(from)
iobCobCalculatorPluginHistory.clearCache()
iobCobCalculatorPluginHistory.runCalculation(from, end, true, false, eventCustomCalculationFinished)
}
@Synchronized
@ -242,7 +244,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
GlobalScope.launch(Dispatchers.Main) {
historybrowse_bggraph ?: return@launch
val graphData = GraphData(injector, historybrowse_bggraph, iobCobStaticCalculatorPlugin)
val graphData = GraphData(injector, historybrowse_bggraph, iobCobCalculatorPluginHistory, treatmentsPluginHistory)
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()
// do preparation in different thread
@ -279,7 +281,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
// ------------------ 2nd graph
for (g in 0 until secondaryGraphs.size) {
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobStaticCalculatorPlugin)
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobCalculatorPluginHistory, treatmentsPluginHistory)
var useIobForScale = false
var useCobForScale = false
var useDevForScale = false

View file

@ -9,7 +9,6 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorP
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.resources.ResourceHelper
@ -18,7 +17,7 @@ import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class IobCobStaticCalculatorPlugin @Inject constructor(
class IobCobCalculatorPluginHistory @Inject constructor(
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
rxBus: RxBusWrapper,
@ -26,14 +25,14 @@ class IobCobStaticCalculatorPlugin @Inject constructor(
resourceHelper: ResourceHelper,
profileFunction: ProfileFunction,
activePlugin: ActivePluginProvider,
treatmentsPlugin: TreatmentsPlugin,
treatmentsPluginHistory: TreatmentsPluginHistory,
sensitivityOref1Plugin: SensitivityOref1Plugin,
sensitivityAAPSPlugin: SensitivityAAPSPlugin,
sensitivityWeightedAveragePlugin: SensitivityWeightedAveragePlugin,
fabricPrivacy: FabricPrivacy,
dateUtil: DateUtil
) : IobCobCalculatorPlugin(injector, aapsLogger, rxBus, sp, resourceHelper, profileFunction,
activePlugin, treatmentsPlugin, sensitivityOref1Plugin, sensitivityAAPSPlugin, sensitivityWeightedAveragePlugin, fabricPrivacy, dateUtil) {
activePlugin, treatmentsPluginHistory, sensitivityOref1Plugin, sensitivityAAPSPlugin, sensitivityWeightedAveragePlugin, fabricPrivacy, dateUtil) {
override fun onStart() { // do not attach to rxbus
}

View file

@ -0,0 +1,41 @@
package info.nightscout.androidaps.historyBrowser
import android.content.Context
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
import info.nightscout.androidaps.plugins.treatments.TreatmentService
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class TreatmentsPluginHistory @Inject constructor(
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
rxBus: RxBusWrapper,
resourceHelper: ResourceHelper,
context: Context,
sp: SP,
profileFunction: ProfileFunction,
activePlugin: ActivePluginProvider,
nsUpload: NSUpload,
fabricPrivacy: FabricPrivacy, dateUtil: DateUtil
) : TreatmentsPlugin(injector, aapsLogger, rxBus, resourceHelper, context, sp, profileFunction, activePlugin, nsUpload, fabricPrivacy, dateUtil) {
init {
onStart()
}
override fun onStart() {
service = TreatmentService(injector)
initializeData(range())
}
}

View file

@ -260,8 +260,8 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("low_temptarget_lowers_sensitivity", false);
mProfile.put("sensitivity_raises_target", SMBDefaults.sensitivity_raises_target);
mProfile.put("resistance_lowers_target", SMBDefaults.resistance_lowers_target);
mProfile.put("sensitivity_raises_target", sp.getBoolean(resourceHelper.gs(R.string.key_sensitivity_raises_target),SMBDefaults.sensitivity_raises_target));
mProfile.put("resistance_lowers_target", sp.getBoolean(resourceHelper.gs(R.string.key_resistance_lowers_target),SMBDefaults.resistance_lowers_target));
mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments);
mProfile.put("exercise_mode", SMBDefaults.exercise_mode);
mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target);

View file

@ -51,6 +51,9 @@ public class DetermineBasalResultSMB extends APSResult {
} else {
smb = 0d;
}
if (result.has("targetBG")) {
targetBG = result.getDouble("targetBG");
}
if (result.has("deliverAt")) {
String date = result.getString("deliverAt");

View file

@ -108,7 +108,7 @@ class PluginStore @Inject constructor(
(activeProfile as PluginBase).setPluginEnabled(PluginType.PROFILE, true)
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting ProfileInterface")
}
setFragmentVisiblities((activeSensitivity as PluginBase).name, pluginsInCategory, PluginType.PROFILE)
setFragmentVisiblities((activeProfile as PluginBase).name, pluginsInCategory, PluginType.PROFILE)
// PluginType.BGSOURCE
pluginsInCategory = getSpecificPluginsList(PluginType.BGSOURCE)

View file

@ -18,9 +18,9 @@ import info.nightscout.androidaps.events.*
import info.nightscout.androidaps.historyBrowser.HistoryBrowseActivity
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction
import info.nightscout.androidaps.plugins.general.overview.StatusLightHandler
import info.nightscout.androidaps.queue.Callback
@ -192,17 +192,15 @@ class ActionsFragment : DaggerFragment() {
@Synchronized
fun updateGui() {
actions_profileswitch?.visibility = (activePlugin.activeProfileInterface.profile != null).toVisibility()
val profile = profileFunction.getProfile()
val pump = activePlugin.activePump
actions_temptarget?.visibility = (profile != null).toVisibility()
actions_historybrowser.visibility = (profile != null).toVisibility()
val basalProfileEnabled = buildHelper.isEngineeringModeOrRelease() && pump.pumpDescription.isSetBasalProfileCapable
actions_profileswitch?.visibility = if (!basalProfileEnabled || !pump.isInitialized || pump.isSuspended) View.GONE else View.VISIBLE
actions_profileswitch?.visibility = (
activePlugin.activeProfileInterface.profile != null &&
pump.pumpDescription.isSetBasalProfileCapable &&
pump.isInitialized &&
!pump.isSuspended).toVisibility()
if (!pump.pumpDescription.isExtendedBolusCapable || !pump.isInitialized || pump.isSuspended || pump.isFakingTempsByExtendedBoluses) {
actions_extendedbolus?.visibility = View.GONE
@ -236,12 +234,11 @@ class ActionsFragment : DaggerFragment() {
}
}
actions_fill?.visibility =
if (!pump.pumpDescription.isRefillingCapable || !pump.isInitialized || pump.isSuspended) View.GONE
else View.VISIBLE
actions_temptarget?.visibility = config.APS.toVisibility()
actions_historybrowser.visibility = (profile != null).toVisibility()
actions_fill?.visibility = (pump.pumpDescription.isRefillingCapable && pump.isInitialized && !pump.isSuspended).toVisibility()
actions_temptarget?.visibility = (profile != null && config.APS).toVisibility()
actions_tddstats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility()
statusLightHandler.updateStatusLights(careportal_canulaage, careportal_insulinage, null, careportal_sensorage, careportal_pbage, null)
checkPumpCustomActions()
}

View file

@ -34,12 +34,11 @@ class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) {
return this
}
override fun shouldRun(): Boolean {
val currentMinSinceMidnight = getMinSinceMidnight(DateUtil.now())
override fun shouldRun() : Boolean {
val currentMinSinceMidnight = getMinSinceMidnight(dateUtil._now())
val scheduledDayOfWeek = Calendar.getInstance()[Calendar.DAY_OF_WEEK]
val scheduled = getMinSinceMidnight(time.value.toLong())
if (days.isSet(Objects.requireNonNull(InputWeekDay.DayOfWeek.fromCalendarInt(scheduledDayOfWeek)))) {
if (currentMinSinceMidnight >= scheduled && currentMinSinceMidnight - scheduled < 5) {
if (currentMinSinceMidnight >= time.value && currentMinSinceMidnight - time.value < 5) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}

View file

@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract
import info.nightscout.androidaps.plugins.general.maintenance.formats.PrefsFormatsHandler
import info.nightscout.androidaps.plugins.general.maintenance.formats.PrefsMetadataKey
import info.nightscout.androidaps.plugins.general.maintenance.formats.PrefsStatus
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
import info.nightscout.androidaps.utils.resources.ResourceHelper
import kotlinx.android.synthetic.main.maintenance_importlist_activity.*
import javax.inject.Inject

View file

@ -331,7 +331,7 @@ public class NSDeviceStatus {
// test warning level
int level = Levels.INFO;
long now = System.currentTimeMillis();
if (deviceStatusOpenAPSData.clockSuggested != 0 && deviceStatusOpenAPSData.clockSuggested + sp.getInt(R.string.key_nsalarm_urgent_staledatavalue, 16) * 60 * 1000L < now)
if (deviceStatusOpenAPSData.clockSuggested != 0 && deviceStatusOpenAPSData.clockSuggested + sp.getInt(R.string.key_nsalarm_urgent_staledatavalue, 31) * 60 * 1000L < now)
level = Levels.URGENT;
else if (deviceStatusOpenAPSData.clockSuggested != 0 && deviceStatusOpenAPSData.clockSuggested + sp.getInt(R.string.key_nsalarm_staledatavalue, 16) * 60 * 1000L < now)
level = Levels.WARN;

View file

@ -842,33 +842,42 @@ public class NSClientService extends DaggerService {
}
private void handleAnnouncement(JSONObject announcement) {
NSAlarm nsAlarm = new NSAlarm(announcement);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
rxBus.send(new EventNSClientNewLog("ANNOUNCEMENT", JsonHelper.safeGetString(announcement, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, announcement.toString());
boolean defaultVal = config.getNSCLIENT();
if (sp.getBoolean(R.string.key_ns_announcements, defaultVal)) {
NSAlarm nsAlarm = new NSAlarm(announcement);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
rxBus.send(new EventNSClientNewLog("ANNOUNCEMENT", JsonHelper.safeGetString(announcement, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, announcement.toString());
}
}
private void handleAlarm(JSONObject alarm) {
long snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L);
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
NSAlarm nsAlarm = new NSAlarm(alarm);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
boolean defaultVal = config.getNSCLIENT();
if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) {
long snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L);
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
NSAlarm nsAlarm = new NSAlarm(alarm);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
}
rxBus.send(new EventNSClientNewLog("ALARM", JsonHelper.safeGetString(alarm, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, alarm.toString());
}
rxBus.send(new EventNSClientNewLog("ALARM", JsonHelper.safeGetString(alarm, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, alarm.toString());
}
private void handleUrgentAlarm(JSONObject alarm) {
long snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L);
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
NSAlarm nsAlarm = new NSAlarm(alarm);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
boolean defaultVal = config.getNSCLIENT();
if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) {
long snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L);
if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) {
NSAlarm nsAlarm = new NSAlarm(alarm);
Notification notification = new NotificationWithAction(injector, nsAlarm);
rxBus.send(new EventNewNotification(notification));
}
rxBus.send(new EventNSClientNewLog("URGENTALARM", JsonHelper.safeGetString(alarm, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, alarm.toString());
}
rxBus.send(new EventNSClientNewLog("URGENTALARM", JsonHelper.safeGetString(alarm, "message", "received")));
aapsLogger.debug(LTag.NSCLIENT, alarm.toString());
}
public void handleNewCal(JSONArray cals, boolean isDelta) {

View file

@ -478,11 +478,11 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overview_iobgraph.removeAllViews()
for (i in 1 until numOfGraphs) {
val label = TextView(context)
label.layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT).also { it.setMargins(100, 0, 0, -90) }
label.layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT).also { it.setMargins(100, 0, 0, -120) }
overview_iobgraph.addView(label)
secondaryGraphsLabel.add(label)
val graph = GraphView(context)
graph.layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, resourceHelper.dpToPx(100)).also { it.setMargins(0, resourceHelper.dpToPx(5), 0, resourceHelper.dpToPx(10)) }
graph.layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, resourceHelper.dpToPx(100)).also { it.setMargins(0, resourceHelper.dpToPx(35), 0, resourceHelper.dpToPx(15)) }
graph.gridLabelRenderer?.gridColor = resourceHelper.gc(R.color.graphgrid)
graph.gridLabelRenderer?.reloadStyles()
graph.gridLabelRenderer?.isHorizontalLabelsVisible = false
@ -646,6 +646,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
} else {
overview_apsmode_text?.visibility = View.GONE
}
val lastRun = loopPlugin.lastRun
// temp target
val tempTarget = treatmentsPlugin.tempTargetFromHistory
@ -654,9 +655,18 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.ribbonWarning))
overview_temptarget?.text = Profile.toTargetRangeString(tempTarget.low, tempTarget.high, Constants.MGDL, units) + " " + DateUtil.untilString(tempTarget.end(), resourceHelper)
} else {
overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextDefault))
overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.ribbonDefault))
overview_temptarget?.text = Profile.toTargetRangeString(profile.targetLowMgdl, profile.targetHighMgdl, Constants.MGDL, units)
// If the target is not the same as set in the profile then oref has overridden it
val targetUsed = lastRun?.constraintsProcessed?.targetBG ?: 0.0
if (targetUsed != 0.0 && profile.targetMgdl != targetUsed) {
overview_temptarget?.text = Profile.toTargetRangeString(targetUsed, targetUsed, Constants.MGDL, units)
overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextWarning))
overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.tempTargetBackground))
} else {
overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextDefault))
overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.ribbonDefault))
overview_temptarget?.text = Profile.toTargetRangeString(profile.targetLowMgdl, profile.targetHighMgdl, Constants.MGDL, units)
}
}
// Basal, TBR
@ -677,7 +687,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
if (activeTemp != null)
overview_basebasal_icon.setImageResource(if (activeTemp.tempBasalConvertedToPercent(System.currentTimeMillis(), profile) > 100) R.drawable.icon_cp_basal_tbr_high else R.drawable.icon_cp_basal_tbr_low)
else
overview_basebasal_icon.setImageResource( R.drawable.icon_cp_basal_no_tbr )
overview_basebasal_icon.setImageResource(R.drawable.icon_cp_basal_no_tbr)
// Extended bolus
val extendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis())
@ -741,7 +751,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
overview_cob?.text = cobText
val lastRun = loopPlugin.lastRun
val predictionsAvailable = if (config.APS) lastRun?.request?.hasPredictions == true else config.NSCLIENT
// pump status from ns
@ -757,9 +766,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overview_uploader?.setOnClickListener { activity?.let { OKDialog.show(it, resourceHelper.gs(R.string.uploader), nsDeviceStatus.extendedUploaderStatus) } }
// Sensitivity
if (sp.getBoolean(R.string.key_openapsama_useautosens, false)) {
if (sp.getBoolean(R.string.key_openapsama_useautosens, false) && constraintChecker.isAutosensModeEnabled().value()) {
overview_sensitivity_icon.setImageResource(R.drawable.ic_swap_vert_black_48dp_green)
}else {
} else {
overview_sensitivity_icon.setImageResource(R.drawable.ic_x_swap_vert_48px_green)
}
@ -771,7 +780,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
// ****** GRAPH *******
GlobalScope.launch(Dispatchers.Main) {
overview_bggraph ?: return@launch
val graphData = GraphData(injector, overview_bggraph, iobCobCalculatorPlugin)
val graphData = GraphData(injector, overview_bggraph, iobCobCalculatorPlugin, treatmentsPlugin)
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()
// do preparation in different thread
@ -834,7 +843,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
// ------------------ 2nd graph
for (g in 0 until secondaryGraphs.size) {
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobCalculatorPlugin)
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobCalculatorPlugin, treatmentsPlugin)
var useIobForScale = false
var useCobForScale = false
var useDevForScale = false
@ -883,4 +892,4 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
}
}
}
}

View file

@ -34,7 +34,13 @@ import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
class GraphData(injector: HasAndroidInjector, private val graph: GraphView, private val iobCobCalculatorPlugin: IobCobCalculatorPlugin) {
class GraphData(
injector: HasAndroidInjector,
private val graph: GraphView,
private val iobCobCalculatorPlugin: IobCobCalculatorPlugin,
private val treatmentsPlugin: TreatmentsInterface
) {
// IobCobCalculatorPlugin Cannot be injected: HistoryBrowser
@Inject lateinit var aapsLogger: AAPSLogger
@ -42,8 +48,6 @@ class GraphData(injector: HasAndroidInjector, private val graph: GraphView, priv
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var activePlugin: ActivePluginProvider
private val treatmentsPlugin: TreatmentsInterface
var maxY = Double.MIN_VALUE
private var minY = Double.MAX_VALUE
private var bgReadingsArray: List<BgReading>? = null
@ -53,7 +57,6 @@ class GraphData(injector: HasAndroidInjector, private val graph: GraphView, priv
init {
injector.androidInjector().inject(this)
units = profileFunction.getUnits()
treatmentsPlugin = activePlugin.activeTreatments
}
@Suppress("UNUSED_PARAMETER")

View file

@ -22,8 +22,6 @@ class NotificationWithAction constructor(
@Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var nsClientPlugin: NSClientPlugin
private var nsAlarm: NSAlarm? = null
init {
injector.androidInjector().inject(this)
}
@ -36,7 +34,6 @@ class NotificationWithAction constructor(
}
constructor (injector: HasAndroidInjector, nsAlarm: NSAlarm) : this(injector) {
this.nsAlarm = nsAlarm
date = System.currentTimeMillis()
when (nsAlarm.level()) {
0 -> {
@ -50,14 +47,14 @@ class NotificationWithAction constructor(
id = NSALARM
level = NORMAL
text = nsAlarm.title()
if (nsAlarm.low() && sp.getBoolean(R.string.key_nsalarm_low, false) || nsAlarm.high() && sp.getBoolean(R.string.key_nsalarm_high, false) || nsAlarm.timeago() && sp.getBoolean(R.string.key_nsalarm_staledata, false)) soundId = R.raw.alarm
soundId = R.raw.alarm
}
2 -> {
id = NSURGENTALARM
level = URGENT
text = nsAlarm.title()
if (nsAlarm.low() && sp.getBoolean(R.string.key_nsalarm_low, false) || nsAlarm.high() && sp.getBoolean(R.string.key_nsalarm_high, false) || nsAlarm.timeago() && sp.getBoolean(R.string.key_nsalarm_staledata, false)) soundId = R.raw.urgentalarm
soundId = R.raw.urgentalarm
}
}
buttonText = R.string.snooze

View file

@ -308,13 +308,20 @@ class SmsCommunicatorPlugin @Inject constructor(
when (splitted[1].toUpperCase(Locale.getDefault())) {
"DISABLE", "STOP" -> {
if (loopPlugin.isEnabled(PluginType.LOOP)) {
loopPlugin.setPluginEnabled(PluginType.LOOP, false)
commandQueue.cancelTempBasal(true, object : Callback() {
val passCode = generatePasscode()
val reply = String.format(resourceHelper.gs(R.string.smscommunicator_loopdisablereplywithcode), passCode)
receivedSms.processed = true
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction() {
override fun run() {
rxBus.send(EventRefreshOverview("SMS_LOOP_STOP"))
val replyText = resourceHelper.gs(R.string.smscommunicator_loophasbeendisabled) + " " +
resourceHelper.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed)
sendSMS(Sms(receivedSms.phoneNumber, replyText))
loopPlugin.setPluginEnabled(PluginType.LOOP, false)
commandQueue.cancelTempBasal(true, object : Callback() {
override fun run() {
rxBus.send(EventRefreshOverview("SMS_LOOP_STOP"))
val replyText = resourceHelper.gs(R.string.smscommunicator_loophasbeendisabled) + " " +
resourceHelper.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed)
sendSMS(Sms(receivedSms.phoneNumber, replyText))
}
})
}
})
} else
@ -324,9 +331,16 @@ class SmsCommunicatorPlugin @Inject constructor(
"ENABLE", "START" -> {
if (!loopPlugin.isEnabled(PluginType.LOOP)) {
loopPlugin.setPluginEnabled(PluginType.LOOP, true)
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_loophasbeenenabled)))
rxBus.send(EventRefreshOverview("SMS_LOOP_START"))
val passCode = generatePasscode()
val reply = String.format(resourceHelper.gs(R.string.smscommunicator_loopenablereplywithcode), passCode)
receivedSms.processed = true
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction() {
override fun run() {
loopPlugin.setPluginEnabled(PluginType.LOOP, true)
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_loophasbeenenabled)))
rxBus.send(EventRefreshOverview("SMS_LOOP_START"))
}
})
} else
sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_loopisenabled)))
receivedSms.processed = true
@ -343,9 +357,16 @@ class SmsCommunicatorPlugin @Inject constructor(
}
"RESUME" -> {
rxBus.send(EventRefreshOverview("SMS_LOOP_RESUME"))
loopPlugin.createOfflineEvent(0)
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_loopresumed)))
val passCode = generatePasscode()
val reply = String.format(resourceHelper.gs(R.string.smscommunicator_loopresumereplywithcode), passCode)
receivedSms.processed = true
messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction() {
override fun run() {
rxBus.send(EventRefreshOverview("SMS_LOOP_RESUME"))
loopPlugin.createOfflineEvent(0)
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.smscommunicator_loopresumed)))
}
})
}
"SUSPEND" -> {

View file

@ -86,7 +86,7 @@ class ActionStringHandler @Inject constructor(
var rMessage = ""
var rAction = ""
// do the parsing and check constraints
val act = actionString.split("\\s+").toTypedArray()
val act = actionString.split("\\s+".toRegex()).toTypedArray()
if ("fillpreset" == act[0]) { ///////////////////////////////////// PRIME/FILL
val amount: Double = if ("1" == act[1]) {
sp.getDouble("fill_button1", 0.3)
@ -470,7 +470,7 @@ class ActionStringHandler @Inject constructor(
if (System.currentTimeMillis() - lastSentTimestamp > TIMEOUT) return
lastConfirmActionString = null
// do the parsing, check constraints and enact!
val act = actionString.split("\\s+").toTypedArray()
val act = actionString.split("\\s+".toRegex()).toTypedArray()
if ("fill" == act[0]) {
val amount = SafeParse.stringToDouble(act[1])
val insulinAfterConstraints = constraintChecker.applyBolusConstraints(Constraint(amount)).value()

View file

@ -597,6 +597,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
bolusMessage.setDuration(0);
bolusMessage.setExtendedAmount(0);
bolusMessage.setImmediateAmount(insulin);
bolusMessage.setVibration(sp.getBoolean(detailedBolusInfo.isSMB ? R.string.key_disable_vibration_auto : R.string.key_disable_vibration ,false));
bolusID = connectionService.requestMessage(bolusMessage).await().getBolusId();
bolusCancelled = false;
}
@ -720,7 +721,8 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
PumpEnactResult cancelTBRResult = cancelTempBasalOnly();
if (cancelTBRResult.success) {
PumpEnactResult ebResult = setExtendedBolusOnly((absoluteRate - getBaseBasalRate()) / 60D
* ((double) durationInMinutes), durationInMinutes);
* ((double) durationInMinutes), durationInMinutes,
sp.getBoolean(R.string.key_disable_vibration_auto,false));
if (ebResult.success) {
result.success = true;
result.enacted = true;
@ -798,7 +800,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
@NonNull @Override
public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) {
PumpEnactResult result = cancelExtendedBolusOnly();
if (result.success) result = setExtendedBolusOnly(insulin, durationInMinutes);
if (result.success) result = setExtendedBolusOnly(insulin, durationInMinutes, sp.getBoolean(R.string.key_disable_vibration,false));
try {
fetchStatus();
readHistory();
@ -812,7 +814,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
return result;
}
public PumpEnactResult setExtendedBolusOnly(Double insulin, Integer durationInMinutes) {
public PumpEnactResult setExtendedBolusOnly(Double insulin, Integer durationInMinutes, boolean disableVibration) {
PumpEnactResult result = new PumpEnactResult(getInjector());
try {
DeliverBolusMessage bolusMessage = new DeliverBolusMessage();
@ -820,6 +822,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
bolusMessage.setDuration(durationInMinutes);
bolusMessage.setExtendedAmount(insulin);
bolusMessage.setImmediateAmount(0);
bolusMessage.setVibration(disableVibration);
int bolusID = connectionService.requestMessage(bolusMessage).await().getBolusId();
InsightBolusID insightBolusID = new InsightBolusID();
insightBolusID.bolusID = bolusID;

View file

@ -14,6 +14,7 @@ public class DeliverBolusMessage extends AppLayerMessage {
private double extendedAmount;
private int duration;
private int bolusId;
private boolean disableVibration = false;
public DeliverBolusMessage() {
super(MessagePriority.NORMAL, true, true, Service.REMOTE_CONTROL);
@ -22,7 +23,11 @@ public class DeliverBolusMessage extends AppLayerMessage {
@Override
protected ByteBuf getData() {
ByteBuf byteBuf = new ByteBuf(22);
byteBuf.putUInt16LE(252);
// 805 => Old value with vibration (2.6.1 and earlier), 252 => new value without vibrations for firmware 3.x
if (disableVibration)
byteBuf.putUInt16LE(252);
else
byteBuf.putUInt16LE(805);
byteBuf.putUInt16LE(BolusTypeIDs.IDS.getID(bolusType));
byteBuf.putUInt16LE(31);
byteBuf.putUInt16LE(0);
@ -57,6 +62,8 @@ public class DeliverBolusMessage extends AppLayerMessage {
this.duration = duration;
}
public void setVibration(boolean disableVibration) { this.disableVibration = disableVibration;}
public int getBolusId() {
return bolusId;
}

View file

@ -178,7 +178,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
return this.service;
}
private long range() {
protected long range() {
double dia = Constants.defaultDIA;
if (profileFunction.getProfile() != null)
dia = profileFunction.getProfile().getDia();

View file

@ -34,7 +34,7 @@ import info.nightscout.androidaps.setupwizard.elements.*
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
import info.nightscout.androidaps.utils.AndroidPermission
import info.nightscout.androidaps.utils.CryptoUtil
import info.nightscout.androidaps.utils.LocaleHelper.update
import info.nightscout.androidaps.utils.locale.LocaleHelper.update
import info.nightscout.androidaps.utils.extensions.isRunningTest
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper

View file

@ -20,7 +20,7 @@ import info.nightscout.androidaps.setupwizard.elements.SWItem
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
import info.nightscout.androidaps.utils.AndroidPermission
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.LocaleHelper.update
import info.nightscout.androidaps.utils.locale.LocaleHelper.update
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation
import info.nightscout.androidaps.utils.resources.ResourceHelper

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.utils;
import android.os.Build;
import android.text.Html;
import android.text.Spanned;
@ -8,7 +7,6 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Iterator;
@ -24,33 +22,24 @@ public class JSONFormatter {
final JsonVisitor visitor = new JsonVisitor(1, '\t');
try {
if (jsonString.equals("undefined"))
return Html.fromHtml("undefined");
return HtmlHelper.INSTANCE.fromHtml("undefined");
else if (jsonString.getBytes()[0] == '[')
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return Html.fromHtml(visitor.visit(new JSONArray(jsonString), 0), Html.FROM_HTML_MODE_COMPACT);
} else {
return Html.fromHtml(visitor.visit(new JSONArray(jsonString), 0));
}
else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return Html.fromHtml(visitor.visit(new JSONObject(jsonString), 0), Html.FROM_HTML_MODE_COMPACT);
} else {
return Html.fromHtml(visitor.visit(new JSONObject(jsonString), 0));
}
}
return HtmlHelper.INSTANCE.fromHtml(visitor.visit(new JSONArray(jsonString), 0));
else
return HtmlHelper.INSTANCE.fromHtml(visitor.visit(new JSONObject(jsonString), 0));
} catch (JSONException e) {
log.error("Unhandled exception", e);
return Html.fromHtml("");
return HtmlHelper.INSTANCE.fromHtml("");
}
}
public static Spanned format(final JSONObject object) {
final JsonVisitor visitor = new JsonVisitor(1, '\t');
try {
return Html.fromHtml(visitor.visit(object, 0));
return HtmlHelper.INSTANCE.fromHtml(visitor.visit(object, 0));
} catch (JSONException e) {
log.error("Unhandled exception", e);
return Html.fromHtml("");
return HtmlHelper.INSTANCE.fromHtml("");
}
}

View file

@ -381,12 +381,6 @@
<string name="careportal_insulinage_label">Insulien ouderdom</string>
<string name="careportal_pbage_label">Pomp battery ouderdom</string>
<string name="ns_alarmoptions">Alarm Opsies</string>
<string name="nsalarm_urgenthigh">Nood hoog</string>
<string name="nsalarm_high">Hoog</string>
<string name="nsalarm_low">Laag</string>
<string name="nsalarm_urgentlow">Nood laag</string>
<string name="nsalarm_staledata">Ou data</string>
<string name="nsalarm_urgentstaledata">Nood ou data</string>
<string name="nsalarm_staledatavalue_label">Ou data drumpel [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Nood ou data drumpel [min]</string>
<string name="openapsama_autosens_period">Interval vir autosens [h]</string>

View file

@ -410,12 +410,6 @@
<string name="doprofileswitch">Смени профил</string>
<string name="careportal_pbage_label">Възраст на батерията на помпата</string>
<string name="ns_alarmoptions">Опции за аларми</string>
<string name="nsalarm_urgenthigh">Много висока</string>
<string name="nsalarm_high">Висока</string>
<string name="nsalarm_low">Ниска</string>
<string name="nsalarm_urgentlow">Много ниска</string>
<string name="nsalarm_staledata">Стари данни</string>
<string name="nsalarm_urgentstaledata">Много стари данни</string>
<string name="nsalarm_staledatavalue_label">Когато няма данни повече от [мин]</string>
<string name="nsalarm_urgent_staledatavalue_label">Много стари данни при повече от [мин]</string>
<string name="openapsama_autosens_period">Интервал за autosens [ч]</string>

View file

@ -468,12 +468,6 @@
<string name="doprofileswitch">Proveďte přepnutí profilu</string>
<string name="careportal_pbage_label">Stáří baterie v pumpě</string>
<string name="ns_alarmoptions">Nastavení alarmů</string>
<string name="nsalarm_urgenthigh">Urgentně vysoká</string>
<string name="nsalarm_high">Vysoká</string>
<string name="nsalarm_low">Nízká</string>
<string name="nsalarm_urgentlow">Urgentně nízká</string>
<string name="nsalarm_staledata">Zastaralá data</string>
<string name="nsalarm_urgentstaledata">Urgentně zastaralá data</string>
<string name="nsalarm_staledatavalue_label">Mezní hodnota pro zastaralá data [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Urgentní mezní hodnota pro zastaralá data [min]</string>
<string name="openapsama_autosens_period">Interval pro detekci senzitivity [h]</string>

View file

@ -2,7 +2,7 @@
<resources>
<string name="connection_failed">Verbindung fehlgeschlagen</string>
<string name="connection_lost">Verbindung unterbrochen</string>
<string name="pairing_rejected">Pairing abgelehnt</string>
<string name="pairing_rejected">Kopplung abgelehnt</string>
<string name="socket_creation_failed">Erstellen des Sockets fehlgeschlagen</string>
<string name="timeout">Zeitüberschreitung</string>
<string name="maximum_number_of_bolus_type_already_running">Maximale Anzahl an Boli dieses Typs bereits aktiv</string>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="biometric_title">Authentifizierung erforderlich</string>
<string name="biometric_description">Legen Deinen Finger auf den Fingerabdrucksensors, um Deine Identität zu bestätigen.</string>
<string name="biometric_description">Lege Deinen Finger auf den Fingerabdrucksensor, um Deine Identität zu bestätigen.</string>
<string name="settings_protection">Schutz der Einstellungen</string>
<string name="application_protection">Schutz der App</string>
<string name="bolus_protection">Bolus-Schutz</string>
@ -14,7 +14,7 @@
<string name="custom_password">Benutzerdefiniertes Passwort</string>
<string name="noprotection">Kein Schutz</string>
<string name="protection">Schutz</string>
<string name="master_password_missing">Das Master-Passwort ist nicht festgelegt!\n\nLege Dein Master-Passwort bitte in en Einstellungen fest (%1$s &#8594; %2$s)</string>
<string name="master_password_missing">Das Master-Passwort ist nicht festgelegt!\n\nLege Dein Master-Passwort bitte in den Einstellungen fest (%1$s &#8594; %2$s)</string>
<string name="password_set">Passwort festgelegt!</string>
<string name="password_not_set">Passwort nicht festgelegt</string>
<string name="password_not_changed">Passwort nicht geändert</string>

View file

@ -185,7 +185,7 @@
<string name="check_preferences_import_anyway_btn">Trotzdem importieren (GEFÄHRLICH!)</string>
<string name="metadata_warning_different_flavour">Einstellungen wurden mit einer anderen Variante von AAPS erstellt (%1$s). Du nutzt: %2$s.\n\nEinige Einstellungen können fehlen oder ungültig sein - überprüfe und aktualisiere Deine Einstellungen nach dem Import .</string>
<string name="metadata_warning_different_device">Einstellungen wurden auf einem anderen Gerät erstellt. Das ist OK, wenn Du von einem älteren/anderen Handy importierst. Stelle aber sicher, dass die importierten Einstellungen korrekt sind!</string>
<string name="metadata_warning_outdated_format">Du verwendest das veraltete Format einer alten AAPS-Version das nicht sicher ist! Verwende dieses nur als letzte Möglichkeit, wenn Du keinen Export im aktuellen JSON-Format hast.</string>
<string name="metadata_warning_outdated_format">Du verwendest das veraltete Format einer alten AAPS-Version, das nicht sicher ist! Verwende dieses nur als letzte Möglichkeit, wenn Du keinen Export im aktuellen JSON-Format hast.</string>
<string name="metadata_warning_old_export">Die importierten Einstellungen sind bereits %1$s Tage alt! Hast Du aktuellere Einstellungen oder evtl. die falsche Datei gewählt? Denke daran, die Einstellungen regelmäßig zu exportieren.</string>
<string name="metadata_warning_date_format">Ungültiges Datums-/Zeitformat!</string>
<string name="metadata_warning_different_version">Einstellungen stammen aus einer Vorgängerversion (Nebenversion). Du kannst diese importieren, prüfe aber unbedingt nach dem Import, ob diese noch korrekt sind!</string>
@ -251,7 +251,7 @@
<string name="bolusstopped">Bolus gestoppt</string>
<string name="bolusstopping">Bolus wird gestoppt</string>
<string name="smscommunicator_loophasbeendisabled">Loop wurde deaktiviert.</string>
<string name="smscommunicator_loophasbeenenabled">Loop wurde aktiviert</string>
<string name="smscommunicator_loophasbeenenabled">Lopp wurde aktiviert.</string>
<string name="smscommunicator_loopisdisabled">Loop ist deaktiviert.</string>
<string name="smscommunicator_loopisenabled">Loop ist aktiviert.</string>
<string name="valuelimitedto">%1$.2f limitiert auf %2$.2f</string>
@ -266,15 +266,15 @@
<string name="smscommunicator_suspendreplywithcode">Um das Loopen für %1$d Minuten zu pausieren, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_tempbasalset">TBR mit %1$.2f IE/h für %2$d min wurde erfolgreich gestartet.</string>
<string name="smscommunicator_extendedset">Der erweiterte Bolus %1$.2f IE/h für %2$d Minuten wurde erfolgreich gestartet</string>
<string name="smscommunicator_carbsset">%1$dg Kohlenhydrate erfolgreich erfasst</string>
<string name="smscommunicator_carbsset">%1$dg Kohlenhydrate erfolgreich erfasst.</string>
<string name="smscommunicator_carbsfailed">Eingabe von %1$dg Kohlenhydraten ist fehlgeschlagen.</string>
<string name="smscommunicator_tempbasalset_percent">Die temporäre Basalrate wurde erfolgreich für %2$d Minuten auf %1$d%% gesetzt</string>
<string name="smscommunicator_tempbasalset_percent">Die temporäre Basalrate wurde erfolgreich für %2$d Minuten auf %1$d%% gesetzt.</string>
<string name="smscommunicator_tempbasalfailed">Das Starten der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_extendedfailed">Die Abgabe des erweiterten Bolus ist fehlgeschlagen</string>
<string name="smscommunicator_basalstopreplywithcode">Antworte mit dem Code %1$s, um die temporäre Basalrate zu beenden</string>
<string name="smscommunicator_extendedstopreplywithcode">Antworte mit dem Code %1$s, um den erweiterten Bolus zu beenden</string>
<string name="smscommunicator_extendedfailed">Die Abgabe des erweiterten Bolus ist fehlgeschlagen.</string>
<string name="smscommunicator_basalstopreplywithcode">Antworte mit dem Code %1$s, um die temporäre Basalrate zu beenden.</string>
<string name="smscommunicator_extendedstopreplywithcode">Antworte mit dem Code %1$s, um den erweiterten Bolus zu beenden.</string>
<string name="smscommunicator_tempbasalcanceled">TBR abgebrochen</string>
<string name="smscommunicator_extendedcanceled">Die Abgabe des erweiterten Bolus wurde abgebrochen</string>
<string name="smscommunicator_extendedcanceled">Die Abgabe des erweiterten Bolus wurde abgebrochen.</string>
<string name="smscommunicator_tempbasalcancelfailed">Das Abbrechen der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_extendedcancelfailed">Der Abbruch des erweiterten Bolus ist fehlgeschlagen</string>
<string name="smscommunicator_unknowncommand">Unbekannter Befehl oder falsche Antwort</string>
@ -326,7 +326,7 @@
<string name="array_of_elements">Array mit %1$d Elementen.\nWert:</string>
<string name="openapsma_autosensdata_label">Autosens-Daten</string>
<string name="openapsma_scriptdebugdata_label">Skript Debug</string>
<string name="openapsama_useautosens">Nutze Autosense</string>
<string name="openapsama_useautosens">Nutze Autosens</string>
<string name="refresheventsfromnightscout">Aktualisiere Einträge von Nightscout</string>
<string name="deletefuturetreatments">Lösche Behandlungen in der Zukunft</string>
<string name="eatingsoon">Bald essen</string>
@ -468,12 +468,8 @@
<string name="doprofileswitch">Profilwechsel durchführen</string>
<string name="careportal_pbage_label">Batteriealter</string>
<string name="ns_alarmoptions">Alarm-Optionen</string>
<string name="nsalarm_urgenthigh">Sehr hoch</string>
<string name="nsalarm_high">Hoch</string>
<string name="nsalarm_low">Niedrig</string>
<string name="nsalarm_urgentlow">Sehr niedrig</string>
<string name="nsalarm_staledata">Veraltete Daten</string>
<string name="nsalarm_urgentstaledata">Stark veraltete Daten</string>
<string name="ns_alarms">Benachrichtigungen über NS-Alarme</string>
<string name="ns_announcements">Benachrichtigungen über NS-Ankündigungen</string>
<string name="nsalarm_staledatavalue_label">Veraltete Daten seit [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Stark veraltete Daten seit [min]</string>
<string name="openapsama_autosens_period">Intervall für Autosens [h]</string>
@ -832,9 +828,9 @@ Unerwartetes Verhalten.</string>
<string name="loop_openmode_min_change">Minimaler Wert zur Anfrage einer Änderung [%]</string>
<string name="loop_openmode_min_change_summary" formatted="false">Open Loop schlägt neue Änderungen nur dann vor, wenn die Änderung größer als dieser Wert ist. Der Standard-Wert ist 20%.</string>
<string name="searching_for_devices">Geräte werden gesucht…</string>
<string name="pairing_completed">Pairing abgeschlossen</string>
<string name="pairing_completed">Kopplung abgeschlossen</string>
<string name="code_compare">Stimmen die Codes auf diesem Gerät und auf deiner Pumpe überein?</string>
<string name="insight_pairing">Insight Pairing</string>
<string name="insight_pairing">Insight Kopplung</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2f U / %2$.2f U abgegeben</string>
<string name="insight_alert_formatter">%1$s: %2$s</string>
@ -851,6 +847,10 @@ Unerwartetes Verhalten.</string>
<string name="log_alerts">Alarme protokollieren</string>
<string name="enable_tbr_emulation">TBR-Emulation aktivieren</string>
<string name="enable_tbr_emulation_summary">Verzögerte Boli an Stelle von TBRs verwenden, um die Beschränkung auf 250%% zu umgehen</string>
<string name="disable_vibration">Vibrationen bei manueller Bolus-Abgabe deaktivieren</string>
<string name="disable_vibration_summary">Für Boli und verlängerte Boli (nur mit Insight Firmware 3.x verfügbar)</string>
<string name="disable_vibration_auto">Vibrationen bei automatischer Bolus-Abgabe deaktivieren</string>
<string name="disable_vibration_auto_summary">Für SMB und Temporäre Basalraten mit TBR Emulation (nur mit Insight Firmware 3.x verfügbar)</string>
<string name="disconnect_delay">Verbindungsabbau-Verzögerung [s]</string>
<string name="serial_number">Seriennummer</string>
<string name="release_software_version">Release-Softwareversion</string>
@ -862,8 +862,8 @@ Unerwartetes Verhalten.</string>
<string name="bluetooth_address">Bluetooth-Adresse</string>
<string name="system_id_appendix">System-ID-Appendix</string>
<string name="manufacturing_date">Herstellungsdatum</string>
<string name="delete_pairing">Pairing löschen</string>
<string name="pairing_information">Pairinginformationen</string>
<string name="delete_pairing">Kopplung aufheben</string>
<string name="pairing_information">Kopplungsinformation</string>
<string name="start_pump">Pumpe starten</string>
<string name="stop_pump">Pumpe stoppen</string>
<string name="operating_mode">Betriebsmodus</string>

View file

@ -386,12 +386,6 @@
<string name="careportal_insulinage_label">Χρόνος ζωής Ινσουλίνης</string>
<string name="careportal_pbage_label">Χρόνος ζωής μπαταρίας αντλίας</string>
<string name="ns_alarmoptions">Επιλογές συναγερμού</string>
<string name="nsalarm_urgenthigh">Επείγον υψηλό</string>
<string name="nsalarm_high">Υψηλό</string>
<string name="nsalarm_low">Χαμηλό</string>
<string name="nsalarm_urgentlow">Επείγον χαμηλό</string>
<string name="nsalarm_staledata">Παλιά δεδομένα</string>
<string name="nsalarm_urgentstaledata">Επείγον παλιά δεδομένα</string>
<string name="nsalarm_staledatavalue_label">Οριακή τιμή για παλιά δεδομένα [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Επείγουσα οριακή τιμή για παλιά δεδομένα [min]</string>
<string name="openapsama_autosens_period">Εσωτερικά διαστήματα για autosense [h] </string>

View file

@ -441,12 +441,6 @@
<string name="doprofileswitch">Cambio de perfil</string>
<string name="careportal_pbage_label">Edad batería bomba</string>
<string name="ns_alarmoptions">Opciones alarma</string>
<string name="nsalarm_urgenthigh">Urgente alto</string>
<string name="nsalarm_high">Alto</string>
<string name="nsalarm_low">Bajo</string>
<string name="nsalarm_urgentlow">Urgente bajo</string>
<string name="nsalarm_staledata">Datos anticuados</string>
<string name="nsalarm_urgentstaledata">Datos antiguos urgentes</string>
<string name="nsalarm_staledatavalue_label">Datos antiguos limite [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Datos antiguos urgentes limite [min]</string>
<string name="openapsama_autosens_period">Intervalo para autosens [h]</string>

View file

@ -469,12 +469,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="doprofileswitch">Changer de profil</string>
<string name="careportal_pbage_label">Age batterie pompe</string>
<string name="ns_alarmoptions">Options d\'alarme</string>
<string name="nsalarm_urgenthigh">Haute urgent</string>
<string name="nsalarm_high">Haute</string>
<string name="nsalarm_low">Basse</string>
<string name="nsalarm_urgentlow">Basse urgent</string>
<string name="nsalarm_staledata">Données obsolètes</string>
<string name="nsalarm_urgentstaledata">Urgent données obsolètes</string>
<string name="nsalarm_staledatavalue_label">Seuil sans nouvelle donnée Glyc. [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Seuil d\'urgence pour les données obsolètes [min]</string>
<string name="openapsama_autosens_period">Plage pour Autosens [h]</string>
@ -567,7 +561,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="smbmaxminutes_summary">Max. minutes de basal pour limiter le SMB</string>
<string name="uamsmbmaxminutes">SMB RNS minutes max</string>
<string name="uamsmbmaxminutes_summary">Minutes de basal max pour limiter les SMB des RNS</string>
<string name="carbsReqThreshold">Seuil de suggestionde glucides</string>
<string name="carbsReqThreshold">Seuil de suggestion de glucides</string>
<string name="carbsReqThreshold_summary">Quantité de glucides à partir de laquelle une notification est envoyée</string>
<string name="dexcomg5_xdripupload_title">Transmettre les Gly vers xDrip+</string>
<string name="dexcomg5_xdripupload_summary">Dans xDrip+ veuillez séléctionner 640g/Eversense comme source de données</string>
@ -852,6 +846,10 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="log_alerts">Enreg. alertes</string>
<string name="enable_tbr_emulation">Activer lémulation de DBT</string>
<string name="enable_tbr_emulation_summary">Utilisez des Bolus étendus au lieu de DBTs pour contourner la limite de 250%%</string>
<string name="disable_vibration">Désactiver les vibrations des bolus manuels</string>
<string name="disable_vibration_summary">Concerne les bolus et bolus étendus (disponible uniquement pour les firmwares 3.x)</string>
<string name="disable_vibration_auto">Désactiver les vibrations des bolus automatiques</string>
<string name="disable_vibration_auto_summary">Concerne les SMB et les basal temp avec émulation DBT (disponible uniquement pour les firmwares 3.x)</string>
<string name="disconnect_delay">Délai de déconnexion [s]</string>
<string name="serial_number">Numéro de série</string>
<string name="release_software_version">Version du logiciel</string>

View file

@ -468,12 +468,8 @@
<string name="doprofileswitch">Cambia profilo</string>
<string name="careportal_pbage_label">Età batteria micro</string>
<string name="ns_alarmoptions">Opzioni allarme</string>
<string name="nsalarm_urgenthigh">Molto alto</string>
<string name="nsalarm_high">Alto</string>
<string name="nsalarm_low">Basso</string>
<string name="nsalarm_urgentlow">Molto basso</string>
<string name="nsalarm_staledata">Dati non aggiornati</string>
<string name="nsalarm_urgentstaledata">Dati non aggiornati da molto tempo</string>
<string name="ns_alarms">Crea notifiche da allarmi NS</string>
<string name="ns_announcements">Crea notifiche da avvisi NS</string>
<string name="nsalarm_staledatavalue_label">Soglia dati non aggiornati [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Soglia dati non aggiornati da molto tempo [min]</string>
<string name="openapsama_autosens_period">Intervallo per autosens [h]</string>
@ -851,6 +847,10 @@
<string name="log_alerts">Registra avvisi</string>
<string name="enable_tbr_emulation">Abilita emulazione TBR</string>
<string name="enable_tbr_emulation_summary">Usa i bolli estesi invece dei TBR per aggirare il limite del 250%%</string>
<string name="disable_vibration">Erogazione bolo manuale: disabilita vibrazioni</string>
<string name="disable_vibration_summary">Per bolo e bolo esteso (disponibile solo con firmware Insight 3.x)</string>
<string name="disable_vibration_auto">Erogazione bolo automatica: disabilita vibrazioni</string>
<string name="disable_vibration_auto_summary">Per SMB e basale temporanea con emulazione TBR (disponibile solo con firmware Insight 3.x)</string>
<string name="disconnect_delay">Ritardo disconnessione [s]</string>
<string name="serial_number">Numero seriale</string>
<string name="release_software_version">Versione Release software</string>

View file

@ -408,12 +408,6 @@
<string name="doprofileswitch">프로파일 변경 실행</string>
<string name="careportal_pbage_label">펌프배터리사용기간</string>
<string name="ns_alarmoptions">알람 옵션</string>
<string name="nsalarm_urgenthigh">위험 고혈당</string>
<string name="nsalarm_high">고혈당</string>
<string name="nsalarm_low">저혈당</string>
<string name="nsalarm_urgentlow">위험 저혈당</string>
<string name="nsalarm_staledata">누락 데이터</string>
<string name="nsalarm_urgentstaledata">위험 누락 데이터</string>
<string name="nsalarm_staledatavalue_label">누락 데이터 기준값 [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">위험 누락 데이터 기준값 [min]</string>
<string name="openapsama_autosens_period">autosens 시간 [h]</string>

View file

@ -450,12 +450,6 @@
<string name="doprofileswitch">Profilio keitimas</string>
<string name="careportal_pbage_label">Baterija</string>
<string name="ns_alarmoptions">Aliarmų nustatymai</string>
<string name="nsalarm_urgenthigh">Kritiškai aukštas</string>
<string name="nsalarm_high">Aukštas</string>
<string name="nsalarm_low">Žemas</string>
<string name="nsalarm_urgentlow">Kritiškai žemas</string>
<string name="nsalarm_staledata">Seni duomenys</string>
<string name="nsalarm_urgentstaledata">Kritiškai seni duomenys</string>
<string name="nsalarm_staledatavalue_label">Seni duomenys, riba [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Kritiškai seni duomenys, riba [min]</string>
<string name="openapsama_autosens_period">Autosens intervalas [h]</string>

View file

@ -408,12 +408,6 @@
<string name="doprofileswitch">Profiel wissel uitvoeren</string>
<string name="careportal_pbage_label">Ouderdom batterij</string>
<string name="ns_alarmoptions">Alarm opties</string>
<string name="nsalarm_urgenthigh">Zeer hoog</string>
<string name="nsalarm_high">Hoog</string>
<string name="nsalarm_low">Laag</string>
<string name="nsalarm_urgentlow">Zeer laag</string>
<string name="nsalarm_staledata">Oude gegevens</string>
<string name="nsalarm_urgentstaledata">Dringend oude gegevens vernieuwen</string>
<string name="nsalarm_staledatavalue_label">Oude gegevens sinds [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Alarm oude gegevens sinds [min]</string>
<string name="openapsama_autosens_period">Interval voor autosens [uur]</string>
@ -895,6 +889,7 @@
<string name="recurringTime">Herhaal tijd</string>
<string name="every">Elke</string>
<string name="never">Nooit</string>
<string name="mins">%1$dmin</string>
<string name="condition">Voorwaarde:</string>
<string name="action">Actie:</string>
<string name="iob_u">IOB [E]:</string>

View file

@ -459,12 +459,6 @@
<string name="doprofileswitch">Zmień profil</string>
<string name="careportal_pbage_label">Czas baterii pompy</string>
<string name="ns_alarmoptions">Opcje alarmu</string>
<string name="nsalarm_urgenthigh">Uwaga wysoki</string>
<string name="nsalarm_high">Wysoki</string>
<string name="nsalarm_low">Niski</string>
<string name="nsalarm_urgentlow">Uwaga niski</string>
<string name="nsalarm_staledata">Nieaktualne dane</string>
<string name="nsalarm_urgentstaledata">Uwaga, nieaktualne dane</string>
<string name="nsalarm_staledatavalue_label">Próg nieaktualne dane [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Próg uwaga nieaktualne dane [min]</string>
<string name="openapsama_autosens_period">Przedział czasowy dla autosens [h]</string>

View file

@ -171,8 +171,8 @@
<string name="openapsma_maxbasal_summary">Este valor é chamado max basal no contexto do OpenAPS</string>
<string name="openapsma_maxiob_title">Basal Máxima IOB que OpenAPS pode dar [U]</string>
<string name="openapsma_maxiob_summary">Este valor é denominado Max IOB em contexto OpenAPS \nEste é o valor máximo de insulina em [U] que APS pode dar de uma vez.</string>
<string name="password_preferences_encrypt_prompt">Será perguntado pela password mestre, que será usada para encriptar preferências exportadas.</string>
<string name="password_preferences_decrypt_prompt">Será perguntado pela password mestre, que será necessária para desencriptar preferências importadas.</string>
<string name="password_preferences_encrypt_prompt">Será perguntado pela senha mestre, que será usada para encriptar preferências exportadas.</string>
<string name="password_preferences_decrypt_prompt">Será perguntado pela senha mestre, que será necessária para desencriptar preferências importadas.</string>
<string name="preferences_export_canceled">Exportação cancelada! Preferências NÃO foram exportadas!</string>
<string name="preferences_import_canceled">Importação cancelada! Preferências NÃO foram importadas!</string>
<string name="preferences_import_list_title">Seleccione o ficheiro para importação</string>
@ -205,11 +205,11 @@
<string name="prefdecrypt_settings_secure">Ficheiro de configurações é seguro</string>
<string name="prefdecrypt_settings_unencrypted">A usar um formato de configurações não seguro e não encriptado</string>
<string name="prefdecrypt_wrong_json">Erro de formato JSON, campo necessário ausente (formato, conteúdo, metadados ou segurança)</string>
<string name="prefdecrypt_wrong_password">Erro ao desencriptar, a password inserida não pode desencriptar o ficheiro</string>
<string name="prefdecrypt_wrong_password">Erro ao desencriptar, a senha inserida não pode desencriptar o ficheiro</string>
<string name="prefdecrypt_issue_missing_file_hash">Ficheiro de verificação (hash) em falta, não é possível verificar a autenticidade de configurações!</string>
<string name="prefdecrypt_issue_modified">Ficheiro foi modificado após exportação!</string>
<string name="prefdecrypt_issue_parsing">Erro Desencriptação, a análise de preferências falhou!</string>
<string name="prefdecrypt_issue_wrong_pass">Erro de Desencriptação, a password é inválida ou configurações de arquivo foram modificadas! Pode acontecer que o ficheiro importado foi exportado com uma Password Mestre diferente.</string>
<string name="prefdecrypt_issue_wrong_pass">Erro de Desencriptação, a senha é inválida ou configurações de arquivo foram modificadas! Pode acontecer que o ficheiro importado foi exportado com uma Senha Mestre diferente.</string>
<string name="prefdecrypt_issue_wrong_format">Configuração de encriptação ausente, formato de configurações é inválido!</string>
<string name="prefdecrypt_issue_wrong_algorithm">Algoritmo de encriptação não suportado ou não especificado!</string>
<string name="exported_today">exportado hoje</string>
@ -226,7 +226,7 @@
<string name="smscommunicator_allowednumbers">Números de telefone permitidos</string>
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
<string name="smscommunicator_bolusreplywithcode">Para dar bolus %1$.2fU responder com código %2$s</string>
<string name="smscommunicator_mealbolusreplywithcode">Para dar bólus %1$.2fU responder com código %2$s</string>
<string name="smscommunicator_mealbolusreplywithcode">Para administrar bólus %1$.2fU responder com código %2$s</string>
<string name="smscommunicator_temptargetwithcode">Para definir o Alvo Tempo %1$s responda com o código %2$s</string>
<string name="smscommunicator_temptargetcancel">Para cancelar Alvo Temp responda com o código %1$s</string>
<string name="smscommunicator_stopsmswithcode">Para desactivar o Serviço Remoto SMS de responda com o código %1$s.\n\nTenha em mente que será capaz de o reactivar directamente apenas a partir do telemóvel mestre do AAPS.</string>
@ -239,7 +239,7 @@
<string name="bolusdelivered">Bolus %1$.2fU entregue com sucesso</string>
<string name="bolusrequested">Vão ser administradas %1$.2fU</string>
<string name="smscommunicator_bolusdelivered">Bólus %1$.2fU enviado com êxito</string>
<string name="smscommunicator_mealbolusdelivered">Bólus de refeição %1$.2fU entregue com sucesso</string>
<string name="smscommunicator_mealbolusdelivered">Bólus de refeição %1$.2fU administrado com sucesso</string>
<string name="smscommunicator_mealbolusdelivered_tt">Alvo %1$s para %2$d minutos</string>
<string name="smscommunicator_tt_set">Alvo %1$s para %2$d minutos definido com sucesso</string>
<string name="smscommunicator_tt_canceled">Alvo Temp cancelado com êxito</string>
@ -468,12 +468,6 @@
<string name="doprofileswitch">Fazer Mudança De Perfil</string>
<string name="careportal_pbage_label">Idade bateria bomba</string>
<string name="ns_alarmoptions">Opções Alarme</string>
<string name="nsalarm_urgenthigh">Urgência hiperglicemia</string>
<string name="nsalarm_high">Alta</string>
<string name="nsalarm_low">Baixa</string>
<string name="nsalarm_urgentlow">Urgência hipoglicemia</string>
<string name="nsalarm_staledata">Dados Obsoletos</string>
<string name="nsalarm_urgentstaledata">Dados obsoletos urgentes</string>
<string name="nsalarm_staledatavalue_label">Tempo limite para dados obsoletos [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Tempo limite para Urgência por dados obsoletos [min]</string>
<string name="openapsama_autosens_period">Intervalo para autosens [h]</string>
@ -1247,9 +1241,9 @@
<!-- SMS Communicator & OTP Authenticator -->
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">a partir da app Autenticador para: %1$s</string>
<string name="smscommunicator_otp_enabled">Activar Autenticador</string>
<string name="smscommunicator_otp_enabled_summary">Autenticar comandos usando Uma-Password-Única que sejam geradas pelo Google Authenticator ou app 2FA similar.</string>
<string name="smscommunicator_otp_enabled_summary">Autenticar comandos usando Uma-Senha-Única que sejam geradas pelo Google Authenticator ou app 2FA similar.</string>
<string name="smscommunicator_otp_pin">PIN adicional no token final</string>
<string name="smscommunicator_otp_pin_summary">Dígitos adicionais que devem ser memorizados e colados no final de cada Uma-Password-Única que seja gerada</string>
<string name="smscommunicator_otp_pin_summary">Dígitos adicionais que devem ser memorizados e colados no final de cada Uma-Senha-Única que seja gerada</string>
<string name="smscomunicator_tab_otp_label">Configuração do Autenticador</string>
<string name="smscommunicator_otp_verify_label">OTP para verificar:</string>
<string name="smscommunicator_otp_reset_btn">Repor Autenticadores</string>
@ -1258,7 +1252,7 @@
<string name="smscommunicator_otp_reset_successful">Nova Chave do Autenticador foi gerada! Por favor, use o QRCode actualizado para os autenticadores.</string>
<string name="smscommunicator_otp_step1_install_header">1. Instalar Autenticador</string>
<string name="smscommunicator_otp_step2_provisioning_header">2. Pesquise o código para configurar os códigos OTP do AndroidAPS</string>
<string name="smscommunicator_otp_step3_test_header">3. Teste Uma-Password-Única</string>
<string name="smscommunicator_otp_step3_test_header">3. Testar Uma-Senha-Única</string>
<string name="smscommunicator_otp_reset_header">Repor Autenticadores</string>
<string name="smscommunicator_otp_install_info">Instalar uma app Autenticador que suporte Tokens RFC 6238 TOTP em cada telefone seguidor. Populares aplicativos gratuitos são:\n • Authy\n • o Google Authenticator\n • LastPass Autenticador\n • FreeOTP Autenticador</string>
<string name="smscommunicator_otp_provisioning_warning">NÃO PARTILHE este código online!\nUse-o apenas para a instalação da app Autenticador nos telefones seguidores.</string>
@ -1269,9 +1263,9 @@
<string name="overview_show_deviationslope">Desvio de inclinação</string>
<string name="authorizationfailed">Falha na autorização</string>
<string name="overview_show_absinsulin">Insulina absoluta</string>
<string name="master_password_summary">Password Mestre é usada para encriptação da cópia de segurança e substituir segurança na aplicação. Lembre-se dela ou guarde-a em um lugar seguro.</string>
<string name="passwords_dont_match">As passwords não coincidem</string>
<string name="current_master_password">Password Mestre actual</string>
<string name="master_password_summary">Senha Mestre é usada para encriptação da cópia de segurança e substituir segurança na aplicação. Lembre-se dela ou guarde-a em um lugar seguro.</string>
<string name="passwords_dont_match">As senhas não coincidem</string>
<string name="current_master_password">Senha Mestre actual</string>
<string name="statuslights">Luzes de Estado</string>
<string name="statuslights_copy_ns">Copiar definições do NS</string>
<string name="copyexistingvalues">Copiar definições do NS (se existir)?</string>
@ -1280,11 +1274,13 @@
<string name="skin">Tema gráfico</string>
<!-- Omnipod -->
<!-- Omnipod - Base -->
<string name="description_pump_omnipod">Integração de bomba para Omnipod, requer RileyLink (com pelo menos firmware 2.0) dispositivo.</string>
<!-- Omnipod Configuration -->
<string name="omnipod_config_beep_bolus_enabled">Beep Bólus Activado</string>
<string name="omnipod_config_beep_basal_enabled">Beep Basal Activado</string>
<string name="omnipod_config_beep_smb_enabled">Beep SMB Activado</string>
<string name="omnipod_config_beep_tbr_enabled">Beep DBT Activado</string>
<string name="omnipod_config_beep_bolus_enabled">Sinal Bólus Activado</string>
<string name="omnipod_config_beep_basal_enabled">Sinal Basal Activado</string>
<string name="omnipod_config_beep_smb_enabled">Sinal SMB Activado</string>
<string name="omnipod_config_beep_tbr_enabled">Sinal DBT Activado</string>
<string name="omnipod_config_pod_debugging_options_enabled">Opções de Depuração do Pod habilitadas</string>
<string name="omnipod_config_timechange_enabled">Detecção de DST/Fuso Horário Activado</string>
<!-- Omnipod - Fragment -->
<string name="omnipod_pod_mgmt">Gestão Pod</string>
@ -1301,8 +1297,27 @@
<!-- Omnipod - Dialogs -->
<string name="omnipod_frequency">Omnipod (433.91 MHz)</string>
<!-- Omnipod - Error -->
<string name="omnipod_error_operation_not_possible_no_configuration">A operação não é possível.\n\nPrecisa configurar o Omnipod primeiro, antes de pode usar esta operação.</string>
<string name="omnipod_error_operation_not_possible_no_profile">A operação não é possível.\n\n Precisa de esperar alguns minutos, até que AAPS tente definir o perfil para a primeira vez.</string>
<string name="omnipod_error_illegal_init_action_type">PodInitActionType Ilegal: %1$s</string>
<string name="omnipod_error_pod_not_attached">Nenhum Pod Activo.</string>
<string name="omnipod_driver_error_setup_action_verification_failed">A verificação do comando falhou.</string>
<string name="omnipod_driver_error_unexpected_exception_type">Ocorreu um erro inesperado. Por favor reporte! (digite: %1$s).</string>
<string name="omnipod_driver_error_invalid_parameters">Falha na comunicação: foram recebidos parâmetros de entrada inválidos.</string>
<string name="omnipod_driver_error_communication_failed_timeout">Falha na comunicação: tempo limite.</string>
<string name="omnipod_driver_error_communication_failed_unexpected_exception">Falha na comunicação: ocorreu um erro inesperado. Por favor, reporte!</string>
<string name="omnipod_driver_error_crc_mismatch">Falha na comunicação: mensagem de falha de verificação de integridade.</string>
<string name="omnipod_driver_error_invalid_packet_type">Falha na comunicação: recebeu um pacote inválido do Pod.</string>
<string name="omnipod_driver_error_invalid_progress_state">Falha na comunicação: o Pod está em um estado errado.</string>
<string name="omnipod_driver_error_invalid_response">Falha na comunicação: recebeu uma resposta inválida do Pod.</string>
<string name="omnipod_driver_error_invalid_message_sequence_number">Falha na comunicação: recebeu uma mensagem com número de sequência inválido do Pod.</string>
<string name="omnipod_driver_error_invalid_message_address">Falha na comunicação: recebeu uma mensagem com um endereço inválido do Pod.</string>
<string name="omnipod_driver_error_message_decoding_failed">Falha na comunicação: falha ao descodificar a mensagem do Pod.</string>
<string name="omnipod_driver_error_nonce_resync_failed">Falha na comunicação: nonce resync falhou.</string>
<string name="omnipod_driver_error_nonce_out_of_sync">Falha na comunicação: nonce fora de sincronização.</string>
<string name="omnipod_driver_error_not_enough_data">Falha na comunicação: não há dados suficientes recebidos do Pod.</string>
<string name="omnipod_driver_error_pod_fault">Uma falha de Pod (%1$03d %2$s) foi detectada. Por favor, desactive o Pod e inicie um novo.</string>
<string name="omnipod_driver_error_pod_returned_error_response">Falha na comunicação: o Pod devolveu uma resposta de erro.</string>
<!-- Omnipod - Pod Mgmt -->
<string name="omnipod_pod_mgmt_title">Gestão Pod</string>
<string name="omnipod_cmd_init_pod">Iniciar Pod</string>
@ -1326,19 +1341,29 @@
<string name="omnipod_cmd_bolus_value">%1$.1f U</string>
<string name="omnipod_cmd_bolus_value_with_carbs">%1$.1f U, HC=%2$.1f g</string>
<string name="omnipod_cmd_tbr_value">Taxa: %1$.1f U, Duração: %2$d min</string>
<string name="omnipod_cmd_reset_pod_desc">Se pressionar <b>OK</b>, o estado do Pod vai ser forçado a redefinir e você não será capaz de comunicar mais com o Pod. Faça isso somente se você não pode comunicar mais com o Pod. Se ainda pode comunicar com o Pod, por favor, use o <b>Desactivar Pod</b> opção.</string>
<string name="omnipod_cmd_pod_history_na">Histórico do Pod não disponível no momento.</string>
<string name="omnipod_init_pod_wizard_step1_title">Encher o Pod</string>
<string name="omnipod_init_pod_wizard_step1_desc">\nPreencher o novo Pod com insulina suficiente para 3 dias.\n\nOuvir dois sinais sonoros a partir do Pod durante o processo de enchimento. Isso indica que a quantidade mínima de 85U foi inserida. Certifique-se de esvaziar completamente a seringa, mesmo depois de ouvir dois sinais sonoros.\n\nDepois de preencher o Pod, por favor, pressione <b>Próximo</b>.\n\n<b>Nota:</b> não remova a tampa da agulha do Pod neste momento.</string>
<string name="omnipod_init_pod_wizard_step2_title">A Purgar</string>
<string name="omnipod_init_pod_wizard_step2_action_header">A tentar emparelhar com o novo Pod e purgá-lo.\n\nQuando todos os itens forem verificados, pode pressionar <b>Próximo</b>.\n\n<b>Nota:</b> por favor, mantenha o Pod muito perto do RileyLink neste momento.</string>
<string name="omnipod_init_pod_wizard_step3_title">Anexar o Pod</string>
<string name="omnipod_init_pod_wizard_step3_desc">\nPrepare o local de infusão. Remova a tampa da agulha do Pod e o adesivo e fixe o Pod no local de infusão.\n\nSe a canula sair, por favor, pressione <b>Cancelar</b> e descarte o seu Pod.\n\nPressione <b>Próximo</b> para inserir a canula e começar a administração da basal.</string>
<string name="omnipod_init_pod_wizard_step4_title">A inserir canula</string>
<string name="omnipod_init_pod_wizard_step4_action_header">A tentar definir um plano da basal inicial e inserir canula.\n\nQuando todos os itens estiverem verificados, pode pressionar <b>Próximo</b>.</string>
<string name="omnipod_init_pod_wizard_pod_info_title">Info Pod</string>
<string name="omnipod_init_pod_wizard_pod_info_init_pod_description">\nO Pod está agora activo.\n\nO seu plano de basal foi programado e a canula foi inserida.\n\nPor favor, verifique se a canula foi inserida correctamente e substitua o seu Pod se você se sente que não.</string>
<string name="omnipod_remove_pod_wizard_step1_title">Desactivar Pod</string>
<string name="omnipod_remove_pod_wizard_step1_desc">\nPressione <b>Próximo</b> para desactivar o Pod.\n\n<b>Nota:</b> Isto irá suspender toda a administração de insulina e desactivar o Pod.</string>
<string name="omnipod_remove_pod_wizard_step2_title">A Desactivar Pod</string>
<string name="omnipod_remove_pod_wizard_step2_action_header">A desactivar o Pod.\n\nQuando todos os itens forem verificados, pode pressionar <b>Próximo</b>.\n\n<b>Nota:</b> Se desactivar falhar continuamente, por favor, pressione <b>Cancelar</b> e use o <b>Repor Pod</b> opção para forçar a repor o estado do Pod.</string>
<string name="omnipod_init_pod_wizard_pod_info_remove_pod_description">Pod desactivado.\n\nPor favor, remova o Pod do seu corpo e descarte-o.</string>
<string name="omnipod_init_pod_pair_pod">Emparelhar Pod</string>
<string name="omnipod_init_pod_prime_pod">Purgar Pod</string>
<string name="omnipod_init_pod_fill_cannula">Enchimento de Canula</string>
<string name="omnipod_init_pod_set_basal_profile">Definir Perfil Basal</string>
<string name="omnipod_deactivate_pod_cancel_delivery">Cancelar Administração</string>
<string name="omnipod_deactivate_pod_deactivate_pod">Desacitvar Pod</string>
<string name="omnipod_deactivate_pod_deactivate_pod">Desactivar Pod</string>
<!-- Omnipod Dash -->
<!-- Omnipod - Base -->
<string name="description_pump_omnipod_dash">Integração da Bomba para Omnipod Dash.</string>
@ -1349,6 +1374,10 @@
<string name="omnipod_alert_shutdown_imminent">Encerramento iminente</string>
<string name="omnipod_alert_low_reservoir">Reservatório baixo</string>
<string name="omnipod_alert_unknown_alert">Alerta desconhecido</string>
<string name="omnipod_error_set_basal_failed_uncertain">Pode ter falhado ao definir perfil da basal. A administração pode estar suspensa! Por favor, actualize o estado do Pod.</string>
<string name="omnipod_error_set_temp_basal_failed_uncertain">Pode ter falhado ao definir basal temporária. Se houve uma basal temporária já em execução, pode ter sido cancelada! Por favor, actualize o estado do Pod.</string>
<string name="omnipod_error_set_time_failed_uncertain">Pode ter falhado ao definir a hora. A administração pode estar suspensa! Por favor, actualize o estado do Pod.</string>
<string name="omnipod_bolus_failed_uncertain">Não é possível verificar se o bólus foi bem-sucedido. Por favor, verifique se o Pod está administrar ou cancelar o bólus.</string>
<string name="omnipod_rl_stats">Estatísticas RL</string>
<string name="omnipod_read_pulse_log_short">Registo de Pulse</string>
</resources>

View file

@ -115,7 +115,7 @@
<string name="extendedcarbs_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Extended-Carbs.html</string>
<string name="nsclient_label">Tópico: Monitorização Remota</string>
<string name="nsclient_howcanyou">Como pode monitorizar AAPS do seu filho remotamente?</string>
<string name="nsclient_nightscout">A usar um site Nightscout.</string>
<string name="nsclient_nightscout">Usando um site Nightscout.</string>
<string name="nsclient_dexcomfollow">App Dex om Follow se estiver a usar a app original Dexcom (Glic apenas).</string>
<string name="nsclient_dexcomfollowxdrip">Dexcom Follow se estiver a usar a app xDrip.</string>
<string name="nsclient_xdripfollower">xDrip a correr no modo seguidor.</string>

View file

@ -143,7 +143,7 @@
<string name="careportal_newnstreatment_other">Outro</string>
<string name="careportal_newnstreatment_meter">Medidor</string>
<string name="careportal_newnstreatment_sensor">Sensor</string>
<string name="careportal_newnstreatment_carbs_label">Hidratos de Carbono</string>
<string name="careportal_newnstreatment_carbs_label">Hidratos</string>
<string name="careportal_newnstreatment_insulin_label">Insulina</string>
<string name="careportal_newnstreatment_carbtime_label">Tempo Hidratos</string>
<string name="careportal_newnstreatment_split_label">Dividir</string>
@ -370,12 +370,12 @@
<string name="executing">A Executar</string>
<string name="virtualpump_settings">Definições da bomba virtual</string>
<string name="virtualpump_uploadstatus_title">Enviar estado para NS</string>
<string name="nsclientinternal">NSCliente</string>
<string name="nsclientinternal_shortname">NSCI</string>
<string name="nsclientinternal">ClienteNS</string>
<string name="nsclientinternal_shortname">CLNS</string>
<string name="nsclientinternal_url">URL:</string>
<string name="nsclientinternal_autoscroll">Rolar automático</string>
<string name="restart">Reiniciar</string>
<string name="nsclientinternal_title">NSCliente</string>
<string name="nsclientinternal_title">ClienteNS</string>
<string name="nsclientinternal_url_title">Nightscout URL</string>
<string name="nsclientinternal_url_dialogmessage">Introduza o Nightscout URL</string>
<string name="nsclientinternal_secret_title">NS API secret</string>
@ -388,7 +388,7 @@
<string name="status">Estado:</string>
<string name="paused">Em pausa</string>
<string name="clearlog">Limpar Registo</string>
<string name="nowritepermission">NSCliente sem permissões para alterar dados. Tem a senha API correta?</string>
<string name="nowritepermission">ClienteNS sem permissões para alterar dados. Tem a senha API correta?</string>
<string name="wear_settings">Definições Wear</string>
<string name="wear_detailedIOB_title">Mostrar IOB detalhada</string>
<string name="wear_detailedIOB_summary">Dividir IOB entre IOB de bolus e de basal na face do relógio</string>
@ -468,12 +468,6 @@
<string name="doprofileswitch">Fazer Mudança De Perfil</string>
<string name="careportal_pbage_label">Idade bateria bomba</string>
<string name="ns_alarmoptions">Opções Alarme</string>
<string name="nsalarm_urgenthigh">Urgência hiperglicemia</string>
<string name="nsalarm_high">Alto</string>
<string name="nsalarm_low">Baixo</string>
<string name="nsalarm_urgentlow">Urgência hipoglicemia</string>
<string name="nsalarm_staledata">Dados Obsoletos</string>
<string name="nsalarm_urgentstaledata">Dados obsoletos urgentes</string>
<string name="nsalarm_staledatavalue_label">Tempo limite para dados obsoletos [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Tempo limite para Urgência por dados obsoletos [min]</string>
<string name="openapsama_autosens_period">Intervalo para autosens [h]</string>
@ -506,7 +500,7 @@
<string name="mdtp_cancel">Cancelar</string>
<string name="notloadedplugins">Nem todos perfis foram carregados!</string>
<string name="valuesnotstored">Valores não guardados!</string>
<string name="ns_localbroadcasts">Activar transmissões para outras aplicações (como xDrip). Não habilite se tiver mais de uma instância de AAPS ou NSClient instalado!</string>
<string name="ns_localbroadcasts">Activar transmissões para outras aplicações (como xDrip). Não habilite se tiver mais de uma instância de AAPS ou ClienteNS instalado!</string>
<string name="ns_localbroadcasts_title">Activar partilha local.</string>
<string name="careportal_activity_label">ACTIVIDADE &amp; FEEDBACK</string>
<string name="careportal_carbsandbolus_label">HIDRATOS &amp; BÓLUS</string>
@ -570,7 +564,7 @@
<string name="carbsReqThreshold_summary">Quando Hidratos são sugeridos, quantos hidratos irá solicitar uma notificação</string>
<string name="dexcomg5_xdripupload_title">Enviar dados Glic. para xDrip+</string>
<string name="dexcomg5_xdripupload_summary">Seleccionar 640g/Eversense como fonte no xDrip+</string>
<string name="nsclientbg">Glic NSCliente</string>
<string name="nsclientbg">Glic ClienteNS</string>
<string name="overview_editquickwizard_usebg">Cálculos Glic</string>
<string name="overview_editquickwizard_usebolusiob">Cálculo de Bólus IOB</string>
<string name="overview_editquickwizard_usebasaliob">Cálculo de Basal IOB</string>
@ -584,7 +578,7 @@
<string name="overview_editquickwizard_usetemptarget">Cálculo alvo temporário</string>
<string name="loopenabled">Loop activado</string>
<string name="apsselected">APS seleccionado</string>
<string name="nsclienthaswritepermission">NSCLiente tem permissão de escrita</string>
<string name="nsclienthaswritepermission">ClienteNS tem permissão de escrita</string>
<string name="closedmodeenabled">Modo fechado ativado</string>
<string name="maxiobset">IOB máxima definida correctamente</string>
<string name="hasbgdata">Glicemia disponivel desde a fonte selecionada</string>
@ -759,7 +753,7 @@
<string name="wear_wizard_settings_summary">Resultado cálculos incluídos no Assistente:</string>
<string name="wear_display_settings">Configurações Ecrã</string>
<string name="wear_general_settings">Configurações Gerais</string>
<string name="enable_nsclient">Activar NSCliente</string>
<string name="enable_nsclient">Activar ClienteNS</string>
<string name="welcometosetupwizard">Bem-vindo ao assistente de configuração. Vai guiá-lo(a) através do processo de instalação\n</string>
<string name="pumpsetup">Configurações da bomba</string>
<string name="readstatus">Ler estado</string>
@ -770,7 +764,7 @@
<string name="sensitivitysetup">Configurar plugin Sensibilidade</string>
<string name="setupwizard_sensitivity_description">Plugin de Sensibilidade é usado para detecção de sensibilidade e cálculos COB. Para mais info visite:</string>
<string name="setupwizard_sensitivity_url">https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB</string>
<string name="nsclientinfotext">NSCliente gere a ligação ao Nightscout. Pode saltar esta parte mas não será possível passar os objectivos até que o configure.</string>
<string name="nsclientinfotext">ClienteNS gere a ligação ao Nightscout. Pode saltar esta parte mas não será possível passar os objectivos até que o configure.</string>
<string name="diawarning">Lembre-se: novos perfis de insulina requerem diâmetro de pelo menos 5h. DIA 56h no novo perfil é igual ao diâmetro 3h nos antigos perfis de insulina.</string>
<string name="bgsourcesetup">Configure a fonte das glicemias</string>
<string name="setupwizard_profile_description">Por favor seleccione a fonte do perfil. Se o paciente é uma criança deverá utilizar perfil NS. Se ninguém o está a seguir no Nightscout provavelmente preferirá um perfil Local. Lembre-se que apenas está a escolher a fonte de perfil. Para o utilizar terá que o activar executando \"Troca Perfil\"</string>
@ -821,7 +815,7 @@
<string name="openaps_noasdata">Sem dados Autosens disponíveis</string>
<string name="nav_logsettings">Definições de registo</string>
<string name="resettodefaults">Repor definições por defeito</string>
<string name="nsmalfunction">Erro de funcionamento do NSCliente. Pondere reiniciar o NS e NSCliente.</string>
<string name="nsmalfunction">Erro de funcionamento do ClienteNS. Pondere reiniciar o NS e ClienteNS.</string>
<string name="as">AS</string>
<string name="versionavailable">Disponível %1$s disponível</string>
<string name="time_offset">Fuso horário</string>

View file

@ -383,12 +383,6 @@
<string name="careportal_insulinage_label">Vechime insulină</string>
<string name="careportal_pbage_label">Vechime baterie pompă</string>
<string name="ns_alarmoptions">Opțiuni alarmare</string>
<string name="nsalarm_urgenthigh">Hiper urgent</string>
<string name="nsalarm_high">Hiper</string>
<string name="nsalarm_low">Hipo</string>
<string name="nsalarm_urgentlow">Hipo urgent</string>
<string name="nsalarm_staledata">Date învechite</string>
<string name="nsalarm_urgentstaledata">Date mult prea vechi</string>
<string name="nsalarm_staledatavalue_label">Prag vechime date [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Prag date mult prea vechi [min]</string>
<string name="openapsama_autosens_period">Interval pentru autosens [o]</string>

View file

@ -468,12 +468,6 @@
<string name="doprofileswitch">Переключить профиль</string>
<string name="careportal_pbage_label">Батарея помпы работает</string>
<string name="ns_alarmoptions">опции оповещения</string>
<string name="nsalarm_urgenthigh">Тревога выс</string>
<string name="nsalarm_high">Высокий</string>
<string name="nsalarm_low">Низкий</string>
<string name="nsalarm_urgentlow">Тревога низкий</string>
<string name="nsalarm_staledata">Устаревшие данные</string>
<string name="nsalarm_urgentstaledata">Тревога! устаревшие данные</string>
<string name="nsalarm_staledatavalue_label">Порог оповещения об устаревших данных [min] (мин)</string>
<string name="nsalarm_urgent_staledatavalue_label">Порог тревоги об устаревших данных [min] (мин)</string>
<string name="openapsama_autosens_period">Интервал для autosens [h] (ч)</string>
@ -853,6 +847,10 @@ Context | Edit Context</string>
<string name="log_alerts">Журнал оповещений</string>
<string name="enable_tbr_emulation">Включить эмуляцию TBR</string>
<string name="enable_tbr_emulation_summary">Использовать пролонгированные болюсы вместо временных базалов TBR чтобы обойти лимит в 250%%</string>
<string name="disable_vibration">Отключение вибраций при ручном болюсе</string>
<string name="disable_vibration_summary">Для болюса и пролонгированного болюса (доступно только для Insight прошивки 3.х)</string>
<string name="disable_vibration_auto">Отключение вибрации при ручном болюсе</string>
<string name="disable_vibration_auto_summary">Для микроболюсов SMB и временных базалов с эмуляцией TBR (доступно только для Insight с прошивкой версии 3.x)</string>
<string name="disconnect_delay">Задержка разъединения [s]</string>
<string name="serial_number">Серийный номер</string>
<string name="release_software_version">Версия ПО</string>

View file

@ -468,12 +468,6 @@
<string name="doprofileswitch">Vykonajte zmenu profilu</string>
<string name="careportal_pbage_label">Vek batérie v pumpe</string>
<string name="ns_alarmoptions">Nastavenie alarmov</string>
<string name="nsalarm_urgenthigh">Veľmi vysoká</string>
<string name="nsalarm_high">Vysoká</string>
<string name="nsalarm_low">Nízka</string>
<string name="nsalarm_urgentlow">Veľmi nízka</string>
<string name="nsalarm_staledata">Zastaralé dáta</string>
<string name="nsalarm_urgentstaledata">Veľmi zastaralé dáta</string>
<string name="nsalarm_staledatavalue_label">Hraničná hodnota pre zastaralé dáta [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Vysoká hraničná hodnota pre zastaralé dáta [min]</string>
<string name="openapsama_autosens_period">Interval pre automatickú detekciu citlivosti [h]</string>

View file

@ -130,7 +130,7 @@
<string name="isf_profile">Om du ändrar ISF-värdet i din profil är det tillräckligt för att tillämpa ändringen.</string>
<string name="isf_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u</string>
<string name="isf_hint2">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html</string>
<string name="ic_label">Ämne: IC-kvoten</string>
<string name="ic_label">Ämne: KH-kvot</string>
<string name="ic_increasingvalue">Högre IC-kvot leder till mindre insulin som levereras för en given mängd kolhydrater.</string>
<string name="ic_decreasingvalue">Lägre IC-kvot leder till mindre insulin som levereras för en given mängd kolhydrater.</string>
<string name="ic_noeffect">Om du har 0 COB, kommer en förändring av IC-kvoten leda till en annan mängd insulin för att korrigera din BG-nivå.</string>

View file

@ -132,12 +132,12 @@ Eversense-appen.</string>
<string name="closedloop">Closed Loop</string>
<string name="openloop">Open Loop</string>
<string name="lowglucosesuspend">Stopp innan lågt</string>
<string name="disabledloop">Loop avstängd</string>
<string name="disabledloop">Loop inaktiverad</string>
<string name="disableloop">Inaktivera loop</string>
<string name="enableloop">Aktivera loop</string>
<string name="openloop_newsuggestion">Ny rekommendation tillgänglig</string>
<string name="unsupportednsversion">Versionen av Nightscout stöds inte</string>
<string name="loopdisabled">LOOP STOPPAD PGA BEGRÄNSNINGAR</string>
<string name="loopdisabled">LOOP INAKTIVERAD PGA BEGRÄNSNINGAR</string>
<string name="treatments_wizard_basaliob_label">IOB från basal</string>
<string name="bolusconstraintapplied">Bolusspärr aktiverad</string>
<string name="carbsconstraintapplied">Kolhydratsspärr aktiverad</string>
@ -251,9 +251,9 @@ Eversense-appen.</string>
<string name="uploading">Laddar upp</string>
<string name="bolusstopped">Bolus avbruten</string>
<string name="bolusstopping">Avbryter bolus</string>
<string name="smscommunicator_loophasbeendisabled">Loop stängdes av. </string>
<string name="smscommunicator_loophasbeenenabled">Loop aktiverades</string>
<string name="smscommunicator_loopisdisabled">Loop är avstängd</string>
<string name="smscommunicator_loophasbeendisabled">Loop inaktiverad.</string>
<string name="smscommunicator_loophasbeenenabled">Loop aktiverad</string>
<string name="smscommunicator_loopisdisabled">Loop är inaktiverad</string>
<string name="smscommunicator_loopisenabled">Loop är aktiverad</string>
<string name="valuelimitedto">%1$.2f begränsat till %2$.2f</string>
<string name="valueoutofrange">Värdet %1$s är utanför hård begränsning</string>
@ -423,7 +423,7 @@ Eversense-appen.</string>
<string name="resume">Återuppta</string>
<string name="reconnect">Återanslut Pump</string>
<string name="smscommunicator_wrongduration">Fel duration</string>
<string name="smscommunicator_loopsuspended">Loop pausad. </string>
<string name="smscommunicator_loopsuspended">Loop pausad</string>
<string name="smscommunicator_loopresumed">Loop återupptagen</string>
<string name="treatments_wizard_bgtrend_label">15 min trend</string>
<string name="treatments_wizard_cob_label">COB</string>
@ -469,12 +469,6 @@ Eversense-appen.</string>
<string name="doprofileswitch">Genomför profilbyte</string>
<string name="careportal_pbage_label">Pumpbatteri ålder</string>
<string name="ns_alarmoptions">Larminställningar</string>
<string name="nsalarm_urgenthigh">Akut hög</string>
<string name="nsalarm_high">Hög</string>
<string name="nsalarm_low">Låg</string>
<string name="nsalarm_urgentlow">Akut låg</string>
<string name="nsalarm_staledata">BG-data saknas</string>
<string name="nsalarm_urgentstaledata">BG-data saknas (akut larm)</string>
<string name="nsalarm_staledatavalue_label">Första varning efter [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Akut varning efter [min]</string>
<string name="openapsama_autosens_period">Intervall för autosens [tim]</string>
@ -675,7 +669,7 @@ Eversense-appen.</string>
<string name="overview_show_basals">Basaler</string>
<string name="no_action_selected">Ingen åtgärd vald. Inget ändras.</string>
<string name="start_hypo_tt">Starta \"Hypo\"</string>
<string name="closed_loop_disabled_on_dev_branch">Du kör nu dev-versionen. Closed Loop inte tillåtet.</string>
<string name="closed_loop_disabled_on_dev_branch">Du kör nu dev-versionen. Closed Loop inaktiverat.</string>
<string name="engineering_mode_enabled">Engineering Mode aktiverat</string>
<string name="not_eng_mode_or_release">Engineering Mode inte aktiverat och appen körs inte som release</string>
<string name="combo_actvity_reading_basal_profile">Läser basalprofil</string>

View file

@ -355,12 +355,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="careportal_insulinage_label">İnsülin yaşı</string>
<string name="careportal_pbage_label">Pompa pil yaşı</string>
<string name="ns_alarmoptions">Alarm türleri</string>
<string name="nsalarm_urgenthigh">ırı yüksek</string>
<string name="nsalarm_high">Yüksek</string>
<string name="nsalarm_low">Düşük</string>
<string name="nsalarm_urgentlow">Çok düşük</string>
<string name="nsalarm_staledata">Eski veriler</string>
<string name="nsalarm_urgentstaledata">Acil durum verileri</string>
<string name="nsalarm_staledatavalue_label">Eski veri eşiği [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Acil durum verileri eşiği [min]</string>
<string name="openapsama_autosens_period">Autosens [h] için aralık</string>

View file

@ -378,12 +378,6 @@
<string name="careportal_insulinage_label">胰岛素使用时间</string>
<string name="careportal_pbage_label">泵电池使用时间</string>
<string name="ns_alarmoptions">报警选项</string>
<string name="nsalarm_urgenthigh">紧急高</string>
<string name="nsalarm_high"></string>
<string name="nsalarm_low"></string>
<string name="nsalarm_urgentlow">紧急低</string>
<string name="nsalarm_staledata">陈旧数据</string>
<string name="nsalarm_urgentstaledata">紧急陈旧数据</string>
<string name="nsalarm_staledatavalue_label">陈旧数据阈值 [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">紧急陈旧数据阈值 [min]</string>
<string name="openapsama_autosens_period">Autosens间隔的 [h]</string>

View file

@ -22,6 +22,7 @@
</string-array>
<string-array name="languagesArray">
<item>@string/default_lang</item>
<item>@string/en_lang</item>
<item>@string/af_lang</item>
<item>@string/bg_lang</item>
@ -45,6 +46,7 @@
<item>@string/zh_lang</item>
</string-array>
<string-array name="languagesValues" translatable="false">
<item>default</item>
<item>en</item>
<item>af</item>
<item>bg</item>

View file

@ -1,4 +1,5 @@
<resources>
<string name="default_lang" translatable="false">System default</string>
<string name="en_lang" translatable="false">English</string>
<string name="cs_lang" translatable="false">Czech</string>
<string name="af_lang" translatable="false">Afrikaans</string>
@ -307,6 +308,9 @@
<string name="smscommunicator_carbsreplywithcode">To enter %1$dg at %2$s reply with code %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">To start basal %1$d%% for %2$d min reply with code %3$s</string>
<string name="smscommunicator_suspendreplywithcode">To suspend loop for %1$d minutes reply with code %2$s</string>
<string name="smscommunicator_loopresumereplywithcode">To resume loop reply with code %1$s</string>
<string name="smscommunicator_loopenablereplywithcode">To enable loop reply with code %1$s</string>
<string name="smscommunicator_loopdisablereplywithcode">To disable loop reply with code %1$s</string>
<string name="smscommunicator_tempbasalset">Temp basal %1$.2fU/h for %2$d min started successfully</string>
<string name="smscommunicator_extendedset">Extended bolus %1$.2fU for %2$d min started successfully</string>
<string name="smscommunicator_carbsset">Carbs %1$dg entered successfully</string>
@ -548,20 +552,12 @@
<string name="doprofileswitch">Do Profile Switch</string>
<string name="careportal_pbage_label">Pump battery age</string>
<string name="ns_alarmoptions">Alarm options</string>
<string name="key_nsalarm_urgent_high" translatable="false">nsalarm_urgent_high</string>
<string name="key_nsalarm_high" translatable="false">nsalarm_high</string>
<string name="key_nsalarm_low" translatable="false">nsalarm_low</string>
<string name="key_nsalarm_urgent_low" translatable="false">nsalarm_urgent_low</string>
<string name="key_nsalarm_staledata" translatable="false">nsalarm_staledata</string>
<string name="key_nsalarm_urgent_staledata" translatable="false">nsalarm_urgent_staledata</string>
<string name="key_ns_announcements" translatable="false">ns_announcements</string>
<string name="key_ns_alarms" translatable="false">ns_alarms</string>
<string name="key_nsalarm_staledatavalue" translatable="false">nsalarm_staledatavalue</string>
<string name="key_nsalarm_urgent_staledatavalue" translatable="false">nsalarm_urgent_staledatavalue</string>
<string name="nsalarm_urgenthigh">Urgent high</string>
<string name="nsalarm_high">High</string>
<string name="nsalarm_low">Low</string>
<string name="nsalarm_urgentlow">Urgent low</string>
<string name="nsalarm_staledata">Stale data</string>
<string name="nsalarm_urgentstaledata">Urgent stale data</string>
<string name="ns_alarms">Create notifications from NS alarms</string>
<string name="ns_announcements">Create notifications from NS announcements</string>
<string name="nsalarm_staledatavalue_label">Stale data threshold [min]</string>
<string name="nsalarm_urgent_staledatavalue_label">Urgent stale data threshold [min]</string>
<string name="openapsama_autosens_period">Interval for autosens [h]</string>
@ -1019,6 +1015,12 @@
<string name="log_alerts">Log alerts</string>
<string name="enable_tbr_emulation">Enable TBR emulation</string>
<string name="enable_tbr_emulation_summary">Use extended boluses instead of TBRs to bypass the 250%% limit</string>
<string name="key_disable_vibration" translatable="false">insight_disable_vibration</string>
<string name="disable_vibration">Disable vibrations on manual bolus delivery</string>
<string name="disable_vibration_summary">For bolus and extended bolus (only available with Insight firmware 3.x)</string>
<string name="key_disable_vibration_auto" translatable="false">insight_disable_vibration_auto</string>
<string name="disable_vibration_auto">Disable vibrations on automated bolus delivery</string>
<string name="disable_vibration_auto_summary">For SMB and Temp Basal with TBR emulation (only available with Insight firmware 3.x)</string>
<string name="disconnect_delay">Disconnect delay [s]</string>
<string name="serial_number">Serial number</string>
<string name="release_software_version">Release software version</string>
@ -1678,7 +1680,7 @@
<string name="description_pump_omnipod_dash">Pump integration for Omnipod Dash.</string>
<string name="omnipod_alert_finish_pairing_reminder">Finish pairing reminder</string>
<string name="omnipod_alert_finish_setup_reminder_reminder">Finish setup reminder</string>
<string name="omnipod_alert_expiration">Pod wil expire soon</string>
<string name="omnipod_alert_expiration">Pod will expire soon</string>
<string name="omnipod_alert_expiration_advisory">Pod will expire soon</string>
<string name="omnipod_alert_shutdown_imminent">Shutdown is imminent</string>
<string name="omnipod_alert_low_reservoir">Low reservoir</string>

View file

@ -14,7 +14,7 @@
android:title="@string/unitsnosemicolon" />
<ListPreference
android:defaultValue="en"
android:defaultValue="default"
android:entries="@array/languagesArray"
android:entryValues="@array/languagesValues"
android:key="@string/key_language"

View file

@ -48,6 +48,18 @@
android:summary="@string/enable_tbr_emulation_summary"
android:title="@string/enable_tbr_emulation" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_disable_vibration"
android:summary="@string/disable_vibration_summary"
android:title="@string/disable_vibration" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_disable_vibration_auto"
android:summary="@string/disable_vibration_auto_summary"
android:title="@string/disable_vibration_auto" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"

View file

@ -48,6 +48,12 @@
android:summary="@string/enable_tbr_emulation_summary"
android:title="@string/enable_tbr_emulation" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_disable_vibration"
android:summary="@string/disable_vibration_summary"
android:title="@string/disable_vibration" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"

View file

@ -42,29 +42,12 @@
android:title="@string/ns_alarmoptions">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_urgent_high"
android:title="@string/nsalarm_urgenthigh" />
android:key="@string/key_ns_alarms"
android:title="@string/ns_alarms" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_high"
android:title="@string/nsalarm_high" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_low"
android:title="@string/nsalarm_low" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_urgent_low"
android:title="@string/nsalarm_urgentlow" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_staledata"
android:title="@string/nsalarm_staledata" />
android:key="@string/key_ns_announcements"
android:title="@string/ns_announcements" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="16"
@ -79,11 +62,6 @@
validate:minNumber="15"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_nsalarm_urgent_staledata"
android:title="@string/nsalarm_urgentstaledata" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="31"
android:digits="0123456789"

View file

@ -20,6 +20,7 @@ class DanaRS_Packet_APS_Set_Event_HistoryTest : DanaRSTestBase() {
it.dateUtil = dateUtil
}
if (it is DanaRS_Packet_APS_Set_Event_History) {
it.danaPump = danaPump
}
}
}

View file

@ -34,7 +34,7 @@ class DanaRS_Packet_Option_Get_Pump_TimeTest : DanaRSTestBase() {
putByteToArray(array, 5, 35) // second 35
packet.handleMessage(array)
Assert.assertEquals(DateTime(2019, 2, 4, 20, 11, 35).millis, danaPump.pumpTime)
Assert.assertEquals(DateTime(2019, 2, 4, 20, 11, 35).millis, danaPump.getPumpTime())
Assert.assertEquals("OPTION__GET_PUMP_TIME", packet.friendlyName)
}
}

View file

@ -1,6 +1,8 @@
package info.nightscout.androidaps.plugins.general.automation.triggers
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.MidnightTime
import info.nightscout.androidaps.utils.T
import org.json.JSONObject
import org.junit.Assert
import org.junit.Before
@ -14,32 +16,23 @@ import org.powermock.modules.junit4.PowerMockRunner
@PrepareForTest(DateUtil::class)
class TriggerRecurringTimeTest : TriggerTestBase() {
var now = 1514766900000L
var now : Long = 0L
@Before fun mock() {
PowerMockito.mockStatic(DateUtil::class.java)
PowerMockito.`when`(DateUtil.now()).thenReturn(now)
// val calendar = GregorianCalendar()
// calendar.timeInMillis = now
// PowerMockito.`when`(DateUtil.gregorianCalendar()).thenReturn(calendar)
now = MidnightTime.calc() + T.mins(95).msecs() // 95 min from midnight
PowerMockito.`when`(dateUtil._now()).thenReturn(now)
}
@Test fun shouldRunTest() {
// limit by validTo
var t: TriggerRecurringTime = TriggerRecurringTime(injector).time(94)
var t: TriggerRecurringTime = TriggerRecurringTime(injector).time(89)
t.days.setAll(true)
Assert.assertFalse(t.shouldRun())
// scheduled 1 min before
// t = new TriggerRecurringTime().hour(1).minute(34);
// t.setAll(true);
// Assert.assertTrue(t.shouldRun());
// already run
t = TriggerRecurringTime(injector).time(94)
t.days.setAll(true)
Assert.assertFalse(t.shouldRun())
Assert.assertTrue(t.shouldRun())
}
private var timeJson = "{\"data\":{\"WEDNESDAY\":false,\"MONDAY\":false,\"THURSDAY\":false,\"SUNDAY\":false,\"TUESDAY\":false,\"FRIDAY\":false,\"SATURDAY\":false,\"time\":4444},\"type\":\"info.nightscout.androidaps.plugins.general.automation.triggers.TriggerRecurringTime\"}"

View file

@ -223,6 +223,9 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
`when`(resourceHelper.gs(R.string.smscommunicator_mealbolusdelivered_tt)).thenReturn("Target %1\$s for %2\$d minutes")
`when`(resourceHelper.gs(R.string.sms_actualbg)).thenReturn("BG:")
`when`(resourceHelper.gs(R.string.sms_lastbg)).thenReturn("Last BG:")
`when`(resourceHelper.gs(R.string.smscommunicator_loopdisablereplywithcode)).thenReturn("To disable loop reply with code %1\$s")
`when`(resourceHelper.gs(R.string.smscommunicator_loopenablereplywithcode)).thenReturn("To enable loop reply with code %1\$s")
`when`(resourceHelper.gs(R.string.smscommunicator_loopresumereplywithcode)).thenReturn("To resume loop reply with code %1\$s")
}
@Test
@ -344,7 +347,11 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
smsCommunicatorPlugin.processSms(sms)
Assert.assertFalse(sms.ignored)
Assert.assertEquals("LOOP DISABLE", smsCommunicatorPlugin.messages[0].text)
Assert.assertEquals("Loop has been disabled Temp basal canceled", smsCommunicatorPlugin.messages[1].text)
Assert.assertTrue(smsCommunicatorPlugin.messages[1].text.contains("To disable loop reply with code "))
var passCode: String = smsCommunicatorPlugin.messageToConfirm?.confirmCode!!
smsCommunicatorPlugin.processSms(Sms("1234", passCode))
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages[2].text)
Assert.assertEquals("Loop has been disabled Temp basal canceled", smsCommunicatorPlugin.messages[3].text)
Assert.assertTrue(hasBeenRun)
//LOOP ENABLE : already enabled
@ -368,7 +375,11 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
smsCommunicatorPlugin.processSms(sms)
Assert.assertFalse(sms.ignored)
Assert.assertEquals("LOOP ENABLE", smsCommunicatorPlugin.messages[0].text)
Assert.assertEquals("Loop has been enabled", smsCommunicatorPlugin.messages[1].text)
Assert.assertTrue(smsCommunicatorPlugin.messages[1].text.contains("To enable loop reply with code "))
passCode = smsCommunicatorPlugin.messageToConfirm?.confirmCode!!
smsCommunicatorPlugin.processSms(Sms("1234", passCode))
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages[2].text)
Assert.assertEquals("Loop has been enabled", smsCommunicatorPlugin.messages[3].text)
Assert.assertTrue(hasBeenRun)
//LOOP RESUME : already enabled
@ -377,7 +388,11 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
smsCommunicatorPlugin.processSms(sms)
Assert.assertFalse(sms.ignored)
Assert.assertEquals("LOOP RESUME", smsCommunicatorPlugin.messages[0].text)
Assert.assertEquals("Loop resumed", smsCommunicatorPlugin.messages[1].text)
Assert.assertTrue(smsCommunicatorPlugin.messages[1].text.contains("To resume loop reply with code "))
passCode = smsCommunicatorPlugin.messageToConfirm?.confirmCode!!
smsCommunicatorPlugin.processSms(Sms("1234", passCode))
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages[2].text)
Assert.assertEquals("Loop resumed", smsCommunicatorPlugin.messages[3].text)
//LOOP SUSPEND 1 2: wrong format
smsCommunicatorPlugin.messages = ArrayList()
@ -402,7 +417,7 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
Assert.assertFalse(sms.ignored)
Assert.assertEquals("LOOP SUSPEND 100", smsCommunicatorPlugin.messages[0].text)
Assert.assertTrue(smsCommunicatorPlugin.messages[1].text.contains("To suspend loop for 100 minutes reply with code "))
var passCode: String = smsCommunicatorPlugin.messageToConfirm?.confirmCode!!
passCode = smsCommunicatorPlugin.messageToConfirm?.confirmCode!!
smsCommunicatorPlugin.processSms(Sms("1234", passCode))
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages[2].text)
Assert.assertEquals("Loop suspended Temp basal canceled", smsCommunicatorPlugin.messages[3].text)

View file

@ -25,6 +25,6 @@ class MsgSettingPumpTimeTest : DanaRTestBase() {
packet.intFromBuff(bytes, 0, 1)
).time
packet.handleMessage(bytes)
Assert.assertEquals(time, danaPump.pumpTime)
Assert.assertEquals(time, danaPump.getPumpTime())
}
}

View file

@ -10,26 +10,26 @@ public class DecimalFormatterTest {
@Test
public void to0DecimalTest() {
Assert.assertEquals("1", DecimalFormatter.to0Decimal(1.33d));
Assert.assertEquals("1U", DecimalFormatter.to0Decimal(1.33d, "U"));
Assert.assertEquals("1", DecimalFormatter.to0Decimal(1.33d).replace(",", "."));
Assert.assertEquals("1U", DecimalFormatter.to0Decimal(1.33d, "U").replace(",", "."));
}
@Test
public void to1DecimalTest() {
Assert.assertEquals("1.3", DecimalFormatter.to1Decimal(1.33d));
Assert.assertEquals("1.3U", DecimalFormatter.to1Decimal(1.33d, "U"));
Assert.assertEquals("1.3", DecimalFormatter.to1Decimal(1.33d).replace(",", "."));
Assert.assertEquals("1.3U", DecimalFormatter.to1Decimal(1.33d, "U").replace(",", "."));
}
@Test
public void to2DecimalTest() {
Assert.assertEquals("1.33", DecimalFormatter.to2Decimal(1.3333d));
Assert.assertEquals("1.33U", DecimalFormatter.to2Decimal(1.3333d, "U"));
Assert.assertEquals("1.33", DecimalFormatter.to2Decimal(1.3333d).replace(",", "."));
Assert.assertEquals("1.33U", DecimalFormatter.to2Decimal(1.3333d, "U").replace(",", "."));
}
@Test
public void to3DecimalTest() {
Assert.assertEquals("1.333", DecimalFormatter.to3Decimal(1.3333d));
Assert.assertEquals("1.333U", DecimalFormatter.to3Decimal(1.3333d, "U"));
Assert.assertEquals("1.333", DecimalFormatter.to3Decimal(1.3333d).replace(",", "."));
Assert.assertEquals("1.333U", DecimalFormatter.to3Decimal(1.3333d, "U").replace(",", "."));
}
@Test

View file

@ -58,3 +58,9 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.activities
import android.content.Context
import dagger.android.support.DaggerAppCompatActivity
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
open class DialogAppCompatActivity : DaggerAppCompatActivity() {
public override fun attachBaseContext(newBase: Context) {

View file

@ -4,7 +4,7 @@ import android.content.Context
import android.os.Bundle
import dagger.android.support.DaggerAppCompatActivity
import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.utils.LocaleHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper
//@Suppress("registered")
open class NoSplashAppCompatActivity : DaggerAppCompatActivity() {

View file

@ -100,6 +100,7 @@ public class Profile {
}
protected void init(JSONObject json, int percentage, int timeshift) {
if (json == null) return;
units = null;
dia = Constants.defaultDIA;
timeZone = TimeZone.getDefault();
@ -404,6 +405,10 @@ public class Profile {
return toMgdl(getIsfTimeFromMidnight(secondsFromMidnight(time)), units);
}
public double getIsfMgdlTimeFromMidnight(int timeAsSeconds) {
return toMgdl(getIsfTimeFromMidnight(timeAsSeconds), units);
}
public double getIsfTimeFromMidnight(int timeAsSeconds) {
if (isf_v == null)
isf_v = convertToSparseArray(isf);
@ -525,7 +530,6 @@ public class Profile {
public double getTargetMgdl(int timeAsSeconds) {
return toMgdl((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
}
public double getTargetLowMgdl() {
return toMgdl(getTargetLowTimeFromMidnight(secondsFromMidnight()), units);
}

View file

@ -1,3 +1,3 @@
package info.nightscout.androidaps.events
class EventRebuildTabs @JvmOverloads constructor(var recreate: Boolean = false) : Event()
class EventRebuildTabs constructor(var recreate: Boolean = false) : Event()

View file

@ -62,6 +62,7 @@ public class APSResult {
public boolean hasPredictions = false;
public double smb = 0d; // super micro bolus in units
public long deliverAt = 0;
public double targetBG = 0d;
public Constraint<Double> inputConstraints;
@ -184,6 +185,7 @@ public class APSResult {
newResult.smbConstraint = smbConstraint;
newResult.percent = percent;
newResult.usePercent = usePercent;
newResult.targetBG = targetBG;
}

View file

@ -261,6 +261,10 @@ public class DateUtil {
return timeFrameString(timestamp - System.currentTimeMillis(), resourceHelper);
}
public long _now() {
return System.currentTimeMillis();
}
public static long now() {
return System.currentTimeMillis();
}
@ -358,6 +362,7 @@ public class DateUtil {
// singletons to avoid repeated allocation
private static DecimalFormatSymbols dfs;
private static DecimalFormat df;
public static String qs(double x, int digits) {
if (digits == -1) {

View file

@ -6,11 +6,6 @@ import android.text.Spanned
object HtmlHelper {
fun fromHtml(source: String): Spanned {
// API level 24 to replace call
@Suppress("DEPRECATION")
return when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY)
else -> Html.fromHtml(source)
}
return Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY)
}
}

View file

@ -1,22 +1,23 @@
package info.nightscout.androidaps.utils
package info.nightscout.androidaps.utils.locale
import android.content.Context
import android.content.ContextWrapper
import android.os.Build
import android.os.LocaleList
import androidx.preference.PreferenceManager
import info.nightscout.androidaps.core.R
import java.util.*
object LocaleHelper {
private fun currentLanguage(context: Context): String =
PreferenceManager.getDefaultSharedPreferences(context).getString(context.getString(R.string.key_language), "en")
?: "en"
private fun selectedLanguage(context: Context): String =
PreferenceManager.getDefaultSharedPreferences(context).getString(context.getString(R.string.key_language), "default")
?: "default"
// injection not possible because of use in attachBaseContext
//SP.getString(R.string.key_language, Locale.getDefault().language)
private fun currentLocale(context: Context): Locale {
val language = currentLanguage(context)
val language = selectedLanguage(context)
if (language == "default") return Locale.getDefault()
var locale = Locale(language)
if (language.contains("_")) {
// language with country like pt_BR defined in arrays.xml
@ -27,8 +28,10 @@ object LocaleHelper {
return locale
}
@Suppress("DEPRECATION")
fun update(context: Context) {
// no action for system default language
if (selectedLanguage(context) == "default") return
val locale = currentLocale(context)
Locale.setDefault(locale)
val resources = context.resources
@ -39,20 +42,18 @@ object LocaleHelper {
resources.updateConfiguration(configuration, resources.displayMetrics)
}
fun wrap(ctx: Context): ContextWrapper {
fun wrap(ctx: Context): Context {
// no action for system default language
if (selectedLanguage(ctx) == "default") return ctx
val res = ctx.resources
val configuration = res.configuration
val newLocale = currentLocale(ctx)
val context = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
configuration.setLocale(newLocale)
val localeList = LocaleList(newLocale)
LocaleList.setDefault(localeList)
configuration.locales = localeList
ctx.createConfigurationContext(configuration)
} else {
configuration.setLocale(newLocale)
ctx.createConfigurationContext(configuration)
}
configuration.setLocale(newLocale)
val localeList = LocaleList(newLocale)
LocaleList.setDefault(localeList)
configuration.locales = localeList
val context = ctx.createConfigurationContext(configuration)
return ContextWrapper(context)
}
}

View file

@ -124,25 +124,24 @@
<!-- TDD-->
<string name="tddformat"><![CDATA[<b>%1$s:</b> ∑: <b>%2$.2f</b> Bol: <b>%3$.2f</b> Bas: <b>%4$.2f</b>]]></string>
<!-- Translator-->
<string name="careportal_bgcheck">BZ Test</string>
<string name="careportal_bgcheck">BZ-Test</string>
<string name="careportal_announcement">Ankündigung</string>
<string name="careportal_note">Notiz</string>
<string name="careportal_question">Frage</string>
<string name="careportal_exercise">Bewegung</string>
<string name="careportal_pumpsitechange">Pumpenkatheter Wechsel</string>
<string name="careportal_pumpsitechange">Pumpenkatheter-Wechsel</string>
<string name="careportal_cgmsensorinsert">CGM-Sensor gesetzt</string>
<string name="careportal_cgmsensorstart">CGM-Sensor Start</string>
<string name="careportal_insulincartridgechange">Insulinreservoir Wechsel</string>
<string name="careportal_insulincartridgechange">Insulinreservoir-Wechsel</string>
<string name="careportal_profileswitch">Profilwechsel</string>
<string name="careportal_snackbolus">Snack Bolus</string>
<string name="careportal_mealbolus">Mahlzeiten Bolus</string>
<string name="careportal_correctionbolus">Korrektur Bolus</string>
<string name="careportal_combobolus">Combo Bolus</string>
<string name="careportal_tempbasalstart">TBR Start</string>
<string name="careportal_snackbolus">Snack-Bolus</string>
<string name="careportal_mealbolus">Mahlzeiten-Bolus</string>
<string name="careportal_correctionbolus">Korrektur-Bolus</string>
<string name="careportal_combobolus">Combo-Bolus</string>
<string name="careportal_tempbasalend">TBR Ende</string>
<string name="careportal_carbscorrection">Kohlenhydrat Korrektur</string>
<string name="careportal_carbscorrection">Kohlenhydrat-Korrektur</string>
<string name="careportal_openapsoffline">OpenAPS offline</string>
<string name="careportal_pumpbatterychange">Pumpenbatterie Wechsel</string>
<string name="careportal_pumpbatterychange">Pumpenbatterie-Wechsel</string>
<string name="careportal_temporarytarget">Temporäres Ziel</string>
<string name="careportal_temporarytargetcancel">Temporäres Ziel abbrechen</string>
<string name="glucosetype_finger">Finger</string>

View file

@ -10,7 +10,7 @@
<string name="tempbasaldeliveryerror">Erreur injection basal temporaire</string>
<string name="goingtodeliver">%1$.2fU vont être injectées</string>
<string name="waitingforpump">Attente connection pompe</string>
<string name="connectingfor">Connexion à %1$s en cours</string>
<string name="connectingfor">Connexion à %1$d en cours</string>
<string name="bolusdelivering">Injection en cours %1$.2fU</string>
<string name="handshaking">Connexion</string>
<string name="connecting">Connection en cours</string>

View file

@ -8,7 +8,7 @@
<string name="profile_set_ok">Perfil Basal actualizado na bomba</string>
<string name="invalidinput">Entrada Inválida</string>
<string name="tempbasaldeliveryerror">Erro na administração da Basal Temp</string>
<string name="goingtodeliver">A ser administrada %1$.2fU</string>
<string name="goingtodeliver">Quantidade a ser administrada %1$.2fU</string>
<string name="waitingforpump">À espera da bomba</string>
<string name="connectingfor">A ligar durante %1$d s</string>
<string name="bolusdelivering">A administrar %1$.2fU</string>
@ -130,7 +130,7 @@
<string name="careportal_question">Questão</string>
<string name="careportal_exercise">Exercício</string>
<string name="careportal_pumpsitechange">Mudança Local Bomba</string>
<string name="careportal_cgmsensorinsert">Colocação do Sensor CGM</string>
<string name="careportal_cgmsensorinsert">Colocação Sensor CGM</string>
<string name="careportal_cgmsensorstart">Início do Sensor CGM</string>
<string name="careportal_insulincartridgechange">Mudança de Cartucho de Insulina</string>
<string name="careportal_profileswitch">Troca de Perfil</string>

View file

@ -3,10 +3,11 @@ package info.nightscout.androidaps.dana
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.db.Treatment
import info.nightscout.androidaps.interfaces.ProfileStore
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.db.Treatment
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.sharedPreferences.SP
import org.json.JSONArray
import org.json.JSONException
@ -49,8 +50,32 @@ class DanaPump @Inject constructor(
var bleModel = "" // RS v3: like BPN-1.0.1
var isNewPump = true // R only , providing model info
var password = -1 // R, RSv1
var pumpTime: Long = 0
// time
private var pumpTime: Long = 0
var zoneOffset: Int = 0 // i (hw 7+)
fun setPumpTime(value: Long) {
pumpTime = value
}
fun setPumpTime(value: Long, zoneOffset: Int) {
pumpTime = value + T.hours(zoneOffset.toLong()).msecs()
this.zoneOffset = zoneOffset
}
fun resetPumpTime() {
pumpTime = 0
}
fun getPumpTime() = pumpTime
var hwModel = 0
val usingUTC
get() = hwModel >= 7
val profile24
get() = hwModel >= 7
var protocol = 0
var productCode = 0
var errorState: ErrorState = ErrorState.NONE
@ -90,8 +115,9 @@ class DanaPump @Inject constructor(
var extendedBolusRemainingMinutes = 0
var extendedBolusDeliveredSoFar = 0.0 //RS only = 0.0
// Profile
// Profile R,RSv1
var units = 0
var activeProfile = 0
var easyBasalMode = 0
var basal48Enable = false
var currentCIR = 0
@ -107,7 +133,10 @@ class DanaPump @Inject constructor(
var eveningCF = 0.0
var nightCIR = 0
var nightCF = 0.0
var activeProfile = 0
// Profile I
var cf24 = Array<Double>(24) { 0.0 }
var cir24 = Array<Double>(24) { 0.0 }
//var pumpProfiles = arrayOf<Array<Double>>()
var pumpProfiles: Array<Array<Double>>? = null
@ -151,6 +180,8 @@ class DanaPump @Inject constructor(
var bolusDone = false // success end
var lastEventTimeLoaded: Long = 0 // timestamp of last received event
val lastKnownHistoryId: Int = 0 // hwver 7+, 1-2000
fun createConvertedProfile(): ProfileStore? {
pumpProfiles?.let {
val json = JSONObject()
@ -165,18 +196,30 @@ class DanaPump @Inject constructor(
json.put("store", store)
profile.put("dia", Constants.defaultDIA)
val carbratios = JSONArray()
carbratios.put(JSONObject().put("time", "00:00").put("timeAsSeconds", 0).put("value", nightCIR))
carbratios.put(JSONObject().put("time", "06:00").put("timeAsSeconds", 6 * 3600).put("value", morningCIR))
carbratios.put(JSONObject().put("time", "11:00").put("timeAsSeconds", 11 * 3600).put("value", afternoonCIR))
carbratios.put(JSONObject().put("time", "14:00").put("timeAsSeconds", 17 * 3600).put("value", eveningCIR))
carbratios.put(JSONObject().put("time", "22:00").put("timeAsSeconds", 22 * 3600).put("value", nightCIR))
if (!profile24) {
carbratios.put(JSONObject().put("time", "00:00").put("timeAsSeconds", 0).put("value", nightCIR))
carbratios.put(JSONObject().put("time", "06:00").put("timeAsSeconds", 6 * 3600).put("value", morningCIR))
carbratios.put(JSONObject().put("time", "11:00").put("timeAsSeconds", 11 * 3600).put("value", afternoonCIR))
carbratios.put(JSONObject().put("time", "14:00").put("timeAsSeconds", 17 * 3600).put("value", eveningCIR))
carbratios.put(JSONObject().put("time", "22:00").put("timeAsSeconds", 22 * 3600).put("value", nightCIR))
} else { // 24 values
for (i in 0..23) {
carbratios.put(JSONObject().put("time", String.format("%02d", i) + ":00").put("timeAsSeconds", i * 3600).put("value", cir24[i]))
}
}
profile.put("carbratio", carbratios)
val sens = JSONArray()
sens.put(JSONObject().put("time", "00:00").put("timeAsSeconds", 0).put("value", nightCF))
sens.put(JSONObject().put("time", "06:00").put("timeAsSeconds", 6 * 3600).put("value", morningCF))
sens.put(JSONObject().put("time", "11:00").put("timeAsSeconds", 11 * 3600).put("value", afternoonCF))
sens.put(JSONObject().put("time", "17:00").put("timeAsSeconds", 17 * 3600).put("value", eveningCF))
sens.put(JSONObject().put("time", "22:00").put("timeAsSeconds", 22 * 3600).put("value", nightCF))
if (!profile24) {
sens.put(JSONObject().put("time", "00:00").put("timeAsSeconds", 0).put("value", nightCF))
sens.put(JSONObject().put("time", "06:00").put("timeAsSeconds", 6 * 3600).put("value", morningCF))
sens.put(JSONObject().put("time", "11:00").put("timeAsSeconds", 11 * 3600).put("value", afternoonCF))
sens.put(JSONObject().put("time", "17:00").put("timeAsSeconds", 17 * 3600).put("value", eveningCF))
sens.put(JSONObject().put("time", "22:00").put("timeAsSeconds", 22 * 3600).put("value", nightCF))
} else { // 24 values
for (i in 0..23) {
sens.put(JSONObject().put("time", String.format("%02d", i) + ":00").put("timeAsSeconds", i * 3600).put("value", cf24[i]))
}
}
profile.put("sens", sens)
val basals = JSONArray()
val basalValues = if (basal48Enable) 48 else 24
@ -270,6 +313,7 @@ class DanaPump @Inject constructor(
const val PROFILECHANGE = 13
const val CARBS = 14
const val PRIMECANNULA = 15
const val TIMECHANGE = 16
// Dana R btModel
const val DOMESTIC_MODEL = 0x01

View file

@ -44,6 +44,8 @@ class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
private fun isDanaR() = activePlugin.activePump.pumpDescription.pumpType == PumpType.DanaR
private fun isDanaRv2() = activePlugin.activePump.pumpDescription.pumpType == PumpType.DanaRv2
var minBacklight = 1
@Synchronized
override fun onResume() {
super.onResume()
@ -65,6 +67,8 @@ class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
save_user_options.setOnClickListener { onSaveClick() }
minBacklight = if (danaPump.hwModel < 7) 1 else 0 // Dana-i allows zero
aapsLogger.debug(LTag.PUMP,
"UserOptionsLoaded:" + (System.currentTimeMillis() - danaPump.lastConnection) / 1000 + " s ago"
+ "\ntimeDisplayType:" + danaPump.timeDisplayType
@ -76,7 +80,7 @@ class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
+ "\nlowReservoir:" + danaPump.lowReservoirRate)
danar_screentimeout.setParams(danaPump.lcdOnTimeSec.toDouble(), 5.0, 240.0, 5.0, DecimalFormat("1"), false, save_user_options)
danar_backlight.setParams(danaPump.backlightOnTimeSec.toDouble(), 1.0, 60.0, 1.0, DecimalFormat("1"), false, save_user_options)
danar_backlight.setParams(danaPump.backlightOnTimeSec.toDouble(), minBacklight.toDouble(), 60.0, 1.0, DecimalFormat("1"), false, save_user_options)
danar_shutdown.setParams(danaPump.shutdownHour.toDouble(), 0.0, 24.0, 1.0, DecimalFormat("1"), true, save_user_options)
danar_lowreservoir.setParams(danaPump.lowReservoirRate.toDouble(), 10.0, 60.0, 10.0, DecimalFormat("10"), false, save_user_options)
when (danaPump.beepAndAlarm) {
@ -136,7 +140,7 @@ class DanaUserOptionsActivity : NoSplashAppCompatActivity() {
// step is 5 seconds, 5 to 240
danaPump.lcdOnTimeSec = min(max(danar_screentimeout.value.toInt() / 5 * 5, 5), 240)
// 1 to 60
danaPump.backlightOnTimeSec = min(max(danar_backlight.value.toInt(), 1), 60)
danaPump.backlightOnTimeSec = min(max(danar_backlight.value.toInt(), minBacklight), 60)
danaPump.units = if (danar_units.isChecked) 1 else 0

View file

@ -29,6 +29,9 @@
<string name="batterydischarged">Baterie v pumpě vybitá</string>
<string name="occlusion">Okluze</string>
<string name="emptyreservoir">Prázdný zásobník</string>
<string name="checkshaft">Zkontrolovat hřídel</string>
<string name="basalmax">Max. bazál</string>
<string name="dailymax">Max. denní</string>
<string name="bloodsugarmeasurementalert">Výstraha měření glykémie</string>
<string name="remaininsulinalert">Zbývající inzulín</string>
<string name="missedbolus">Chybějící bolus</string>

View file

@ -29,6 +29,9 @@
<string name="batterydischarged">Pumpenbatterie entladen</string>
<string name="occlusion">Verstopfung</string>
<string name="emptyreservoir">Reservoir leer</string>
<string name="checkshaft">Gewindestange prüfen</string>
<string name="basalmax">max. Basal</string>
<string name="dailymax">Tagesmaximum</string>
<string name="bloodsugarmeasurementalert">Alarm BZ-Messung</string>
<string name="remaininsulinalert">Restinsulin</string>
<string name="missedbolus">Versäumter Bolus</string>

View file

@ -29,6 +29,8 @@
<string name="batterydischarged">Batterie Pompe Déchargée</string>
<string name="occlusion">Occlusion</string>
<string name="emptyreservoir">Réservoir vide</string>
<string name="basalmax">Basal max</string>
<string name="dailymax">Quotidien max</string>
<string name="bloodsugarmeasurementalert">Alerte de mesure de glycémie</string>
<string name="remaininsulinalert">Niveau d\'insuline restant</string>
<string name="missedbolus">Bolus manqués</string>

View file

@ -29,6 +29,9 @@
<string name="batterydischarged">Batteria del micro scarica</string>
<string name="occlusion">Occlusione</string>
<string name="emptyreservoir">Serbatoio vuoto</string>
<string name="checkshaft">Controlla asta meccanica (shaft)</string>
<string name="basalmax">Max basale</string>
<string name="dailymax">Max giornaliero</string>
<string name="bloodsugarmeasurementalert">Avviso misurazione glicemia</string>
<string name="remaininsulinalert">Livello insulina rimanente</string>
<string name="missedbolus">Bolo perso</string>

View file

@ -12,9 +12,11 @@
<string name="commanderror">Erro no comando</string>
<string name="speederror">Erro velocidade</string>
<string name="insulinlimitviolation">Transgressão limite insulina</string>
<string name="boluserrorcode">Pedido: %1$.2fU Entregue: %2$.2fU Código Erro: %3$s</string>
<string name="boluserrorcode">Pedido: %1$.2fU Administrado: %2$.2fU Código Erro: %3$s</string>
<string name="danar_valuenotsetproperly">Valor não definido corretamente</string>
<string name="danar_setbasalstep001">Coloque o incremento da basal em 0.01 U/h</string>
<string name="resetpairing">Repor as informações de emparelhamento?</string>
<string name="dana_model">%1$s\nModelo: %2$02X\nProtocolo: %3$02X\nCódigo: %4$02X</string>
<string name="processinghistory">A processar acção</string>
<string name="danar_enableextendedbolus">Habilitar bólus prolongado na bomba</string>
<string name="overview_bolusprogress_delivered">Administrado</string>
@ -22,6 +24,7 @@
<string name="unsupportedfirmware">Firmware bomba não suportado</string>
<string name="pumperror">Erro Bomba</string>
<string name="lowbattery">Bateria fraca</string>
<string name="basalcompare">A administrar menos que a taxa de base predefinida</string>
<string name="pumpshutdown">Encerrar Bomba</string>
<string name="batterydischarged">Bateria da Bomba Descarregada</string>
<string name="occlusion">Oclusão</string>
@ -29,6 +32,7 @@
<string name="bloodsugarmeasurementalert">Alerta medição da glicemia</string>
<string name="remaininsulinalert">Nível de insulina restante</string>
<string name="missedbolus">Bólus não administrado</string>
<string name="invalidpairing">Informações de emparelhamento inválidas. A solicitar novo emparelhamento</string>
<string name="gettingpumpstatus">A obter estado bomba</string>
<string name="gettingextendedbolusstatus">A procurar o estado do bólus prolongado</string>
<string name="gettingbolusstatus">A obter estado bólus</string>
@ -39,7 +43,7 @@
<string name="largetimediff">Grande diferença horária:\n A diferença de hora para a bomba é superior a 1.5h.\nPor favor ajuste manualmente a hora na bomba e certifique-se que a leitura do histórico da bomba não provoca problemas.\nSe possível apague o histórico da bomba antes de modificar a hora ou desabilite o loop durante toda a duração de acção da insulina (DIA) depois da ultima entrada no histórico da bomba ou mais um DIA desde o momento da correcção, qual delas seja a que mantenha o loop aberto durante mais tempo.</string>
<string name="pairfirst">Emparelhe a sua bomba com o seu telefone!</string>
<string name="approachingdailylimit">Aproximação do limite diário de insulina</string>
<string name="startingbolus">A iniciar administração de bolus</string>
<string name="startingbolus">A iniciar administração de bólus</string>
<string name="waitingforestimatedbolusend">A aguardar o final do bolus. Restam %1$d seg.</string>
<string name="stoppingtempbasal">A parar basal temp</string>
<string name="settingextendedbolus">A configurar bólus prolongado</string>
@ -61,6 +65,55 @@
<string name="danar_history_prime">Purgar</string>
<string name="danar_useroptions">Opções do utilizador</string>
<string name="danar_timedisplay">Formato hora</string>
<string name="danar_buttonscroll">Botão rolamento</string>
<string name="danar_beep">Sinal ao pressionar botão</string>
<string name="danar_pumpalarm">Alarme</string>
<string name="danar_pumpalarm_sound">Som</string>
<string name="danar_pumpalarm_vibrate">Vibrar</string>
<string name="danar_pumpalarm_both">Ambos</string>
<string name="danar_screentimeout">LCD na hora [segundos]</string>
<string name="danar_backlight">Luz de fundo na hora [segundos]</string>
<string name="danar_glucoseunits">Unidades de Glicose</string>
<string name="danar_shutdown">Desligar [horas]</string>
<string name="danar_lowreservoir">Reservatório baixo [Unidades]</string>
<string name="danar_saveuseroptions">Gravar opções para a bomba</string>
<string name="description_pump_dana_r">Integração para bombas DANA Diabecare R</string>
<string name="description_pump_dana_r_korean">Integração para bombas DANA Diabecare R Coreanas</string>
<string name="description_pump_dana_r_v2">Integração para as bombas DANA Diabecare R com firmware actualizado</string>
<string name="danarpump_shortname">DANA</string>
<string name="nobtadapter">Nenhum dispositivo bluetooth encontrado</string>
<string name="devicenotfound">Dispositivo seleccionado não foi encontrado</string>
<string name="danar_switchtouhmode">Mudar de modo U/d para U/h na bomba</string>
<string name="danarkoreanpump">DanaR Coreana</string>
<string name="danarpump">DanaR</string>
<string name="pumpdrivercorrected">Controlador bomba corrigido</string>
<string name="danarv2pump">DanaRv2</string>
<string name="danar_disableeasymode">Desactivar modo EasyUI na bomba</string>
<string name="profile_set_failed">Não foi possível configurar o perfil de basal</string>
<string name="danar_bluetooth_status">Estado Bluetooth</string>
<string name="danar_iob_label">IOB Bomba</string>
<string name="basal_step">Incremento Basal</string>
<string name="bolus_step">Incremento Bólus</string>
<string name="virtualpump_firmware_label">Firmware</string>
<string name="danar_pump_settings">Configurações da bomba Dana</string>
<string name="timeformat12h">12h</string>
<string name="timeformat24h">24h</string>
<string name="option_on">Ligado</string>
<string name="option_off">Desligado</string>
<string name="danar_bt_name_title">Dispositivo Bluetooth DanaR</string>
<string name="danars_password_title">Senha da bomba (apenas v1)</string>
<string name="danar_password_title">Senha da bomba</string>
<string name="danar_useextended_title">Usar bólus prolongado por &gt;200%%</string>
<string name="danar_visualizeextendedaspercentage_title">Visualizar bólus prolongado como %%</string>
<string name="bolusspeed">Velocidade Bólus</string>
<string name="selectedpump">Bomba seleccionada</string>
<string name="rs_loginsulinchange_title">Registar mudança de reservatório</string>
<string name="rs_loginsulinchange_summary">Adicionar evento \"Mudança de Insulina\" ao careportal quando detectado no histórico</string>
<string name="rs_logcanulachange_title">Registar mudança de canula</string>
<string name="rs_logcanulachange_summary">Adicionar evento \"Mudança Local Bomba\" ao careportal, quando detectado no histórico</string>
<string name="pin1">PIN1</string>
<string name="pin2">PIN2</string>
<string name="press_ok_on_the_pump">Pressione OK na bomba\ne digite os 2 números mostrados\nManter o visor da bomba ligado, pressionando o botão menos até que você termine a digitação do código.</string>
<string name="num1pin">1: (12 dígitos)</string>
<string name="num2pin">2: (8 dígitos)</string>
</resources>

View file

@ -29,6 +29,9 @@
<string name="batterydischarged">Bateria da Bomba Descarregada</string>
<string name="occlusion">Oclusão</string>
<string name="emptyreservoir">Reservatório vazio</string>
<string name="checkshaft">Verificar Eixo</string>
<string name="basalmax">Máx Basal</string>
<string name="dailymax">Máx Diário</string>
<string name="bloodsugarmeasurementalert">Alerta medição da glicemia</string>
<string name="remaininsulinalert">Nível de insulina restante</string>
<string name="missedbolus">Bólus não administrado</string>

View file

@ -29,6 +29,9 @@
<string name="batterydischarged">батарея помпы разряжена</string>
<string name="occlusion">закупорка</string>
<string name="emptyreservoir">Резервуар пуст</string>
<string name="checkshaft">Проверьте шток помпы</string>
<string name="basalmax">Макс. шаг базала</string>
<string name="dailymax">Максимум в день</string>
<string name="bloodsugarmeasurementalert">Предупреждение при измерении уровня СК</string>
<string name="remaininsulinalert">Уровень оставшегося инсулина</string>
<string name="missedbolus">Недоставленный болюс</string>

View file

@ -42,6 +42,9 @@
<string name="batterydischarged">Pump Battery Discharged</string>
<string name="occlusion">Occlusion</string>
<string name="emptyreservoir">Empty reservoir</string>
<string name="checkshaft">Check shaft</string>
<string name="basalmax">Basal max</string>
<string name="dailymax">Daily max</string>
<string name="bloodsugarmeasurementalert">Blood sugar measurement alert</string>
<string name="remaininsulinalert">Remaining insulin level</string>
<string name="missedbolus">Missed bolus</string>

View file

@ -1,10 +1,7 @@
package info.nightscout.androidaps.danar.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.utils.DateUtil
import org.joda.time.DateTime
import java.util.*
@ -27,10 +24,10 @@ class MsgSettingPumpTime(
intFromBuff(bytes, 0, 1)
).millis
aapsLogger.debug(LTag.PUMPCOMM, "Pump time: " + dateUtil.dateAndTimeString(time) + " Phone time: " + Date())
danaPump.pumpTime = time
danaPump.setPumpTime(time)
}
override fun handleMessageNotReceived() {
danaPump.pumpTime = 0
danaPump.resetPumpTime()
}
}

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.data.Profile
import java.util.*
import javax.inject.Inject
import javax.inject.Singleton
@ -37,6 +38,7 @@ class DanaRSMessageHashTable @Inject constructor(
put(DanaRS_Packet_Bolus_Get_Calculation_Information(injector))
put(DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information(injector))
put(DanaRS_Packet_Bolus_Get_CIR_CF_Array(injector))
put(DanaRS_Packet_Bolus_Get_24_CIR_CF_Array(injector))
put(DanaRS_Packet_Bolus_Get_Dual_Bolus(injector))
put(DanaRS_Packet_Bolus_Get_Extended_Bolus(injector))
put(DanaRS_Packet_Bolus_Get_Extended_Bolus_State(injector))
@ -45,6 +47,7 @@ class DanaRSMessageHashTable @Inject constructor(
put(DanaRS_Packet_Bolus_Set_Bolus_Option(injector))
put(DanaRS_Packet_Bolus_Set_Initial_Bolus(injector))
put(DanaRS_Packet_Bolus_Set_CIR_CF_Array(injector))
put(DanaRS_Packet_Bolus_Set_24_CIR_CF_Array(injector, Profile(injector, null)))
put(DanaRS_Packet_Bolus_Set_Dual_Bolus(injector))
put(DanaRS_Packet_Bolus_Set_Extended_Bolus(injector))
put(DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel(injector))
@ -60,8 +63,10 @@ class DanaRSMessageHashTable @Inject constructor(
put(DanaRS_Packet_Notify_Delivery_Rate_Display(injector))
put(DanaRS_Packet_Notify_Missed_Bolus_Alarm(injector))
put(DanaRS_Packet_Option_Get_Pump_Time(injector))
put(DanaRS_Packet_Option_Get_Pump_UTC_And_TimeZone(injector))
put(DanaRS_Packet_Option_Get_User_Option(injector))
put(DanaRS_Packet_Option_Set_Pump_Time(injector))
put(DanaRS_Packet_Option_Set_Pump_UTC_And_TimeZone(injector))
put(DanaRS_Packet_Option_Set_User_Option(injector))
//put(new DanaRS_Packet_History_(injector));
put(DanaRS_Packet_History_Alarm(injector))

View file

@ -151,6 +151,29 @@ public class DanaRS_Packet {
return ret;
}
protected static int intFromBuffMsbLsb(byte[] b, int srcStart, int srcLength) {
int ret;
switch (srcLength) {
case 1:
ret = b[DATA_START + srcStart] & 0x000000FF;
break;
case 2:
ret = ((b[DATA_START + srcStart] & 0x000000FF) << 8) + (b[DATA_START + srcStart + 1] & 0x000000FF);
break;
case 3:
ret = ((b[DATA_START + srcStart] & 0x000000FF) << 16) + ((b[DATA_START + srcStart + 1] & 0x000000FF) << 8) + (b[DATA_START + srcStart + 2] & 0x000000FF);
break;
case 4:
ret = ((b[DATA_START + srcStart] & 0x000000FF) << 24) + ((b[DATA_START + srcStart + 1] & 0x000000FF) << 16) + ((b[DATA_START + srcStart + 2] & 0x000000FF) << 8) + (b[DATA_START + srcStart + 3] & 0x000000FF);
break;
default:
ret = -1;
break;
}
return ret;
}
@TargetApi(Build.VERSION_CODES.KITKAT)
public static String stringFromBuff(byte[] buff, int offset, int length) {
byte[] strbuff = new byte[length];

View file

@ -18,6 +18,8 @@ import info.nightscout.androidaps.danars.encryption.BleEncryption
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import java.util.*
import javax.inject.Inject
@ -34,59 +36,67 @@ open class DanaRS_Packet_APS_History_Events(
@Inject lateinit var sp: SP
@Inject lateinit var nsUpload: NSUpload
private var year = 0
private var month = 0
private var day = 0
private var hour = 0
private var min = 0
private var sec = 0
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE__APS_HISTORY_EVENTS
val cal = GregorianCalendar()
if (from > DateUtil.now()) {
aapsLogger.debug(LTag.PUMPCOMM, "Asked to load from the future")
from = 0
}
if (from != 0L) cal.timeInMillis = from else cal[2000, 0, 1, 0, 0] = 0
year = cal[Calendar.YEAR] - 1900 - 100
month = cal[Calendar.MONTH] + 1
day = cal[Calendar.DAY_OF_MONTH]
hour = cal[Calendar.HOUR_OF_DAY]
min = cal[Calendar.MINUTE]
sec = cal[Calendar.SECOND]
aapsLogger.debug(LTag.PUMPCOMM, "Loading event history from: " + dateUtil.dateAndTimeString(cal.timeInMillis))
aapsLogger.debug(LTag.PUMPCOMM, "Loading event history from: " + dateUtil.dateAndTimeString(from))
danaPump.historyDoneReceived = false
}
override fun getRequestParams(): ByteArray {
val date =
if (danaPump.usingUTC) DateTime(from).withZone(DateTimeZone.UTC)
else DateTime(from)
val request = ByteArray(6)
request[0] = (year and 0xff).toByte()
request[1] = (month and 0xff).toByte()
request[2] = (day and 0xff).toByte()
request[3] = (hour and 0xff).toByte()
request[4] = (min and 0xff).toByte()
request[5] = (sec and 0xff).toByte()
if (from == 0L) {
request[0] = 0
request[1] = 1
request[2] = 1
request[3] = 0
request[4] = 0
request[5] = 0
} else {
request[0] = (date.year - 2000 and 0xff).toByte()
request[1] = (date.monthOfYear and 0xff).toByte()
request[2] = (date.dayOfMonth and 0xff).toByte()
request[3] = (date.hourOfDay and 0xff).toByte()
request[4] = (date.minuteOfHour and 0xff).toByte()
request[5] = (date.secondOfMinute and 0xff).toByte()
}
return request
}
override fun handleMessage(data: ByteArray) {
val recordCode = intFromBuff(data, 0, 1).toByte()
var recordCode = intFromBuff(data, 0, 1).toByte()
// Last record
if (recordCode == 0xFF.toByte()) {
danaPump.historyDoneReceived = true
aapsLogger.debug(LTag.PUMPCOMM, "Last record received")
return
}
val datetime = dateTimeSecFromBuff(data, 1) // 6 bytes
val param1 = (intFromBuff(data, 7, 1) shl 8 and 0xFF00) + (intFromBuff(data, 8, 1) and 0xFF)
val param2 = (intFromBuff(data, 9, 1) shl 8 and 0xFF00) + (intFromBuff(data, 10, 1) and 0xFF)
val temporaryBasal = TemporaryBasal(injector).date(datetime).source(Source.PUMP).pumpId(datetime)
val extendedBolus = ExtendedBolus(injector).date(datetime).source(Source.PUMP).pumpId(datetime)
val datetime: Long
val param1 = intFromBuffMsbLsb(data, 7, 2)
val param2 = intFromBuffMsbLsb(data, 9, 2)
val pumpId: Long
var id = 0
if (!danaPump.usingUTC) {
datetime = dateTimeSecFromBuff(data, 1) // 6 bytes
pumpId = datetime
} else {
datetime = intFromBuffMsbLsb(data, 3, 4) * 1000L
recordCode = intFromBuff(data, 2, 1).toByte()
id = intFromBuffMsbLsb(data, 0, 2) // range only 1-2000
pumpId = datetime shl 16 + id
}
val temporaryBasal = TemporaryBasal(injector).date(datetime).source(Source.PUMP).pumpId(pumpId)
val extendedBolus = ExtendedBolus(injector).date(datetime).source(Source.PUMP).pumpId(pumpId)
val status: String
when (recordCode.toInt()) {
DanaPump.TEMPSTART -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
temporaryBasal.percentRate = param1
temporaryBasal.durationInMinutes = param2
activePlugin.activeTreatments.addToHistoryTempBasal(temporaryBasal)
@ -94,13 +104,13 @@ open class DanaRS_Packet_APS_History_Events(
}
DanaPump.TEMPSTOP -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
activePlugin.activeTreatments.addToHistoryTempBasal(temporaryBasal)
status = "TEMPSTOP " + dateUtil.timeString(datetime)
}
DanaPump.EXTENDEDSTART -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT EXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
extendedBolus.insulin = param1 / 100.0
extendedBolus.durationInMinutes = param2
activePlugin.activeTreatments.addToHistoryExtendedBolus(extendedBolus)
@ -108,7 +118,7 @@ open class DanaRS_Packet_APS_History_Events(
}
DanaPump.EXTENDEDSTOP -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT EXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
activePlugin.activeTreatments.addToHistoryExtendedBolus(extendedBolus)
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
}
@ -121,7 +131,7 @@ open class DanaRS_Packet_APS_History_Events(
detailedBolusInfo.pumpId = datetime
detailedBolusInfo.insulin = param1 / 100.0
val newRecord = activePlugin.activeTreatments.addToHistoryTreatment(detailedBolusInfo, false)
aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
status = "BOLUS " + dateUtil.timeString(datetime)
}
@ -133,12 +143,12 @@ open class DanaRS_Packet_APS_History_Events(
detailedBolusInfo.pumpId = datetime
detailedBolusInfo.insulin = param1 / 100.0
val newRecord = activePlugin.activeTreatments.addToHistoryTreatment(detailedBolusInfo, false)
aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min")
status = "DUALBOLUS " + dateUtil.timeString(datetime)
}
DanaPump.DUALEXTENDEDSTART -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT DUALEXTENDEDSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U Duration: " + param2 + "min")
extendedBolus.insulin = param1 / 100.0
extendedBolus.durationInMinutes = param2
activePlugin.activeTreatments.addToHistoryExtendedBolus(extendedBolus)
@ -146,37 +156,37 @@ open class DanaRS_Packet_APS_History_Events(
}
DanaPump.DUALEXTENDEDSTOP -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT DUALEXTENDEDSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Delivered: " + param1 / 100.0 + "U RealDuration: " + param2 + "min")
activePlugin.activeTreatments.addToHistoryExtendedBolus(extendedBolus)
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
}
DanaPump.SUSPENDON -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
status = "SUSPENDON " + dateUtil.timeString(datetime)
}
DanaPump.SUSPENDOFF -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
}
DanaPump.REFILL -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
if (sp.getBoolean(R.string.key_rs_loginsulinchange, true))
nsUpload.generateCareportalEvent(CareportalEvent.INSULINCHANGE, datetime, resourceHelper.gs(R.string.danarspump))
status = "REFILL " + dateUtil.timeString(datetime)
}
DanaPump.PRIME -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
if (sp.getBoolean(R.string.key_rs_logcanulachange, true))
nsUpload.generateCareportalEvent(CareportalEvent.SITECHANGE, datetime, resourceHelper.gs(R.string.danarspump))
status = "PRIME " + dateUtil.timeString(datetime)
}
DanaPump.PROFILECHANGE -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
}
@ -187,17 +197,23 @@ open class DanaRS_Packet_APS_History_Events(
emptyCarbsInfo.source = Source.PUMP
emptyCarbsInfo.pumpId = datetime
val newRecord = activePlugin.activeTreatments.addToHistoryTreatment(emptyCarbsInfo, false)
aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + (if (newRecord) "**NEW** " else "") + "EVENT CARBS (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Carbs: " + param1 + "g")
status = "CARBS " + dateUtil.timeString(datetime)
}
DanaPump.PRIMECANNULA -> {
aapsLogger.debug(LTag.PUMPCOMM, "EVENT PRIMECANNULA(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT PRIMECANNULA(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
status = "PRIMECANNULA " + dateUtil.timeString(datetime)
}
else -> {
aapsLogger.debug(LTag.PUMPCOMM, "Event: " + recordCode + " " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Param1: " + param1 + " Param2: " + param2)
DanaPump.TIMECHANGE -> {
val oldDateTime = intFromBuffMsbLsb(data, 7, 4) * 1000L
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "EVENT TIMECHANGE(" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Previous: " + dateUtil.dateAndTimeString(oldDateTime))
status = "TIMECHANGE " + dateUtil.timeString(datetime)
}
else -> {
aapsLogger.debug(LTag.PUMPCOMM, "[" + id + "] " + "Event: " + recordCode + " " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Param1: " + param1 + " Param2: " + param2)
status = "UNKNOWN " + dateUtil.timeString(datetime)
}
}

View file

@ -1,9 +1,12 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.encryption.BleEncryption
import java.util.*
import info.nightscout.androidaps.logging.LTag
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import javax.inject.Inject
class DanaRS_Packet_APS_Set_Event_History(
injector: HasAndroidInjector,
@ -13,29 +16,26 @@ class DanaRS_Packet_APS_Set_Event_History(
private var param2: Int
) : DanaRS_Packet(injector) {
@Inject lateinit var danaPump: DanaPump
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY
if ((packetType == info.nightscout.androidaps.dana.DanaPump.CARBS || packetType == info.nightscout.androidaps.dana.DanaPump.BOLUS) && param1 <= 0) this.param1 = 0
if ((packetType == DanaPump.CARBS || packetType == DanaPump.BOLUS) && param1 <= 0) this.param1 = 0
aapsLogger.debug(LTag.PUMPCOMM, "Set history entry: " + dateUtil.dateAndTimeString(time) + " type: " + packetType + " param1: " + param1 + " param2: " + param2)
}
override fun getRequestParams(): ByteArray {
val cal = GregorianCalendar()
cal.timeInMillis = time
val year = cal[Calendar.YEAR] - 1900 - 100
val month = cal[Calendar.MONTH] + 1
val day = cal[Calendar.DAY_OF_MONTH]
val hour = cal[Calendar.HOUR_OF_DAY]
val min = cal[Calendar.MINUTE]
val sec = cal[Calendar.SECOND]
val date =
if (danaPump.usingUTC) DateTime(time).withZone(DateTimeZone.UTC)
else DateTime(time)
val request = ByteArray(11)
request[0] = (packetType and 0xff).toByte()
request[1] = (year and 0xff).toByte()
request[2] = (month and 0xff).toByte()
request[3] = (day and 0xff).toByte()
request[4] = (hour and 0xff).toByte()
request[5] = (min and 0xff).toByte()
request[6] = (sec and 0xff).toByte()
request[1] = (date.year - 2000 and 0xff).toByte()
request[2] = (date.monthOfYear and 0xff).toByte()
request[3] = (date.dayOfMonth and 0xff).toByte()
request[4] = (date.hourOfDay and 0xff).toByte()
request[5] = (date.minuteOfHour and 0xff).toByte()
request[6] = (date.secondOfMinute and 0xff).toByte()
request[7] = (param1 ushr 8 and 0xff).toByte()
request[8] = (param1 and 0xff).toByte()
request[9] = (param2 ushr 8 and 0xff).toByte()

View file

@ -0,0 +1,39 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.encryption.BleEncryption
import javax.inject.Inject
class DanaRS_Packet_Bolus_Get_24_CIR_CF_Array(
injector: HasAndroidInjector
) : DanaRS_Packet(injector) {
@Inject lateinit var danaPump: DanaPump
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE_BOLUS__GET_24_CIR_CF_ARRAY
aapsLogger.debug(LTag.PUMPCOMM, "New message")
}
override fun handleMessage(data: ByteArray) {
danaPump.units = byteArrayToInt(getBytes(data, DATA_START, 1))
for (i in 0 .. 23) {
val cf = byteArrayToInt(getBytes(data, DATA_START + 1 + 2 * i, 2)).toDouble()
val cir = if (danaPump.units == DanaPump.UNITS_MGDL)
byteArrayToInt(getBytes(data, DATA_START + 1 + 48 + 2 * i, 2)).toDouble()
else
byteArrayToInt(getBytes(data, DATA_START + 1 + 48 + 2 * i, 2)) / 100.0
danaPump.cir24[i] = cir
danaPump.cf24[i] = cf
aapsLogger.debug(LTag.PUMPCOMM, "$i: CIR: $cir CF: $cf")
}
if (danaPump.units < 0 || danaPump.units > 1) failed = true
aapsLogger.debug(LTag.PUMPCOMM, "Pump units: " + if (danaPump.units == DanaPump.UNITS_MGDL) "MGDL" else "MMOL")
}
override fun getFriendlyName(): String {
return "BOLUS__GET_24_ CIR_CF_ARRAY"
}
}

View file

@ -0,0 +1,52 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.encryption.BleEncryption
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject
class DanaRS_Packet_Bolus_Set_24_CIR_CF_Array(
injector: HasAndroidInjector,
private val profile: Profile?
) : DanaRS_Packet(injector) {
@Inject lateinit var danaPump: DanaPump
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE_BOLUS__SET_24_CIR_CF_ARRAY
aapsLogger.debug(LTag.PUMPCOMM, "New message")
}
override fun getRequestParams(): ByteArray {
val request = ByteArray(96)
profile ?: return request // profile is null only in hash table
val cfStart = 24 * 2
for (i in 0..23) {
var isf = profile.getIsfMgdlTimeFromMidnight(i * 3600)
if (danaPump.units == DanaPump.UNITS_MMOL) isf *= 10
val ic = profile.getIcTimeFromMidnight(i * 3600) * 100
request[2 * i] = (isf.toInt() and 0xff).toByte()
request[2 * i] = (isf.toInt() ushr 8 and 0xff).toByte()
request[cfStart + 2 * i] = (ic.toInt() and 0xff).toByte()
request[cfStart + 2 * i] = (ic.toInt() ushr 8 and 0xff).toByte()
}
return request
}
override fun handleMessage(data: ByteArray) {
val result = intFromBuff(data, 0, 1)
if (result == 0) {
aapsLogger.debug(LTag.PUMPCOMM, "Result OK")
failed = false
} else {
aapsLogger.error("Result Error: $result")
failed = true
}
}
override fun getFriendlyName(): String {
return "BOLUS__SET_24_CIR_CF_ARRAY"
}
}

View file

@ -1,12 +1,12 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.comm.RecordTypes
import info.nightscout.androidaps.db.DanaRHistoryRecord
import info.nightscout.androidaps.events.EventDanaRSyncStatus
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.dana.comm.RecordTypes
import info.nightscout.androidaps.events.EventDanaRSyncStatus
import org.joda.time.DateTime
import java.util.*
import javax.inject.Inject
@ -83,20 +83,17 @@ abstract class DanaRS_Packet_History_(
val historySecond = byteArrayToInt(getBytes(data, DATA_START + 6, 1))
val paramByte7 = historySecond.toByte()
val dailyBolus: Double = ((data[DATA_START + 6].toInt() and 0xFF shl 8) + (data[DATA_START + 7].toInt() and 0xFF)) * 0.01
val date = DateTime(2000 + historyYear, historyMonth, historyDay, 0, 0)
val datetime = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute)
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
val historyCode = byteArrayToInt(getBytes(data, DATA_START + 7, 1))
val paramByte8 = historyCode.toByte()
val value: Int = (data[DATA_START + 8].toInt() and 0xFF shl 8) + (data[DATA_START + 9].toInt() and 0xFF)
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
danaRHistoryRecord.setBytes(data)
// danaRHistoryRecord.recordCode is different from DanaR codes
// set in switch for every type
// set in switch for every type
var messageType = ""
when (recordCode) {
0x02 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BOLUS
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_BOLUS
val datetime = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute)
danaRHistoryRecord.recordDate = datetime.millis
when (0xF0 and paramByte8.toInt()) {
0xA0 -> {
@ -123,80 +120,103 @@ abstract class DanaRS_Packet_History_(
}
danaRHistoryRecord.recordDuration = (paramByte8.toInt() and 0x0F) * 60 + paramByte7.toInt()
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetime.millis) + " Code: " + historyCode + " Value: " + value)
}
0x03 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_DAILY
messageType += "dailyinsulin"
val date = DateTime(2000 + historyYear, historyMonth, historyDay, 0, 0)
danaRHistoryRecord.recordDate = date.millis
danaRHistoryRecord.recordDailyBasal = dailyBasal
danaRHistoryRecord.recordDailyBolus = dailyBolus
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(date.millis) + " Code: " + historyCode + " Value: " + value)
}
0x04 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_PRIME
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_PRIME
messageType += "prime"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x05 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_REFILL
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_REFILL
messageType += "refill"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x0b -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_BASALHOUR
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_BASALHOUR
messageType += "basal hour"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x99 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_TEMP_BASAL
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_TEMP_BASAL
messageType += "tb"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x06 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_GLUCOSE
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_GLUCOSE
messageType += "glucose"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value.toDouble()
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x07 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_CARBO
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_CARBO
messageType += "carbo"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
danaRHistoryRecord.recordValue = value.toDouble()
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x0a -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_ALARM
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_ALARM
messageType += "alarm"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
var strAlarm = "None"
when (paramByte8.toInt()) {
67 -> strAlarm = "Check"
79 -> strAlarm = "Occlusion"
66 -> strAlarm = "Low Battery"
83 -> strAlarm = "Shutdown"
when (paramByte8) {
'P'.toByte() -> strAlarm = "Basal Compare"
'R'.toByte() -> strAlarm = "Empty Reservoir"
'C'.toByte() -> strAlarm = "Check"
'O'.toByte() -> strAlarm = "Occlusion"
'M'.toByte() -> strAlarm = "Basal max"
'D'.toByte() -> strAlarm = "Daily max"
'B'.toByte() -> strAlarm = "Low Battery"
'S'.toByte() -> strAlarm = "Shutdown"
}
danaRHistoryRecord.recordAlarm = strAlarm
danaRHistoryRecord.recordValue = value * 0.01
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
0x09 -> {
danaRHistoryRecord.recordCode = info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_SUSPEND
danaRHistoryRecord.recordCode = RecordTypes.RECORD_TYPE_SUSPEND
messageType += "suspend"
val datetimewihtsec = DateTime(2000 + historyYear, historyMonth, historyDay, historyHour, historyMinute, historySecond)
danaRHistoryRecord.recordDate = datetimewihtsec.millis
var strRecordValue = "Off"
if (paramByte8.toInt() == 79) strRecordValue = "On"
danaRHistoryRecord.stringRecordValue = strRecordValue
aapsLogger.debug(LTag.PUMPCOMM, "History packet: " + recordCode + " Date: " + dateUtil.dateAndTimeString(datetimewihtsec.millis) + " Code: " + historyCode + " Value: " + value)
}
}
databaseHelper.createOrUpdate(danaRHistoryRecord)

View file

@ -41,12 +41,18 @@ class DanaRS_Packet_Notify_Alarm(
errorString = resourceHelper.gs(R.string.lowbattery)
0x06 -> // Basal Compare
errorString = resourceHelper.gs(R.string.basalcompare)
0x09 -> // Empty Reservoir
errorString = resourceHelper.gs(R.string.emptyreservoir)
0x07, 0xFF -> // Blood sugar measurement alert
errorString = resourceHelper.gs(R.string.bloodsugarmeasurementalert)
0x08, 0xFE -> // Remaining insulin level
errorString = resourceHelper.gs(R.string.remaininsulinalert)
0x09 -> // Empty Reservoir
errorString = resourceHelper.gs(R.string.emptyreservoir)
0x0A -> // Check shaft
errorString = resourceHelper.gs(R.string.checkshaft)
0x0B -> // Basal MAX
errorString = resourceHelper.gs(R.string.basalmax)
0x0C -> // Daily MAX
errorString = resourceHelper.gs(R.string.dailymax)
0xFD -> // Blood sugar check miss alarm
errorString = resourceHelper.gs(R.string.missedbolus)
}

View file

@ -19,31 +19,19 @@ class DanaRS_Packet_Option_Get_Pump_Time(
}
override fun handleMessage(data: ByteArray) {
var dataIndex = DATA_START
var dataSize = 1
val year = byteArrayToInt(getBytes(data, dataIndex, dataSize))
dataIndex += dataSize
dataSize = 1
val month = byteArrayToInt(getBytes(data, dataIndex, dataSize))
dataIndex += dataSize
dataSize = 1
val day = byteArrayToInt(getBytes(data, dataIndex, dataSize))
dataIndex += dataSize
dataSize = 1
val hour = byteArrayToInt(getBytes(data, dataIndex, dataSize))
dataIndex += dataSize
dataSize = 1
val min = byteArrayToInt(getBytes(data, dataIndex, dataSize))
dataIndex += dataSize
dataSize = 1
val sec = byteArrayToInt(getBytes(data, dataIndex, dataSize))
val year = byteArrayToInt(getBytes(data, DATA_START, 1))
val month = byteArrayToInt(getBytes(data, DATA_START + 1, 1))
val day = byteArrayToInt(getBytes(data, DATA_START + 2, 1))
val hour = byteArrayToInt(getBytes(data, DATA_START + 3, 1))
val min = byteArrayToInt(getBytes(data, DATA_START + 4, 1))
val sec = byteArrayToInt(getBytes(data, DATA_START + 5, 1))
val time = DateTime(2000 + year, month, day, hour, min, sec)
danaPump.pumpTime = time.millis
danaPump.setPumpTime(time.millis)
aapsLogger.debug(LTag.PUMPCOMM, "Pump time " + dateUtil.dateAndTimeString(time.millis))
}
override fun handleMessageNotReceived() {
danaPump.pumpTime = 0
danaPump.resetPumpTime()
}
override fun getFriendlyName(): String {

View file

@ -0,0 +1,41 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.encryption.BleEncryption
import org.joda.time.DateTime
import javax.inject.Inject
class DanaRS_Packet_Option_Get_Pump_UTC_And_TimeZone(
injector: HasAndroidInjector
) : DanaRS_Packet(injector) {
@Inject lateinit var danaPump: DanaPump
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE_OPTION__GET_PUMP_UTC_AND_TIME_ZONE
aapsLogger.debug(LTag.PUMPCOMM, "Requesting pump UTC time")
}
override fun handleMessage(data: ByteArray) {
val year = byteArrayToInt(getBytes(data, DATA_START, 1))
val month = byteArrayToInt(getBytes(data, DATA_START + 1, 1))
val day = byteArrayToInt(getBytes(data, DATA_START + 2, 1))
val hour = byteArrayToInt(getBytes(data, DATA_START + 3, 1))
val min = byteArrayToInt(getBytes(data, DATA_START + 4, 1))
val sec = byteArrayToInt(getBytes(data, DATA_START + 5, 1))
val zoneOffset = getBytes(data, DATA_START + 6, 1)[0].toInt()
val time = DateTime(2000 + year, month, day, hour, min, sec)
danaPump.setPumpTime(time.millis, zoneOffset)
aapsLogger.debug(LTag.PUMPCOMM, "Pump time ${dateUtil.dateAndTimeString(danaPump.getPumpTime())} ZoneOffset: $zoneOffset")
}
override fun handleMessageNotReceived() {
danaPump.resetPumpTime()
}
override fun getFriendlyName(): String {
return "OPTION__GET_PUMP_UTC_AND_TIMEZONE"
}
}

View file

@ -0,0 +1,49 @@
package info.nightscout.androidaps.danars.comm
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.danars.encryption.BleEncryption
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
class DanaRS_Packet_Option_Set_Pump_UTC_And_TimeZone(
injector: HasAndroidInjector,
private var time: Long = 0,
private var zoneOffset: Int = 0
) : DanaRS_Packet(injector) {
var error = 0
init {
opCode = BleEncryption.DANAR_PACKET__OPCODE_OPTION__SET_PUMP_UTC_AND_TIME_ZONE
aapsLogger.debug(LTag.PUMPCOMM, "Setting UTC pump time ${dateUtil.dateAndTimeString(time)} ZoneOffset: $zoneOffset")
}
override fun getRequestParams(): ByteArray {
val date = DateTime(time).withZone(DateTimeZone.UTC)
val request = ByteArray(7)
request[0] = (date.year - 2000 and 0xff).toByte()
request[1] = (date.monthOfYear and 0xff).toByte()
request[2] = (date.dayOfMonth and 0xff).toByte()
request[3] = (date.hourOfDay and 0xff).toByte()
request[4] = (date.minuteOfHour and 0xff).toByte()
request[5] = (date.secondOfMinute and 0xff).toByte()
request[6] = zoneOffset.toByte()
return request
}
override fun handleMessage(data: ByteArray) {
val result = intFromBuff(data, 0, 1)
if (result == 0) {
aapsLogger.debug(LTag.PUMPCOMM, "Result OK")
failed = false
} else {
aapsLogger.error("Result Error: $result")
failed = true
}
}
override fun getFriendlyName(): String {
return "OPTION__SET_PUMP_UTC_AND_TIMEZONE"
}
}

View file

@ -25,6 +25,7 @@ abstract class DanaRSCommModule {
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_Calculation_Information(): DanaRS_Packet_Bolus_Get_Calculation_Information
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information(): DanaRS_Packet_Bolus_Get_Carbohydrate_Calculation_Information
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_CIR_CF_Array(): DanaRS_Packet_Bolus_Get_CIR_CF_Array
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_24_CIR_CF_Array(): DanaRS_Packet_Bolus_Get_24_CIR_CF_Array
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_Dual_Bolus(): DanaRS_Packet_Bolus_Get_Dual_Bolus
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_Extended_Bolus(): DanaRS_Packet_Bolus_Get_Extended_Bolus
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Get_Extended_Bolus_State(): DanaRS_Packet_Bolus_Get_Extended_Bolus_State
@ -33,6 +34,7 @@ abstract class DanaRSCommModule {
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_Bolus_Option(): DanaRS_Packet_Bolus_Set_Bolus_Option
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_Initial_Bolus(): DanaRS_Packet_Bolus_Set_Initial_Bolus
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_CIR_CF_Array(): DanaRS_Packet_Bolus_Set_CIR_CF_Array
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_24_CIR_CF_Array(): DanaRS_Packet_Bolus_Set_24_CIR_CF_Array
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_Dual_Bolus(): DanaRS_Packet_Bolus_Set_Dual_Bolus
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_Extended_Bolus(): DanaRS_Packet_Bolus_Set_Extended_Bolus
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel(): DanaRS_Packet_Bolus_Set_Extended_Bolus_Cancel
@ -76,4 +78,6 @@ abstract class DanaRSCommModule {
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_APS_Set_Event_History(): DanaRS_Packet_APS_Set_Event_History
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_General_Get_Shipping_Version(): DanaRS_Packet_General_Get_Shipping_Version
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Review_Get_Pump_Dec_Ratio(): DanaRS_Packet_Review_Get_Pump_Dec_Ratio
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Option_Get_Pump_UTC_And_TimeZone(): DanaRS_Packet_Option_Get_Pump_UTC_And_TimeZone
@ContributesAndroidInjector abstract fun contributesDanaRS_Packet_Option_Set_Pump_UTC_And_TimeZone(): DanaRS_Packet_Option_Set_Pump_UTC_And_TimeZone
}

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