Merge branch 'master' of https://github.com/MilosKozak/AndroidAPS into 221-fix

This commit is contained in:
AdrianLxM 2019-04-07 17:00:36 +02:00
commit 5fbc274c5b
108 changed files with 4028 additions and 1036 deletions

View file

@ -63,11 +63,12 @@ android {
targetSdkVersion 25
multiDexEnabled true
versionCode 1500
version "2.1.2"
version "2.2"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// if you change minSdkVersion to less than 11, you need to change executeTask for wear
ndk {
moduleName "BleCommandUtil"
@ -77,7 +78,7 @@ android {
// TODO remove once wear dependency com.google.android.gms:play-services-wearable:7.3.0
// has been upgraded (requiring significant code changes), which currently fails release
// build with a deprecation warning
abortOnError false
// abortOnError false
// (disabled entirely to avoid reports on the error, which would still be displayed
// and it's easy to overlook that it's ignored)
checkReleaseBuilds false
@ -194,7 +195,7 @@ dependencies {
implementation "org.slf4j:slf4j-api:1.7.12"
implementation "com.jjoe64:graphview:4.0.1"
implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.1.1"
implementation "com.google.android.gms:play-services-wearable:7.5.0"
implementation 'com.google.android.gms:play-services-wearable:10.2.1'
implementation(name: "android-edittext-validator-v1.3.4-mod", ext: "aar")
implementation(name: "sightparser-release", ext: "aar")
implementation 'com.madgag.spongycastle:core:1.58.0.0'

View file

@ -169,7 +169,63 @@
android:name=".plugins.general.wear.wearintegration.WatchUpdaterService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
<!-- <action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> -->
<!-- listeners receive events that match the action and data filters -->
<action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" />
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_data" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_data_resend" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_cancel_bolus" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_confirmactionstring" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_initiateactionstring" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/openwearsettings" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/sendstatustowear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/sendpreferencestowear" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_basal" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_bolusprogress" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_actionconfirmationrequest" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_changeconfirmationrequest" />
<data
android:scheme="wear"
android:host="*"
android:pathPrefix="/nightscout_watch_cancelnotificationrequest" />
</intent-filter>
</service>
<service
@ -216,4 +272,4 @@
android:label="@string/pairing_information" />
</application>
</manifest>
</manifest>

View file

@ -68,4 +68,7 @@ public class Constants {
//SMS Communicator
public static final long SMS_CONFIRM_TIMEOUT = T.mins(5).msecs();
//Storage [MB]
public static final long MINIMUM_FREE_SPACE = 200;
}

View file

@ -37,6 +37,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.constraints.dstHelper.DstHelperPlugin;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin;
import info.nightscout.androidaps.plugins.constraints.storage.StorageConstraintPlugin;
import info.nightscout.androidaps.plugins.general.actions.ActionsFragment;
import info.nightscout.androidaps.plugins.general.careportal.CareportalPlugin;
import info.nightscout.androidaps.plugins.general.food.FoodPlugin;
@ -175,6 +176,7 @@ public class MainApp extends Application {
if (Config.OTHERPROFILES) pluginsList.add(LocalProfilePlugin.getPlugin());
pluginsList.add(TreatmentsPlugin.getPlugin());
if (Config.SAFETY) pluginsList.add(SafetyPlugin.getPlugin());
if (Config.SAFETY) pluginsList.add(StorageConstraintPlugin.getPlugin());
if (Config.APS) pluginsList.add(ObjectivesPlugin.getPlugin());
pluginsList.add(SourceXdripPlugin.getPlugin());
pluginsList.add(SourceNSClientPlugin.getPlugin());
@ -198,6 +200,7 @@ public class MainApp extends Application {
pluginsList.add(DstHelperPlugin.getPlugin());
ConfigBuilderPlugin.getPlugin().initialize();
}

View file

@ -50,6 +50,10 @@ public class ConstraintChecker implements ConstraintsInterface {
return isAdvancedFilteringEnabled(new Constraint<>(true));
}
public Constraint<Boolean> isSuperBolusEnabled() {
return isSuperBolusEnabled(new Constraint<>(true));
}
public Constraint<Double> getMaxBasalAllowed(Profile profile) {
return applyBasalConstraints(new Constraint<>(Constants.REALLYHIGHBASALRATE), profile);
}
@ -157,6 +161,17 @@ public class ConstraintChecker implements ConstraintsInterface {
return value;
}
@Override
public Constraint<Boolean> isSuperBolusEnabled(Constraint<Boolean> value) {
ArrayList<PluginBase> constraintsPlugins = mainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class);
for (PluginBase p : constraintsPlugins) {
ConstraintsInterface constraint = (ConstraintsInterface) p;
if (!p.isEnabled(PluginType.CONSTRAINTS)) continue;
constraint.isSuperBolusEnabled(value);
}
return value;
}
@Override
public Constraint<Double> applyBasalConstraints(Constraint<Double> absoluteRate, Profile profile) {
ArrayList<PluginBase> constraintsPlugins = mainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class);

View file

@ -464,7 +464,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
} catch (SQLException e) {
log.error("Unhandled exception", e);
}
return new ArrayList<BgReading>();
return new ArrayList<>();
}
public List<BgReading> getBgreadingsDataFromTime(long start, long end, boolean ascending) {
@ -481,7 +481,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
} catch (SQLException e) {
log.error("Unhandled exception", e);
}
return new ArrayList<BgReading>();
return new ArrayList<>();
}
public List<BgReading> getAllBgreadingsDataFromTime(long mills, boolean ascending) {

View file

@ -35,6 +35,10 @@ public interface ConstraintsInterface {
return value;
}
default Constraint<Boolean> isSuperBolusEnabled(Constraint<Boolean> value) {
return value;
}
default Constraint<Double> applyBasalConstraints(Constraint<Double> absoluteRate, Profile profile) {
return absoluteRate;
}

View file

@ -93,6 +93,8 @@ public abstract class PluginBase {
return state == State.ENABLED && specialEnableCondition();
if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.PUMP && isEnabled(PluginType.PUMP))
return true;
if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.APS && isEnabled(PluginType.APS))
return true;
if (type == PluginType.PROFILE && pluginDescription.mainType == PluginType.PUMP)
return isProfileInterfaceEnabled;
return false;

View file

@ -2,9 +2,13 @@ package info.nightscout.androidaps.interfaces;
import org.json.JSONObject;
import java.util.List;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
/**
* Created by mike on 04.06.2016.
@ -61,4 +65,10 @@ public interface PumpInterface {
PumpEnactResult loadTDDs();
public boolean canHandleDST();
List<CustomAction> getCustomActions();
void executeCustomAction(CustomActionType customActionType);
}

View file

@ -95,6 +95,7 @@ public class L {
public static final String PROFILE = "PROFILE";
public static final String CONFIGBUILDER = "CONFIGBUILDER";
public static final String UI = "UI";
public static final String SMS = "SMS";
private static void initialize() {
logElements = new ArrayList<>();
@ -117,6 +118,7 @@ public class L {
logElements.add(new LogElement(PUMPBTCOMM, false));
logElements.add(new LogElement(PUMPCOMM, true));
logElements.add(new LogElement(PUMPQUEUE, true));
logElements.add(new LogElement(SMS, true));
logElements.add(new LogElement(UI, true));
}

View file

@ -34,6 +34,7 @@ import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.interfaces.APSInterface;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.PluginBase;
@ -175,6 +176,14 @@ public class LoopPlugin extends PluginBase {
return loopSuspendedTill;
}
@Subscribe
public void onStatusEvent(final EventTempTargetChange ev) {
new Thread(() -> invoke("EventTempTargetChange", true)).start();
FabricPrivacy.getInstance().logCustom(new CustomEvent("TT_Loop_Run"));
}
public void suspendTo(long endTime) {
loopSuspendedTill = endTime;
isSuperBolus = false;

View file

@ -13,6 +13,7 @@ import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.interfaces.APSInterface;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
@ -38,7 +39,7 @@ import info.nightscout.androidaps.utils.ToastUtils;
/**
* Created by mike on 05.08.2016.
*/
public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
public class OpenAPSSMBPlugin extends PluginBase implements APSInterface, ConstraintsInterface {
private static Logger log = LoggerFactory.getLogger(L.APS);
private static OpenAPSSMBPlugin openAPSSMBPlugin;
@ -147,7 +148,9 @@ public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
if (L.isEnabled(L.APS))
Profiler.log(log, "getMealData()", startPart);
double maxIob = MainApp.getConstraintChecker().getMaxIOBAllowed().value();
Constraint<Double> maxIOBAllowedConstraint = MainApp.getConstraintChecker().getMaxIOBAllowed();
inputConstraints.copyReasons(maxIOBAllowedConstraint);
double maxIob = maxIOBAllowedConstraint.value();
minBg = verifyHardLimits(minBg, "minBg", HardLimits.VERY_HARD_LIMIT_MIN_BG[0], HardLimits.VERY_HARD_LIMIT_MIN_BG[1]);
maxBg = verifyHardLimits(maxBg, "maxBg", HardLimits.VERY_HARD_LIMIT_MAX_BG[0], HardLimits.VERY_HARD_LIMIT_MAX_BG[1]);
@ -266,4 +269,9 @@ public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
return newvalue;
}
public Constraint<Boolean> isSuperBolusEnabled(Constraint<Boolean> value) {
value.set(false);
return value;
}
}

View file

@ -42,6 +42,7 @@ import info.nightscout.androidaps.interfaces.SensitivityInterface;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.insulin.InsulinOrefRapidActingPlugin;
import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin;
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref0Plugin;
import info.nightscout.androidaps.utils.FabricPrivacy;

View file

@ -16,6 +16,7 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.db.ProfileSwitch;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.interfaces.ProfileInterface;
@ -139,4 +140,44 @@ public class ProfileFunctions {
return null;
}
public static ProfileSwitch prepareProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift, long date) {
ProfileSwitch profileSwitch = new ProfileSwitch();
profileSwitch.date = date;
profileSwitch.source = Source.USER;
profileSwitch.profileName = profileName;
profileSwitch.profileJson = profileStore.getSpecificProfile(profileName).getData().toString();
profileSwitch.profilePlugin = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getClass().getName();
profileSwitch.durationInMinutes = duration;
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
profileSwitch.timeshift = timeshift;
profileSwitch.percentage = percentage;
return profileSwitch;
}
public static void doProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift) {
ProfileSwitch profileSwitch = prepareProfileSwitch(profileStore, profileName, duration, percentage, timeshift, System.currentTimeMillis());
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
}
public static void doProfileSwitch(final int duration, final int percentage, final int timeshift) {
ProfileSwitch profileSwitch = TreatmentsPlugin.getPlugin().getProfileSwitchFromHistory(System.currentTimeMillis());
if (profileSwitch != null) {
profileSwitch = new ProfileSwitch();
profileSwitch.date = System.currentTimeMillis();
profileSwitch.source = Source.USER;
profileSwitch.profileName = getInstance().getProfileName(System.currentTimeMillis(), false);
profileSwitch.profileJson = getInstance().getProfile().getData().toString();
profileSwitch.profilePlugin = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getClass().getName();
profileSwitch.durationInMinutes = duration;
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
profileSwitch.timeshift = timeshift;
profileSwitch.percentage = percentage;
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
} else {
log.error("No profile switch existing");
}
}
}

View file

@ -12,18 +12,17 @@ import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.utils.T;
/**
* Created by Rumen on 31.10.2018.
*/
public class DstHelperPlugin extends PluginBase implements ConstraintsInterface {
public static final int DISABLE_TIMEFRAME_HOURS = -3;
public static final int WARN_PRIOR_TIMEFRAME_HOURS = 24;
private static Logger log = LoggerFactory.getLogger(L.CONSTRAINTS);
private int minutesToChange = 0;
static DstHelperPlugin plugin = null;
@ -43,83 +42,53 @@ public class DstHelperPlugin extends PluginBase implements ConstraintsInterface
);
}
public int dstTest(Calendar c) throws Exception {
// c = Calendar.getInstance(TimeZone.getDefault());
// c = Calendar.getInstance(TimeZone.getTimeZone("Australia/Lord_Howe"));
// c.setTimeInMillis(DateUtil.fromISODateString("2018-10-07T01:00:00Z").getTime());
long zoneOffset = c.get(Calendar.ZONE_OFFSET);
long d1 = c.getTimeInMillis() - zoneOffset;
c.setTimeInMillis(d1);
int offset1 = c.get(Calendar.DST_OFFSET);
c.add(Calendar.DATE, 1);
long d2 = c.getTimeInMillis();
int diffInHours = (int) ((d1 - d2) / -T.hours(1).msecs());
long offsetDetectedTime = 0;
// comparing millis because change can be < 1 hour
// log.debug("Starting from: "+startTimeString + " to "+endTimeString);
// log.debug("start "+offset1+" end "+c.get(Calendar.DST_OFFSET));
if (offset1 != c.get(Calendar.DST_OFFSET)) {
//we have a time change in next 24 hours, but when exactly
// log.debug("Daylight saving time detected between " + startTimeString + " and " + endTimeString);
// log.debug("Diff in hours is: "+diffInHours);
c.setTimeInMillis(d1 - zoneOffset);
offset1 = c.get(Calendar.DST_OFFSET);
for (int i = 0; i <= diffInHours * 4; i++) {
if (offset1 != c.get(Calendar.DST_OFFSET)) {
log.debug("Detected offset in " + ((i / 4) - zoneOffset / T.hours(1).msecs()) + " hours value is " + (offset1 - c.get(Calendar.DST_OFFSET)) / T.mins(1).msecs() + " minutes");
offsetDetectedTime = c.getTimeInMillis() - d1;
break;
}
c.add(Calendar.MINUTE, 15);
}
}
int minutesLeft = (int) ((offsetDetectedTime / T.mins(1).msecs()));
/*log.debug("zoneoffset(minutes):"+zoneOffset/T.mins(1).msecs());
log.debug("Start offset: "+offset1/T.mins(1).msecs());
log.debug("End offset :" + c.get(Calendar.DST_OFFSET)/T.mins(1).msecs());
log.debug("Now is:"+startTimeString);
log.debug("Detected in(min): "+(offsetDetectedTime/T.mins(1).msecs()));
log.debug("Returning value of: " + minutesLeft); */
minutesToChange = minutesLeft;
return minutesLeft;
public static boolean wasDST(Calendar now) {
Calendar ago = (Calendar) now.clone();
ago.add(Calendar.HOUR, DISABLE_TIMEFRAME_HOURS);
return now.get(Calendar.DST_OFFSET) != ago.get(Calendar.DST_OFFSET);
}
//Return false if time to DST change is less than 91 and positive
public static boolean willBeDST(Calendar now) {
Calendar ago = (Calendar) now.clone();
ago.add(Calendar.HOUR, WARN_PRIOR_TIMEFRAME_HOURS);
return now.get(Calendar.DST_OFFSET) != ago.get(Calendar.DST_OFFSET);
}
//Return false if time to DST change happened in the last 3 hours.
@Override
public Constraint<Boolean> isLoopInvocationAllowed(Constraint<Boolean> value) {
try {
this.dstTest(Calendar.getInstance());
} catch (Exception e) {
e.printStackTrace();
}
if (this.minutesToChange <= 90 && minutesToChange > 0 && value.value()) {
try {
LoopPlugin loopPlugin = LoopPlugin.getPlugin();
if (loopPlugin.suspendedTo() == 0L) {
// loopPlugin.suspendTo(System.currentTimeMillis() + minutesToChange * T.mins(1).msecs());
warnUser(Notification.DST_LOOP_DISABLED, MainApp.gs(R.string.dst_loop_disabled_warning));
} else
log.debug("Loop already suspended");
} catch (Exception e) {
e.printStackTrace();
}
value.set(false, "DST in 90 minutes or less", this);
} else if (minutesToChange <= 24 * T.hours(1).mins() && minutesToChange > 0) {
PumpInterface pump = ConfigBuilderPlugin.getPlugin().getActivePump();
if (pump == null || pump.canHandleDST()) {
log.debug("Pump can handle DST");
return value;
}
Calendar cal = Calendar.getInstance();
if (willBeDST(cal)) {
warnUser(Notification.DST_IN_24H, MainApp.gs(R.string.dst_in_24h_warning));
}
if (!value.value()) {
log.debug("Already not allowed - don't check further");
return value;
}
if (wasDST(cal)) {
LoopPlugin loopPlugin = LoopPlugin.getPlugin();
if (!loopPlugin.isSuspended()) {
warnUser(Notification.DST_LOOP_DISABLED, MainApp.gs(R.string.dst_loop_disabled_warning));
} else {
log.debug("Loop already suspended");
}
value.set(false, "DST in last 3 hours.", this);
}
return value;
}
// display warning
void warnUser(int id, String warningText) {
private void warnUser(int id, String warningText) {
Notification notification = new Notification(id, warningText, Notification.LOW);
MainApp.bus().post(new EventNewNotification(notification));
}
}

View file

@ -120,6 +120,7 @@ public class ObjectivesFragment extends SubscriberFragment {
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Objective objective = ObjectivesPlugin.getPlugin().getObjectives().get(position);
holder.title.setText(MainApp.gs(R.string.nth_objective, position + 1));
holder.revert.setVisibility(View.INVISIBLE);
if (objective.getObjective() != 0) {
holder.objective.setVisibility(View.VISIBLE);
holder.objective.setText(MainApp.gs(objective.getObjective()));
@ -145,6 +146,9 @@ public class ObjectivesFragment extends SubscriberFragment {
holder.verify.setVisibility(View.VISIBLE);
holder.verify.setEnabled(objective.isCompleted() || enableFake.isChecked());
holder.start.setVisibility(View.GONE);
if(objective.isRevertable()) {
holder.revert.setVisibility(View.VISIBLE);
}
holder.progress.setVisibility(View.VISIBLE);
holder.progress.removeAllViews();
for (Objective.Task task : objective.getTasks()) {
@ -169,8 +173,20 @@ public class ObjectivesFragment extends SubscriberFragment {
scrollToCurrentObjective();
startUpdateTimer();
});
holder.revert.setOnClickListener((view) -> {
objective.setAccomplishedOn(null);
objective.setStartedOn(null);
if (position > 0) {
Objective prevObj = ObjectivesPlugin.getPlugin().getObjectives().get(position - 1);
prevObj.setAccomplishedOn(null);
}
notifyDataSetChanged();
scrollToCurrentObjective();
});
}
@Override
public int getItemCount() {
return ObjectivesPlugin.getPlugin().getObjectives().size();
@ -185,6 +201,7 @@ public class ObjectivesFragment extends SubscriberFragment {
public LinearLayout progress;
public Button verify;
public Button start;
public Button revert;
public ViewHolder(View itemView) {
super(itemView);
@ -195,6 +212,7 @@ public class ObjectivesFragment extends SubscriberFragment {
progress = itemView.findViewById(R.id.objective_progress);
verify = itemView.findViewById(R.id.objective_verify);
start = itemView.findViewById(R.id.objective_start);
revert = itemView.findViewById(R.id.objective_back);
}
}
}

View file

@ -42,6 +42,10 @@ public abstract class Objective {
return true;
}
public boolean isRevertable() {
return false;
}
public boolean isAccomplished() {
return accomplishedOn != null;
}

View file

@ -25,4 +25,9 @@ public class Objective4 extends Objective {
}
});
}
@Override
public boolean isRevertable() {
return true;
}
}

View file

@ -0,0 +1,76 @@
package info.nightscout.androidaps.plugins.constraints.storage;
import android.os.Environment;
import android.os.StatFs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
/**
* Created by Rumen on 06.03.2019.
*/
public class StorageConstraintPlugin extends PluginBase implements ConstraintsInterface {
private static Logger log = LoggerFactory.getLogger(L.CONSTRAINTS);
static StorageConstraintPlugin plugin = null;
public static StorageConstraintPlugin getPlugin() {
if (plugin == null)
plugin = new StorageConstraintPlugin();
return plugin;
}
public StorageConstraintPlugin() {
super(new PluginDescription()
.mainType(PluginType.CONSTRAINTS)
.neverVisible(true)
.alwaysEnabled(true)
.showInList(false)
.pluginName(R.string.storage)
);
}
/**
* Constraints interface
**/
@Override
public Constraint<Boolean> isClosedLoopAllowed(Constraint<Boolean> value) {
long diskfree = getAvailableInternalMemorySize();
if (L.isEnabled(L.CONSTRAINTS))
log.debug("Internal storage free (Mb):" + diskfree);
if (diskfree < Constants.MINIMUM_FREE_SPACE) {
value.set(false, MainApp.gs(R.string.diskfull, Constants.MINIMUM_FREE_SPACE), this);
Notification notification = new Notification(Notification.DISKFULL, MainApp.gs(R.string.diskfull, Constants.MINIMUM_FREE_SPACE), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(notification));
} else {
MainApp.bus().post(new EventDismissNotification(Notification.DISKFULL));
}
return value;
}
public static long getAvailableInternalMemorySize() {
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSizeLong();
long blocksAvailable = stat.getAvailableBlocksLong();
int size = 1048576; // blocksize of 1 Mb
return ((blocksAvailable * blockSize) / size);
}
}

View file

@ -3,16 +3,23 @@ package info.nightscout.androidaps.plugins.general.actions;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.crashlytics.android.answers.CustomEvent;
import com.squareup.otto.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.activities.HistoryBrowseActivity;
import info.nightscout.androidaps.MainApp;
@ -25,19 +32,22 @@ import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.dialogs.FillDialog;
import info.nightscout.androidaps.plugins.general.actions.dialogs.NewExtendedBolusDialog;
import info.nightscout.androidaps.plugins.general.actions.dialogs.NewTempBasalDialog;
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment;
import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.SingleClickButton;
/**
* A simple {@link Fragment} subclass.
*/
@ -49,6 +59,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
return actionsPlugin;
}
View actionsFragmentView;
SingleClickButton profileSwitch;
SingleClickButton tempTarget;
SingleClickButton extendedBolus;
@ -59,6 +70,9 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
SingleClickButton tddStats;
SingleClickButton history;
private Map<String,CustomAction> pumpCustomActions = new HashMap<>();
private List<SingleClickButton> pumpCustomButtons = new ArrayList<>();
public ActionsFragment() {
super();
}
@ -90,6 +104,8 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
history.setOnClickListener(this);
tddStats.setOnClickListener(this);
actionsFragmentView = view;
updateGUI();
return view;
} catch (Exception e) {
@ -192,13 +208,87 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
else
tempTarget.setVisibility(View.VISIBLE);
if (!ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().supportsTDDs) tddStats.setVisibility(View.GONE);
else tddStats.setVisibility(View.VISIBLE);
if (!pump.getPumpDescription().supportsTDDs)
tddStats.setVisibility(View.GONE);
else
tddStats.setVisibility(View.VISIBLE);
checkPumpCustomActions();
}
});
}
View.OnClickListener pumpCustomActionsListener = v -> {
SingleClickButton btn = (SingleClickButton)v;
CustomAction customAction = this.pumpCustomActions.get(btn.getText().toString());
ConfigBuilderPlugin.getPlugin().getActivePump().executeCustomAction(customAction.getCustomActionType());
};
private void checkPumpCustomActions() {
PumpInterface activePump = ConfigBuilderPlugin.getPlugin().getActivePump();
removePumpCustomActions();
if (activePump == null) {
return;
}
List<CustomAction> customActions = activePump.getCustomActions();
if (customActions != null && customActions.size()>0) {
LinearLayout ll = actionsFragmentView.findViewById(R.id.action_buttons_layout);
for (CustomAction customAction : customActions) {
SingleClickButton btn = new SingleClickButton(getContext(), null, android.R.attr.buttonStyle);
btn.setText(MainApp.gs(customAction.getName()));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 0.5f);
layoutParams.setMargins(20, 8, 20, 8); // 10,3,10,3
btn.setLayoutParams(layoutParams);
btn.setOnClickListener(pumpCustomActionsListener);
Drawable top = getResources().getDrawable(customAction.getIconResourceId());
btn.setCompoundDrawablesWithIntrinsicBounds(null, top, null, null);
ll.addView(btn);
this.pumpCustomActions.put(MainApp.gs(customAction.getName()), customAction);
this.pumpCustomButtons.add(btn);
}
}
}
private void removePumpCustomActions() {
if (pumpCustomActions.size()==0)
return;
LinearLayout ll = actionsFragmentView.findViewById(R.id.action_buttons_layout);
for (SingleClickButton customButton : pumpCustomButtons) {
ll.removeView(customButton);
}
pumpCustomButtons.clear();
pumpCustomActions.clear();
}
@Override
public void onClick(View view) {
FragmentManager manager = getFragmentManager();

View file

@ -0,0 +1,47 @@
package info.nightscout.androidaps.plugins.general.actions.defs;
import info.nightscout.androidaps.R;
/**
* Created by andy on 9/20/18.
*/
public class CustomAction {
private int name;
private String iconName;
private CustomActionType customActionType;
private int iconResourceId;
public CustomAction(int nameResourceId, CustomActionType actionType) {
this.name = nameResourceId;
this.customActionType = actionType;
this.iconResourceId = R.drawable.icon_actions_profileswitch;
}
public CustomAction(int nameResourceId, CustomActionType actionType, int iconResourceId) {
this.name = nameResourceId;
this.customActionType = actionType;
this.iconResourceId = iconResourceId;
}
public int getName() {
return name;
}
public CustomActionType getCustomActionType() {
return customActionType;
}
public int getIconResourceId() {
return iconResourceId;
}
}

View file

@ -0,0 +1,11 @@
package info.nightscout.androidaps.plugins.general.actions.defs;
/**
* Created by andy on 9/20/18.
*/
public interface CustomActionType {
String getKey();
}

View file

@ -229,8 +229,8 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli
double sageWarn = nsSettings.getExtendedWarnValue("sage", "warn", 164);
handleAge(sage, CareportalEvent.SENSORCHANGE, sageWarn, sageUrgent);
double pbageUrgent = nsSettings.getExtendedWarnValue("pgage", "urgent", 360);
double pbageWarn = nsSettings.getExtendedWarnValue("pgage", "warn", 240);
double pbageUrgent = nsSettings.getExtendedWarnValue("bage", "urgent", 360);
double pbageWarn = nsSettings.getExtendedWarnValue("bage", "warn", 240);
handleAge(pbage, CareportalEvent.PUMPBATTERYCHANGE, pbageWarn, pbageUrgent);
}
);

View file

@ -722,7 +722,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
public void createNSTreatment(JSONObject data) {
if (options.executeProfileSwitch) {
if (data.has("profile")) {
doProfileSwitch(profileStore, JsonHelper.safeGetString(data, "profile"), JsonHelper.safeGetInt(data, "duration"), JsonHelper.safeGetInt(data, "percentage"), JsonHelper.safeGetInt(data, "timeshift"));
ProfileFunctions.doProfileSwitch(profileStore, JsonHelper.safeGetString(data, "profile"), JsonHelper.safeGetInt(data, "duration"), JsonHelper.safeGetInt(data, "percentage"), JsonHelper.safeGetInt(data, "timeshift"));
}
} else if (options.executeTempTarget) {
final int duration = JsonHelper.safeGetInt(data, "duration");
@ -746,7 +746,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
}
} else {
if (JsonHelper.safeGetString(data, "eventType").equals(CareportalEvent.PROFILESWITCH)) {
ProfileSwitch profileSwitch = prepareProfileSwitch(
ProfileSwitch profileSwitch = ProfileFunctions.prepareProfileSwitch(
profileStore,
JsonHelper.safeGetString(data, "profile"),
JsonHelper.safeGetInt(data, "duration"),
@ -762,46 +762,6 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
}
}
public static ProfileSwitch prepareProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift, long date) {
ProfileSwitch profileSwitch = new ProfileSwitch();
profileSwitch.date = date;
profileSwitch.source = Source.USER;
profileSwitch.profileName = profileName;
profileSwitch.profileJson = profileStore.getSpecificProfile(profileName).getData().toString();
profileSwitch.profilePlugin = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getClass().getName();
profileSwitch.durationInMinutes = duration;
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
profileSwitch.timeshift = timeshift;
profileSwitch.percentage = percentage;
return profileSwitch;
}
public static void doProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift) {
ProfileSwitch profileSwitch = prepareProfileSwitch(profileStore, profileName, duration, percentage, timeshift, System.currentTimeMillis());
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
}
public static void doProfileSwitch(final int duration, final int percentage, final int timeshift) {
ProfileSwitch profileSwitch = TreatmentsPlugin.getPlugin().getProfileSwitchFromHistory(System.currentTimeMillis());
if (profileSwitch != null) {
profileSwitch = new ProfileSwitch();
profileSwitch.date = System.currentTimeMillis();
profileSwitch.source = Source.USER;
profileSwitch.profileName = ProfileFunctions.getInstance().getProfileName(System.currentTimeMillis(), false);
profileSwitch.profileJson = ProfileFunctions.getInstance().getProfile().getData().toString();
profileSwitch.profilePlugin = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getClass().getName();
profileSwitch.durationInMinutes = duration;
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
profileSwitch.timeshift = timeshift;
profileSwitch.percentage = percentage;
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch);
FabricPrivacy.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
} else {
log.error("No profile switch existing");
}
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
savedInstanceState.putString("notesEdit", notesEdit.getText().toString());

View file

@ -48,9 +48,7 @@ class NsClientReceiverDelegate {
bus.post(event);
context.registerReceiver(chargingStateReceiver,
new IntentFilter(Intent.ACTION_POWER_CONNECTED));
context.registerReceiver(chargingStateReceiver,
new IntentFilter(Intent.ACTION_POWER_DISCONNECTED));
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
EventChargingState eventChargingState = chargingStateReceiver.grabChargingState(context);
if (eventChargingState != null)
@ -97,7 +95,7 @@ class NsClientReceiverDelegate {
}
void processStateChange() {
boolean newAllowedState = allowedChargingState && allowedNetworkState;
boolean newAllowedState = allowedChargingState && allowedNetworkState;
if (newAllowedState != allowed) {
allowed = newAllowedState;
bus.post(new EventPreferenceChange(R.string.key_nsclientinternal_paused));
@ -109,7 +107,9 @@ class NsClientReceiverDelegate {
boolean newAllowedState = true;
if (!ev.isCharging && chargingOnly) newAllowedState = false;
if (!ev.isCharging && chargingOnly) {
newAllowedState = false;
}
return newAllowedState;
}

View file

@ -51,17 +51,16 @@ import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.events.EventFeatureRunning;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.BolusWizard;
@ -165,18 +164,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
}
@Subscribe
public void onStatusEvent(final EventNewBG e) {
Activity activity = getActivity();
if (activity != null)
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
calculateInsulin();
}
});
}
@Subscribe
public void onStatusEvent(final EventAutosensCalculationFinished e) {
Activity activity = getActivity();

View file

@ -73,6 +73,7 @@ public class Notification {
public static final int INSIGHT_TIMEOUT_DURING_HANDSHAKE = 48;
public static final int DST_LOOP_DISABLED = 49;
public static final int DST_IN_24H = 50;
public static final int DISKFULL = 51;
public int id;

View file

@ -27,7 +27,6 @@ import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshOverview;
@ -39,6 +38,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DecimalFormatter;
@ -283,7 +283,7 @@ public class PersistentNotificationPlugin extends PluginBase {
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
triggerNotificationUpdate();
}

View file

@ -0,0 +1,59 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.utils.DateUtil;
class AuthRequest {
private static Logger log = LoggerFactory.getLogger(L.SMS);
Sms requester;
String confirmCode;
private Runnable action;
private long date;
private boolean processed;
private SmsCommunicatorPlugin plugin;
AuthRequest(SmsCommunicatorPlugin plugin, Sms requester, String requestText, String confirmCode, SmsAction action) {
this.requester = requester;
this.confirmCode = confirmCode;
this.action = action;
this.plugin = plugin;
this.date = DateUtil.now();
plugin.sendSMS(new Sms(requester.phoneNumber, requestText));
}
void action(String codeReceived) {
if (processed) {
if (L.isEnabled(L.SMS))
log.debug("Already processed");
return;
}
if (!confirmCode.equals(codeReceived)) {
processed = true;
if (L.isEnabled(L.SMS))
log.debug("Wrong code");
plugin.sendSMS(new Sms(requester.phoneNumber, R.string.sms_wrongcode));
return;
}
if (DateUtil.now() - date < Constants.SMS_CONFIRM_TIMEOUT) {
processed = true;
if (L.isEnabled(L.SMS))
log.debug("Processing confirmed SMS: " + requester.text);
if (action != null)
action.run();
return;
}
if (L.isEnabled(L.SMS))
log.debug("Timed out SMS: " + requester.text);
}
}

View file

@ -0,0 +1,42 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
import android.telephony.SmsMessage;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.utils.DateUtil;
class Sms {
String phoneNumber;
String text;
long date;
boolean received = false;
boolean sent = false;
boolean processed = false;
boolean ignored = false;
Sms(SmsMessage message) {
phoneNumber = message.getOriginatingAddress();
text = message.getMessageBody();
date = message.getTimestampMillis();
received = true;
}
Sms(String phoneNumber, String text) {
this.phoneNumber = phoneNumber;
this.text = text;
this.date = DateUtil.now();
sent = true;
}
Sms(String phoneNumber, int textId) {
this.phoneNumber = phoneNumber;
this.text = MainApp.gs(textId);
this.date = DateUtil.now();
sent = true;
}
public String toString() {
return "SMS from " + phoneNumber + ": " + text;
}
}

View file

@ -0,0 +1,33 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
abstract class SmsAction implements Runnable {
Double aDouble;
Integer anInteger;
Integer secondInteger;
String aString;
SmsAction() {}
SmsAction(Double aDouble) {
this.aDouble = aDouble;
}
SmsAction(Double aDouble, Integer secondInteger) {
this.aDouble = aDouble;
this.secondInteger = secondInteger;
}
SmsAction(String aString, Integer secondInteger) {
this.aString = aString;
this.secondInteger = secondInteger;
}
SmsAction(Integer anInteger) {
this.anInteger = anInteger;
}
SmsAction(Integer anInteger, Integer secondInteger) {
this.anInteger = anInteger;
this.secondInteger = secondInteger;
}
}

View file

@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.general.smsCommunicator;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
@ -12,9 +11,6 @@ import android.widget.TextView;
import com.squareup.otto.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collections;
import java.util.Comparator;
@ -22,14 +18,8 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
/**
* A simple {@link Fragment} subclass.
*/
public class SmsCommunicatorFragment extends SubscriberFragment {
private static Logger log = LoggerFactory.getLogger(SmsCommunicatorFragment.class);
TextView logView;
public SmsCommunicatorFragment() {
@ -39,18 +29,11 @@ public class SmsCommunicatorFragment extends SubscriberFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
try {
View view = inflater.inflate(R.layout.smscommunicator_fragment, container, false);
View view = inflater.inflate(R.layout.smscommunicator_fragment, container, false);
logView = (TextView) view.findViewById(R.id.smscommunicator_log);
logView = (TextView) view.findViewById(R.id.smscommunicator_log);
updateGUI();
return view;
} catch (Exception e) {
FabricPrivacy.logException(e);
}
return null;
return view;
}
@Subscribe
@ -58,35 +41,33 @@ public class SmsCommunicatorFragment extends SubscriberFragment {
updateGUI();
}
@Override
protected void updateGUI() {
Activity activity = getActivity();
if (activity != null)
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
class CustomComparator implements Comparator<SmsCommunicatorPlugin.Sms> {
public int compare(SmsCommunicatorPlugin.Sms object1, SmsCommunicatorPlugin.Sms object2) {
return (int) (object1.date - object2.date);
}
activity.runOnUiThread(() -> {
class CustomComparator implements Comparator<Sms> {
public int compare(Sms object1, Sms object2) {
return (int) (object1.date - object2.date);
}
Collections.sort(SmsCommunicatorPlugin.getPlugin().messages, new CustomComparator());
int messagesToShow = 40;
int start = Math.max(0, SmsCommunicatorPlugin.getPlugin().messages.size() - messagesToShow);
String logText = "";
for (int x = start; x < SmsCommunicatorPlugin.getPlugin().messages.size(); x++) {
SmsCommunicatorPlugin.Sms sms = SmsCommunicatorPlugin.getPlugin().messages.get(x);
if (sms.received) {
logText += DateUtil.timeString(sms.date) + " &lt;&lt;&lt; " + (sms.processed ? "" : "") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
} else if (sms.sent) {
logText += DateUtil.timeString(sms.date) + " &gt;&gt;&gt; " + (sms.processed ? "" : "") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
}
}
logView.setText(Html.fromHtml(logText));
}
Collections.sort(SmsCommunicatorPlugin.getPlugin().messages, new CustomComparator());
int messagesToShow = 40;
int start = Math.max(0, SmsCommunicatorPlugin.getPlugin().messages.size() - messagesToShow);
String logText = "";
for (int x = start; x < SmsCommunicatorPlugin.getPlugin().messages.size(); x++) {
Sms sms = SmsCommunicatorPlugin.getPlugin().messages.get(x);
if (sms.ignored) {
logText += DateUtil.timeString(sms.date) + " &lt;&lt;&lt; " + "" + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
} else if (sms.received) {
logText += DateUtil.timeString(sms.date) + " &lt;&lt;&lt; " + (sms.processed ? "" : "") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
} else if (sms.sent) {
logText += DateUtil.timeString(sms.date) + " &gt;&gt;&gt; " + (sms.processed ? "" : "") + sms.phoneNumber + " <b>" + sms.text + "</b><br>";
}
}
logView.setText(Html.fromHtml(logText));
});
}
}

View file

@ -693,7 +693,7 @@ public class ActionStringHandler {
//send profile to pumpe
new NewNSTreatmentDialog(); //init
NewNSTreatmentDialog.doProfileSwitch(0, percentage, timeshift);
ProfileFunctions.doProfileSwitch(0, percentage, timeshift);
}
private static void generateTempTarget(int duration, double low, double high) {

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.general.wear;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.squareup.otto.Subscribe;
@ -9,7 +10,6 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventBolusRequested;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventNewBasalProfile;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshOverview;
@ -23,6 +23,7 @@ import info.nightscout.androidaps.plugins.aps.openAPSMA.events.EventOpenAPSUpdat
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusprogressIfRunning;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.utils.SP;
/**
@ -35,6 +36,8 @@ public class WearPlugin extends PluginBase {
private final Context ctx;
private static WearPlugin wearPlugin;
private static String TAG = "WearPlugin";
public static WearPlugin getPlugin() {
return wearPlugin;
@ -76,7 +79,10 @@ public class WearPlugin extends PluginBase {
}
private void sendDataToWatch(boolean status, boolean basals, boolean bgValue) {
if (isEnabled(getType())) { //only start service when this plugin is enabled
//Log.d(TAG, "WR: WearPlugin:sendDataToWatch (status=" + status + ",basals=" + basals + ",bgValue=" + bgValue + ")");
if (isEnabled(getType())) { // only start service when this plugin is enabled
if (bgValue) {
ctx.startService(new Intent(ctx, WatchUpdaterService.class));
@ -93,15 +99,20 @@ public class WearPlugin extends PluginBase {
}
void resendDataToWatch() {
//Log.d(TAG, "WR: WearPlugin:resendDataToWatch");
ctx.startService(new Intent(ctx, WatchUpdaterService.class).setAction(WatchUpdaterService.ACTION_RESEND));
}
void openSettings() {
//Log.d(TAG, "WR: WearPlugin:openSettings");
ctx.startService(new Intent(ctx, WatchUpdaterService.class).setAction(WatchUpdaterService.ACTION_OPEN_SETTINGS));
}
void requestNotificationCancel(String actionstring) {
Intent intent = new Intent(ctx, WatchUpdaterService.class).setAction(WatchUpdaterService.ACTION_CANCEL_NOTIFICATION);
//Log.d(TAG, "WR: WearPlugin:requestNotificationCancel");
Intent intent = new Intent(ctx, WatchUpdaterService.class)
.setAction(WatchUpdaterService.ACTION_CANCEL_NOTIFICATION);
intent.putExtra("actionstring", actionstring);
ctx.startService(intent);
}
@ -136,7 +147,7 @@ public class WearPlugin extends PluginBase {
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
sendDataToWatch(true, true, true);
}

View file

@ -13,40 +13,127 @@ import com.google.android.gms.wearable.PutDataRequest;
import com.google.android.gms.wearable.Wearable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
/**
* Created by emmablack on 12/26/14.
*/
class SendToDataLayerThread extends AsyncTask<DataMap,Void,Void> {
private GoogleApiClient googleApiClient;
private static final String TAG = "SendDataThread";
String path;
private static final String TAG = "SendToDataLayerThread";
private String path;
private String logPrefix = ""; // "WR: ";
private static int concurrency = 0;
private static int state = 0;
private static final ReentrantLock lock = new ReentrantLock();
private static long lastlock = 0;
private static final boolean testlockup = false; // always false in production
SendToDataLayerThread(String path, GoogleApiClient pGoogleApiClient) {
// Log.d(TAG, logPrefix + "SendToDataLayerThread: " + path);
this.path = path;
googleApiClient = pGoogleApiClient;
}
@Override
protected void onPreExecute() {
concurrency++;
if ((concurrency > 12) || ((concurrency > 3 && (lastlock != 0) && (tsl() - lastlock) > 300000))) {
// error if 9 concurrent threads or lock held for >5 minutes with concurrency of 4
final String err = "Wear Integration deadlock detected!! " + ((lastlock != 0) ? "locked" : "") + " state:"
+ state + " @" + hourMinuteString(tsl());
// Home.toaststaticnext(err);
Log.e(TAG, logPrefix + err);
}
if (concurrency < 0)
Log.d(TAG, logPrefix + "Wear Integration impossible concurrency!!");
Log.d(TAG, logPrefix + "SendDataToLayerThread pre-execute concurrency: " + concurrency);
}
@Override
protected Void doInBackground(DataMap... params) {
try {
final NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes(googleApiClient).await(15, TimeUnit.SECONDS);
for (Node node : nodes.getNodes()) {
for (DataMap dataMap : params) {
PutDataMapRequest putDMR = PutDataMapRequest.create(path);
putDMR.getDataMap().putAll(dataMap);
PutDataRequest request = putDMR.asPutDataRequest();
DataApi.DataItemResult result = Wearable.DataApi.putDataItem(googleApiClient, request).await(15, TimeUnit.SECONDS);
if (result.getStatus().isSuccess()) {
Log.d(TAG, "DataMap: " + dataMap + " sent to: " + node.getDisplayName());
} else {
Log.d(TAG, "ERROR: failed to send DataMap");
}
}
if (testlockup) {
try {
Log.e(TAG, logPrefix + "WARNING RUNNING TEST LOCK UP CODE - NEVER FOR PRODUCTION");
Thread.sleep(1000000); // DEEEBBUUGGGG
} catch (Exception e) {
}
} catch (Exception e) {
Log.e(TAG, "Got exception sending data to wear: " + e.toString());
}
sendToWear(params);
concurrency--;
Log.d(TAG, logPrefix + "SendDataToLayerThread post-execute concurrency: " + concurrency);
return null;
}
// Debug function to expose where it might be locking up
private synchronized void sendToWear(final DataMap... params) {
if (!lock.tryLock()) {
Log.d(TAG, logPrefix + "Concurrent access - waiting for thread unlock");
lock.lock(); // enforce single threading
Log.d(TAG, logPrefix + "Thread unlocked - proceeding");
}
lastlock = tsl();
try {
if (state != 0) {
Log.e(TAG, logPrefix + "WEAR STATE ERROR: state=" + state);
}
state = 1;
final NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes(googleApiClient).await(15,
TimeUnit.SECONDS);
Log.d(TAG, logPrefix + "Nodes: " + nodes);
state = 2;
for (Node node : nodes.getNodes()) {
state = 3;
for (DataMap dataMap : params) {
state = 4;
PutDataMapRequest putDMR = PutDataMapRequest.create(path);
state = 5;
putDMR.getDataMap().putAll(dataMap);
putDMR.setUrgent();
state = 6;
PutDataRequest request = putDMR.asPutDataRequest();
state = 7;
DataApi.DataItemResult result = Wearable.DataApi.putDataItem(googleApiClient, request).await(15,
TimeUnit.SECONDS);
state = 8;
if (result.getStatus().isSuccess()) {
Log.d(TAG, logPrefix + "DataMap: " + dataMap + " sent to: " + node.getDisplayName());
} else {
Log.e(TAG, logPrefix + "ERROR: failed to send DataMap");
result = Wearable.DataApi.putDataItem(googleApiClient, request).await(30, TimeUnit.SECONDS);
if (result.getStatus().isSuccess()) {
Log.d(TAG, logPrefix + "DataMap retry: " + dataMap + " sent to: " + node.getDisplayName());
} else {
Log.e(TAG, logPrefix + "ERROR on retry: failed to send DataMap: "
+ result.getStatus().toString());
}
}
state = 9;
}
}
state = 0;
} catch (Exception e) {
Log.e(TAG, logPrefix + "Got exception in sendToWear: " + e.toString());
} finally {
lastlock = 0;
lock.unlock();
}
}
private static long tsl() {
return System.currentTimeMillis();
}
private static String hourMinuteString(long timestamp) {
return android.text.format.DateFormat.format("kk:mm", timestamp).toString();
}
}

View file

@ -1,9 +1,17 @@
package info.nightscout.androidaps.plugins.general.wear.wearintegration;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.Handler;
@ -14,8 +22,11 @@ import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.wearable.CapabilityApi;
import com.google.android.gms.wearable.CapabilityInfo;
import com.google.android.gms.wearable.DataMap;
import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.Node;
import com.google.android.gms.wearable.PutDataMapRequest;
import com.google.android.gms.wearable.PutDataRequest;
import com.google.android.gms.wearable.Wearable;
@ -42,21 +53,24 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorP
import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus;
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
import info.nightscout.androidaps.plugins.general.wear.WearPlugin;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SafeParse;
import info.nightscout.androidaps.utils.ToastUtils;
public class WatchUpdaterService extends WearableListenerService implements
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
public class WatchUpdaterService extends WearableListenerService implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
public static final String ACTION_RESEND = WatchUpdaterService.class.getName().concat(".Resend");
public static final String ACTION_OPEN_SETTINGS = WatchUpdaterService.class.getName().concat(".OpenSettings");
public static final String ACTION_SEND_STATUS = WatchUpdaterService.class.getName().concat(".SendStatus");
@ -91,6 +105,17 @@ public class WatchUpdaterService extends WearableListenerService implements
private Handler handler;
// Phone
private static final String CAPABILITY_PHONE_APP = "phone_app_sync_bgs";
private static final String MESSAGE_PATH_PHONE = "/phone_message_path";
// Wear
private static final String CAPABILITY_WEAR_APP = "wear_app_sync_bgs";
private static final String MESSAGE_PATH_WEAR = "/wear_message_path";
private String mWearNodeId = null;
private String localnode = null;
private String logPrefix = ""; // "WR: "
@Override
public void onCreate() {
mPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
@ -112,24 +137,24 @@ public class WatchUpdaterService extends WearableListenerService implements
public void setSettings() {
wear_integration = WearPlugin.getPlugin().isEnabled(PluginType.GENERAL);
// Log.d(TAG, "WR: wear_integration=" + wear_integration);
if (wear_integration) {
googleApiConnect();
}
}
public void googleApiConnect() {
private void googleApiConnect() {
if (googleApiClient != null && (googleApiClient.isConnected() || googleApiClient.isConnecting())) {
googleApiClient.disconnect();
}
googleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Wearable.API)
.build();
googleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).addApi(Wearable.API).build();
Wearable.MessageApi.addListener(googleApiClient, this);
if (googleApiClient.isConnected()) {
Log.d("WatchUpdater", "API client is connected");
log.debug(logPrefix + "API client is connected");
} else {
// Log.d("WatchUpdater", logPrefix + "API client is not connected and is trying to connect");
googleApiClient.connect();
}
}
@ -138,6 +163,8 @@ public class WatchUpdaterService extends WearableListenerService implements
public int onStartCommand(Intent intent, int flags, int startId) {
String action = intent != null ? intent.getAction() : null;
// Log.d(TAG, logPrefix + "onStartCommand: " + action);
if (wear_integration) {
handler.post(() -> {
if (googleApiClient.isConnected()) {
@ -177,13 +204,63 @@ public class WatchUpdaterService extends WearableListenerService implements
}
private void updateWearSyncBgsCapability(CapabilityInfo capabilityInfo) {
Log.d("WatchUpdaterService", logPrefix + "CabilityInfo: " + capabilityInfo);
Set<Node> connectedNodes = capabilityInfo.getNodes();
mWearNodeId = pickBestNodeId(connectedNodes);
}
private String pickBestNodeId(Set<Node> nodes) {
String bestNodeId = null;
// Find a nearby node or pick one arbitrarily
for (Node node : nodes) {
if (node.isNearby()) {
return node.getId();
}
bestNodeId = node.getId();
}
return bestNodeId;
}
@Override
public void onConnected(Bundle connectionHint) {
CapabilityApi.CapabilityListener capabilityListener = capabilityInfo -> {
updateWearSyncBgsCapability(capabilityInfo);
// Log.d(TAG, logPrefix + "onConnected onCapabilityChanged mWearNodeID:" + mWearNodeId);
// new CheckWearableConnected().execute();
};
Wearable.CapabilityApi.addCapabilityListener(googleApiClient, capabilityListener, CAPABILITY_WEAR_APP);
sendData();
}
@Override
public void onPeerConnected(com.google.android.gms.wearable.Node peer) {// KS
super.onPeerConnected(peer);
String id = peer.getId();
String name = peer.getDisplayName();
// Log.d(TAG, logPrefix + "onPeerConnected peer name & ID: " + name + "|" + id);
}
@Override
public void onPeerDisconnected(com.google.android.gms.wearable.Node peer) {// KS
super.onPeerDisconnected(peer);
String id = peer.getId();
String name = peer.getDisplayName();
// Log.d(TAG, logPrefix + "onPeerDisconnected peer name & ID: " + name + "|" + id);
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
}
@Override
public void onMessageReceived(MessageEvent event) {
// Log.d(TAG, logPrefix + "onMessageRecieved: " + event);
if (wear_integration) {
if (event != null && event.getPath().equals(WEARABLE_RESEND_PATH)) {
resendData();
@ -214,6 +291,7 @@ public class WatchUpdaterService extends WearableListenerService implements
private void sendData() {
BgReading lastBG = DatabaseHelper.lastBg();
// Log.d(TAG, logPrefix + "LastBg=" + lastBG);
if (lastBG != null) {
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
@ -228,18 +306,19 @@ public class WatchUpdaterService extends WearableListenerService implements
return;
}
new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).execute(dataMap);
executeTask(new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient), dataMap);
}
}
}
private DataMap dataMapSingleBG(BgReading lastBG, GlucoseStatus glucoseStatus) {
String units = ProfileFunctions.getInstance().getProfileUnits();
Double lowLine = SafeParse.stringToDouble(mPrefs.getString("low_mark", "0"));
Double highLine = SafeParse.stringToDouble(mPrefs.getString("high_mark", "0"));
//convert to mg/dl
// convert to mg/dl
if (!units.equals(Constants.MGDL)) {
lowLine *= Constants.MMOLL_TO_MGDL;
highLine *= Constants.MMOLL_TO_MGDL;
@ -287,7 +366,6 @@ public class WatchUpdaterService extends WearableListenerService implements
deltastring += "+";
} else {
deltastring += "-";
}
boolean detailed = SP.getBoolean("wear_detailed_delta", false);
@ -352,7 +430,7 @@ public class WatchUpdaterService extends WearableListenerService implements
}
}
entries.putDataMapArrayList("entries", dataMaps);
new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).execute(entries);
executeTask(new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient), entries);
}
sendPreferences();
sendBasals();
@ -501,7 +579,7 @@ public class WatchUpdaterService extends WearableListenerService implements
dm.putDataMapArrayList("boluses", boluses);
dm.putDataMapArrayList("predictions", predictions);
new SendToDataLayerThread(BASAL_DATA_PATH, googleApiClient).execute(dm);
executeTask(new SendToDataLayerThread(BASAL_DATA_PATH, googleApiClient), dm);
}
private DataMap tempDatamap(long startTime, double startBasal, long to, double toBasal, double amount) {
@ -548,6 +626,7 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMapRequest.getDataMap().putLong("timestamp", System.currentTimeMillis());
dataMapRequest.getDataMap().putString("openSettings", "openSettings");
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendNotification", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("OpenSettings", "No connection to wearable available!");
@ -563,6 +642,7 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMapRequest.getDataMap().putString("progressstatus", status);
dataMapRequest.getDataMap().putInt("progresspercent", progresspercent);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendBolusProgress", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("BolusProgress", "No connection to wearable available!");
@ -582,6 +662,7 @@ public class WatchUpdaterService extends WearableListenerService implements
log.debug("Requesting confirmation from wear: " + actionstring);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendActionConfirmationRequest", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("confirmationRequest", "No connection to wearable available!");
@ -601,6 +682,7 @@ public class WatchUpdaterService extends WearableListenerService implements
log.debug("Requesting confirmation from wear: " + actionstring);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendChangeConfirmationRequest", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("changeConfirmRequest", "No connection to wearable available!");
@ -618,9 +700,10 @@ public class WatchUpdaterService extends WearableListenerService implements
log.debug("Canceling notification on wear: " + actionstring);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendCancelNotificationRequest", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("cancelNotificationRequest", "No connection to wearable available!");
Log.e("cancelNotificationReq", "No connection to wearable available!");
}
}
@ -683,6 +766,7 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMapRequest.getDataMap().putBoolean("showBgi", mPrefs.getBoolean("wear_showbgi", false));
dataMapRequest.getDataMap().putInt("batteryLevel", (phoneBattery >= 30) ? 1 : 0);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendStatus", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("SendStatus", "No connection to wearable available!");
@ -699,12 +783,29 @@ public class WatchUpdaterService extends WearableListenerService implements
dataMapRequest.getDataMap().putLong("timestamp", System.currentTimeMillis());
dataMapRequest.getDataMap().putBoolean("wearcontrol", wearcontrol);
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
debugData("sendPreferences", putDataRequest);
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
} else {
Log.e("SendStatus", "No connection to wearable available!");
}
}
private void debugData(String source, Object data) {
// Log.d(TAG, "WR: " + source + " " + data);
}
private void executeTask(AsyncTask task, DataMap... parameters) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Object[])parameters);
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
// } else {
// task.execute();
// }
}
@NonNull
private String generateStatusString(Profile profile, String currentBasal, String iobSum, String iobDetail, String bgiString) {

View file

@ -17,7 +17,6 @@ import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventAppInitialized;
import info.nightscout.androidaps.events.EventConfigBuilderChange;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.events.EventTempBasalChange;
@ -26,10 +25,11 @@ import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DecimalFormatter;
@ -115,7 +115,7 @@ public class StatuslinePlugin extends PluginBase {
if (ConfigBuilderPlugin.getPlugin().getActivePump() == null)
return "";
LoopPlugin loopPlugin = LoopPlugin.getPlugin();
if (!loopPlugin.isEnabled(PluginType.LOOP)) {
@ -138,7 +138,7 @@ public class StatuslinePlugin extends PluginBase {
IobTotal bolusIob = treatmentsInterface.getLastCalculationTreatments().round();
treatmentsInterface.updateTotalIOBTempBasals();
IobTotal basalIob = treatmentsInterface.getLastCalculationTempBasals().round();
status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob)+"U";
status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U";
if (mPrefs.getBoolean("xdripstatus_detailediob", true)) {
@ -182,7 +182,7 @@ public class StatuslinePlugin extends PluginBase {
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
sendStatus();
}

View file

@ -65,8 +65,6 @@ public class IobCobCalculatorPlugin extends PluginBase {
private volatile List<BgReading> bgReadings = null; // newest at index 0
private volatile List<BgReading> bucketed_data = null;
private double dia = Constants.defaultDIA;
final Object dataLock = new Object();
boolean stopCalculationTrigger = false;
@ -118,11 +116,22 @@ public class IobCobCalculatorPlugin extends PluginBase {
return rounded;
}
void loadBgData(long now) {
long start = (long) (now - 60 * 60 * 1000L * (24 + dia));
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(start, now, false);
if (L.isEnabled(L.AUTOSENS))
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: " + DateUtil.dateAndTimeString(start) + " End date: " + DateUtil.dateAndTimeString(now));
void loadBgData(long to) {
Profile profile = ProfileFunctions.getInstance().getProfile(to);
double dia = Constants.defaultDIA;
if (profile != null) dia = profile.getDia();
long start = to - T.hours((long) (24 + dia)).msecs();
if (DateUtil.isCloseToNow(to)) {
// if close to now expect there can be some readings with time in close future (caused by wrong time setting)
// so read all records
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(start, false);
if (L.isEnabled(L.AUTOSENS))
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: " + DateUtil.dateAndTimeString(start));
} else {
bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime(start, to, false);
if (L.isEnabled(L.AUTOSENS))
log.debug("BG data loaded. Size: " + bgReadings.size() + " Start date: " + DateUtil.dateAndTimeString(start) + " End date: " + DateUtil.dateAndTimeString(to));
}
}
public boolean isAbout5minData() {
@ -608,10 +617,6 @@ public class IobCobCalculatorPlugin extends PluginBase {
}
if (ConfigBuilderPlugin.getPlugin() == null)
return; // app still initializing
Profile profile = ProfileFunctions.getInstance().getProfile();
if (profile == null)
return; // app still initializing
dia = profile.getDia();
if (ev == null) { // on init no need of reset
return;
}

View file

@ -41,6 +41,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.MidnightTime;
import info.nightscout.androidaps.utils.Profiler;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
import static info.nightscout.androidaps.utils.DateUtil.now;
import static java.util.Calendar.MINUTE;
@ -61,7 +62,7 @@ public class IobCobOref1Thread extends Thread {
private PowerManager.WakeLock mWakeLock;
public IobCobOref1Thread(IobCobCalculatorPlugin plugin, String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable, Event cause) {
IobCobOref1Thread(IobCobCalculatorPlugin plugin, String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable, Event cause) {
super();
this.iobCobCalculatorPlugin = plugin;
@ -72,13 +73,15 @@ public class IobCobOref1Thread extends Thread {
this.end = end;
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "iobCobThread");
if (powerManager != null)
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, MainApp.gs(R.string.app_name) + ":iobCobThread");
}
@Override
public final void run() {
long start = DateUtil.now();
mWakeLock.acquire();
if (mWakeLock != null)
mWakeLock.acquire(T.mins(10).msecs());
try {
if (L.isEnabled(L.AUTOSENS))
log.debug("AUTOSENSDATA thread started: " + from);
@ -173,7 +176,7 @@ public class IobCobOref1Thread extends Thread {
double bgi = -iob.activity * sens * 5;
double deviation = delta - bgi;
double avgDeviation = Math.round((avgDelta - bgi) * 1000) / 1000;
double avgDeviation = Math.round((avgDelta - bgi) * 1000) / 1000d;
double slopeFromMaxDeviation = 0;
double slopeFromMinDeviation = 999;
@ -395,7 +398,8 @@ public class IobCobOref1Thread extends Thread {
MainApp.bus().post(new EventAutosensCalculationFinished(cause));
}).start();
} finally {
mWakeLock.release();
if (mWakeLock != null)
mWakeLock.release();
MainApp.bus().post(new EventIobCalculationProgress(""));
if (L.isEnabled(L.AUTOSENS)) {
log.debug("AUTOSENSDATA thread ended: " + from);

View file

@ -41,6 +41,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.MidnightTime;
import info.nightscout.androidaps.utils.Profiler;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
import static info.nightscout.androidaps.utils.DateUtil.now;
@ -60,7 +61,7 @@ public class IobCobThread extends Thread {
private PowerManager.WakeLock mWakeLock;
public IobCobThread(IobCobCalculatorPlugin plugin, String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable, Event cause) {
IobCobThread(IobCobCalculatorPlugin plugin, String from, long end, boolean bgDataReload, boolean limitDataToOldestAvailable, Event cause) {
super();
this.iobCobCalculatorPlugin = plugin;
@ -71,13 +72,15 @@ public class IobCobThread extends Thread {
this.end = end;
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "iobCobThread");
if (powerManager != null)
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, MainApp.gs(R.string.app_name) + ":iobCobThread");
}
@Override
public final void run() {
long start = DateUtil.now();
mWakeLock.acquire();
if (mWakeLock != null)
mWakeLock.acquire(T.mins(10).msecs());
try {
if (L.isEnabled(L.AUTOSENS))
log.debug("AUTOSENSDATA thread started: " + from);
@ -172,7 +175,7 @@ public class IobCobThread extends Thread {
double bgi = -iob.activity * sens * 5;
double deviation = delta - bgi;
double avgDeviation = Math.round((avgDelta - bgi) * 1000) / 1000;
double avgDeviation = Math.round((avgDelta - bgi) * 1000) / 1000d;
double slopeFromMaxDeviation = 0;
double slopeFromMinDeviation = 999;
@ -321,7 +324,8 @@ public class IobCobThread extends Thread {
MainApp.bus().post(new EventAutosensCalculationFinished(cause));
}).start();
} finally {
mWakeLock.release();
if (mWakeLock != null)
mWakeLock.release();
MainApp.bus().post(new EventIobCalculationProgress(""));
if (L.isEnabled(L.AUTOSENS)) {
log.debug("AUTOSENSDATA thread ended: " + from);

View file

@ -22,7 +22,6 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.profile.ns.events.EventNSProfileUpdateGUI;
@ -157,7 +156,7 @@ public class NSProfileFragment extends SubscriberFragment {
Profile profile = store.getSpecificProfile(name);
if (profile != null) {
OKDialog.showConfirmation(getActivity(), MainApp.gs(R.string.activate_profile) + ": " + name + " ?", () ->
NewNSTreatmentDialog.doProfileSwitch(store, name, 0, 100, 0)
ProfileFunctions.doProfileSwitch(store, name, 0, 100, 0)
);
}
}

View file

@ -42,6 +42,8 @@ import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
@ -64,7 +66,6 @@ import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP;
/**
* Created by mike on 05.08.2016.
*/
@ -1379,4 +1380,20 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint
maxIob.setIfSmaller(0d, String.format(MainApp.gs(R.string.limitingmaxiob), 0d, MainApp.gs(R.string.unsafeusage)), this);
return maxIob;
}
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Override
public boolean canHandleDST() {
return false;
}
}

View file

@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.MainApp;
@ -27,6 +28,8 @@ import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -473,4 +476,24 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte
}
// TODO: daily total constraint
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Override
public boolean canHandleDST() {
return false;
}
}

View file

@ -16,6 +16,8 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -39,6 +41,8 @@ import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment;
import info.nightscout.androidaps.plugins.configBuilder.DetailedBolusInfoStorage;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -813,4 +817,19 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
return loadHistory(RecordTypes.RECORD_TYPE_DAILY);
}
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Override
public boolean canHandleDST() {
return false;
}
}

View file

@ -19,9 +19,11 @@ import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment;
import info.nightscout.androidaps.plugins.configBuilder.DetailedBolusInfoStorage;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.danaR.AbstractDanaRPlugin;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump;
import info.nightscout.androidaps.plugins.pump.danaR.comm.MsgBolusStartWithSpeed;

View file

@ -298,4 +298,4 @@ public class LocalInsightFragment extends SubscriberFragment implements View.OnC
statusItems.add(getStatusItem(label, MainApp.gs(R.string.eb_formatter, activeBolus.getRemainingAmount(), activeBolus.getInitialAmount(), activeBolus.getRemainingDuration())));
}
}
}
}

View file

@ -8,6 +8,10 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.*;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.*;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -69,12 +73,6 @@ import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history
import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events.StartOfTBREvent;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events.TotalDailyDoseEvent;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events.TubeFilledEvent;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.BRProfile1Block;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.BRProfileBlock;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.FactoryMinBolusAmountBlock;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.MaxBasalAmountBlock;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.MaxBolusAmountBlock;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.TBROverNotificationBlock;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.remote_control.CancelBolusMessage;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.remote_control.CancelTBRMessage;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.remote_control.ChangeTBRMessage;
@ -98,18 +96,6 @@ import info.nightscout.androidaps.plugins.pump.insight.connection_service.Insigh
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBasalRate;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveTBR;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertType;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.BasalProfileBlock;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.BatteryStatus;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.BolusType;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.CartridgeStatus;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.OperatingMode;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.PumpTime;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.TotalDailyDose;
import info.nightscout.androidaps.plugins.pump.insight.exceptions.InsightException;
import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_errors.AppLayerErrorException;
import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_errors.NoActiveTBRToCanceLException;
@ -152,6 +138,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
private final Object $bolusLock = new Object[0];
private int bolusID;
private boolean bolusCancelled;
private BasalProfile activeBasalProfile;
private List<BasalProfileBlock> profileBlocks;
private boolean limitsFetched;
private double maximumBolusAmount;
@ -345,6 +332,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
}
private void fetchBasalProfile() throws Exception {
activeBasalProfile = ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, ActiveBRProfileBlock.class).getActiveBasalProfile();
profileBlocks = ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, BRProfile1Block.class).getProfileBlocks();
}
@ -438,6 +426,10 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
profileBlocks.add(profileBlock);
}
try {
ActiveBRProfileBlock activeBRProfileBlock = new ActiveBRProfileBlock();
activeBRProfileBlock.setActiveBasalProfile(BasalProfile.PROFILE_1);
ParameterBlockUtil.writeConfigurationBlock(connectionService, activeBRProfileBlock);
activeBasalProfile = BasalProfile.PROFILE_1;
BRProfileBlock profileBlock = new BRProfile1Block();
profileBlock.setProfileBlocks(profileBlocks);
ParameterBlockUtil.writeConfigurationBlock(connectionService, profileBlock);
@ -475,6 +467,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
public boolean isThisProfileSet(Profile profile) {
if (!isInitialized() || profileBlocks == null) return true;
if (profile.getBasalValues().length != profileBlocks.size()) return false;
if (activeBasalProfile != BasalProfile.PROFILE_1) return false;
for (int i = 0; i < profileBlocks.size(); i++) {
BasalProfileBlock profileBlock = profileBlocks.get(i);
Profile.BasalValue basalValue = profile.getBasalValues()[i];
@ -1068,6 +1061,16 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
return new PumpEnactResult().success(true);
}
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
private void readHistory() {
try {
PumpTime pumpTime = connectionService.requestMessage(new GetDateTimeMessage()).await().getPumpTime();
@ -1566,4 +1569,9 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
Notification notification = new Notification(Notification.INSIGHT_TIMEOUT_DURING_HANDSHAKE, MainApp.gs(R.string.timeout_during_handshake), Notification.URGENT);
new Handler(Looper.getMainLooper()).post(() -> MainApp.bus().post(new EventNewNotification(notification)));
}
}
@Override
public boolean canHandleDST() {
return true;
}
}

View file

@ -5,6 +5,8 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -17,9 +19,12 @@ import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
/**
* Created by mike on 05.08.2016.
*/
@ -137,14 +142,10 @@ public class MDIPlugin extends PluginBase implements PumpInterface {
}
@Override
public double getReservoirLevel() {
return -1;
}
public double getReservoirLevel() { return -1; }
@Override
public int getBatteryLevel() {
return -1;
}
public int getBatteryLevel() { return -1; }
@Override
public PumpEnactResult deliverTreatment(DetailedBolusInfo detailedBolusInfo) {
@ -249,4 +250,19 @@ public class MDIPlugin extends PluginBase implements PumpInterface {
return deviceID();
}
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Override
public boolean canHandleDST() {
return true;
}
}

View file

@ -20,11 +20,14 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.FabricPrivacy;
public class VirtualPumpFragment extends SubscriberFragment {
private static Logger log = LoggerFactory.getLogger(VirtualPumpFragment.class);
@ -119,4 +122,6 @@ public class VirtualPumpFragment extends SubscriberFragment {
}
});
}
}

View file

@ -9,6 +9,8 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import info.nightscout.androidaps.BuildConfig;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
@ -27,6 +29,8 @@ import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
@ -37,6 +41,7 @@ import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP;
/**
* Created by mike on 05.08.2016.
*/
@ -140,6 +145,16 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
return new PumpEnactResult();
}
@Override
public List<CustomAction> getCustomActions() {
return null;
}
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Override
public boolean isInitialized() {
return true;
@ -440,6 +455,11 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
return pumpType;
}
@Override
public boolean canHandleDST() {
return true;
}
public void refreshConfiguration() {
String pumptype = SP.getString(R.string.key_virtualpump_type, "Generic AAPS");

View file

@ -21,10 +21,10 @@ import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.T;
@ -67,7 +67,7 @@ public class BGSourceFragment extends SubscriberFragment {
}
@Subscribe
public void onStatusEvent(final EventNewBG unused) {
public void onStatusEvent(final EventAutosensCalculationFinished unused) {
updateGUI();
}

View file

@ -28,12 +28,12 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Iob;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.treatments.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.treatments.dialogs.WizardInfoDialog;
@ -266,7 +266,7 @@ public class TreatmentsBolusFragment extends SubscriberFragment implements View.
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
updateGUI();
}

View file

@ -25,14 +25,14 @@ import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
public class TreatmentsExtendedBolusesFragment extends SubscriberFragment {
@ -186,7 +186,7 @@ public class TreatmentsExtendedBolusesFragment extends SubscriberFragment {
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
updateGUI();
}

View file

@ -25,16 +25,16 @@ import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
public class TreatmentsTemporaryBasalsFragment extends SubscriberFragment {
@ -212,7 +212,7 @@ public class TreatmentsTemporaryBasalsFragment extends SubscriberFragment {
}
@Subscribe
public void onStatusEvent(final EventNewBG ignored) {
public void onStatusEvent(final EventAutosensCalculationFinished ignored) {
updateGUI();
}

View file

@ -182,4 +182,9 @@ public class DateUtil {
public static long roundDateToSec(long date) {
return date - date % 1000;
}
public static boolean isCloseToNow(long date) {
long diff = Math.abs(date - now());
return diff < T.mins(2).msecs();
}
}

View file

@ -5,7 +5,7 @@ import android.util.LongSparseArray;
import java.util.Calendar;
public class MidnightTime {
private static LongSparseArray times = new LongSparseArray();
private static final LongSparseArray<Long> times = new LongSparseArray<>();
private static long hits = 0;
private static long misses = 0;
@ -20,20 +20,23 @@ public class MidnightTime {
}
public static long calc(long time) {
Long m = (Long) times.get(time);
if (m != null) {
++hits;
return m;
Long m;
synchronized (times) {
m = times.get(time);
if (m != null) {
++hits;
return m;
}
Calendar c = Calendar.getInstance();
c.setTimeInMillis(time);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
m = c.getTimeInMillis();
times.append(time, m);
++misses;
}
Calendar c = Calendar.getInstance();
c.setTimeInMillis(time);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
m = c.getTimeInMillis();
times.append(time, m);
++misses;
return m;
}

View file

@ -9,6 +9,7 @@
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/action_buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

View file

@ -65,6 +65,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/objectives_button_start" />
<Button
android:id="@+id/objective_back"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/objectives_button_back" />
</LinearLayout>
</android.support.v7.widget.CardView>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_code">Herinner R1</string>
<string name="alert_r2_code">Herinner R2</string>
<string name="alert_r3_code">Herinner R3</string>
<string name="alert_r4_code">Herinner R4</string>
<string name="alert_r7_code">Herinner R7</string>
<string name="alert_w31_code">Waarskuwing W31</string>
<string name="alert_w32_code">Waarskuwing W33</string>
<string name="alert_w33_code">Waarskuwing W33</string>
<string name="alert_w34_code">Waarskuwing W34</string>
<string name="alert_w36_code">Waarskuwing W36</string>
<string name="alert_w38_code">Waarskuwing W38</string>
<string name="alert_w39_code">Waarskuwing W39</string>
<string name="alert_m20_code">Onderhoud M20</string>
<string name="alert_m21_code">Onderhoud M21</string>
<string name="alert_m22_code">Onderhoud M22</string>
<string name="alert_m23_code">Onderhoud M23</string>
<string name="alert_m24_code">Onderhoud M24</string>
<string name="alert_m25_code">Onderhoud M25</string>
<string name="alert_m26_code">Onderhoud M26</string>
<string name="alert_m27_code">Onderhoud M27</string>
<string name="alert_m28_code">Onderhoud M28</string>
<string name="alert_m29_code">Onderhoud M29</string>
<string name="alert_m30_code">Onderhoud M30</string>
<string name="alert_e6_code">Fout E6</string>
<string name="alert_e10_code">Fout E10</string>
<string name="alert_e13_code">Fout E13</string>
</resources>

View file

@ -1,3 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r7_description"><![CDATA[Volume: <b>%1$d%%</b>\nDurasie: <b>%2$s h</b>]]></string>
<string name="alert_w31_description"><![CDATA[Stoor volume: <b>%1$s U</b>]]></string>
<string name="alert_w32_description">Verander battery.</string>
<string name="alert_w33_description">Stel tyd/datum.</string>
<string name="alert_w34_description">Kontak Accu-Chek ondersteuning.</string>
<string name="alert_w36_description"><![CDATA[Volume: <b>%1$d%%</b><br/>Durasie:<b>%2$s h</b>]]></string>
<string name="alert_w38_description"><![CDATA[Geprogrammeer: <b>%1$s U</b><br/>gelewer: <b>%2$s U</b>]]></string>
<string name="alert_m20_description">Voeg kasset.</string>
<string name="alert_m21_description">Verander kasset.</string>
<string name="alert_m22_description">Verander battery.</string>
<string name="alert_m23_description">Kontroleer pomp status.</string>
<string name="alert_m24_description">Verander infusie stel.</string>
<string name="alert_m25_description">Kontak Accu-Chek ondersteuning.</string>
<string name="alert_m26_description">Verander kasset.</string>
<string name="alert_m27_description">Herhaal data aflaai.</string>
<string name="alert_m28_description">Kontroleer pomp status.</string>
<string name="alert_m29_description">Stel battery tipe.</string>
<string name="alert_m30_description">Stel kasset tipe.</string>
<string name="alert_e6_description">Verander battery en kasset.</string>
<string name="alert_e10_description">Verander kasset.</string>
<string name="alert_e13_description">Verander taal.</string>
</resources>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_title">Lewer Bolus</string>
<string name="alert_r2_title">Bolus Gemis</string>
<string name="alert_r3_title">Wekker</string>
<string name="alert_r4_title">Verander infusie stel</string>
<string name="alert_r7_title">TBR voltooi</string>
<string name="alert_w31_title">Kasset laag</string>
<string name="alert_w32_title">Battery is amper leeg</string>
<string name="alert_w33_title">Ongeldige tyd/datum</string>
<string name="alert_w34_title">Einde van waarborg</string>
<string name="alert_w36_title">TBR gekanselleer</string>
<string name="alert_w38_title">Bolus gekanselleer</string>
<string name="alert_w39_title">Leentyd waarskuwing</string>
<string name="alert_m20_title">Kasset nie ingevoeg</string>
<string name="alert_m21_title">Kasset leeg</string>
<string name="alert_m22_title">Battery leeg</string>
<string name="alert_m23_title">Outomaties af -pomp gestaak</string>
<string name="alert_m24_title">Verstopping</string>
<string name="alert_m25_title">Leentyd oor - einde van werking</string>
<string name="alert_m26_title">Kasset verandering nie voltooi</string>
<string name="alert_m27_title">Data aflaai gefaal</string>
<string name="alert_m28_title">Wag modus verskrei</string>
<string name="alert_m29_title">Battery tipe nie gestel nie</string>
<string name="alert_m30_title">Kasset tipe nie gestel nie</string>
<string name="alert_e6_title">Meganiese fout</string>
<string name="alert_e10_title">Herlaai fout</string>
<string name="alert_e13_title">Taal fout</string>
</resources>

View file

@ -1,3 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="connection_failed">Verbinding het misluk</string>
<string name="connection_lost">Konneksie verloor</string>
<string name="pairing_rejected">Maat verwerp</string>
<string name="socket_creation_failed">Sok skepping gefaal</string>
<string name="timeout">Afsnytyd</string>
<string name="maximum_number_of_bolus_type_already_running">Maksimum bolus nr reeds gelaai</string>
<string name="no_active_tbr_to_cancel">Geen aktiewe TBR om te kanselleer</string>
<string name="no_active_tbr_to_change">Geen aktiewe TBR om te verander</string>
<string name="no_such_bolus_to_cancel">Geen sodanige bolus om te kanselleer</string>
<string name="pump_already_in_that_state_exception">Pomp reeds in daardie staat</string>
<string name="run_mode_not_allowed">Loop modus nie toegelaat</string>
</resources>

View file

@ -44,6 +44,8 @@
<string name="description_sensitivity_oref1">Sensitiwiteit word bereken uit 8h data in die verlede en koolhidrate (indien nie geabsorbeer) is na die tyd vermeld in voorkeure gesny. Plugin bereken ook UAM.</string>
<string name="description_sensitivity_weighted_average">Sensitiwiteit word bereken as \'n geweegde gemiddelde van dwalinge. Nuwer dwalinge het hoër gewig. Minimale karb absorpsie is bereken uit max karb absorpsie tyd vanaf voorkeure. Hierdie algoritme is die vinnigste om sensitiwiteit veranderinge te volg.</string>
<string name="description_source_dexcom_g5">Ontvang BG waardes vanaf die gelapte Dexcom G5 app.</string>
<string name="description_source_dexcom_g6">Ontvang BG waardes vanaf die gelapte Dexcom G6 toep.</string>
<string name="description_source_eversense">Ontvang BG waardes uit die gelapte Eversense toep.</string>
<string name="description_source_glimp">Ontvang BG waardes vanaf Glimp.</string>
<string name="description_source_mm640g">Onvang BG waardes vanaf die 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Laai BG data af vanaf Nightscout</string>
@ -263,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Om %1$.2fU bolus te lewer antwoord met kode %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Om kalibrasie %1$.2f te stuur antwoord met kode %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus het misluk</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU suksesvol afgelewer</string>
<string name="bolusrequested" formatted="false">Gaan %.2fU lewer</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU suksesvol afgelewer</string>
<string name="bolusdelivering" formatted="false">Lewering van %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Laat afstandbeheerde bevele toe via SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Afstandbeheerde bolus nie toegelaat nie</string>
<string name="glucosetype_finger">Vinger</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Per hand</string>
@ -336,16 +333,12 @@
<string name="smscommunicator_loopisenabled">Lus geaktiveer</string>
<string name="valuelimitedto">%1$.2f beperk tot %2$.2f</string>
<string name="valueoutofrange" formatted="false">Waarde %s is uit harde perke</string>
<string name="smscommunicator_remotebasalnotallowed">Afstanbheerde basale instelling word nie toegelaat nie</string>
<string name="smscommunicator_remotecommandnotallowed">Afstandbeheerde bevel word nie toegelaat nie</string>
<string name="smscommunicator_basalreplywithcode">Om %1$.2fU basale te aktiveer antwoord met kode %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Om lus op te skort vir %1$d minute antwoord met kode %2$s</string>
<string name="smscommunicator_tempbasalset">Temp basale %1$.2fU/h vir %2$d min suksesvol geaktiveerd</string>
<string name="smscommunicator_tempbasalfailed">Tydelike basale aktivering het gefaal</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Stop tydelike basale antwoord met kode %s</string>
<string name="smscommunicator_tempbasalcanceled">Tydelike basale gekanselleer</string>
<string name="smscommunicator_tempbasalcancelfailed">Kansellassie van tydelike basale het gefaal</string>
<string name="smscommunicator_unknowncommand">Onbekende opdrag of verkeerd antwoord</string>
<string name="quickwizard">SlimNutsman</string>
<string name="quickwizardsettings">SlimNutsman instellings</string>
<string name="overview_editquickwizard_buttontext">Knoppie teks:</string>
@ -408,6 +401,7 @@
<string name="array_of_elements">Matriks van %1$d elemente. \nWerklike waarde:</string>
<string name="openapsma_autosensdata_label">Autosens data</string>
<string name="openapsma_scriptdebugdata_label">Skrip foutopspoor</string>
<string name="openapsama_useautosens">Gebruik autosens kenmerk</string>
<string name="refresheventsfromnightscout">Verfris gebeure van NS</string>
<string name="deletefuturetreatments">Skrap behandelings in die toekoms</string>
<string name="eatingsoon">Eet binnekort</string>
@ -468,7 +462,6 @@
<string name="send_calibration" formatted="false">Stuur kalibrasie %.1f to xDrip?</string>
<string name="xdripnotinstalled">xDrip + nie geïnstalleerd nie</string>
<string name="calibrationsent">Kalibrasie gestuur na xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Afstandbeheerde bevel word nie toegelaat nie</string>
<string name="smscommunicator_calibrationsent">Kalibrasie gestuur. Ontvang moet geaktiveer word in xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip ontvang nie kalibrasies</string>
<string name="pumpsuspended">Pomp opgeskort</string>
@ -549,6 +542,12 @@
<string name="insulin_shortname">INS</string>
<string name="enablesuperbolus">Ontsper superbolus in Ghoeroe</string>
<string name="enablesuperbolus_summary">Ontsper superbolus funksionaliteit in Ghoeroe. Moenie aktiveer totdat jy leer wat dit werklik doen. DIT KAN \'n INSULIEN OORDOSIS VEROORSAAK AS BLINDELINGS GEBRUIK WORD!</string>
<string name="show_statuslights">Wys status vlae op tuisskerm</string>
<string name="show_statuslights_summary">Wys status vlae vir cage, iage, sage, stoor en battery vlak op tuisskerm.</string>
<string name="statuslights_res_warning">Drempel waarskuwings stoor vlak [U]</string>
<string name="statuslights_res_critical">Drempel kritieke stoor vlak [U]</string>
<string name="statuslights_bat_warning">Drempel waarskuwing battery vlak [%]</string>
<string name="statuslights_bat_critical">Drempel kritieke battery vlak [%]</string>
<string name="iob">IAB</string>
<string name="cob">KOB</string>
<string name="virtualpump_firmware_label">Firmware</string>
@ -703,7 +702,10 @@
<string name="btwatchdog_title">BT Watchdog</string>
<string name="btwatchdog_summary">Skakel asb die foon se bluetooth af vir een sekonde Indien geen verbinding met die pomp moontlik is nie. Dit mag help vir sommige selfone waar die bluetooth stapel vries.</string>
<string name="DexcomG5">DexcomG5 App (gelapte)</string>
<string name="DexcomG6">DexcomG6 App (gelapte)</string>
<string name="eversense">Eversense App (bygewerk)</string>
<string name="dexcomg5_nsupload_title">BG data oplaai na NS</string>
<string name="bgsource_upload">BG oplaai instellings</string>
<string name="wear_detailed_delta_title">Wys gedetailleerde delta</string>
<string name="wear_detailed_delta_summary">Wys delta met een meer desimale plek</string>
<string name="smbmaxminutes_summary">Maks minute van basale beperk SMB tot</string>
@ -769,6 +771,7 @@
<string name="combo_error_bolus_verification_failed">Lewering van die bolus en verifiëring van die pomp se geskiedenis het misluk, Kontroleer asseblief die pomp. As \'n bolus afgelewer is, sal dit bygevoeg word om behandelings gedurende die volgende verbinding met die pomp.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Nie genoeg insulien vir bolus oor in reserwe</string>
<string name="extendedbolusdeliveryerror">Verlengde bolus afleweringsfout</string>
<string name="insightpump_shortname">Sig</string>
<string name="insightpump">Insight Pomp</string>
<string name="status_no_colon">Status</string>
<string name="changed">Verander</string>
@ -843,6 +846,7 @@
<string name="data_choices">Data keuses</string>
<string name="fabric_upload">Fabric Upload</string>
<string name="allow_automated_crash_reporting">Laat outomatiese Foutverslagdoening en kenmerk data stuur na die ontwikkelaars via die fabric.io diens.</string>
<string name="g5appnotdetected">Hernuwe asseblief jou G5 toepassing na \'n ondersteunde weergawe</string>
<string name="start_activity_tt">Begin aktiwiteit TT</string>
<string name="start_eating_soon_tt">Begin eet gou TT</string>
<string name="temptargetshort">TT</string>
@ -1008,6 +1012,7 @@
<string name="nth_objective">%1$d. Doelwit</string>
<string name="poctech">Poctech</string>
<string name="description_source_poctech">Ontvang BG waardes van Poctech toepassing</string>
<string name="description_source_tomato">Ontvang BG waardes vanaf Tomato toep (MiaoMiao toestel)</string>
<string name="high_temptarget_raises_sensitivity_title">Hoë tydelike doelwitte verhoog sensitiwiteit</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Verhoog sensitiwiteit vir tydelike doelwitte > = 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Lae tydelike doelwitte verlaag sensitiwiteit</string>
@ -1050,10 +1055,83 @@
<string name="loop_openmode_min_change">Minimale versoek verandering [%]</string>
<string name="loop_openmode_min_change_summary">Lus sal opspring en nuwe verandering versoek slegs as verandering is groter as hierdie waarde. Verstek waarde is 20%</string>
<string name="pairfirst">Verbind asseblief jou pomp met jou selfoon!</string>
<string name="searching_for_devices">Soek vir toestelle…</string>
<string name="please_wait">Wag asseblief…</string>
<string name="pairing_completed">Maats voltooi</string>
<string name="code_compare">Stem die kodes gewys op hierdie toestel en op jou pomp saam?</string>
<string name="insight_pairing">Insight maatjies</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2fU / %2$.2fU gelewer</string>
<string name="insight_alert_formatter">%1$s:%2$s</string>
<string name="tube_changed">Pyp verander</string>
<string name="pump_time_updated">Pomp tyd opgedateer</string>
<string name="confirm">Bevestig</string>
<string name="mute_alert">Demp</string>
<string name="pump_alert">Pomp alarm</string>
<string name="log_site_changes">Log ligging veranderings</string>
<string name="log_tube_changes">Log voerpyp verandering</string>
<string name="log_battery_changes">Log battery verandering</string>
<string name="log_operating_mode_changes">Log bedryf modus veranderinge</string>
<string name="log_alerts">Log alarms</string>
<string name="enable_tbr_emulation">Skakel TBR emulasie aan</string>
<string name="enable_tbr_emulation_summary">Gebruik uitgebreide boluses in plaas van TBRs om die 250% perk te omseil</string>
<string name="disconnect_delay">Ontkoppel vertraging [s]</string>
<string name="serial_number">Reeksnommer</string>
<string name="release_software_version">Vrygestelde sagteware weergawe</string>
<string name="ui_processor_software_version">UI verwerker sagteware weergawe</string>
<string name="pc_processor_software_version">PC verwerker sagteware weergawe</string>
<string name="md_tel_processor_software_version">MD tel verwerker sagteware weergawe</string>
<string name="safety_processor_software_version">Veiligheid verwerker sagteware weergawe</string>
<string name="bt_info_page_version">BT info bladsy weergawe</string>
<string name="bluetooth_address">Bluetooth adres</string>
<string name="system_id_appendix">Stelsel ID Aanhangsel</string>
<string name="manufacturing_date">Vervaardigings datum</string>
<string name="delete_pairing">Verwyder maats</string>
<string name="pairing_information">Maat inligting</string>
<string name="refreh_status">Verfris status</string>
<string name="start_pump">Begin pomp</string>
<string name="stop_pump">Stop pomp</string>
<string name="operating_mode">Bedryf modus</string>
<string name="insight_status">Status</string>
<string name="tdd_bolus">TDD Bolus</string>
<string name="tdd_basal">TDD basale</string>
<string name="tdd_total">TDD totaal</string>
<string name="recovering">Herstel</string>
<string name="not_paired">Nie gemaat</string>
<string name="last_connected">Laaste verbind</string>
<string name="started">Begin</string>
<string name="stopped">Gestaak</string>
<string name="tbr_formatter">%1$d%% vir %2$d / %3$d min</string>
<string name="extended_bolus">Uitgebreide bolus</string>
<string name="multiwave_bolus">Multigolf bolus</string>
<string name="eb_formatter">%1$.2f / %2$.2f U vir %3$d min</string>
<string name="enable_tbr_over_notification">Skakel kennisgewing van TBR einde\n(pomp instelling)</string>
<string name="disable_tbr_over_notification">Deaktiveer kennisgewing van TBR einde\n(pomp instelling)</string>
<string name="refresh">Verfris</string>
<string name="description_pump_insight_local">Integrasie vir Accu-Chek Insight pompe</string>
<string name="not_inserted">Nie ingesteek</string>
<string name="short_status_last_connected">Laaste kon: %1$d min gelede</string>
<string name="short_status_tbr">TBR: %1$d%% vir %2$d / %3$d min</string>
<string name="short_status_extended">Verleng: %1$.2f / %2$.2f U vir %3$d min</string>
<string name="short_status_multiwave">Multigolf: %1$.2f / %2$.2f U vir %3$d min</string>
<string name="short_status_tdd">TDD: %1$.2f</string>
<string name="short_status_reservoir">Stoor.: %1$.2fU</string>
<string name="short_status_battery">Bat.: %1$d%%</string>
<string name="max_recovery_duration">Max. herstel duur [s]</string>
<string name="min_recovery_duration">Min. herstel duur [s]</string>
<string name="recovery_duration">Herstel duur</string>
<string name="timeout_during_handshake">Afsnytyd gedurende handskud - terugstel bluetooth</string>
<string name="profile_total">== ∑ %1$s U</string>
<string name="profile_ins_units_per_hout">U/h</string>
<string name="profile_carbs_per_unit">g/U</string>
<string name="profile_per_unit">/U</string>
<string name="dexcom_lognssensorchange_title">Log sensor verander na NS</string>
<string name="dexcom_lognssensorchange_summary">Skep geleentheid \"sensor verandering\" in NS automaties op sensor begin</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Daglig spaar tyd verandering in 24 h of minder</string>
<string name="storage">interne berging beperking</string>
<string name="diskfull">Bevry ten minste %1$d MB van intene stoorspasie! Lus gedeaktiveer!</string>
<plurals name="objective_days">
<item quantity="one">%1$d dae</item>
<item quantity="other">%1$d dae</item>

View file

@ -54,6 +54,7 @@
<string name="description_wear">Наблюдавайте и контролирайте AndroidAPS, от вашия WearOS часовник.</string>
<string name="description_xdrip_status_line">Покажи информация за вашия APS на xDrip + циферблат на часовник.</string>
<string name="description_sms_communicator">Дистанционно управление AndroidAPS чрез използване на SMS команди.</string>
<string name="objectives_button_back">Назад</string>
<string name="objectives_button_start">Стартирай</string>
<string name="objectives_button_verify">Провери</string>
<string name="nsprofileview_units_label">Единици</string>
@ -265,12 +266,7 @@
<string name="smscommunicator_bolusreplywithcode">За да доставите болус от %1$.2fЕ отговорете с код %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">За да изпратите калибрация %1$.2f отговорете с код %2$s</string>
<string name="smscommunicator_bolusfailed">Болус отказан</string>
<string name="bolusdelivered" formatted="false">Болус %.2fЕд беше подаден успешно</string>
<string name="bolusrequested" formatted="false">Подава болус %.2fЕ</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Болус от %.2fЕ подаден успешно</string>
<string name="bolusdelivering" formatted="false">Подава %.2fЕ</string>
<string name="smscommunicator_remotecommandsallowed">Позволи отдалечени команди чрез SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Отдалечено подаване на болус - забранено!</string>
<string name="glucosetype_finger">Пръст</string>
<string name="glucosetype_sensor">Сензор</string>
<string name="manual">Друго</string>
@ -338,16 +334,12 @@
<string name="smscommunicator_loopisenabled">APS е включен</string>
<string name="valuelimitedto">%1$.2f ограничен до %2$.2f</string>
<string name="valueoutofrange" formatted="false">Стойността %s е извън границите</string>
<string name="smscommunicator_remotebasalnotallowed">Отдалечено прилагане на базал е забранено</string>
<string name="smscommunicator_remotecommandnotallowed">Отдалеченото управление е забранено</string>
<string name="smscommunicator_basalreplywithcode">За да стартирате базал от %1$.2fЕ отговорете с код %2$s</string>
<string name="smscommunicator_suspendreplywithcode">За да спрете APS за %1$d минути отговорете с код %2$s</string>
<string name="smscommunicator_tempbasalset">Временен базал от %1$.2fЕ/ч за %2$d мин стартиран успешно</string>
<string name="smscommunicator_tempbasalfailed">Неуспешно стартиране на временен базал</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">За да спрете времен базал отговорете с код %s</string>
<string name="smscommunicator_tempbasalcanceled">Временният базал е отменен</string>
<string name="smscommunicator_tempbasalcancelfailed">Спирането на временния базал е неуспешно</string>
<string name="smscommunicator_unknowncommand">Непозната команда или грешен отговор</string>
<string name="quickwizard">Бърз болус</string>
<string name="quickwizardsettings">Настройки за бърз болус</string>
<string name="overview_editquickwizard_buttontext">Текст на бутона:</string>
@ -471,7 +463,6 @@
<string name="send_calibration" formatted="false">Изпрати калибрация %.1f към xDrip?</string>
<string name="xdripnotinstalled">xDrip+ не е инсталиран</string>
<string name="calibrationsent">Калибрацията е изпратена към xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Не е разрешена отдалечена калибрация</string>
<string name="smscommunicator_calibrationsent">Неуспешно. Получаването трябва да е разрешено в xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip не получава калибрации</string>
<string name="pumpsuspended">Помпата е спряна</string>
@ -1139,6 +1130,9 @@
<string name="dexcom_lognssensorchange_summary">Създаване на събитие \"Смяна на сеснзор\" в NS автоматично при старт на сензор</string>
<string name="tomato">Tomato(MяоМяо)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Смяна на времето след по-малко от 24ч</string>
<string name="storage">Ограничение поради липса на памет</string>
<string name="diskfull">Освободете поне %1$d Мб в паметта на телефона! Loop изключен!</string>
<plurals name="objective_days">
<item quantity="one">%1$d дeн</item>
<item quantity="other">%1$d дни</item>

View file

@ -54,6 +54,7 @@
<string name="description_wear">Zobrazování stavu a řízení AndroidAPS z hodinek s WearOS</string>
<string name="description_xdrip_status_line">Zobrazování informací o smyčce na xDrip+ watchface.</string>
<string name="description_sms_communicator">Vzdálené řízení pomocí SMS příkazů</string>
<string name="objectives_button_back">Zpět</string>
<string name="objectives_button_start">Začátek</string>
<string name="objectives_button_verify">Kontrola</string>
<string name="nsprofileview_units_label">Jednotky</string>
@ -265,12 +266,11 @@
<string name="smscommunicator_bolusreplywithcode">K potvrzení bolusu %1$.2fU odpověz SMS s kódem %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Odeslání kalibrace %1$.2f potvrďte kódem %2$s</string>
<string name="smscommunicator_bolusfailed">Chyba při aplikování bolusu</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU aplikován úspěšně</string>
<string name="bolusrequested" formatted="false">Spouštím dodávání %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU aplikován úspěšně</string>
<string name="bolusdelivering" formatted="false">Aplikováno %.2fU</string>
<string name="bolusdelivered">Bolus %1$.2fU aplikován úspěšně</string>
<string name="bolusrequested">Podávání %1$.2fU inzulínu</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU aplikován úspěšně</string>
<string name="bolusdelivering">Aplikováno %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Povolit posílání příkazů přes SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Vzdálený bolus není momentálně povolen</string>
<string name="glucosetype_finger">Glukoměr</string>
<string name="glucosetype_sensor">Senzor</string>
<string name="manual">Jiný</string>
@ -338,15 +338,24 @@
<string name="smscommunicator_loopisenabled">Smyčka je povolena</string>
<string name="valuelimitedto">%1$.2f omezeno na %2$.2f</string>
<string name="valueoutofrange" formatted="false">Hodnota %s je mimo přednastavený rozsah</string>
<string name="smscommunicator_remotebasalnotallowed">Vzdálené posílání příkazů není povoleno</string>
<string name="smscommunicator_remotecommandnotallowed">Vzdálený příkaz není povolen</string>
<string name="smscommunicator_basalreplywithcode">Na spuštění bazálu %1$.2fU/h odpověz SMS s kódem %2$s</string>
<string name="smscommunicator_remotebolusnotallowed">Vzdálený bolus není momentálně povolen. Zkuste to později.</string>
<string name="smscommunicator_basalreplywithcode">Pro spuštění bazálu %1$.2fU/h na %2$d min odpovězte SMS s kódem %3$s</string>
<string name="smscommunicator_profilereplywithcode">Pro přepnutí profilu na %1$s %2$d%% odpovězte SMS s kódem %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Pro spuštění prodlouženého bolusu %1$.2fU na %2$d min odpovězte SMS s kódem %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Pro spuštění bazálu %1$d%% na %2$d min odpovězte SMS s kódem %3$s</string>
<string name="smscommunicator_suspendreplywithcode">K pozastavení smyčky na %1$d minut odpověz SMS s kódem %2$s</string>
<string name="smscommunicator_tempbasalset">Dočasný bazál %1$.2fU/h na %2$d minut spuštěn</string>
<string name="smscommunicator_extendedset">Prodloužený bolus %1$.2fU na %2$d min úspěšně spuštěn</string>
<string name="smscommunicator_tempbasalset_percent">Dočasný bazál %1$d%% na %2$d minut úspěšně spuštěn</string>
<string name="smscommunicator_tempbasalfailed">Spuštění dočasného bazálu selhalo</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Na ukončení bazálu odpověz SMS s kódem %s</string>
<string name="smscommunicator_extendedfailed">Spuštění prodlouženého bolusu selhalo</string>
<string name="smscommunicator_basalstopreplywithcode">Na zastavení dočasného bazálu odpovězte SMS s kódem %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">Na zastavení prodlouženého bolusu odpovězte SMS s kódem %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Dočasný bazál zastaven</string>
<string name="smscommunicator_extendedcanceled">Prodloužený bolus zastaven</string>
<string name="smscommunicator_tempbasalcancelfailed">Rušení dočasného bazálu selhalo</string>
<string name="smscommunicator_extendedcancelfailed">Zastavení prodlouženého bolusu selhalo</string>
<string name="smscommunicator_unknowncommand">Neznámý příkaz nebo chybná odpověď</string>
<string name="quickwizard">Rychlý bolus</string>
<string name="quickwizardsettings">Nastavení rychlých bolusů</string>
@ -471,7 +480,6 @@
<string name="send_calibration" formatted="false">Poslat do xDripu kalibraci %.1f ?</string>
<string name="xdripnotinstalled">xDrip+ není nainstalován</string>
<string name="calibrationsent">Kalibrace odeslána do xDripu</string>
<string name="smscommunicator_remotecalibrationnotallowed">Vzdálené kalibrace nejsou povoleny</string>
<string name="smscommunicator_calibrationsent">Kalibrace odeslána. Příjem musí být v xDripu povolený.</string>
<string name="smscommunicator_calibrationfailed">xDrip nepřijímá kalibrace</string>
<string name="pumpsuspended">Pumpa pozastavena</string>
@ -1140,7 +1148,12 @@
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Změna letního času za méně než 24 hodin</string>
<string name="dst_loop_disabled_warning">Změna letního času za méně než 3 hodiny - Uzavřená smyčka zastavena</string>
<string name="storage">omezení vnitřního úložiště</string>
<string name="diskfull">Uvolněte alespoň %1$d MB z vnitřního úložiště! Smyčka zakázána!</string>
<string name="wrongformat">Chybný formát</string>
<string name="sms_wrongcode">Nesprávný kód. Příkaz zrušen.</string>
<string name="notconfigured">Není nakonfigurováno</string>
<string name="profileswitchcreated">Přepnutí profilu vytvořeno</string>
<plurals name="objective_days">
<item quantity="one">%1$d den</item>
<item quantity="few">%1$d dnů</item>

View file

@ -54,6 +54,7 @@
<string name="description_wear">Überwache und steuere AndroidAPS mit Deiner WearOS-Smartwatch.</string>
<string name="description_xdrip_status_line">Zeige Loop-Informationen auf Deinem xDrip+-Watchface.</string>
<string name="description_sms_communicator">Steuere AndroiAPS fern mittels SMS-Anweisungen.</string>
<string name="objectives_button_back">Zurück</string>
<string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Bestätigen</string>
<string name="nsprofileview_units_label">Einheiten</string>
@ -265,12 +266,7 @@
<string name="smscommunicator_bolusreplywithcode">Um einen Bolus von %1$.2f IE abzugeben, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_calibrationreplywithcode">Um die Kalibrierung %1$.2f zu senden, antworte mit dem Code %2$s.</string>
<string name="smscommunicator_bolusfailed">Bolus fehlgeschlagen</string>
<string name="bolusdelivered" formatted="false">%.2f IE Bolus erfolgreich abgegeben</string>
<string name="bolusrequested" formatted="false">Werde %.2f IE abgeben</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2f IE erfolgreich abgegeben</string>
<string name="bolusdelivering" formatted="false">Abgabe %1$.2f IE</string>
<string name="smscommunicator_remotecommandsallowed">Erlaube externe Befehle per SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Ferngesteuerter Bolus ist nicht erlaubt</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manuell</string>
@ -339,16 +335,12 @@ maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate</string>
<string name="smscommunicator_loopisenabled">Loop ist aktiviert.</string>
<string name="valuelimitedto">%1$.2f limitiert auf %2$.2f</string>
<string name="valueoutofrange" formatted="false">Wert %1$s ist außerhalb des festen Limits.</string>
<string name="smscommunicator_remotebasalnotallowed">Ferngesteuerte Basal-Einstellungen sind nicht erlaubt.</string>
<string name="smscommunicator_remotecommandnotallowed">Ferngesteuerte Befehle sind nicht erlaubt.</string>
<string name="smscommunicator_basalreplywithcode">Um eine BR mit %1$.2f IE/h zu starten, antworte mit dem Code %2$s.</string>
<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_tempbasalfailed">Das Starten der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Um die TBR abzubrechen, antworte mit dem Code %s.</string>
<string name="smscommunicator_tempbasalcanceled">TBR abgebrochen</string>
<string name="smscommunicator_tempbasalcancelfailed">Das Abbrechen der TBR ist fehlgeschlagen.</string>
<string name="smscommunicator_unknowncommand">Unbekannter Befehl oder falsche Antwort</string>
<string name="quickwizard">QuickWizard</string>
<string name="quickwizardsettings">QuickWizard-Einstellungen</string>
<string name="overview_editquickwizard_buttontext">Schaltflächen-Text:</string>
@ -472,7 +464,6 @@ maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate</string>
<string name="send_calibration" formatted="false">Kalibrierung %1$.1f an xDrip+ senden?</string>
<string name="xdripnotinstalled">xDrip+ nicht installiert</string>
<string name="calibrationsent">Kalibrierung an xDrip+ gesendet</string>
<string name="smscommunicator_remotecalibrationnotallowed">Fern-Kalibrierung ist nicht erlaubt.</string>
<string name="smscommunicator_calibrationsent">Kalibrierung gesendet. Das Empfangen von Kalbrierungen muss in xDrip+ aktiviert sein.</string>
<string name="smscommunicator_calibrationfailed">xDrip+ hat die Kalbrierung nicht erhalten</string>
<string name="pumpsuspended">Pumpe pausiert</string>
@ -1141,6 +1132,9 @@ Unerwartetes Verhalten.</string>
<string name="dexcom_lognssensorchange_summary">Ereignis \"Sensorwechsel\" bei Sensorstart automatisch in NS erstellen</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Zeitumstellung in weniger als 24 Stunden</string>
<string name="storage">interne Speicherbegrenzung</string>
<string name="diskfull">Mindestens %1$d MB freier interer Speicher benötigt! Loop abgeschaltet!</string>
<plurals name="objective_days">
<item quantity="one">%1$d Tag</item>
<item quantity="other">%1$d Tage</item>

View file

@ -263,12 +263,7 @@
<string name="smscommunicator_bolusreplywithcode">Για έγχυση bolus %1$.2fU στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Για αποστολή καλιμπραρίσματος %1$.2f στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_bolusfailed">Αποτυχία Bolus</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU παραδόθηκε επιτυχώς</string>
<string name="bolusrequested" formatted="false">Προς έγχυση %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU παραδόθηκε επιτυχώς</string>
<string name="bolusdelivering" formatted="false">Έγχυση %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Άδεια για απομακρυσμένες εντολές μέσω SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Δεν επιτρέπεται απομακρυσμένο bolus</string>
<string name="glucosetype_finger">Δάκτυλο</string>
<string name="glucosetype_sensor">Αισθητήρας</string>
<string name="manual">Χειροκίνητα</string>
@ -336,16 +331,12 @@
<string name="smscommunicator_loopisenabled">Κύκλωμα ενεργοποιημένο</string>
<string name="valuelimitedto">Το %1$.2f περιορίζεται σε %2$.2f</string>
<string name="valueoutofrange" formatted="false">Η τιμή %s είναι έξω από τα όρια</string>
<string name="smscommunicator_remotebasalnotallowed">Δεν επιτρέπεται η απομακρυσμένη ρύθμιση βασικού ρυθμού </string>
<string name="smscommunicator_remotecommandnotallowed">Δεν επιτρέπεται απομακρυσμένη εντολή</string>
<string name="smscommunicator_basalreplywithcode">Για έναρξη βασικού %1$.2fU/h στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Για αναστολή κυκλκώματος για %1$d λεπτών στείλτε με κωδικό %2$s</string>
<string name="smscommunicator_tempbasalset">Προσωρινός Ρυθμός %1$.2fU/h για %2$d λεπτά ξεκίνησε επιτυχώς</string>
<string name="smscommunicator_tempbasalfailed">Εκκίνηση Προσωρινού Ρυθμού απέτυχε</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Για να σταματήσετε Προσωρινό Ρυθμό στείλτε με κωδικό %s</string>
<string name="smscommunicator_tempbasalcanceled">Ο Προσωρινός Ρυθμός ακυρώθηκε</string>
<string name="smscommunicator_tempbasalcancelfailed">Ακύρωση Προσωρινού Ρυθμού απέτυχε</string>
<string name="smscommunicator_unknowncommand">Άγνωστη εντολή ή λάθος απάντηση</string>
<string name="quickwizard">Γρήγορος Οδηγός</string>
<string name="quickwizardsettings">Ρυθμίσεις Γρήγορου Οδηγού</string>
<string name="overview_editquickwizard_buttontext">Κείμενο στο πλήκτρο:</string>
@ -468,7 +459,6 @@
<string name="send_calibration" formatted="false">Να στείλω το καλιμπράρισμα %.1f στο xDrip;</string>
<string name="xdripnotinstalled">xDrip+ μη εγκατεστημένο</string>
<string name="calibrationsent">Το καλιμπράρισμα εστάλει στο xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Δεν επιτρέπεται απομακρυσμένο καλιμπράρισμα</string>
<string name="smscommunicator_calibrationsent">Το καλιμπράρισμα στάλθηκε. Η λήψη πρέπει να είναι ενεργοποιημένη στο xDrip.</string>
<string name="smscommunicator_calibrationfailed">το xDrip δεν λαμβάνει καλιμπραρίσματα</string>
<string name="pumpsuspended">Η αντλία είναι σε παύση</string>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Para entregar bolo %1$.2fU responder con código %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Para enviar calibración %1$.2f responder con código %2$s</string>
<string name="smscommunicator_bolusfailed">Bolo falló</string>
<string name="bolusdelivered" formatted="false">Bolo %.2fU entregado con éxito</string>
<string name="bolusrequested" formatted="false">Entregaré %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolo %.2fU enviado correctamente</string>
<string name="bolusdelivering" formatted="false">Entregando %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Permitir comandos remotos vía SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Bolo remoto no permitido</string>
<string name="glucosetype_finger">Dedo</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manualmente</string>
@ -338,16 +333,12 @@
<string name="smscommunicator_loopisenabled">Lazo activo</string>
<string name="valuelimitedto">%1$.2f limitado a %2$.2f</string>
<string name="valueoutofrange" formatted="false">Valor %s fuera de limites</string>
<string name="smscommunicator_remotebasalnotallowed">No permitidos ajustes basales remotos</string>
<string name="smscommunicator_remotecommandnotallowed">Comando remoto no permitido</string>
<string name="smscommunicator_basalreplywithcode">Para iniciar basal %1$.2fU/h responder con código %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Para cancelar lazo por %1$d minutos responde con código %2$s</string>
<string name="smscommunicator_tempbasalset">Basal temporal %1$.2fU/h para %2$d min iniciada correctamente</string>
<string name="smscommunicator_tempbasalfailed">Fallo inicio basal temporal</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Para parar basal temporal responder con código %s</string>
<string name="smscommunicator_tempbasalcanceled">Basal temporal cancelada</string>
<string name="smscommunicator_tempbasalcancelfailed">Fallo cancelación basal temporal</string>
<string name="smscommunicator_unknowncommand">Comando desconocido o respuesta incorrecta</string>
<string name="quickwizard">Asistente</string>
<string name="quickwizardsettings">Asistente configuración</string>
<string name="overview_editquickwizard_buttontext">Botón Texto:</string>
@ -471,7 +462,6 @@
<string name="send_calibration" formatted="false">¿Mandar calibración %.1f a xDrip?</string>
<string name="xdripnotinstalled">xDrip+ no instalado</string>
<string name="calibrationsent">Calibración mandada a xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Calibración remota no admitida</string>
<string name="smscommunicator_calibrationsent">Calibración enviada. La recepción debe estar habilitada en xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip no recibe calibraciones</string>
<string name="pumpsuspended">Bomba parada</string>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_code">Rappel R1</string>
<string name="alert_r2_code">Rappel R2</string>
<string name="alert_r3_code">Rappel R3</string>
<string name="alert_r4_code">Rappel R4</string>
<string name="alert_r7_code">Rappel R7</string>
<string name="alert_w31_code">Avertissement W31</string>
<string name="alert_w32_code">Avertissement W32</string>
<string name="alert_w33_code">Avertissement W33</string>
<string name="alert_w34_code">Avertissement W34</string>
<string name="alert_w36_code">Avertissement W36</string>
<string name="alert_w38_code">Avertissement W38</string>
<string name="alert_w39_code">Avertissement W39</string>
<string name="alert_m20_code">Maintenance M20</string>
<string name="alert_m21_code">Maintenance M21</string>
<string name="alert_m22_code">Maintenance M22</string>
<string name="alert_m23_code">Maintenance M23</string>
<string name="alert_m24_code">Maintenance M24</string>
<string name="alert_m25_code">Maintenance M25</string>
<string name="alert_m26_code">Maintenance M26</string>
<string name="alert_m27_code">Maintenance M27</string>
<string name="alert_m28_code">Maintenance M28</string>
<string name="alert_m29_code">Maintenance M29</string>
<string name="alert_m30_code">Maintenance M30</string>
<string name="alert_e6_code">Erreur E6</string>
<string name="alert_e10_code">Erreur E10</string>
<string name="alert_e13_code">Erreur E13</string>
</resources>

View file

@ -1,3 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r7_description"><![CDATA[Quantité :<b>%1$d%%</b>\nDurée :<b>%2$s h</b>]]></string>
<string name="alert_w31_description"><![CDATA[Volume dans le réservoir : <b>%1$s U</b>]]></string>
<string name="alert_w32_description">Changer la batterie.</string>
<string name="alert_w33_description">Régler heure/date.</string>
<string name="alert_w34_description">Contacter l\'assistance Accu-Check.</string>
<string name="alert_w36_description"><![CDATA[Quantité : <b>%1$d%%</b><br/>Durée : <b>%2$s h</b>]]></string>
<string name="alert_w38_description"><![CDATA[Programmé : <b>%1$s U</b><br/>Délivré : <b>%2$s U</b>]]></string>
<string name="alert_m20_description">Insérer le réservoir.</string>
<string name="alert_m21_description">Changer le réservoir.</string>
<string name="alert_m22_description">Changer la batterie.</string>
<string name="alert_m23_description">Vérifier l\'état de la pompe.</string>
<string name="alert_m24_description">Remplacer le dispositif de perfusion.</string>
<string name="alert_m25_description">Contacter l\'assistance Accu-Check.</string>
<string name="alert_m26_description">Changer le réservoir.</string>
<string name="alert_m27_description">Recommencer le transfert des données.</string>
<string name="alert_m28_description">Vérifier l\'état de la pompe.</string>
<string name="alert_m29_description">Choisir le type de pile.</string>
<string name="alert_m30_description">Choisir le type de réservoir.</string>
<string name="alert_e6_description">Remplacer pile et réservoir.</string>
<string name="alert_e10_description">Changer le réservoir.</string>
<string name="alert_e13_description">Changer la langue.</string>
</resources>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_title">Injecter le Bolus</string>
<string name="alert_r2_title">Bolus oublié</string>
<string name="alert_r3_title">Réveil</string>
<string name="alert_r4_title">Remplacer le dispositif de perfusion</string>
<string name="alert_r7_title">DBT terminé</string>
<string name="alert_w31_title">Réservoir presque vide</string>
<string name="alert_w32_title">Batterie faible</string>
<string name="alert_w33_title">Heure/date incorrectes</string>
<string name="alert_w34_title">Fin de garantie</string>
<string name="alert_w36_title">DBT annulé</string>
<string name="alert_w38_title">Bolus annulé</string>
<string name="alert_w39_title">Avertissement fin prêt</string>
<string name="alert_m20_title">Réservoir non inséré</string>
<string name="alert_m21_title">Réservoir vide</string>
<string name="alert_m22_title">Pile déchargée</string>
<string name="alert_m23_title">Arrêt automatique - Pompe arrêtée</string>
<string name="alert_m24_title">Occlusion</string>
<string name="alert_m25_title">Fin du prêt - fin de fonctionnement</string>
<string name="alert_m26_title">Changement de réservoir non terminé</string>
<string name="alert_m27_title">Échec du transfert des données</string>
<string name="alert_m28_title">Mode pause expiré</string>
<string name="alert_m29_title">Type de pile non configuré</string>
<string name="alert_m30_title">Type de réservoir non défini</string>
<string name="alert_e6_title">Erreur mécanique</string>
<string name="alert_e10_title">Erreur retour tige filetée</string>
<string name="alert_e13_title">Erreur de langue</string>
</resources>

View file

@ -1,3 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="connection_failed">Échec de connexion</string>
<string name="connection_lost">Connexion perdue</string>
<string name="pairing_rejected">Appairage rejeté</string>
<string name="socket_creation_failed">La création du Socket a échouée</string>
<string name="timeout">Expiration</string>
<string name="maximum_number_of_bolus_type_already_running">Nombre maximum de types de Bolus déjà en cours d\'exécution</string>
<string name="no_active_tbr_to_cancel">Pas de DBT à annuler</string>
<string name="no_active_tbr_to_change">Pas de DBT à changer</string>
<string name="no_such_bolus_to_cancel">Aucun Bolus à annuler</string>
<string name="pump_already_in_that_state_exception">Pompe déjà dans cet état</string>
<string name="run_mode_not_allowed">Mode d\'exécution non autorisé</string>
</resources>

View file

@ -44,6 +44,8 @@
<string name="description_sensitivity_oref1">Sensibilité est calculée à partir des données des dernières 8 heures et des glucides (si non absorbés) ne sont plus pris en compte après le temps spécifié dans les préférences. Plugin calcule également UAM.</string>
<string name="description_sensitivity_weighted_average">Sensibilité est calculée comme une moyenne pondérée des écarts. Les écarts les plus récents ont un poids plus élevé. L\'absorption minimale des glucides est calculée à partir des temps dabsorption des glucides max du menu préférences. Cet algorithme est le plus rapide pour s\'adapter aux changements de sensibilité.</string>
<string name="description_source_dexcom_g5">Recevoir les valeurs de glycémie de lapp Dexcom G5 patchée.</string>
<string name="description_source_dexcom_g6">Recevoir les valeurs de glycémie de lapp Dexcom G6 patchée.</string>
<string name="description_source_eversense">Recevoir les valeurs de glycémie de lapp Eversense patchée.</string>
<string name="description_source_glimp">Recevoir les glycémies depuis Glimp.</string>
<string name="description_source_mm640g">Recevoir les glycémies depuis le 600SeriesAndroidUploder.</string>
<string name="description_source_ns_client">Télécharge les glycémies depuis Nightscout</string>
@ -52,6 +54,7 @@
<string name="description_wear">Surveillez et contrôlez AndroidAPS en utilisant votre montre WearOS.</string>
<string name="description_xdrip_status_line">Afficher les informations de votre Boucle sur votre écran de montre xDrip+.</string>
<string name="description_sms_communicator">Commander à distance AndroidAPS en utilisant les commandes SMS.</string>
<string name="objectives_button_back">Retour</string>
<string name="objectives_button_start">Démarrer</string>
<string name="objectives_button_verify">Vérifier</string>
<string name="nsprofileview_units_label">Unités</string>
@ -264,12 +267,11 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="smscommunicator_bolusreplywithcode">Renvoyer le code %2$s pour injecter le bolus %1$.2fU</string>
<string name="smscommunicator_calibrationreplywithcode">Renvoyer le code %2$s pour envoyer la calibration %1$.2f</string>
<string name="smscommunicator_bolusfailed">Échec du Bolus</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU délivré avec succès</string>
<string name="bolusrequested" formatted="false">%.2fU va être injecté</string>
<string name="smscommunicator_bolusdelivered" formatted="false">%.2fU de bolus injecté avec succès</string>
<string name="bolusdelivering" formatted="false">En train d\'injecter %.2fU</string>
<string name="bolusdelivered">Bolus %1$.2fU délivré avec succès</string>
<string name="bolusrequested">%1$.2fU vont être injectées</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU délivré avec succès</string>
<string name="bolusdelivering">En train d\'injecter %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Autoriser les commandes à distance par SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Bolus à distance non autorisé</string>
<string name="glucosetype_finger">Doigt</string>
<string name="glucosetype_sensor">Capteur</string>
<string name="manual">Manuel</string>
@ -337,16 +339,25 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="smscommunicator_loopisenabled">La Boucle est activée</string>
<string name="valuelimitedto">%1$.2f limité à %2$.2f</string>
<string name="valueoutofrange" formatted="false">La valeur %s est hors des limites strictes</string>
<string name="smscommunicator_remotebasalnotallowed">Le réglage du basal à distance n\'est pas autorisé</string>
<string name="smscommunicator_remotecommandnotallowed">La commande à distance n\'est pas autorisée</string>
<string name="smscommunicator_basalreplywithcode">Envoyer le code %2$s pour initier le basal %1$.2fU/h</string>
<string name="smscommunicator_remotebolusnotallowed">Bolus à distance non disponible. Réessayez plus tard.</string>
<string name="smscommunicator_basalreplywithcode">Pour démarrer Basal %1$.2fU/h pendant %2$d min, renvoyer le code %3$s</string>
<string name="smscommunicator_profilereplywithcode">Pour changer le profil vers %1$s %2$d%%, renvoyer le code %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Pour démarrer le Bolus étendu %1$.2fU pendant %2$d min, renvoyer le code %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Pour démarrer le Basal %1$d% pendant %2$d min, renvoyer le code %3$s</string>
<string name="smscommunicator_suspendreplywithcode">Envoyer le code %2$s pour suspendre la Boucle pour %1$d minutes</string>
<string name="smscommunicator_tempbasalset">Démarrage réussi pour %1$.2fU/h de basal temporaire pour %2$d min</string>
<string name="smscommunicator_extendedset">Le Bolus étendu %1$.2fU pendant %2$d min a commencé avec succès</string>
<string name="smscommunicator_tempbasalset_percent">Démarrage réussi pour %1$d%% de Basal temporaire pour %2$d min</string>
<string name="smscommunicator_tempbasalfailed">Le démarrage du basal temporaire a échoué</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Envoyer le code %s pour arrêter le basal temporaire</string>
<string name="smscommunicator_extendedfailed">Le départ du Bolus étendu a échoué</string>
<string name="smscommunicator_basalstopreplywithcode">Envoyer le code %1$s pour arrêter le Basal temporaire</string>
<string name="smscommunicator_extendedstopreplywithcode">Pour arrêter le Bolus étendu, renvoyer le code %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Basal temporaire annulé</string>
<string name="smscommunicator_extendedcanceled">Bolus étendu annulé</string>
<string name="smscommunicator_tempbasalcancelfailed">Echec de l\'annulation du basal temporaire</string>
<string name="smscommunicator_unknowncommand">Commande inconnue ou fausse réponse</string>
<string name="smscommunicator_extendedcancelfailed">Échec de l\'annulation du Bolus étendu</string>
<string name="smscommunicator_unknowncommand">Commande inconnue ou mauvaise réponse</string>
<string name="quickwizard">Assistant Rapide</string>
<string name="quickwizardsettings">Paramètres de l\'Assistant Rapide</string>
<string name="overview_editquickwizard_buttontext">Texte du bouton :</string>
@ -409,6 +420,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="array_of_elements">Tableau de %1$d éléments.\nValeur Actuelle :</string>
<string name="openapsma_autosensdata_label">Données Autosens</string>
<string name="openapsma_scriptdebugdata_label">Débogage du Script</string>
<string name="openapsama_useautosens">Utiliser la fonction Autosens</string>
<string name="refresheventsfromnightscout">Actualiser les événements depuis NS</string>
<string name="deletefuturetreatments">Supprimer les futurs traitements</string>
<string name="eatingsoon">Repas imminent</string>
@ -469,7 +481,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="send_calibration" formatted="false">Transmettre l\'étalonnage %.1f à xDrip ?</string>
<string name="xdripnotinstalled">xDrip+ n\'est pas installé</string>
<string name="calibrationsent">Étalonnage envoyé à xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">L\'étalonnage à distance n\'est pas autorisé</string>
<string name="smscommunicator_calibrationsent">Étalonnage envoyé. La réception doit être activée dans xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip ne reçoit pas les étalonnages</string>
<string name="pumpsuspended">Pompe arrêtée</string>
@ -550,6 +561,12 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="insulin_shortname">INS</string>
<string name="enablesuperbolus">Activer les Superbolus dans lAssistant</string>
<string name="enablesuperbolus_summary">Activer la fonctionnalité SuperBolus dans lAssistant. Ne pas lactiver avant de bien comprendre comment cela fonctionne réellement. IL PEUT PROVOQUER UNE OVERDOSE DINSULINE SI UTILISÉ AVEUGLÉMENT !</string>
<string name="show_statuslights">Afficher les lumières d\'état sur l\'écran d\'accueil</string>
<string name="show_statuslights_summary">Activer les lumières d\'état pour AgeC, AgeI, AgeS, niveaux du réservoir et de batterie sur l\'écran d\'accueil.</string>
<string name="statuslights_res_warning">Seuil d\'avertissement de niveau du réservoir [U]</string>
<string name="statuslights_res_critical">Seuil critique de niveau du réservoir [U]</string>
<string name="statuslights_bat_warning">Seuil davertissement du niveau de batterie [%]</string>
<string name="statuslights_bat_critical">Seuil critique du niveau de la batterie [%]</string>
<string name="iob">IA</string>
<string name="cob">GA</string>
<string name="virtualpump_firmware_label">Firmware</string>
@ -704,7 +721,10 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="btwatchdog_title">BT Watchdog</string>
<string name="btwatchdog_summary">Ceci va arrêter le Bluetooth du téléphone pour une seconde si la connexion pompe nest pas possible. Cela peut assister certains téléphones dont la connexion Bluetooth se bloque.</string>
<string name="DexcomG5">App Dexcom G5 (adaptée)</string>
<string name="DexcomG6">App DexcomG6 (patché)</string>
<string name="eversense">App Eversense (patché)</string>
<string name="dexcomg5_nsupload_title">Remonter les données glycémiques vers NS</string>
<string name="bgsource_upload">Paramètres de téléchargement des glycémies</string>
<string name="wear_detailed_delta_title">Afficher le delta détaillé</string>
<string name="wear_detailed_delta_summary">Afficher delta avec une décimale supplémentaire</string>
<string name="smbmaxminutes_summary">Max. minutes de basal pour limiter le SMB</string>
@ -770,6 +790,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="combo_error_bolus_verification_failed">L\'administration de bolus et la vérification de l\'historique de la pompe ont échoué. Vérifiez la pompe manuellement. Si un bolus a été administré, il sera ajouté aux traitements au cours de la prochaine connexion avec la pompe.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Pas assez d\'insuline dans le réservoir pour le bolus</string>
<string name="extendedbolusdeliveryerror">Erreur administration bolus étendu</string>
<string name="insightpump_shortname">Vue</string>
<string name="insightpump">Pompe Insight</string>
<string name="status_no_colon">État</string>
<string name="changed">Modifié</string>
@ -844,6 +865,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="data_choices">Choix de données</string>
<string name="fabric_upload">Téléchargement Fabric</string>
<string name="allow_automated_crash_reporting">Autoriser l\'envoi automatique des rapports d\'erreur et des données d\'utilisation aux développeurs via le service fabric.io</string>
<string name="g5appnotdetected">SVP actualisez votre app Dexcom vers une version compatible</string>
<string name="start_activity_tt">Début Activités</string>
<string name="start_eating_soon_tt">Début Repas Imminent</string>
<string name="temptargetshort">Traitement</string>
@ -1009,6 +1031,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="nth_objective">%1$d. Objectif</string>
<string name="poctech">Poctech</string>
<string name="description_source_poctech">Recevoir les glycémies depuis l\'app Poctech</string>
<string name="description_source_tomato">Recevoir les valeurs de glycémie de l\'application Tomato (appareil MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">Cible temp. haute élève la sensibilité</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Augmente la Sensibilité pour les cibles temporaires >= 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Cible temp. basse abaisse la sensibilité</string>
@ -1051,10 +1074,87 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="loop_openmode_min_change">Changement minimum possible [%]</string>
<string name="loop_openmode_min_change_summary">Le fonctionnement de la Boucle demandera une confirmation uniquement si le changement est supérieur à cette valeur. Par défaut, la valeur est 20%</string>
<string name="pairfirst">Appairez SVP votre pompe avec votre téléphone !</string>
<string name="searching_for_devices">Recherche d\'appareils en cours…</string>
<string name="please_wait">Merci de patienter...</string>
<string name="pairing_completed">Appairage terminé</string>
<string name="code_compare">Les codes affichés sur cet appareil et sur la pompe sont-ils identiques ?</string>
<string name="insight_pairing">Appairage de Insight</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2fU / %2$.2fU injecté</string>
<string name="insight_alert_formatter">%1$s : %2$s</string>
<string name="tube_changed">Tubulure changée</string>
<string name="pump_time_updated">Mise à jour de l\'heure de la pompe</string>
<string name="confirm">Confirmer</string>
<string name="mute_alert">Coupure son</string>
<string name="pump_alert">Alerte de la pompe</string>
<string name="log_site_changes">Enreg. changement de site</string>
<string name="log_tube_changes">Enreg. changement de tubulure</string>
<string name="log_battery_changes">Enreg. changement batterie</string>
<string name="log_operating_mode_changes">Enreg. changement mode de fonctionnement</string>
<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="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>
<string name="ui_processor_software_version">Version du logiciel de processeur UI</string>
<string name="pc_processor_software_version">Version du logiciel du processeur PC</string>
<string name="md_tel_processor_software_version">Version du logiciel MD tel processeur</string>
<string name="safety_processor_software_version">Version logicielle du processeur de sécurité</string>
<string name="bt_info_page_version">Version de la page d\'info BT</string>
<string name="bluetooth_address">Adresse Bluetooth</string>
<string name="system_id_appendix">Annexe ID Système</string>
<string name="manufacturing_date">Date de fabrication</string>
<string name="delete_pairing">Supprimer lappairage</string>
<string name="pairing_information">Information sur lappairage</string>
<string name="refreh_status">Actualiser le status</string>
<string name="start_pump">Démarrer la pompe</string>
<string name="stop_pump">Arrêter la pompe</string>
<string name="operating_mode">Mode de fonctionnement</string>
<string name="insight_status">État</string>
<string name="tdd_bolus">Bolus DTI</string>
<string name="tdd_basal">DTI basale</string>
<string name="tdd_total">Total DTI</string>
<string name="recovering">Récupération en cours.</string>
<string name="not_paired">Non appairé</string>
<string name="last_connected">Dernière connexion</string>
<string name="started">Démarré</string>
<string name="stopped">Arrêté</string>
<string name="tbr_formatter">%1$d%% pour %2$d / %3$d min</string>
<string name="extended_bolus">Bolus étendu</string>
<string name="multiwave_bolus">Bolus mixte</string>
<string name="eb_formatter">%1$.2f / %2$.2f U pour %3$d min</string>
<string name="enable_tbr_over_notification">Activer la notification de la fin DBT\n(réglage de pompe)</string>
<string name="disable_tbr_over_notification">Activer la notification de la fin de DBT\n(réglage de pompe)</string>
<string name="refresh">Actualiser</string>
<string name="description_pump_insight_local">Intégration des pompes Accu-Chek Insight</string>
<string name="not_inserted">Non inséré</string>
<string name="short_status_last_connected">Dernière conn : il y a %1$d min</string>
<string name="short_status_tbr">DBT : %1$d%% pour %2$d / %3$d min</string>
<string name="short_status_extended">Étendue : %1$.2f / %2$.2f U pour %3$d min</string>
<string name="short_status_multiwave">Mixte : %1$.2f / %2$.2f U pour %3$d min</string>
<string name="short_status_tdd">DTI : %1$.2f</string>
<string name="short_status_reservoir">Réserv. : %1$.2fU</string>
<string name="short_status_battery">Batt.: %1$d%%</string>
<string name="max_recovery_duration">Durée max. de récupération [s]</string>
<string name="min_recovery_duration">Durée min. de récupération [s]</string>
<string name="recovery_duration">Durée de récupération</string>
<string name="timeout_during_handshake">Expiration pendant l\'appairage - réinitialiser le Bluetooth</string>
<string name="profile_total">== ∑ %1$s U</string>
<string name="profile_ins_units_per_hout">U/h</string>
<string name="profile_carbs_per_unit">g/U</string>
<string name="profile_per_unit">/U</string>
<string name="dexcom_lognssensorchange_title">Enreg. du changement de capteur sur NS</string>
<string name="dexcom_lognssensorchange_summary">Créer automatiquement sur NS un événement \"Changement de capteur\" au démarrage du capteur</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Changement d\'heure d\'été dans moins de 24 heures</string>
<string name="storage">stockage interne limité</string>
<string name="diskfull">Boucle désactivée ! Libérez au moins %1$d Mo du stockage interne !</string>
<string name="wrongformat">Format incorrect</string>
<string name="sms_wrongcode">Code incorrect. Commande annulée.</string>
<string name="notconfigured">Non configuré</string>
<string name="profileswitchcreated">Changement de profil effectué</string>
<plurals name="objective_days">
<item quantity="one">%1$d jour</item>
<item quantity="other">%1$d jours</item>

View file

@ -263,12 +263,7 @@
<string name="smscommunicator_bolusreplywithcode">Per fornire risposta %1$.2fU bolo con codice %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Invia la taratura %1$.2f risposta con codice %2$s</string>
<string name="smscommunicator_bolusfailed">Bolo fallito</string>
<string name="bolusdelivered" formatted="false">Bolo %.2fU inviato correttamente</string>
<string name="bolusrequested" formatted="false">Inviando %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolo %.2fU inviato correttamente</string>
<string name="bolusdelivering" formatted="false">Inviare %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Consenti comandi remoti tramite SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Il bolo da remoto non e\' permesso</string>
<string name="glucosetype_finger">Dito</string>
<string name="glucosetype_sensor">Sensore</string>
<string name="manual">Manuale</string>
@ -336,16 +331,12 @@
<string name="smscommunicator_loopisenabled">Loop abilitato</string>
<string name="valuelimitedto">%1$.2f limitato a %2$.2f</string>
<string name="valueoutofrange" formatted="false">Valore %s è fuori limiti massimi</string>
<string name="smscommunicator_remotebasalnotallowed">Impostare basale da remoto non e\' permesso</string>
<string name="smscommunicator_remotecommandnotallowed">il comando da remoto non e\' permesso</string>
<string name="smscommunicator_basalreplywithcode">Per iniziare basale %1$.2fU/h risposta con codice %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Sospendi il loop per %1$d minuti riprendi %2$s</string>
<string name="smscommunicator_tempbasalset">Basale temporanea %1$.2fU/h for %2$d min avviata con successo</string>
<string name="smscommunicator_tempbasalfailed">Avvio Basale temporanea fallita</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Per interrompere la risposta basale della temperatura con il codice %s</string>
<string name="smscommunicator_tempbasalcanceled">Baasale temporanea cancellata</string>
<string name="smscommunicator_tempbasalcancelfailed">Cancellazione temporanea fallita</string>
<string name="smscommunicator_unknowncommand">Comando errato</string>
<string name="quickwizard">QuickWizard</string>
<string name="quickwizardsettings">Impostazioni QuickWizard</string>
<string name="overview_editquickwizard_buttontext">Tasto testo:</string>
@ -468,7 +459,6 @@
<string name="send_calibration" formatted="false">Invia calibrazione %.1f a xDrip?</string>
<string name="xdripnotinstalled">xDrip non installato</string>
<string name="calibrationsent">Invio calibrazione xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">La calibrazione da remoto non e\' permesso</string>
<string name="smscommunicator_calibrationsent">La calibrazione è stata inviata. La ricezione deve essere abilitata in xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip non ha ricevuto la calibrazione</string>
<string name="pumpsuspended">Sospensione Micro</string>

View file

@ -263,12 +263,7 @@
<string name="smscommunicator_bolusreplywithcode">Bolus %1$.2fU 을 주입하려면 %2$s 를 입력하고 답장하세요</string>
<string name="smscommunicator_calibrationreplywithcode">보정값 %1$.2f을 전송하려면 %2$s 를 입력하고 답장하세요</string>
<string name="smscommunicator_bolusfailed">Bolus failed</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU이 주입되었습니다.</string>
<string name="bolusrequested" formatted="false">%.2fU 주입 예정입니다.</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
<string name="bolusdelivering" formatted="false">%.2fU 주입중</string>
<string name="smscommunicator_remotecommandsallowed">SMS 원격 명령 사용하기</string>
<string name="smscommunicator_remotebolusnotallowed">원격 Bolus 허용되지 않음</string>
<string name="glucosetype_finger">체혈</string>
<string name="glucosetype_sensor">센서</string>
<string name="manual">수동</string>
@ -336,16 +331,12 @@
<string name="smscommunicator_loopisenabled">Loop가 실행중입니다.</string>
<string name="valuelimitedto">%1$.2f, %2$.2f으로 제한됨</string>
<string name="valueoutofrange" formatted="false">%s값이 하드한계(Hard Limit)를 벗어났습니다</string>
<string name="smscommunicator_remotebasalnotallowed">원격 Basal 설정이 허가되지 않았습니다</string>
<string name="smscommunicator_remotecommandnotallowed">원격 명령이 허가되지 않았습니다</string>
<string name="smscommunicator_basalreplywithcode">Basal %1$.2fU/h 을 주입하려면 %2$s 를 입력하고 답장하세요</string>
<string name="smscommunicator_suspendreplywithcode">%1$d분동안 Loop 일시중지하려면 %2$s 를 입력하고 답장하세요</string>
<string name="smscommunicator_tempbasalset">Temp Basal %1$.2fU/h for %2$d min started successfully</string>
<string name="smscommunicator_tempbasalfailed">Temp Basal start failed</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">임시Basal을 중지하려면 %s 를 입력하고 답장하세요</string>
<string name="smscommunicator_tempbasalcanceled">Temp Basal canceled</string>
<string name="smscommunicator_tempbasalcancelfailed">Canceling Temp Basal failed</string>
<string name="smscommunicator_unknowncommand">알려지지 않은 명령이거나 잘못된 답장입니다.</string>
<string name="quickwizard">빠른마법사</string>
<string name="quickwizardsettings">빠른마법사 설정</string>
<string name="overview_editquickwizard_buttontext">버튼명:</string>
@ -468,7 +459,6 @@
<string name="send_calibration" formatted="false">보정값 %.1f을 xDrip에 전송하시겠습니까?</string>
<string name="xdripnotinstalled">xDrip+가 설치되지 않았습니다</string>
<string name="calibrationsent">보정이 xDrip으로 전송되었습니다</string>
<string name="smscommunicator_remotecalibrationnotallowed">원격보정이 허용되지 않았습니다</string>
<string name="smscommunicator_calibrationsent">보정 전송됨. xDrip에서 수신이 되도록 설정되어 있어야 합니다.</string>
<string name="smscommunicator_calibrationfailed">xDrip에서 보정을 받지 못합니다.</string>
<string name="pumpsuspended">펌프 일시중지됨</string>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Om de bolus %1$.2fU toe te dienen antwoord met de code %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Om calibratie %1$.2f te verzenden antwoord met de code %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus mislukt</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU succesvol toegediend</string>
<string name="bolusrequested" formatted="false">Klaar om %.2fE toe te dienen</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU succesvol toegediend</string>
<string name="bolusdelivering" formatted="false">Toedienen %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Sta SMS commando\'s toe</string>
<string name="smscommunicator_remotebolusnotallowed">Bolus via sms niet toegestaan</string>
<string name="glucosetype_finger">Vingerprik</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manueel</string>
@ -339,16 +334,12 @@ Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sport
<string name="smscommunicator_loopisenabled">Loop is ingeschakeld</string>
<string name="valuelimitedto">%1$.2f gelimiteerd tot %2$.2f</string>
<string name="valueoutofrange" formatted="false">Waarde %s is buiten de toegestane limieten</string>
<string name="smscommunicator_remotebasalnotallowed">Basale instellingen op afstand zijn niet toegestaan</string>
<string name="smscommunicator_remotecommandnotallowed">Commando\'s op afstand zijn niet toegestaan</string>
<string name="smscommunicator_basalreplywithcode">Om het basaal %1$.2fE/uur te starten antwoord met de code %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Om de loop te onderbreken voor %1$d minuten antwoord met de code %2$s</string>
<string name="smscommunicator_tempbasalset">Tijdelijk basaal %1$.2fE/u voor %2$d minuten succesvol gestart</string>
<string name="smscommunicator_tempbasalfailed">Start tijdelijk basaal mislukt</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Om het tijdelijke basaal te stoppen antwoord met de code %s</string>
<string name="smscommunicator_tempbasalcanceled">Tijdelijk basaal afgebroken</string>
<string name="smscommunicator_tempbasalcancelfailed">Afbreken van tijdelijk basaal mislukt</string>
<string name="smscommunicator_unknowncommand">Onbekend commando of verkeerd antwoord</string>
<string name="quickwizard">Vaste maaltijd</string>
<string name="quickwizardsettings">Vaste maaltijd instellingen</string>
<string name="overview_editquickwizard_buttontext">Naam:</string>
@ -472,7 +463,6 @@ Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sport
<string name="send_calibration" formatted="false">Verzend calibratie %.1f naar xDrip?</string>
<string name="xdripnotinstalled">xDrip+ niet geïnstalleerd</string>
<string name="calibrationsent">Kalibratie naar xDrip verzonden</string>
<string name="smscommunicator_remotecalibrationnotallowed">Kalibratie op afstand is niet toegestaan</string>
<string name="smscommunicator_calibrationsent">Kalibratie verzonden. Het ontvangen van kalibraties moet actief zijn in xDrip.</string>
<string name="smscommunicator_calibrationfailed">XDrip ontvangt geen kalibraties</string>
<string name="pumpsuspended">Pomp onderbreken</string>
@ -633,7 +623,7 @@ Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sport
<string name="careportal_activity_label">ACTIVITEIT &amp; FEEDBACK</string>
<string name="careportal_carbsandbolus_label">KOOLHYDRATEN &amp; BOLUS</string>
<string name="careportal_cgm_label">CGM &amp; OPENAPS</string>
<string name="careportal_pump_label">POMO</string>
<string name="careportal_pump_label">POMP</string>
<string name="overview_newtempbasal_basalabsolute">Basale waarde [E/uur]</string>
<string name="careportal_newnstreatment_duration_min_label">Tijdsduur [min]</string>
<string name="openapssmb">OpenAPS SMB</string>
@ -1141,7 +1131,8 @@ Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sport
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="dst_in_24h_warning">Zomer/wintertijd omschakeling binnen 24 uur</string>
<string name="dst_loop_disabled_warning">Zomer/wintertijd omschakeling in minder dan 3 uur - Closed loop gedeactiveerd</string>
<string name="storage">interne opslag bijna vol</string>
<string name="diskfull">Maak minstens %1$d MB vrij in interne opslag! Loop is uitgeschakeld!</string>
<plurals name="objective_days">
<item quantity="one">%1$d dag</item>
<item quantity="other">%1$d dag</item>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Aby dostarczyć bolus %1$.2fU wprowadź kod %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Aby wysłać kalibrację %1$.2f wprowadź kod %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus nieudany</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU dostarczony</string>
<string name="bolusrequested" formatted="false">Zamierzam dostarczyć %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU dostarczony</string>
<string name="bolusdelivering" formatted="false">Dostarczam %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Zezwalaj na komendy zdalne via SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Bolus zdalny nie dozwolony</string>
<string name="glucosetype_finger">Palec</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Ręczne</string>
@ -338,16 +333,12 @@
<string name="smscommunicator_loopisenabled">Pętla (Loop) jest włączona</string>
<string name="valuelimitedto">%1$.2f ograniczone do %2$.2f</string>
<string name="valueoutofrange" formatted="false">Wartość %s jest poza dopuszczalną granicą</string>
<string name="smscommunicator_remotebasalnotallowed">Ustawienie zdalnej bazy nie jest dozwolone</string>
<string name="smscommunicator_remotecommandnotallowed">Zdalne komendy nie są dozwolone</string>
<string name="smscommunicator_basalreplywithcode">Aby rozpocząć bazę %1$.2fU/h odpowiedz kodem %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Aby wstrzymać pętle na %1$d minut odpowiedz kodem %2$s</string>
<string name="smscommunicator_tempbasalset">Tymczasowa baza %1$.2fU/h przez %2$d min rozpoczęta</string>
<string name="smscommunicator_tempbasalfailed">Rozpoczęcie tymczasowej bazy nie powiodło się</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Aby zatrzymać bazę tymczasową odpowiedz kodem %s</string>
<string name="smscommunicator_tempbasalcanceled">Baza tymczasowa anulowana</string>
<string name="smscommunicator_tempbasalcancelfailed">Anulowanie tymczasowej bazy nie powiodło się</string>
<string name="smscommunicator_unknowncommand">Nieznane polecenie lub błędna odpowiedź</string>
<string name="quickwizard">Bolus zdefiniowany</string>
<string name="quickwizardsettings">Ustaw szybkie bolusy</string>
<string name="overview_editquickwizard_buttontext">Tekst przycisku:</string>
@ -471,7 +462,6 @@
<string name="send_calibration" formatted="false">Wysłać kalibrację %.1f do xDrip?</string>
<string name="xdripnotinstalled">xDrip+ nie zainstalowany</string>
<string name="calibrationsent">Kalibracja przesłana do xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Zdalna kalibracja nie dozwolona</string>
<string name="smscommunicator_calibrationsent">Kalibracja wysłana. Odbiór musi być dozwolony w xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip nie odbiera kalibracji</string>
<string name="pumpsuspended">Pompa wstrzymana</string>

View file

@ -1,3 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r1_code">Lembrete R1</string>
<string name="alert_r2_code">Lembrete R2</string>
<string name="alert_r3_code">Lembrete R3</string>
<string name="alert_r4_code">Lembrete R4</string>
<string name="alert_r7_code">Lembrete R7</string>
<string name="alert_w31_code">Aviso W31</string>
<string name="alert_w32_code">Aviso W32</string>
<string name="alert_w33_code">Aviso W33</string>
<string name="alert_w34_code">Aviso W34</string>
<string name="alert_w36_code">Aviso W36</string>
<string name="alert_w38_code">Aviso W38</string>
<string name="alert_w39_code">Aviso W39</string>
<string name="alert_m20_code">Manutenção M20</string>
<string name="alert_m21_code">Manutenção M21</string>
<string name="alert_m22_code">Manutenção M22</string>
<string name="alert_m23_code">Manutenção M23</string>
<string name="alert_m24_code">Manutenção M24</string>
<string name="alert_m25_code">Manutenção M25</string>
<string name="alert_m26_code">Manutenção M26</string>
<string name="alert_m27_code">Manutenção M27</string>
<string name="alert_m28_code">Manutenção M28</string>
<string name="alert_m29_code">Manutenção M29</string>
<string name="alert_m30_code">Manutenção M30</string>
<string name="alert_e6_code">Erro E6</string>
<string name="alert_e10_code">Erro E10</string>
<string name="alert_e13_code">Erro E13</string>
</resources>

View file

@ -1,3 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources></resources>
<resources>
<string name="alert_r7_description"><![CDATA[Valor: <b>%1$d%%</b>\nDuração: <b>%2$s h</b>]]></string>
<string name="alert_w31_description"><![CDATA[Conteúdo do cartucho: <b>%1$s U</b>]]></string>
<string name="alert_w32_description">Trocar a bateria.</string>
<string name="alert_w33_description">Definir hora/data.</string>
<string name="alert_w34_description">Contatar o suporte Accu-Chek.</string>
<string name="alert_w36_description"><![CDATA[Valor: <b>%1$d%%</b><br/>Duração: <b>%2$s h</b>]]></string>
<string name="alert_w38_description"><![CDATA[Programado: <b>%1$s U</b><br/>Administrado: <b>%2$s U</b>]]></string>
<string name="alert_m20_description">Inserir cartucho.</string>
<string name="alert_m21_description">Mudar cartucho.</string>
<string name="alert_m22_description">Trocar a bateria.</string>
<string name="alert_m23_description">Verificar estado da bomba.</string>
<string name="alert_m24_description">Alterar o conjunto de infusão.</string>
<string name="alert_m25_description">Contatar o suporte Accu-Chek.</string>
<string name="alert_m26_description">Mudar cartucho.</string>
<string name="alert_m27_description">Reiniciar download de dados.</string>
<string name="alert_m28_description">Verificar estado da bomba.</string>
<string name="alert_m29_description">Definir o tipo de bateria.</string>
<string name="alert_m30_description">Definir tipo de cartucho.</string>
<string name="alert_e6_description">Mudar bateria e cartucho.</string>
<string name="alert_e10_description">Mudar cartucho.</string>
<string name="alert_e13_description">Alterar Idioma.</string>
</resources>

View file

@ -1,9 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources>
<string name="alert_r1_title">Administrar bolus</string>
<string name="alert_r2_title">Bolus não administrado</string>
<string name="alert_r3_title">Alarme</string>
<string name="alert_r4_title">Mudar o conjunto de infusão</string>
<string name="alert_r7_title">Basal temporária concluída</string>
<string name="alert_w31_title">Reservatório quase vazio</string>
<string name="alert_w32_title">Bateria fraca</string>
<string name="alert_w33_title">Hora/Data inválida</string>
<string name="alert_w34_title">Fora da Garantia</string>
<string name="alert_w36_title">Basal temporária cancelada</string>
<string name="alert_w38_title">Bolus cancelado</string>
<string name="alert_m21_title">Cartucho vazio</string>
<string name="alert_m22_title">Bateria vazia</string>
<string name="alert_m24_title">Oclusão</string>
<string name="alert_m26_title">Mudança de Cartucho não concluída</string>
<string name="alert_m27_title">Falha no download de dados</string>
<string name="alert_m28_title">Tempo limite de modo de pausa</string>
<string name="alert_m29_title">Tipo de bateria não definido</string>
<string name="alert_m30_title">Tipo de Cartucho não definido</string>
<string name="alert_e6_title">Erro mecânico</string>
<string name="alert_e13_title">Erro de idioma</string>
</resources>

View file

@ -4,6 +4,12 @@
<string name="connection_failed">Ligação falhou</string>
<string name="connection_lost">Ligação perdida</string>
<string name="pairing_rejected">Emparelhamento rejeitado</string>
<string name="socket_creation_failed">Falha ao criar documento</string>
<string name="timeout">Tempo expirou</string>
<string name="maximum_number_of_bolus_type_already_running">Número máximo de bólus tipo já em execução</string>
<string name="no_active_tbr_to_cancel">Sem basal temporária para cancelar</string>
<string name="no_active_tbr_to_change">Sem basal temporária para alterar</string>
<string name="no_such_bolus_to_cancel">Sem bolus para cancelar</string>
<string name="pump_already_in_that_state_exception">A bomba já está nesse estado</string>
<string name="run_mode_not_allowed">Modo executar não autorizado</string>
</resources>

View file

@ -54,6 +54,7 @@
<string name="description_wear">Monitorizar e controlar o AndroidAPS usando o seu relógio WearOS.</string>
<string name="description_xdrip_status_line">Mostrar informações sobre o loop no watchface do xDrip+.</string>
<string name="description_sms_communicator">Controlar remotamente o AndroidAPS usando comandos SMS.</string>
<string name="objectives_button_back">Anterior</string>
<string name="objectives_button_start">Iniciar</string>
<string name="objectives_button_verify">Verificar</string>
<string name="nsprofileview_units_label">Unidades</string>
@ -265,12 +266,7 @@
<string name="smscommunicator_bolusreplywithcode">Para dar bolus %1$.2fU responder com código %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Para enviar calibração %1$.2f responder com código %2$s</string>
<string name="smscommunicator_bolusfailed">Bólus falhado</string>
<string name="bolusdelivered" formatted="false">Bólus %.2fU enviado com êxito</string>
<string name="bolusrequested" formatted="false">Vai ser enviado %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bólus %.2fU enviado com êxito</string>
<string name="bolusdelivering" formatted="false">A enviar %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Permitir comandos remotos via SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Bólus remoto não permitido</string>
<string name="glucosetype_finger">Dedo</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manual</string>
@ -338,16 +334,12 @@
<string name="smscommunicator_loopisenabled">Loop activado</string>
<string name="valuelimitedto">%1$.2f limitado a %2$.2f</string>
<string name="valueoutofrange" formatted="false">O valor %s está fora dos limites permitidos</string>
<string name="smscommunicator_remotebasalnotallowed">A configuração remota de basal não é permitida</string>
<string name="smscommunicator_remotecommandnotallowed">O comando remoto não é permitido</string>
<string name="smscommunicator_basalreplywithcode">Para começar basal %1$.2fU/h responda com código %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Para suspender o loop por %1$d minutos resposta com código %2$s</string>
<string name="smscommunicator_tempbasalset">Basal temporária %1$.2fU/h para %2$d min iniciada com êxito</string>
<string name="smscommunicator_tempbasalfailed">Início basal temp falhou </string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Para parar a basal temporaria responda com o código %s</string>
<string name="smscommunicator_tempbasalcanceled">Basal temp cancelada</string>
<string name="smscommunicator_tempbasalcancelfailed">Não foi possivel cancelar a basal temp</string>
<string name="smscommunicator_unknowncommand">Comando desconhecido ou resposta errada</string>
<string name="quickwizard">Assistente Rápido</string>
<string name="quickwizardsettings">Definições do Assistente Rápido</string>
<string name="overview_editquickwizard_buttontext">Texto do botão:</string>
@ -471,7 +463,6 @@
<string name="send_calibration" formatted="false">Enviar calibração %.1f para o xDrip?</string>
<string name="xdripnotinstalled">xDrip+ não está instalado</string>
<string name="calibrationsent">Calibração enviada para o xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Calibração remota não permitida</string>
<string name="smscommunicator_calibrationsent">Calibração enviada. Recepção têm de estar activada no xDrip.</string>
<string name="smscommunicator_calibrationfailed">O xDrip não esta a receber as calibrações</string>
<string name="pumpsuspended">Bomba suspensa</string>
@ -553,6 +544,11 @@
<string name="enablesuperbolus">Activar superbólus no assistente</string>
<string name="enablesuperbolus_summary">Habilite a funcionalidade de superbolus no assistente. Não habilite até que aprenda o funcionamento. PODE CAUSAR OVERDOSE DE INSULINA SE USAR INDISCRIMINADAMENTE!</string>
<string name="show_statuslights">Mostrar luzes de estado no ecrã principal</string>
<string name="show_statuslights_summary">Ativar as luzes de status para idade da cânula, idade da insulina, idade do sensor, reservatório e bateria no ecrã inicial.</string>
<string name="statuslights_res_warning">Limite de aviso de nível de reservatório [U]</string>
<string name="statuslights_res_critical">Limite crítico de nível de reservatório [U]</string>
<string name="statuslights_bat_warning">Limite de aviso de nível de bateria [%]</string>
<string name="statuslights_bat_critical">Limite crítico de nível de bateria [%]</string>
<string name="iob">IOB</string>
<string name="cob">COB</string>
<string name="virtualpump_firmware_label">Firmware</string>
@ -1017,6 +1013,7 @@
<string name="nth_objective">%1$d. Objectivo</string>
<string name="poctech">Poctech</string>
<string name="description_source_poctech">Receber valores Glucose da app Poctech</string>
<string name="description_source_tomato">Receber valores de Glicose da aplicação Tomato (dispositivo MiaoMiao)</string>
<string name="high_temptarget_raises_sensitivity_title">Alto alvotempo aumenta sensibilidade</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Aumentar sensibilidade para alvostemp >= 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Baixo alvotemp baixa sensibilidade</string>
@ -1062,6 +1059,7 @@
<string name="searching_for_devices">A pesquisar dispositivos…</string>
<string name="please_wait">Por favor aguarde…</string>
<string name="pairing_completed">Emparelhamento concluído</string>
<string name="code_compare">Os códigos exibidos neste dispositivo e na sua bomba correspondem?</string>
<string name="insight_pairing">Emparelhamento Insight</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2fU / %2$.2fU entregue</string>
@ -1071,9 +1069,13 @@
<string name="confirm">Confirmar</string>
<string name="mute_alert">Silêncio</string>
<string name="pump_alert">Alerta da Bomba</string>
<string name="log_site_changes">Registar alterações de local</string>
<string name="log_tube_changes">Registar alterações de tubo</string>
<string name="log_battery_changes">Registar mudanças de bateria</string>
<string name="log_operating_mode_changes">Alterações do modo de funcionamento de registo</string>
<string name="log_alerts">Alertas de registo</string>
<string name="enable_tbr_emulation">Ativar a emulação TBR</string>
<string name="enable_tbr_emulation_summary">Usar bolus estendidos em vez de TBRs para contornar o limite de 250%</string>
<string name="serial_number">Número de série</string>
<string name="release_software_version">Lançar versão de software</string>
<string name="ui_processor_software_version">Versão de software do processador de interface do utilizador</string>
@ -1089,17 +1091,43 @@
<string name="stop_pump">Parar Bomba</string>
<string name="operating_mode">Modo de funcionamento</string>
<string name="insight_status">Estado</string>
<string name="tdd_bolus">DDT de Bolus</string>
<string name="tdd_basal">DDT Basal</string>
<string name="tdd_total">DDT Total</string>
<string name="recovering">A recuperar</string>
<string name="not_paired">Não emparelhado</string>
<string name="last_connected">Última ligação</string>
<string name="started">Iniciado</string>
<string name="stopped">Parado</string>
<string name="tbr_formatter">%1$d%% para %2$d / %3$d min</string>
<string name="extended_bolus">Bólus estendido</string>
<string name="multiwave_bolus">Bólus Multi-Onda</string>
<string name="eb_formatter">%1$.2f / %2$.2f U por %3$d min</string>
<string name="disable_tbr_over_notification">Desativar notificação do fim da basal temporária\n(configuração da bomba)</string>
<string name="refresh">Actualizar</string>
<string name="description_pump_insight_local">Integração de bomba para bombas Accu-Chek Insight</string>
<string name="not_inserted">Não inserido</string>
<string name="short_status_last_connected">Última conexão:%1$d minutos atrás</string>
<string name="short_status_tbr">Basal temporária: %1$d%% para %2$d / %3$d minutos</string>
<string name="short_status_extended">Estendido: %1$.2f / %2$.2f U por %3$d min</string>
<string name="short_status_multiwave">Multionda: %1$.2f / %2$.2f U por %3$d min</string>
<string name="short_status_reservoir">Reser:%1$.2fU</string>
<string name="short_status_battery">Bat.: %1$d%%</string>
<string name="max_recovery_duration">Duração máxima da recuperação [s]</string>
<string name="min_recovery_duration">Duração mínima da recuperação [s]</string>
<string name="recovery_duration">Duração da recuperação</string>
<string name="profile_total">== ∑ %1$s U</string>
<string name="profile_ins_units_per_hout">U/h</string>
<string name="profile_carbs_per_unit">g/U</string>
<string name="profile_per_unit">/U</string>
<string name="dexcom_lognssensorchange_title">Registar mudança de sensor para NS</string>
<string name="dexcom_lognssensorchange_summary">Criar evento \"Mudança de Sensor\" automaticamente no NS aquando do início do sensor</string>
<string name="tomato">Tomato (MiaoMiao)</string>
<string name="tomato_short">Tomato</string>
<string name="storage">restrição de armazenamento interno</string>
<string name="diskfull">Liberte pelo menos %1$d MB do armazenamento interno! Loop desativado!</string>
<string name="notconfigured">Não configurado</string>
<string name="profileswitchcreated">Troca de perfil criada</string>
<plurals name="objective_days">
<item quantity="one">%1$d dia</item>
<item quantity="other">%1$d dias</item>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Pentru a livra un bolus de %1$.2fU răspundeți cu codul %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Pentru a trimite calibrarea cu %1$.2f răspundeți cu codul %2$s</string>
<string name="smscommunicator_bolusfailed">Bolusare eșuată</string>
<string name="bolusdelivered" formatted="false">Bolusul de %.2fU livrat cu succes</string>
<string name="bolusrequested" formatted="false">Se va livra un bolus de %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolusul de %.2fU a fost livrat cu succes</string>
<string name="bolusdelivering" formatted="false">Se livrează %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Permite comenzi de la distanță, prin SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Bolusarea prin comenzi de la distanță nu este permisă</string>
<string name="glucosetype_finger">Deget</string>
<string name="glucosetype_sensor">Senzor</string>
<string name="manual">Manual</string>
@ -338,16 +333,12 @@
<string name="smscommunicator_loopisenabled">Bucla este activată</string>
<string name="valuelimitedto">%1$.2f este limitată la %2$.2f</string>
<string name="valueoutofrange" formatted="false">Valoarea %s este mai mare decât limita fizică</string>
<string name="smscommunicator_remotebasalnotallowed">Setarea de la distanță a bazalei nu este permisă</string>
<string name="smscommunicator_remotecommandnotallowed">Comanda de la distanță nu este permisă</string>
<string name="smscommunicator_basalreplywithcode">Pentru pornirea bazalei de %1$.2fU/h trimiteți codul %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Pentru suspendarea buclei pentru %1$d minute trimiteți codul %2$s</string>
<string name="smscommunicator_tempbasalset">Bazala temporară %1$.2fU/h pentru %2$d minute a fost trimisă cu succes</string>
<string name="smscommunicator_tempbasalfailed">Trimiterea bazalei temporare a eșuat</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Pentru oprirea bazalei temporare trimiteți codul %s</string>
<string name="smscommunicator_tempbasalcanceled">Bazala temporară a fost anulată</string>
<string name="smscommunicator_tempbasalcancelfailed">Renunțarea la bazala temporară a eșuat</string>
<string name="smscommunicator_unknowncommand">Comandă necunoscută sau răspuns greșit</string>
<string name="quickwizard">AsistentRapid</string>
<string name="quickwizardsettings">Setări AsistentRapid</string>
<string name="overview_editquickwizard_buttontext">Text buton:</string>
@ -471,7 +462,6 @@
<string name="send_calibration" formatted="false">Trimite calibrarea %.1f către xDrip?</string>
<string name="xdripnotinstalled">xDrip+ nu este instalat.</string>
<string name="calibrationsent">Calibrare trimisă către xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Calibrarea la distanță nu este permisă</string>
<string name="smscommunicator_calibrationsent">Calibrare trimisă. Recepționarea trebuie să fie activată și în xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip nu recepționează calibrări</string>
<string name="pumpsuspended">Livrare de insulină suspendată</string>

View file

@ -9,10 +9,10 @@
<string name="nav_resetdb">обнулить базы</string>
<string name="reset_db_confirm">Вы действительно хотите обнулить базы данных?</string>
<string name="nav_exit">Выход</string>
<string name="danar_useextended_title">Для величин &gt;200% пользуйтесь удлиненным болюсом</string>
<string name="danar_useextended_title">Для величин &gt;200% пользуйтесь пролонгированным болюсом</string>
<string name="danar_bt_name_title">устройство блутус danaR</string>
<string name="ns_sync_use_absolute_title">Всегда пользуйтесь абсолютными величинами для базала</string>
<string name="alert_dialog_storage_permission_text">Пожалуйста перезагрузите телефон или перезапустите AndroidAPS из системных настроек \nиначе AndroidAPS не будет вести лог (важно для отслеживания и проверки алгоритмов)!</string>
<string name="alert_dialog_storage_permission_text">Пожалуйста перезагрузите телефон или перезапустите AndroidAPS из системных настроек \иначе AndroidAPS не будет вести лог (важно для отслеживания и проверки алгоритмов)!</string>
<string name="description_actions">Кнопки быстрого доступа к некоторым распространенным настройкам</string>
<string name="description_careportal">Введите дополнительные записи логов.</string>
<string name="description_config_builder">Применяется для настройки активных плагинов</string>
@ -54,6 +54,7 @@
<string name="description_wear">Мониторить и контролировать AndroidAPS при помощи часов WearOS.</string>
<string name="description_xdrip_status_line">Показать информацию о работе алгоритма ИПЖ на экране смарт-часов xDrip+.</string>
<string name="description_sms_communicator">Дистанционное управление AndroidAPS при помощи команд SMS.</string>
<string name="objectives_button_back">Назад</string>
<string name="objectives_button_start">старт</string>
<string name="objectives_button_verify">Верификация</string>
<string name="nsprofileview_units_label">единицы</string>
@ -265,12 +266,11 @@
<string name="smscommunicator_bolusreplywithcode">Чтобы подать болюс %1$.2fU ответьте кодом %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">чтобы отправить калибровку %1$.2f ответьте кодом %2$s</string>
<string name="smscommunicator_bolusfailed">Подача болюса не состоялась</string>
<string name="bolusdelivered" formatted="false">Болюс %.2fU подан успешно</string>
<string name="bolusrequested" formatted="false">Начинается подача болюса %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Болюс %.2fU дан успешно</string>
<string name="bolusdelivering" formatted="false">Подается болюс %.2fU</string>
<string name="bolusdelivered">Болюс %1$.2fед. подан успешно</string>
<string name="bolusrequested">Начинается подача болюса %1$.2fед.</string>
<string name="smscommunicator_bolusdelivered">Болюс %1$.2fед. подан успешно</string>
<string name="bolusdelivering">Подается болюс %1$.2fед.</string>
<string name="smscommunicator_remotecommandsallowed">разрешить команды через смс</string>
<string name="smscommunicator_remotebolusnotallowed">Команда на удаленный болюс не разрешена</string>
<string name="glucosetype_finger">палец</string>
<string name="glucosetype_sensor">сенсор</string>
<string name="manual">вручную</string>
@ -338,16 +338,25 @@
<string name="smscommunicator_loopisenabled">зцикл работает</string>
<string name="valuelimitedto">%1$.2f ограничено до %2$.2f</string>
<string name="valueoutofrange" formatted="false">величина %s недопустима</string>
<string name="smscommunicator_remotebasalnotallowed">удаленная настройка базала не разрешена</string>
<string name="smscommunicator_remotecommandnotallowed">удаленная команда не разрешена</string>
<string name="smscommunicator_basalreplywithcode">чтобы начать базал %1$.2fU/h ответьте кодом %2$s</string>
<string name="smscommunicator_remotebolusnotallowed">Удаленный болюс недоступен, повторите попытку позже.</string>
<string name="smscommunicator_basalreplywithcode">Чтобы подать базал %1$.2fед./ч в течение %2$d мин. ответьте кодом %3$s</string>
<string name="smscommunicator_profilereplywithcode">Для переключения профиля на %1$s %2$d%% ответьте кодом %3$s</string>
<string name="smscommunicator_extendedreplywithcode">Для начала подачи пролонгированного болюса %1$.2fед. за %2$d мин. ответьте кодом %3$s</string>
<string name="smscommunicator_basalpctreplywithcode">Для начала подачи базала %1$d%% на %2$d мин. ответьте кодом %3$s</string>
<string name="smscommunicator_suspendreplywithcode">для приостановки цикла на %1$d мин ответьте кодом %2$s</string>
<string name="smscommunicator_tempbasalset">врем базал %1$.2fU/h на %2$d мин начат успешно</string>
<string name="smscommunicator_extendedset">Пролонгированный болюс %1$.2fед. на %2$d мин. начат успешно</string>
<string name="smscommunicator_tempbasalset_percent">Врем. базал %1$d%% на %2$d мин. начат успешно</string>
<string name="smscommunicator_tempbasalfailed">неуспех старта врем базала</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">чтобы прекратить врем базал ответьте кодом %s</string>
<string name="smscommunicator_extendedfailed">Не удалось начать подачу пролонгированного болюса</string>
<string name="smscommunicator_basalstopreplywithcode">Для прекращения подачи врем. базала ответьте кодом %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">Для прекращения подачи пролонгированного болюса ответьте кодом %1$s</string>
<string name="smscommunicator_tempbasalcanceled">врем базал отменен</string>
<string name="smscommunicator_extendedcanceled">Пролонгированный болюс отменен</string>
<string name="smscommunicator_tempbasalcancelfailed">отмена врем базала не состоялась</string>
<string name="smscommunicator_unknowncommand">неизвестная команда или неверный ответ</string>
<string name="smscommunicator_extendedcancelfailed">Сбой отмены пролонгированного болюса</string>
<string name="smscommunicator_unknowncommand">Неизвестная команда или неверный ответ</string>
<string name="quickwizard">БыстрыйБолюс</string>
<string name="quickwizardsettings">БыстрыйБолюс настройки</string>
<string name="overview_editquickwizard_buttontext">текст на кнопке</string>
@ -404,7 +413,7 @@
<string name="minago">%1$d мин. назад</string>
<string name="sms_minago">%1$d мин. назад</string>
<string name="localprofile">локальный профиль</string>
<string name="openapsama">Помощник болюса OpenAPS MA</string>
<string name="openapsama">Помощник болюса OpenAPS AMA</string>
<string name="short_avgdelta">краткосрочная средняя дельта</string>
<string name="long_avgdelta">Долгосрочная средняя дельта</string>
<string name="array_of_elements">Массив %1$d элементов. \nActual актуальная величина:</string>
@ -413,7 +422,7 @@
<string name="openapsama_useautosens">Пользоваться функцией Autosens</string>
<string name="refresheventsfromnightscout">обновить данные из NS</string>
<string name="deletefuturetreatments">Удалить назначения из будущего</string>
<string name="eatingsoon">Близкий прием пищи</string>
<string name="eatingsoon">Ожидаемый прием пищи</string>
<string name="hypo">Гипо</string>
<string name="activity">Нагрузка</string>
<string name="removerecord">удалить запись</string>
@ -471,7 +480,6 @@
<string name="send_calibration" formatted="false">отправить калибровку %.1f на xdrip?</string>
<string name="xdripnotinstalled">xdrip+ не установлен</string>
<string name="calibrationsent">калибровка передается на xdrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">удаленная калибровка не разрешена</string>
<string name="smscommunicator_calibrationsent">калибровка отправлена. в xdrip должен быть активирован прием</string>
<string name="smscommunicator_calibrationfailed">xdrip не получает калибровок</string>
<string name="pumpsuspended">Работа помпы остановлена</string>
@ -640,7 +648,7 @@
<string name="enableuam">Включить непредвиденный прием пищи UAM</string>
<string name="enablesmb">Включить супер микро болюс SMB</string>
<string name="enablesmb_summary">Для ускорения действия используйте супер микро болюсы SMB вместо временного базала</string>
<string name="enableuam_summary">Поиск непредвиденного приема пищи</string>
<string name="enableuam_summary">Поиск незапланированного приема пищи</string>
<string name="insulin_oref_peak">Время пика действующего инс IOB</string>
<string name="insulin_peak_time">время пика (в мин.)</string>
<string name="free_peak_oref">Свободный от пиков Oref</string>
@ -858,7 +866,7 @@
<string name="allow_automated_crash_reporting">Разрешить отправлять сообщения о неполадках и данные об использовании опций разработчикам при помощи сервиса fabric.io.</string>
<string name="g5appnotdetected">Пожалуйста, обновите приложение Dexcom до поддерживаемой версии</string>
<string name="start_activity_tt">Включить временную цель TT Нагрузка</string>
<string name="start_eating_soon_tt">Включить временную цель TT Скорый прием пищи</string>
<string name="start_eating_soon_tt">Включить временную цель TT Ожидаемый прием пищи</string>
<string name="temptargetshort">Временная цель (TT)</string>
<string name="do_not_bolus_record_only">Не подавать болюс, только внести запись</string>
<string name="category">Категория</string>
@ -1142,5 +1150,10 @@ Context | Edit Context</string>
<string name="tomato">Томато (MiaoMiao)</string>
<string name="tomato_short">Томато</string>
<string name="dst_in_24h_warning">Переход на летнее/зимнее время через 24 часа или менее</string>
<string name="dst_loop_disabled_warning">Переход на летнее/зимнее время менее чем через 3 часа - замкнутый цикл отключен</string>
<string name="storage">ограничение по объему карты памяти</string>
<string name="diskfull">Освободите по крайней мере %1$d MB из внутренней памяти! Цикл остановлен!</string>
<string name="wrongformat">Неверный формат</string>
<string name="sms_wrongcode">Неверный код. Команда отменена.</string>
<string name="notconfigured">Не сконфигурировано</string>
<string name="profileswitchcreated">Переключатель профиля создан</string>
</resources>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">Pre podanie bolusu %1$.2fU odpovedz SMS kódom %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Pre odoslanie kalibrácie %1$.2f odpovedz SMS kódom %2$s</string>
<string name="smscommunicator_bolusfailed">Chyba pri aplikovaní bolusu</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU aplikovaný úspešne</string>
<string name="bolusrequested" formatted="false">Spúšťam podávanie %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU podaný úspešne</string>
<string name="bolusdelivering" formatted="false">Podané %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Povoliť príkazy na diaľku cez SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Diaľkovo ovládaný bolus nie je povolený</string>
<string name="glucosetype_finger">Prst</string>
<string name="glucosetype_sensor">Senzor</string>
<string name="manual">Iný</string>
@ -338,16 +333,12 @@
<string name="smscommunicator_loopisenabled">Uzavretý okruh je aktivovaný</string>
<string name="valuelimitedto">%1$.2f obmedzené na %2$.2f</string>
<string name="valueoutofrange" formatted="false">Hodnota %s je mimo prednastavený rozsah</string>
<string name="smscommunicator_remotebasalnotallowed">Ovládanie bazálu na diaľku nie je povolené</string>
<string name="smscommunicator_remotecommandnotallowed">Príkazy na diaľku nie sú povolené</string>
<string name="smscommunicator_basalreplywithcode">Pre spustenie bazálu %1$.2fU/h odpovedaj SMS s kódom %2$s</string>
<string name="smscommunicator_suspendreplywithcode">Pre pozastavenie uzavretého okruhu na %1$d minút odpovedaj SMS s kódom %2$s</string>
<string name="smscommunicator_tempbasalset">Dočasný bazál %1$.2fU/h spustený na %2$d minút</string>
<string name="smscommunicator_tempbasalfailed">Spustenie dočasného bazálu zlyhalo</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Pre ukončenie dočasného bazálu odpovedaj SMS s kódom %s</string>
<string name="smscommunicator_tempbasalcanceled">Dočasný bazál zrušený</string>
<string name="smscommunicator_tempbasalcancelfailed">Zrušenie dočasného bazálu zlyhalo</string>
<string name="smscommunicator_unknowncommand">Neznámý príkaz alebo chybná odpoveď</string>
<string name="quickwizard">Rýchly bolus</string>
<string name="quickwizardsettings">Nastavenie rýchleho bolusu</string>
<string name="overview_editquickwizard_buttontext">Text na tlačidle:</string>
@ -471,7 +462,6 @@
<string name="send_calibration" formatted="false">Poslať kalibráciu %.1f do xDripu?</string>
<string name="xdripnotinstalled">xDrip+ nie je nainštalovaný</string>
<string name="calibrationsent">Kalibrácia odoslaná do xDripu</string>
<string name="smscommunicator_remotecalibrationnotallowed">Kalibrácia na diaľku nie je povolená</string>
<string name="smscommunicator_calibrationsent">Kalibrácia odoslaná. Príjem kalibrácií musí byť v xDripe povolený.</string>
<string name="smscommunicator_calibrationfailed">xDrip neprijíma kalibrácie</string>
<string name="pumpsuspended">Pumpa pozastavená</string>

View file

@ -266,12 +266,7 @@ Eversense-appen.</string>
<string name="smscommunicator_bolusreplywithcode">För att ge bolus %1$.2f enheter, svara med kod %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">För att skicka kalibrering %1$.2f, svara med kod %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus misslyckades</string>
<string name="bolusdelivered" formatted="false">Bolus %.2f enheter korrekt levererad</string>
<string name="bolusrequested" formatted="false">Kommer att leverera %.2f enheter</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2f enheter levererad</string>
<string name="bolusdelivering" formatted="false">Levererar %.2f enheter</string>
<string name="smscommunicator_remotecommandsallowed">Tillåt fjärrstyrning via SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Fjärrbolus är inte tillåtet</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manuell</string>
@ -339,16 +334,12 @@ Eversense-appen.</string>
<string name="smscommunicator_loopisenabled">Loop är aktiverad</string>
<string name="valuelimitedto">%1$.2f begränsat till %2$.2f</string>
<string name="valueoutofrange" formatted="false">Värdet %s är utanför hård begränsning</string>
<string name="smscommunicator_remotebasalnotallowed">Fjärrkommandon för att ändra basaler tillåts ej</string>
<string name="smscommunicator_remotecommandnotallowed">Otillåtet fjärrkommando</string>
<string name="smscommunicator_basalreplywithcode">För att starta temp basal %1$.2f enheter/tim, svara med kod %2$s</string>
<string name="smscommunicator_suspendreplywithcode">För att pausa loop i %1$d minuter, svara med kod %2$s</string>
<string name="smscommunicator_tempbasalset">Temp basal %1$.2f enheter/tim i %2$d min startad</string>
<string name="smscommunicator_tempbasalfailed">Fel vid start av temp basal</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">För att stoppa temp basal, svara med kod %s</string>
<string name="smscommunicator_tempbasalcanceled">Temp basal avbruten</string>
<string name="smscommunicator_tempbasalcancelfailed">Misslyckades med att avbryta temp basal</string>
<string name="smscommunicator_unknowncommand">Okänt kommando eller fel svar</string>
<string name="quickwizard">Kalkylator</string>
<string name="quickwizardsettings">Kalkylatorinställningar</string>
<string name="overview_editquickwizard_buttontext">Knapptext:</string>
@ -472,7 +463,6 @@ Eversense-appen.</string>
<string name="send_calibration" formatted="false">Skicka kalibrering %.1f till xDrip?</string>
<string name="xdripnotinstalled">xDrip+ inte installerat</string>
<string name="calibrationsent">Kalibrering skickad till xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Kalibrering från andra källor inte tillåtna</string>
<string name="smscommunicator_calibrationsent">Kalibrering skickad. Observera att xDrip måste vara inställd att ta emot kalibreringar.</string>
<string name="smscommunicator_calibrationfailed">xDrip tar inte emot kalibreringar</string>
<string name="pumpsuspended">Pump pausad</string>

View file

@ -263,12 +263,7 @@
<string name="smscommunicator_bolusreplywithcode">Bolus %1$.2fU gönderilecek, kod ile cevap ver %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">Kalibrasyon %1$.2f gönderilecek, kod ile cevap ver %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus başarısız oldu</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU başarıyla gönderildi</string>
<string name="bolusrequested" formatted="false">%.2fU Gönderilecek</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU başarıyla gönderildi</string>
<string name="bolusdelivering" formatted="false">%.2fU Gönderiliyor</string>
<string name="smscommunicator_remotecommandsallowed">SMS ile uzaktan komutlara izin ver</string>
<string name="smscommunicator_remotebolusnotallowed">Uzaktan bolus\'a izin verilmiyor</string>
<string name="glucosetype_finger">Parmak</string>
<string name="glucosetype_sensor">Sensör</string>
<string name="manual">Manuel</string>
@ -336,16 +331,12 @@
<string name="smscommunicator_loopisenabled">Döngü etkin</string>
<string name="valuelimitedto">%1$.2f dan %2$.2f olarak sınırlı</string>
<string name="valueoutofrange" formatted="false">Değer %s sabit sınırları dışında olduğunu</string>
<string name="smscommunicator_remotebasalnotallowed">Uzak bazal ayarına izin verilmez</string>
<string name="smscommunicator_remotecommandnotallowed">Uzaktan komuta izin verilmez</string>
<string name="smscommunicator_basalreplywithcode">Bazal\'ı %1$.2fÜ/s başlatmak için kodu %2$s ile yanıtlayın</string>
<string name="smscommunicator_suspendreplywithcode">%1$d dakika için Döngü\'yü askıya almak için %2$s kodunu yanıtla</string>
<string name="smscommunicator_tempbasalset">Geçici bazal %1$.2fÜ/s %2$d dakika için başarıyla başlatıldı</string>
<string name="smscommunicator_tempbasalfailed">Temp bazal başlatma başarısız oldu</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">Geçici bazal oranını iptal etmek için kodla %s yanıtla</string>
<string name="smscommunicator_tempbasalcanceled">Geçici bazal iptal</string>
<string name="smscommunicator_tempbasalcancelfailed">Geçici bazal iptali hata verdi</string>
<string name="smscommunicator_unknowncommand">Bilinmeyen komut veya yanlış cevap</string>
<string name="quickwizard">Kurulum Sihirbazı</string>
<string name="quickwizardsettings">Kurulum Sihirbazı Ayarları</string>
<string name="overview_editquickwizard_buttontext">Düğme Metni:</string>
@ -469,7 +460,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
<string name="send_calibration" formatted="false">Kalibrasyon %.1f xDrip\'e gönderilsin mi?</string>
<string name="xdripnotinstalled">xDrip+ uygulaması yüklenmemiş</string>
<string name="calibrationsent">Kalibrasyon xDrip+ a gönderildi</string>
<string name="smscommunicator_remotecalibrationnotallowed">Uzaktan kalibrasyona izin verilmiyor</string>
<string name="smscommunicator_calibrationsent">Kalibrasyon gönderildi. Alma xDrip+\'ta etkinleştirilmelidir.</string>
<string name="smscommunicator_calibrationfailed">xDrip+ kalibrasyonları almıyor</string>
<string name="pumpsuspended">Pompa durduldu</string>

View file

@ -265,12 +265,7 @@
<string name="smscommunicator_bolusreplywithcode">要输注大剂量胰岛素%1$.2fU 回复如下代码 %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">要发送校准值 %1$.2f 回复如下代码 %2$s</string>
<string name="smscommunicator_bolusfailed">大剂量输注失败</string>
<string name="bolusdelivered" formatted="false">成功输注大剂量%.2fU</string>
<string name="bolusrequested" formatted="false">将要输注 %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">成功输注大剂量%.2fU</string>
<string name="bolusdelivering" formatted="false">正在输注 %.2fU</string>
<string name="smscommunicator_remotecommandsallowed">通过SMS短信允许远程命令</string>
<string name="smscommunicator_remotebolusnotallowed">远程大剂量没有被允许</string>
<string name="glucosetype_finger">手指</string>
<string name="glucosetype_sensor">传感器</string>
<string name="manual">手动</string>
@ -338,16 +333,12 @@
<string name="smscommunicator_loopisenabled">闭环被启用</string>
<string name="valuelimitedto">%1$.2f 超过 %2$.2f的限制</string>
<string name="valueoutofrange" formatted="false">值 %s 超过了硬限制</string>
<string name="smscommunicator_remotebasalnotallowed">远程基础率设置没有被允许</string>
<string name="smscommunicator_remotecommandnotallowed">远程命令没有被允许</string>
<string name="smscommunicator_basalreplywithcode">要开始基础率 %1$.2fU/h 请回复如下代码 %2$s</string>
<string name="smscommunicator_suspendreplywithcode">要暂停闭环 %1$d 分钟请回复如下代码 %2$s</string>
<string name="smscommunicator_tempbasalset">临时基础率 %1$.2fU/h 持续 %2$d 分钟启用成功了</string>
<string name="smscommunicator_tempbasalfailed">开始临时基础率失败了</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">要停止临时基础率,请回复如下代码 %s</string>
<string name="smscommunicator_tempbasalcanceled">临时基础率取消了</string>
<string name="smscommunicator_tempbasalcancelfailed">取消临时基础率失败</string>
<string name="smscommunicator_unknowncommand">未知的命令或错误的回复</string>
<string name="quickwizard">快速向导</string>
<string name="quickwizardsettings">快速向导设置</string>
<string name="overview_editquickwizard_buttontext">按钮文本:</string>
@ -471,7 +462,6 @@
<string name="send_calibration" formatted="false">确认将校准值 %.1f 发送到 xDrip 吗?</string>
<string name="xdripnotinstalled">没有安装xDrip+</string>
<string name="calibrationsent">校准发送到 xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">远程校准没有被允许</string>
<string name="smscommunicator_calibrationsent">校准值发送了必须在xDrip开启允许通过其他app使用它的校准功能</string>
<string name="smscommunicator_calibrationfailed">xDrip 没有收到校准</string>
<string name="pumpsuspended">泵暂停了</string>

View file

@ -55,6 +55,7 @@
<string name="description_xdrip_status_line">Show information about your loop on your xDrip+ watchface.</string>
<string name="description_sms_communicator">Remote control AndroidAPS using SMS commands.</string>
<string name="objectives_button_back">Back</string>
<string name="objectives_button_start">Start</string>
<string name="objectives_button_verify">Verify</string>
<string name="nsprofileview_units_label">Units</string>
@ -293,12 +294,11 @@
<string name="smscommunicator_bolusreplywithcode">To deliver bolus %1$.2fU reply with code %2$s</string>
<string name="smscommunicator_calibrationreplywithcode">To send calibration %1$.2f reply with code %2$s</string>
<string name="smscommunicator_bolusfailed">Bolus failed</string>
<string name="bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
<string name="bolusrequested" formatted="false">Going to deliver %.2fU</string>
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
<string name="bolusdelivering" formatted="false">Delivering %.2fU</string>
<string name="bolusdelivered">Bolus %1$.2fU delivered successfully</string>
<string name="bolusrequested">Going to deliver %1$.2fU</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2fU delivered successfully</string>
<string name="bolusdelivering">Delivering %1$.2fU</string>
<string name="smscommunicator_remotecommandsallowed">Allow remote commands via SMS</string>
<string name="smscommunicator_remotebolusnotallowed">Remote bolus not allowed</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="manual">Manual</string>
@ -366,16 +366,25 @@
<string name="smscommunicator_loopisenabled">Loop is enabled</string>
<string name="valuelimitedto">%1$.2f limited to %2$.2f</string>
<string name="valueoutofrange" formatted="false">Value %s is out of hard limits</string>
<string name="smscommunicator_remotebasalnotallowed">Remote basal setting is not allowed</string>
<string name="smscommunicator_remotecommandnotallowed">Remote command is not allowed</string>
<string name="smscommunicator_basalreplywithcode">To start basal %1$.2fU/h reply with code %2$s</string>
<string name="smscommunicator_remotebolusnotallowed">Remote bolus not available. Try again later.</string>
<string name="smscommunicator_basalreplywithcode">To start basal %1$.2fU/h for %2$d min reply with code %3$s</string>
<string name="smscommunicator_profilereplywithcode">To switch profile to %1$s %2$d%% reply with code %3$s</string>
<string name="smscommunicator_extendedreplywithcode">To start extended bolus %1$.2fU for %2$d min 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_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_tempbasalset_percent">Temp basal %1$d%% for %2$d min started successfully</string>
<string name="smscommunicator_tempbasalfailed">Temp basal start failed</string>
<string name="smscommunicator_basalstopreplywithcode" formatted="false">To stop temp basal reply with code %s</string>
<string name="smscommunicator_extendedfailed">Extended bolus start failed</string>
<string name="smscommunicator_basalstopreplywithcode">To stop temp basal reply with code %1$s</string>
<string name="smscommunicator_extendedstopreplywithcode">To stop extended bolus reply with code %1$s</string>
<string name="smscommunicator_tempbasalcanceled">Temp basal canceled</string>
<string name="smscommunicator_extendedcanceled">Extended bolus canceled</string>
<string name="smscommunicator_tempbasalcancelfailed">Canceling temp basal failed</string>
<string name="smscommunicator_unknowncommand">Uknown command or wrong reply</string>
<string name="smscommunicator_extendedcancelfailed">Canceling extended bolus failed</string>
<string name="smscommunicator_unknowncommand">Unknown command or wrong reply</string>
<string name="quickwizard">QuickWizard</string>
<string name="quickwizardsettings">QuickWizard settings</string>
@ -508,7 +517,6 @@
<string name="send_calibration" formatted="false">Send calibration %.1f to xDrip?</string>
<string name="xdripnotinstalled">xDrip+ not installed</string>
<string name="calibrationsent">Calibration sent to xDrip</string>
<string name="smscommunicator_remotecalibrationnotallowed">Remote calibration not allowed</string>
<string name="smscommunicator_calibrationsent">Calibration sent. Receiving must be enabled in xDrip.</string>
<string name="smscommunicator_calibrationfailed">xDrip is not receiving calibrations</string>
<string name="pumpsuspended">Pump suspended</string>
@ -1311,8 +1319,13 @@
<string name="key_smbmaxminutes" translatable="false">smbmaxminutes</string>
<string name="dst_plugin_name" translatable="false">Dayligh Saving time</string>
<string name="dst_in_24h_warning">Dayligh Saving time change in 24h or less</string>
<string name="dst_loop_disabled_warning">Dayligh Saving time change in less than 3 hours - Closed loop diabled</string>
<string name="dst_loop_disabled_warning">Dayligh Saving time change less than 3 hours ago - Closed loop diabled</string>
<string name="storage">internal storage constraint</string>
<string name="diskfull">Free at least %1$d MB from internal storage! Loop disabled!</string>
<string name="wrongformat">Wrong format</string>
<string name="sms_wrongcode">Wrong code. Command cancelled.</string>
<string name="notconfigured">Not configured</string>
<string name="profileswitchcreated">Profile switch created</string>
<plurals name="objective_days">
<item quantity="one">%1$d day</item>
<item quantity="other">%1$d days</item>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string-array name="android_wear_capabilities">
<item>phone_app_sync_bgs</item>
</string-array>
</resources>

View file

@ -1,57 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference android:title="@string/insight_pairing">
<intent
android:targetClass="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity"
android:targetPackage="info.nightscout.androidaps" />
</Preference>
<PreferenceCategory android:title="@string/insight_local">
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_site_changes"
android:title="@string/log_site_changes" />
<Preference android:title="@string/insight_pairing">
<intent
android:targetClass="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity"
android:targetPackage="info.nightscout.androidaps" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_tube_changes"
android:title="@string/log_tube_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_site_changes"
android:title="@string/log_site_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_battery_changes"
android:title="@string/log_battery_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_tube_changes"
android:title="@string/log_tube_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_operating_mode_changes"
android:title="@string/log_operating_mode_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_battery_changes"
android:title="@string/log_battery_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_alerts"
android:title="@string/log_alerts" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_operating_mode_changes"
android:title="@string/log_operating_mode_changes" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_enable_tbr_emulation"
android:summary="@string/enable_tbr_emulation_summary"
android:title="@string/enable_tbr_emulation" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_log_alerts"
android:title="@string/log_alerts" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"
android:key="insight_min_recovery_duration"
android:title="@string/min_recovery_duration" />
<SwitchPreference
android:defaultValue="false"
android:key="insight_enable_tbr_emulation"
android:summary="@string/enable_tbr_emulation_summary"
android:title="@string/enable_tbr_emulation" />
<EditTextPreference
android:defaultValue="20"
android:inputType="number"
android:key="insight_max_recovery_duration"
android:title="@string/max_recovery_duration" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"
android:key="insight_min_recovery_duration"
android:title="@string/min_recovery_duration" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"
android:key="insight_disconnect_delay"
android:title="@string/disconnect_delay" />
<EditTextPreference
android:defaultValue="20"
android:inputType="number"
android:key="insight_max_recovery_duration"
android:title="@string/max_recovery_duration" />
<EditTextPreference
android:defaultValue="5"
android:inputType="number"
android:key="insight_disconnect_delay"
android:title="@string/disconnect_delay" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -2,6 +2,7 @@ package info;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import com.squareup.otto.Bus;
@ -9,6 +10,7 @@ import com.squareup.otto.Bus;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Assert;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import java.util.Locale;
@ -17,6 +19,7 @@ import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.ConstraintChecker;
import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.db.DatabaseHelper;
@ -24,11 +27,14 @@ import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentService;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.queue.CommandQueue;
import info.nightscout.androidaps.utils.SP;
@ -36,6 +42,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@ -51,6 +58,8 @@ public class AAPSMocker {
public static Intent intentSent = null;
public static CommandQueue queue;
public static void mockStrings() {
Locale.setDefault(new Locale("en", "US"));
@ -104,6 +113,43 @@ public class AAPSMocker {
when(MainApp.gs(R.string.profile_per_unit)).thenReturn("/U");
when(MainApp.gs(R.string.profile_carbs_per_unit)).thenReturn("g/U");
when(MainApp.gs(R.string.profile_ins_units_per_hout)).thenReturn("U/h");
when(MainApp.gs(R.string.sms_wrongcode)).thenReturn("Wrong code. Command cancelled.");
when(MainApp.gs(R.string.sms_iob)).thenReturn("IOB:");
when(MainApp.gs(R.string.sms_lastbg)).thenReturn("Last BG:");
when(MainApp.gs(R.string.sms_minago)).thenReturn("%1$dmin ago");
when(MainApp.gs(R.string.smscommunicator_remotecommandnotallowed)).thenReturn("Remote command is not allowed");
when(MainApp.gs(R.string.loopsuspendedfor)).thenReturn("Suspended (%1$d m)");
when(MainApp.gs(R.string.smscommunicator_loopisdisabled)).thenReturn("Loop is disabled");
when(MainApp.gs(R.string.smscommunicator_loopisenabled)).thenReturn("Loop is enabled");
when(MainApp.gs(R.string.wrongformat)).thenReturn("Wrong format");
when(MainApp.gs(R.string.smscommunicator_loophasbeendisabled)).thenReturn("Loop has been disabled");
when(MainApp.gs(R.string.smscommunicator_loophasbeenenabled)).thenReturn("Loop has been enabled");
when(MainApp.gs(R.string.smscommunicator_tempbasalcanceled)).thenReturn("Temp basal canceled");
when(MainApp.gs(R.string.smscommunicator_loopresumed)).thenReturn("Loop resumed");
when(MainApp.gs(R.string.smscommunicator_wrongduration)).thenReturn("Wrong duration");
when(MainApp.gs(R.string.smscommunicator_suspendreplywithcode)).thenReturn("To suspend loop for %1$d minutes reply with code %2$s");
when(MainApp.gs(R.string.smscommunicator_loopsuspended)).thenReturn("Loop suspended");
when(MainApp.gs(R.string.smscommunicator_unknowncommand)).thenReturn("Unknown command or wrong reply");
when(MainApp.gs(R.string.notconfigured)).thenReturn("Not configured");
when(MainApp.gs(R.string.smscommunicator_profilereplywithcode)).thenReturn("To switch profile to %1$s %2$d%% reply with code %3$s");
when(MainApp.gs(R.string.profileswitchcreated)).thenReturn("Profile switch created");
when(MainApp.gs(R.string.smscommunicator_basalstopreplywithcode)).thenReturn("To stop temp basal reply with code %1$s");
when(MainApp.gs(R.string.smscommunicator_basalpctreplywithcode)).thenReturn("To start basal %1$d%% for %2$d min reply with code %3$s");
when(MainApp.gs(R.string.smscommunicator_tempbasalset_percent)).thenReturn("Temp basal %1$d%% for %2$d min started successfully");
when(MainApp.gs(R.string.smscommunicator_basalreplywithcode)).thenReturn("To start basal %1$.2fU/h for %2$d min reply with code %3$s");
when(MainApp.gs(R.string.smscommunicator_tempbasalset)).thenReturn("Temp basal %1$.2fU/h for %2$d min started successfully");
when(MainApp.gs(R.string.smscommunicator_extendedstopreplywithcode)).thenReturn("To stop extended bolus reply with code %1$s");
when(MainApp.gs(R.string.smscommunicator_extendedcanceled)).thenReturn("Extended bolus canceled");
when(MainApp.gs(R.string.smscommunicator_extendedreplywithcode)).thenReturn("To start extended bolus %1$.2fU for %2$d min reply with code %3$s");
when(MainApp.gs(R.string.smscommunicator_extendedset)).thenReturn("Extended bolus %1$.2fU for %2$d min started successfully");
when(MainApp.gs(R.string.smscommunicator_bolusreplywithcode)).thenReturn("To deliver bolus %1$.2fU reply with code %2$s");
when(MainApp.gs(R.string.smscommunicator_bolusdelivered)).thenReturn("Bolus %1$.2fU delivered successfully");
when(MainApp.gs(R.string.smscommunicator_remotebolusnotallowed)).thenReturn("Remote bolus not available. Try again later.");
when(MainApp.gs(R.string.smscommunicator_calibrationreplywithcode)).thenReturn("To send calibration %1$.2f reply with code %2$s");
when(MainApp.gs(R.string.smscommunicator_calibrationsent)).thenReturn("Calibration sent. Receiving must be enabled in xDrip.");
when(MainApp.gs(R.string.pumpsuspended)).thenReturn("Pump suspended");
when(MainApp.gs(R.string.cob)).thenReturn("COB");
when(MainApp.gs(R.string.value_unavailable_short)).thenReturn("n/a");
}
public static MainApp mockMainApp() {
@ -143,7 +189,7 @@ public class AAPSMocker {
when(L.isEnabled(any())).thenReturn(true);
}
public static void mockNSUpload(){
public static void mockNSUpload() {
PowerMockito.mockStatic(NSUpload.class);
}
@ -152,6 +198,8 @@ public class AAPSMocker {
Resources mResources = mock(Resources.class);
when(MainApp.instance().getApplicationContext()).thenReturn(mockedContext);
when(mockedContext.getResources()).thenReturn(mResources);
PackageManager packageManager = mock(PackageManager.class);
when(mockedContext.getPackageManager()).thenReturn(packageManager);
}
public static DatabaseHelper mockDatabaseHelper() {
@ -161,7 +209,7 @@ public class AAPSMocker {
}
public static void mockCommandQueue() {
CommandQueue queue = mock(CommandQueue.class);
queue = mock(CommandQueue.class);
when(ConfigBuilderPlugin.getPlugin().getCommandQueue()).thenReturn(queue);
}
@ -169,12 +217,21 @@ public class AAPSMocker {
PowerMockito.mockStatic(TreatmentsPlugin.class);
TreatmentsPlugin treatmentsPlugin = PowerMockito.mock(TreatmentsPlugin.class);
when(TreatmentsPlugin.getPlugin()).thenReturn(treatmentsPlugin);
when(treatmentsPlugin.getLastCalculationTreatments()).thenReturn(new IobTotal(0));
when(treatmentsPlugin.getLastCalculationTempBasals()).thenReturn(new IobTotal(0));
TreatmentService treatmentService = PowerMockito.mock(TreatmentService.class);
when(treatmentsPlugin.getService()).thenReturn(treatmentService);
return treatmentsPlugin;
}
public static void mockTreatmentService() throws Exception {
public static void mockTreatmentService() {
TreatmentService treatmentService = PowerMockito.mock(TreatmentService.class);
PowerMockito.whenNew(TreatmentService.class).withNoArguments().thenReturn(treatmentService);
try {
PowerMockito.whenNew(TreatmentService.class).withNoArguments().thenReturn(treatmentService);
} catch (Exception e) {
}
}
public static DanaRPlugin mockDanaRPlugin() {
@ -221,6 +278,14 @@ public class AAPSMocker {
PowerMockito.when(ProfileFunctions.getInstance()).thenReturn(profileFunctions);
profile = getValidProfile();
PowerMockito.when(ProfileFunctions.getInstance().getProfile()).thenReturn(profile);
PowerMockito.when(ProfileFunctions.getInstance().getProfileUnits()).thenReturn(Constants.MGDL);
PowerMockito.when(ProfileFunctions.getInstance().getProfileName()).thenReturn(TESTPROFILENAME);
}
public static void mockIobCobCalculatorPlugin() {
PowerMockito.mockStatic(IobCobCalculatorPlugin.class);
IobCobCalculatorPlugin iobCobCalculatorPlugin = PowerMockito.mock(IobCobCalculatorPlugin.class);
PowerMockito.when(IobCobCalculatorPlugin.getPlugin()).thenReturn(iobCobCalculatorPlugin);
}
private static MockedBus bus = new MockedBus();

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
@ -9,6 +10,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
import info.AAPSMocker;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.utils.SP;
/**
@ -16,15 +18,11 @@ import info.nightscout.androidaps.utils.SP;
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({MainApp.class, SP.class})
@PrepareForTest({MainApp.class, SP.class, L.class})
public class ConstraintTest {
@Test
public void doTests() {
AAPSMocker.mockMainApp();
AAPSMocker.mockApplicationContext();
AAPSMocker.mockSP();
Constraint<Boolean> b = new Constraint<>(true);
Assert.assertEquals(Boolean.TRUE, b.value());
Assert.assertEquals("", b.getReasons());
@ -56,5 +54,18 @@ public class ConstraintTest {
Assert.assertEquals("ConstraintTest: Set 5d\nConstraintTest: Set 6d\nConstraintTest: Set 4d", d.getReasons());
Assert.assertEquals("ConstraintTest: Set 4d", d.getMostLimitedReasons());
Assert.assertEquals(10d, d.originalValue());
d.setIfDifferent(7d, "Set 7d", this);
Assert.assertEquals(7d, d.value());
Assert.assertEquals("ConstraintTest: Set 5d\nConstraintTest: Set 6d\nConstraintTest: Set 4d\nConstraintTest: Set 7d", d.getReasons());
Assert.assertEquals("ConstraintTest: Set 4d\nConstraintTest: Set 7d", d.getMostLimitedReasons());
Assert.assertEquals(10d, d.originalValue());
}
@Before
public void prepareMock() {
AAPSMocker.mockMainApp();
AAPSMocker.mockApplicationContext();
AAPSMocker.mockSP();
AAPSMocker.mockL();
}
}

View file

@ -54,6 +54,7 @@ public class ConstraintsCheckerTest {
DanaRPlugin danaRPlugin;
DanaRSPlugin danaRSPlugin;
LocalInsightPlugin insightPlugin;
OpenAPSSMBPlugin openAPSSMBPlugin;
boolean notificationSent = false;
@ -119,6 +120,14 @@ public class ConstraintsCheckerTest {
Assert.assertEquals(Boolean.FALSE, c.value());
}
@Test
public void isSuperBolusEnabledTest() throws Exception {
OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, true);
Constraint<Boolean> c = constraintChecker.isSuperBolusEnabled();
Assert.assertEquals(Boolean.FALSE, c.value()); // SMB should limit
}
@Test
public void isSMBModeEnabledTest() throws Exception {
objectivesPlugin.objectives.get(7).setStartedOn(null);
@ -288,6 +297,7 @@ public class ConstraintsCheckerTest {
danaRPlugin = DanaRPlugin.getPlugin();
danaRSPlugin = DanaRSPlugin.getPlugin();
insightPlugin = LocalInsightPlugin.getPlugin();
openAPSSMBPlugin = OpenAPSSMBPlugin.getPlugin();
ArrayList<PluginBase> constraintsPluginsList = new ArrayList<>();
constraintsPluginsList.add(safetyPlugin);
constraintsPluginsList.add(objectivesPlugin);
@ -295,6 +305,7 @@ public class ConstraintsCheckerTest {
constraintsPluginsList.add(danaRPlugin);
constraintsPluginsList.add(danaRSPlugin);
constraintsPluginsList.add(insightPlugin);
constraintsPluginsList.add(openAPSSMBPlugin);
when(mainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class)).thenReturn(constraintsPluginsList);
}

View file

@ -9,7 +9,11 @@ import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import info.AAPSMocker;
@ -27,39 +31,46 @@ public class DstHelperPluginTest {
public void runTest() throws Exception {
AAPSMocker.mockMainApp();
AAPSMocker.mockApplicationContext();
// test different time zones
//Starting with Europe/Sofia
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("Europe/Sofia"));
c.setTimeInMillis(DateUtil.fromISODateString("2018-10-28T02:00:00Z").getTime());
int minutesLeftToChange = plugin.dstTest(c);
Assert.assertEquals(60, minutesLeftToChange);
c.setTimeInMillis(DateUtil.fromISODateString("2018-03-25T02:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
Assert.assertEquals(60, minutesLeftToChange);
// try something with half hour somewhere in Australia
c = Calendar.getInstance(TimeZone.getTimeZone("Australia/Lord_Howe"));
c.setTimeInMillis(DateUtil.fromISODateString("2018-04-01T00:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
// try something with half hour somewhere in Australia
c = Calendar.getInstance(TimeZone.getTimeZone("Australia/Lord_Howe"));
c.setTimeInMillis(DateUtil.fromISODateString("2018-04-01T00:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
Assert.assertEquals(90, minutesLeftToChange);
c = Calendar.getInstance(TimeZone.getTimeZone("Australia/Lord_Howe"));
// and back
c.setTimeInMillis(DateUtil.fromISODateString("2018-10-07T00:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
Assert.assertEquals(120, minutesLeftToChange);
c.setTimeInMillis(DateUtil.fromISODateString("2018-10-08T00:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
Assert.assertEquals(0, minutesLeftToChange);
TimeZone tz = TimeZone.getTimeZone("Europe/Rome");
TimeZone.setDefault(tz);
Calendar cal = Calendar.getInstance(tz, Locale.ITALIAN);
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.ITALIAN);
Date dateBeforeDST = df.parse("2018-03-25 01:55");
cal.setTime(dateBeforeDST);
Assert.assertEquals(false, plugin.wasDST(cal));
Assert.assertEquals(true, plugin.willBeDST(cal));
TimeZone.setDefault(tz);
cal = Calendar.getInstance(tz, Locale.ITALIAN);
dateBeforeDST = df.parse("2018-03-25 03:05");
cal.setTime(dateBeforeDST);
Assert.assertEquals(true, plugin.wasDST(cal));
Assert.assertEquals(false, plugin.willBeDST(cal));
TimeZone.setDefault(tz);
cal = Calendar.getInstance(tz, Locale.ITALIAN);
dateBeforeDST = df.parse("2018-03-25 02:05"); //Cannot happen!!!
cal.setTime(dateBeforeDST);
Assert.assertEquals(true, plugin.wasDST(cal));
Assert.assertEquals(false, plugin.willBeDST(cal));
TimeZone.setDefault(tz);
cal = Calendar.getInstance(tz, Locale.ITALIAN);
dateBeforeDST = df.parse("2018-03-25 05:55"); //Cannot happen!!!
cal.setTime(dateBeforeDST);
Assert.assertEquals(true, plugin.wasDST(cal));
Assert.assertEquals(false, plugin.willBeDST(cal));
TimeZone.setDefault(tz);
cal = Calendar.getInstance(tz, Locale.ITALIAN);
dateBeforeDST = df.parse("2018-03-25 06:05"); //Cannot happen!!!
cal.setTime(dateBeforeDST);
Assert.assertEquals(false, plugin.wasDST(cal));
Assert.assertEquals(false, plugin.willBeDST(cal));
// DST event was 30 mins
c.setTimeInMillis(DateUtil.fromISODateString("2018-04-01T02:00:00Z").getTime());
minutesLeftToChange = plugin.dstTest(c);
// Assert.assertEquals(630, plugin.zoneOffsetInMinutes(c));
Assert.assertEquals(0, minutesLeftToChange);
}
}

View file

@ -0,0 +1,80 @@
package info.nightscout.androidaps.plugins.constraints.storage;
import android.os.Environment;
import android.os.StatFs;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.File;
import info.AAPSMocker;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.mock;
import static org.powermock.api.mockito.PowerMockito.whenNew;
import static org.mockito.ArgumentMatchers.any;
/**
* Created by Rumen on 06.03.2019.
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({MainApp.class, StorageConstraintPlugin.class, StatFs.class, Environment.class})
public class StorageConstraintPluginTest extends StorageConstraintPlugin{
StorageConstraintPlugin storageConstraintPlugin;
private File mockedFile;
private static final String path = "/data";
private StatFs mockedStatFs;
@Test
public void isLoopInvocationAllowedTest(){
PowerMockito.mockStatic(StorageConstraintPlugin.class);
// Set free space under 200(Mb) to disable loop
when(StorageConstraintPlugin.getAvailableInternalMemorySize()).thenReturn(150L);
Constraint<Boolean> c = new Constraint<>(true);
c = storageConstraintPlugin.isClosedLoopAllowed(c);
Assert.assertEquals(Boolean.FALSE, c.value());
// Set free space over 200(Mb) to enable loop
when(StorageConstraintPlugin.getAvailableInternalMemorySize()).thenReturn(300L);
Constraint<Boolean> c2 = new Constraint<>(true);
c2 = storageConstraintPlugin.isClosedLoopAllowed(c2);
Assert.assertEquals(Boolean.TRUE, c2.value());
}
@Test
public void getAvailableInternalMemorySizeTest() throws Exception {
PowerMockito.mockStatic(Environment.class);
PowerMockito.when(Environment.getDataDirectory()).thenReturn(mockedFile);
when(mockedFile.getPath()).thenReturn(path);
when(mockedFile.exists()).thenReturn(true);
whenNew(StatFs.class).withArguments(any()).thenReturn(mockedStatFs);
when(mockedStatFs.getBlockSizeLong()).thenReturn(1024L);
when(mockedStatFs.getAvailableBlocksLong()).thenReturn(150l*1024);
long freeSpaceInMb = storageConstraintPlugin.getAvailableInternalMemorySize();
Assert.assertEquals(150L, freeSpaceInMb);
}
@Before
public void prepareMock() {
AAPSMocker.mockMainApp();
AAPSMocker.mockStrings();
AAPSMocker.mockBus();
mockedFile = mock(File.class);
mockedStatFs = mock(StatFs.class);
storageConstraintPlugin = StorageConstraintPlugin.getPlugin();
}
}

View file

@ -0,0 +1,94 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.stubbing.Answer;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.Date;
import info.AAPSMocker;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
import static org.mockito.ArgumentMatchers.any;
import static org.powermock.api.mockito.PowerMockito.doAnswer;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PrepareForTest({SmsCommunicatorPlugin.class, L.class, SP.class, MainApp.class, DateUtil.class})
public class AuthRequestTest {
SmsCommunicatorPlugin smsCommunicatorPlugin;
Sms sentSms;
boolean actionCalled = false;
@Test
public void doTests() {
Sms requester = new Sms("aNumber", "aText");
SmsAction action = new SmsAction() {
@Override
public void run() {
actionCalled = true;
}
};
// Check if SMS requesting code is sent
AuthRequest authRequest = new AuthRequest(smsCommunicatorPlugin, requester, "Request text", "ABC", action);
Assert.assertEquals(sentSms.phoneNumber, "aNumber");
Assert.assertEquals(sentSms.text, "Request text");
// wrong reply
actionCalled = false;
authRequest.action("EFG");
Assert.assertEquals(sentSms.phoneNumber, "aNumber");
Assert.assertEquals(sentSms.text, "Wrong code. Command cancelled.");
Assert.assertFalse(actionCalled);
// correct reply
authRequest = new AuthRequest(smsCommunicatorPlugin, requester, "Request text", "ABC", action);
actionCalled = false;
authRequest.action("ABC");
Assert.assertTrue(actionCalled);
// second time action should not be called
actionCalled = false;
authRequest.action("ABC");
Assert.assertFalse(actionCalled);
// test timed out message
long now = 10000;
when(DateUtil.now()).thenReturn(now);
authRequest = new AuthRequest(smsCommunicatorPlugin, requester, "Request text", "ABC", action);
actionCalled = false;
when(DateUtil.now()).thenReturn(now + T.mins(Constants.SMS_CONFIRM_TIMEOUT).msecs() + 1);
authRequest.action("ABC");
Assert.assertFalse(actionCalled);
}
@Before
public void prepareTests() {
smsCommunicatorPlugin = mock(SmsCommunicatorPlugin.class);
doAnswer((Answer) invocation -> {
sentSms = invocation.getArgument(0);
return null;
}).when(smsCommunicatorPlugin).sendSMS(any(Sms.class));
AAPSMocker.mockMainApp();
AAPSMocker.mockApplicationContext();
AAPSMocker.mockSP();
AAPSMocker.mockL();
AAPSMocker.mockStrings();
mockStatic(DateUtil.class);
}
}

View file

@ -0,0 +1,90 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
import android.telephony.SmsMessage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import info.AAPSMocker;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
public class SmsActionTest {
String result = "";
@Test
public void doTests() {
SmsAction smsAction = new SmsAction() {
@Override
public void run() {
result = "A";
}
};
smsAction.run();
Assert.assertEquals(result, "A");
smsAction = new SmsAction(1d) {
@Override
public void run() {
result = "B";
}
};
smsAction.run();
Assert.assertEquals(result, "B");
Assert.assertEquals(smsAction.aDouble, 1d, 0.000001d);
smsAction = new SmsAction(1d, 2) {
@Override
public void run() {
result = "C";
}
};
smsAction.run();
Assert.assertEquals(result, "C");
Assert.assertEquals(smsAction.aDouble, 1d, 0.000001d);
Assert.assertEquals(smsAction.secondInteger.intValue(), 2);
smsAction = new SmsAction("aString", 3) {
@Override
public void run() {
result = "D";
}
};
smsAction.run();
Assert.assertEquals(result, "D");
Assert.assertEquals(smsAction.aString, "aString");
Assert.assertEquals(smsAction.secondInteger.intValue(), 3);
smsAction = new SmsAction(4) {
@Override
public void run() {
result = "E";
}
};
smsAction.run();
Assert.assertEquals(result, "E");
Assert.assertEquals(smsAction.anInteger.intValue(), 4);
smsAction = new SmsAction(5, 6) {
@Override
public void run() {
result = "F";
}
};
smsAction.run();
Assert.assertEquals(result, "F");
Assert.assertEquals(smsAction.anInteger.intValue(), 5);
Assert.assertEquals(smsAction.secondInteger.intValue(), 6);
}
}

View file

@ -0,0 +1,804 @@
package info.nightscout.androidaps.plugins.general.smsCommunicator;
import android.telephony.SmsManager;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.ArrayList;
import java.util.List;
import info.AAPSMocker;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.profile.simple.SimpleProfilePlugin;
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.queue.CommandQueue;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.XdripCalibrations;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyDouble;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.powermock.api.mockito.PowerMockito.doAnswer;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PrepareForTest({
L.class, SP.class, MainApp.class, DateUtil.class, ProfileFunctions.class,
TreatmentsPlugin.class, SmsManager.class, IobCobCalculatorPlugin.class,
CommandQueue.class, ConfigBuilderPlugin.class, NSUpload.class, ProfileInterface.class,
SimpleProfilePlugin.class, XdripCalibrations.class, VirtualPumpPlugin.class
})
public class SmsCommunicatorPluginTest {
private SmsCommunicatorPlugin smsCommunicatorPlugin;
private LoopPlugin loopPlugin;
private boolean hasBeenRun = false;
@Test
public void processSettingsTest() {
// called from constructor
Assert.assertEquals("1234", smsCommunicatorPlugin.allowedNumbers.get(0));
Assert.assertEquals("5678", smsCommunicatorPlugin.allowedNumbers.get(1));
Assert.assertEquals(2, smsCommunicatorPlugin.allowedNumbers.size());
}
@Test
public void isCommandTest() {
Assert.assertTrue(smsCommunicatorPlugin.isCommand("BOLUS", ""));
smsCommunicatorPlugin.messageToConfirm = null;
Assert.assertFalse(smsCommunicatorPlugin.isCommand("BLB", ""));
smsCommunicatorPlugin.messageToConfirm = new AuthRequest(smsCommunicatorPlugin, new Sms("1234", "ddd"), "RequestText", "ccode", new SmsAction() {
@Override
public void run() {
}
});
Assert.assertTrue(smsCommunicatorPlugin.isCommand("BLB", "1234"));
Assert.assertFalse(smsCommunicatorPlugin.isCommand("BLB", "2345"));
smsCommunicatorPlugin.messageToConfirm = null;
}
@Test
public void isAllowedNumberTest() {
Assert.assertTrue(smsCommunicatorPlugin.isAllowedNumber("5678"));
Assert.assertFalse(smsCommunicatorPlugin.isAllowedNumber("56"));
}
@Test
public void processSmsTest() {
Sms sms;
// SMS from not allowed number should be ignored
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("12", "aText");
smsCommunicatorPlugin.processSms(sms);
Assert.assertTrue(sms.ignored);
Assert.assertEquals("aText", smsCommunicatorPlugin.messages.get(0).text);
//UNKNOWN
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "UNKNOWN");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("UNKNOWN", smsCommunicatorPlugin.messages.get(0).text);
//BG
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BG");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BG", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("IOB:"));
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("Last BG: 100"));
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("COB: 10(2)g"));
// LOOP : test remote control disabled
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP STATUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP STATUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("Remote command is not allowed"));
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//LOOP STATUS : disabled
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP STATUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("LOOP STATUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop is disabled", smsCommunicatorPlugin.messages.get(1).text);
//LOOP STATUS : suspended
when(loopPlugin.minutesToEndOfSuspend()).thenReturn(10);
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(true);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP STATUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("LOOP STATUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Suspended (10 m)", smsCommunicatorPlugin.messages.get(1).text);
//LOOP STATUS : enabled
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP STATUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP STATUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop is enabled", smsCommunicatorPlugin.messages.get(1).text);
//LOOP : wrong format
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//LOOP DISABLE : already disabled
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP DISABLE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP DISABLE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop is disabled", smsCommunicatorPlugin.messages.get(1).text);
//LOOP DISABLE : from enabled
hasBeenRun = false;
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
doAnswer((Answer) invocation -> {
hasBeenRun = true;
return null;
}).when(loopPlugin).setPluginEnabled(PluginType.LOOP, false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP DISABLE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP DISABLE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop has been disabled Temp basal canceled", smsCommunicatorPlugin.messages.get(1).text);
Assert.assertTrue(hasBeenRun);
//LOOP ENABLE : already enabled
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP ENABLE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP ENABLE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop is enabled", smsCommunicatorPlugin.messages.get(1).text);
//LOOP ENABLE : from disabled
hasBeenRun = false;
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(false);
doAnswer((Answer) invocation -> {
hasBeenRun = true;
return null;
}).when(loopPlugin).setPluginEnabled(PluginType.LOOP, true);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP ENABLE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP ENABLE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop has been enabled", smsCommunicatorPlugin.messages.get(1).text);
Assert.assertTrue(hasBeenRun);
//LOOP RESUME : already enabled
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP RESUME");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP RESUME", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Loop resumed", smsCommunicatorPlugin.messages.get(1).text);
//LOOP SUSPEND 1 2: wrong format
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP SUSPEND 1 2");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP SUSPEND 1 2", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//LOOP SUSPEND 0 : wrong duration
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP SUSPEND 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP SUSPEND 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong duration", smsCommunicatorPlugin.messages.get(1).text);
//LOOP SUSPEND 100 : suspend for 100 min + correct answer
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP SUSPEND 100");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP SUSPEND 100", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To suspend loop for 100 minutes reply with code "));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Loop suspended Temp basal canceled", smsCommunicatorPlugin.messages.get(3).text);
//LOOP SUSPEND 200 : limit to 180 min + wrong answer
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP SUSPEND 200");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP SUSPEND 200", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To suspend loop for 180 minutes reply with code "));
passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
// ignore from other number
smsCommunicatorPlugin.processSms(new Sms("5678", passCode));
smsCommunicatorPlugin.processSms(new Sms("1234", "XXXX"));
Assert.assertEquals("XXXX", smsCommunicatorPlugin.messages.get(3).text);
Assert.assertEquals("Wrong code. Command cancelled.", smsCommunicatorPlugin.messages.get(4).text);
//then correct code should not work
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(5).text);
Assert.assertEquals(6, smsCommunicatorPlugin.messages.size()); // processed as common message
//LOOP BLABLA
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "LOOP BLABLA");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("LOOP BLABLA", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//TREATMENTS REFRESH
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "TREATMENTS REFRESH");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("TREATMENTS REFRESH", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("TREATMENTS REFRESH"));
//TREATMENTS BLA BLA
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "TREATMENTS BLA BLA");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("TREATMENTS BLA BLA", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//TREATMENTS BLABLA
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "TREATMENTS BLABLA");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("TREATMENTS BLABLA", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//NSCLIENT RESTART
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "NSCLIENT RESTART");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("NSCLIENT RESTART", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("NSCLIENT RESTART"));
//NSCLIENT BLA BLA
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "NSCLIENT BLA BLA");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("NSCLIENT BLA BLA", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//NSCLIENT BLABLA
when(loopPlugin.isEnabled(PluginType.LOOP)).thenReturn(true);
when(loopPlugin.isSuspended()).thenReturn(false);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "NSCLIENT BLABLA");
smsCommunicatorPlugin.processSms(sms);
Assert.assertFalse(sms.ignored);
Assert.assertEquals("NSCLIENT BLABLA", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//PUMP
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PUMP");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PUMP", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Virtual Pump", smsCommunicatorPlugin.messages.get(1).text);
}
@Test
public void processProfileTest() {
Sms sms;
//PROFILE
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote command is not allowed", smsCommunicatorPlugin.messages.get(1).text);
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//PROFILE
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//PROFILE LIST (no profile interface)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE LIST");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE LIST", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Not configured", smsCommunicatorPlugin.messages.get(1).text);
ProfileInterface profileInterface = mock(SimpleProfilePlugin.class);
when(ConfigBuilderPlugin.getPlugin().getActiveProfileInterface()).thenReturn(profileInterface);
//PROFILE LIST (no profile defined)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE LIST");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE LIST", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Not configured", smsCommunicatorPlugin.messages.get(1).text);
when(profileInterface.getProfile()).thenReturn(AAPSMocker.getValidProfileStore());
//PROFILE STATUS
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE STATUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE STATUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals(AAPSMocker.TESTPROFILENAME, smsCommunicatorPlugin.messages.get(1).text);
//PROFILE LIST
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE LIST");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE LIST", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("1. " + AAPSMocker.TESTPROFILENAME, smsCommunicatorPlugin.messages.get(1).text);
//PROFILE 2 (non existing)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE 2");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE 2", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//PROFILE 1 0(wrong percentage)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE 1 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE 1 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//PROFILE 0(wrong index)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//PROFILE 1(OK)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE 1");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE 1", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To switch profile to someProfile 100% reply with code"));
//PROFILE 1 90(OK)
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "PROFILE 1 90");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("PROFILE 1 90", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To switch profile to someProfile 90% reply with code"));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Profile switch created", smsCommunicatorPlugin.messages.get(3).text);
}
@Test
public void processBasalTest() {
Sms sms;
//BASAL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote command is not allowed", smsCommunicatorPlugin.messages.get(1).text);
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//BASAL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//BASAL CANCEL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL CANCEL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL CANCEL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To stop temp basal reply with code"));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Temp basal canceled\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
//BASAL a%
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL a%");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL a%", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//BASAL 10% 0
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL 10% 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL 10% 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyBasalPercentConstraints(any(), any())).thenReturn(new Constraint<>(20));
//BASAL 20% 20
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL 20% 20");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL 20% 20", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To start basal 20% for 20 min reply with code"));
passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Temp basal 20% for 20 min started successfully\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
//BASAL a
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL a");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL a", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//BASAL 1 0
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL 1 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL 1 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyBasalConstraints(any(), any())).thenReturn(new Constraint<>(1d));
//BASAL 1 20
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BASAL 1 20");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BASAL 1 20", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To start basal 1.00U/h for 20 min reply with code"));
passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Temp basal 1.00U/h for 20 min started successfully\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
}
@Test
public void processExtendedTest() {
Sms sms;
//EXTENDED
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote command is not allowed", smsCommunicatorPlugin.messages.get(1).text);
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//EXTENDED
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//EXTENDED CANCEL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED CANCEL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED CANCEL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To stop extended bolus reply with code"));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Extended bolus canceled\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
//EXTENDED a%
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED a%");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED a%", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyExtendedBolusConstraints(any())).thenReturn(new Constraint<>(1d));
//EXTENDED 1 0
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED 1 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED 1 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//EXTENDED 1 20
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "EXTENDED 1 20");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("EXTENDED 1 20", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To start extended bolus 1.00U for 20 min reply with code"));
passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Extended bolus 1.00U for 20 min started successfully\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
}
@Test
public void processBolusTest() {
Sms sms;
//BOLUS
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote command is not allowed", smsCommunicatorPlugin.messages.get(1).text);
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//BOLUS
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyBolusConstraints(any())).thenReturn(new Constraint<>(1d));
when(DateUtil.now()).thenReturn(1000L);
//BOLUS 1
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS 1");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS 1", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote bolus not available. Try again later.", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyBolusConstraints(any())).thenReturn(new Constraint<>(0d));
when(DateUtil.now()).thenReturn(Constants.remoteBolusMinDistance + 1002L);
//BOLUS 0
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//BOLUS a
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS a");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS a", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(MainApp.getConstraintChecker().applyExtendedBolusConstraints(any())).thenReturn(new Constraint<>(1d));
when(MainApp.getConstraintChecker().applyBolusConstraints(any())).thenReturn(new Constraint<>(1d));
//BOLUS 1
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS 1");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS 1", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To deliver bolus 1.00U reply with code"));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Bolus 1.00U delivered successfully\nVirtual Pump", smsCommunicatorPlugin.messages.get(3).text);
//BOLUS 1 (Suspended pump)
smsCommunicatorPlugin.lastRemoteBolusTime = 0;
PumpInterface pump = mock(VirtualPumpPlugin.class);
when(ConfigBuilderPlugin.getPlugin().getActivePump()).thenReturn(pump);
when(pump.isSuspended()).thenReturn(true);
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "BOLUS 1");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("BOLUS 1", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Pump suspended", smsCommunicatorPlugin.messages.get(1).text);
when(pump.isSuspended()).thenReturn(false);
}
@Test
public void processCalTest() {
Sms sms;
//CAL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "CAL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("CAL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Remote command is not allowed", smsCommunicatorPlugin.messages.get(1).text);
when(SP.getBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)).thenReturn(true);
//CAL
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "CAL");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("CAL", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
//CAL 0
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "CAL 0");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("CAL 0", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("Wrong format", smsCommunicatorPlugin.messages.get(1).text);
when(XdripCalibrations.sendIntent(any())).thenReturn(true);
//CAL 1
smsCommunicatorPlugin.messages = new ArrayList<>();
sms = new Sms("1234", "CAL 1");
smsCommunicatorPlugin.processSms(sms);
Assert.assertEquals("CAL 1", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertTrue(smsCommunicatorPlugin.messages.get(1).text.contains("To send calibration 1.00 reply with code"));
String passCode = smsCommunicatorPlugin.messageToConfirm.confirmCode;
smsCommunicatorPlugin.processSms(new Sms("1234", passCode));
Assert.assertEquals(passCode, smsCommunicatorPlugin.messages.get(2).text);
Assert.assertEquals("Calibration sent. Receiving must be enabled in xDrip.", smsCommunicatorPlugin.messages.get(3).text);
}
@Test
public void sendNotificationToAllNumbers() {
smsCommunicatorPlugin.messages = new ArrayList<>();
smsCommunicatorPlugin.sendNotificationToAllNumbers("abc");
Assert.assertEquals("abc", smsCommunicatorPlugin.messages.get(0).text);
Assert.assertEquals("abc", smsCommunicatorPlugin.messages.get(1).text);
}
@Before
public void prepareTests() {
AAPSMocker.mockMainApp();
AAPSMocker.mockApplicationContext();
AAPSMocker.mockSP();
AAPSMocker.mockL();
AAPSMocker.mockStrings();
AAPSMocker.mockBus();
AAPSMocker.mockProfileFunctions();
AAPSMocker.mockTreatmentPlugin();
AAPSMocker.mockTreatmentService();
AAPSMocker.mockIobCobCalculatorPlugin();
AAPSMocker.mockConfigBuilder();
AAPSMocker.mockCommandQueue();
AAPSMocker.mockNSUpload();
AAPSMocker.mockConstraintsChecker();
BgReading reading = new BgReading();
reading.value = 100;
List<BgReading> bgList = new ArrayList<>();
bgList.add(reading);
PowerMockito.when(IobCobCalculatorPlugin.getPlugin().getBgReadings()).thenReturn(bgList);
PowerMockito.when(IobCobCalculatorPlugin.getPlugin().getCobInfo(false, "SMS COB")).thenReturn(new CobInfo(10d, 2d));
mockStatic(XdripCalibrations.class);
mockStatic(DateUtil.class);
mockStatic(SmsManager.class);
SmsManager smsManager = mock(SmsManager.class);
when(SmsManager.getDefault()).thenReturn(smsManager);
when(SP.getString(R.string.key_smscommunicator_allowednumbers, "")).thenReturn("1234;5678");
smsCommunicatorPlugin = SmsCommunicatorPlugin.getPlugin();
smsCommunicatorPlugin.setPluginEnabled(PluginType.GENERAL, true);
loopPlugin = mock(LoopPlugin.class);
when(MainApp.getSpecificPlugin(LoopPlugin.class)).thenReturn(loopPlugin);
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(1);
callback.result = new PumpEnactResult().success(true);
callback.run();
return null;
}).when(AAPSMocker.queue).cancelTempBasal(anyBoolean(), any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(0);
callback.result = new PumpEnactResult().success(true);
callback.run();
return null;
}).when(AAPSMocker.queue).cancelExtended(any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(1);
callback.result = new PumpEnactResult().success(true);
callback.run();
return null;
}).when(AAPSMocker.queue).readStatus(anyString(), any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(1);
callback.result = new PumpEnactResult().success(true).bolusDelivered(1);
callback.run();
return null;
}).when(AAPSMocker.queue).bolus(any(DetailedBolusInfo.class), any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(4);
callback.result = new PumpEnactResult().success(true).isPercent(true).percent(invocation.getArgument(0)).duration(invocation.getArgument(1));
callback.run();
return null;
}).when(AAPSMocker.queue).tempBasalPercent(anyInt(), anyInt(), anyBoolean(), any(), any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(4);
callback.result = new PumpEnactResult().success(true).isPercent(false).absolute(invocation.getArgument(0)).duration(invocation.getArgument(1));
callback.run();
return null;
}).when(AAPSMocker.queue).tempBasalAbsolute(anyDouble(), anyInt(), anyBoolean(), any(), any(Callback.class));
Mockito.doAnswer(invocation -> {
Callback callback = invocation.getArgument(2);
callback.result = new PumpEnactResult().success(true).isPercent(false).absolute(invocation.getArgument(0)).duration(invocation.getArgument(1));
callback.run();
return null;
}).when(AAPSMocker.queue).extendedBolus(anyDouble(), anyInt(), any(Callback.class));
VirtualPumpPlugin virtualPumpPlugin = VirtualPumpPlugin.getPlugin();
when(ConfigBuilderPlugin.getPlugin().getActivePump()).thenReturn(virtualPumpPlugin);
}
}

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