Merge branch 'dev' into smb

This commit is contained in:
Milos Kozak 2017-12-07 23:54:37 +01:00
commit 696dd4c592
10 changed files with 28 additions and 12 deletions

View file

@ -15,7 +15,7 @@
<maxHistory>120</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level [%file:%line]: %msg%n</pattern>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level [%class:%line]: %msg%n</pattern>
</encoder>
</appender>
@ -24,7 +24,7 @@
<pattern>%logger{0}</pattern>
</tagEncoder>
<encoder>
<pattern>[%thread] %-5level [%file:%line]: %msg%n</pattern>
<pattern>[%thread] %-5level [%class:%line]: %msg%n</pattern>
</encoder>
</appender>

View file

@ -1353,7 +1353,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
return;
}
extendedBolus.date = trJson.getLong("mills");
extendedBolus.durationInMinutes = trJson.getInt("duration");
extendedBolus.durationInMinutes = trJson.has("duration") ? trJson.getInt("duration") : 0;
extendedBolus.insulin = trJson.getDouble("relative");
extendedBolus._id = trJson.getString("_id");
createOrUpdate(extendedBolus);

View file

@ -290,7 +290,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
}
@Override
public void onClick(View view) {
public synchronized void onClick(View view) {
switch (view.getId()) {
case R.id.ok:
if (okClicked) {

View file

@ -243,7 +243,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
Rect bounds = new Rect((int)endX, (int)endY + 3, (int) (xpluslength), (int) endY + 8);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
canvas.drawRect(bounds, mPaint);
mPaint.setTextSize((int) (scaledTextSize * 2.5));
mPaint.setTextSize((float) (scaledTextSize));
mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
mPaint.setFakeBoldText(true);
canvas.drawText(value.getLabel(), endX, endY, mPaint);
@ -295,7 +295,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
mPaint.setStrokeWidth(0);
if (value.getLabel() != null) {
mPaint.setStrokeWidth(0);
mPaint.setTextSize((int) (scaledTextSize * 3));
mPaint.setTextSize((float) (scaledTextSize * 1.2));
mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
Rect bounds = new Rect();
mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds);
@ -325,7 +325,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
mPaint.setStrokeWidth(0);
if (value.getLabel() != null) {
mPaint.setStrokeWidth(0);
mPaint.setTextSize(scaledTextSize * 3);
mPaint.setTextSize((float) (scaledTextSize * 1.5));
mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
Rect bounds = new Rect();
mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds);

View file

@ -55,6 +55,7 @@ public class Notification {
public static final int WRONG_DRIVER = 24;
public static final int PUMP_UNREACHABLE = 26;
public static final int BG_READINGS_MISSED = 27;
public static final int UNSUPPORTED_FIRMWARE = 28;
public int id;
public Date date;

View file

@ -6,6 +6,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump;
public class DanaRS_Packet_General_Get_Pump_Check extends DanaRS_Packet {
@ -37,6 +41,10 @@ public class DanaRS_Packet_General_Get_Pump_Check extends DanaRS_Packet {
log.debug("Protocol: " + String.format("%02X ", pump.protocol));
log.debug("Product Code: " + String.format("%02X ", pump.productCode));
}
if (pump.productCode < 2) {
MainApp.bus().post(new EventNewNotification(new Notification(Notification.UNSUPPORTED_FIRMWARE, MainApp.sResources.getString(R.string.unsupportedfirmware), Notification.URGENT)));
}
}
@Override

View file

@ -538,8 +538,10 @@ public class WatchUpdaterService extends WearableListenerService implements
//bgi
String bgiString = "";
Profile profile = MainApp.getConfigBuilder().getProfile();
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf();
bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi);
if(profile!=null) {
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf();
bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi);
}
String status = generateStatusString(profile, tempBasal,iobSum, iobDetail, bgiString);

View file

@ -97,7 +97,7 @@
<string name="vitualpump_label">VIRTUELLE PUMPE</string>
<string name="virtualpump_sqlerror">SQL Error</string>
<string name="virtualpump_extendedbolus_label">Extended bolus</string>
<string name="virtualpump_tempbasal_label">Temp basal</string>
<string name="virtualpump_tempbasal_label">Temp Basal</string>
<string name="visible">Sichtbar</string>
<string name="virtualpump_basebasalrate_label">Basis Basalrate</string>
<string name="treatments_wizard_total_label">TOTAL</string>
@ -672,4 +672,10 @@
<string name="predictionshortlabel">PRE</string>
<string name="nsclientinternal_title">Interner NSClient</string>
<string name="nsclientinternal_shortname">NSCI</string>
<string name="localalertsettings_title">Lokale Alarme</string>
<string name="raise_notifications_as_android_notifications">Benutze Systemmeldungen für Alarme und Meldungen</string>
<string name="pump_unreachable">Pumpe ist nicht erreichbar</string>
<string name="enable_missed_bg_readings_alert">Alarm wenn keine Glukose Daten empfangen werden</string>
<string name="enable_pump_unreachable_alert">Alarm wenn die Pumpe nicht erreichbar ist</string>
<string name="pump_unreachable_threshold">Pumpe ist nicht erreichbar Grenze [min]</string>
</resources>

View file

@ -435,9 +435,7 @@
<string name="advancedsettings_title">Ρυθμίσεις για Προχωρημένους</string>
<string name="danar_model" formatted="false">Model: %02X Protocol: %02X Code: %02X</string>
<string name="profile">Προφίλ</string>
<string name="openapsama_max_daily_safety_multiplier" translatable="false">max_daily_safety_multiplier</string>
<string name="openapsama_max_daily_safety_multiplier_summary">"Προεπιλεγμένη τιμή: 3 Αυτό είναι ένα κλειδί ασφαλείας OpenAPS.Αυτό περιορίζει την αύξηση του βασικού x3 από την μεγαλύτερη τιμή του.Δεν χρειάζεται να το αλλάξετε "</string>
<string name="openapsama_current_basal_safety_multiplier" translatable="false">current_basal_safety_multiplier</string>
<string name="error_only_numeric_digits_allowed">Μόνο αριθμητικά ψηφία επιτρέπονται.</string>
<string name="error_only_numeric_digits_range_allowed" formatted="false">"Μόνο αριθμητικά ψηφία μέσα στο εύρος %1$s - %2$s επιτρέπονται. "</string>
<string name="error_field_must_not_be_empty">Το πεδίο αυτό δεν πρέπει να είναι κενό</string>

View file

@ -792,5 +792,6 @@
<string name="customapp">Customized APK for download</string>
<string name="wear_detailed_delta_title">Show detailed delta</string>
<string name="wear_detailed_delta_summary">Show delta with one more decimal place</string>
<string name="unsupportedfirmware">Unsupported pump firmware</string>
</resources>