diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b53035b7bb..f7d91f83c1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -13,6 +13,7 @@
+
diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java
index 171d4b2f94..94ccb45521 100644
--- a/app/src/main/java/info/nightscout/androidaps/MainApp.java
+++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java
@@ -87,6 +87,7 @@ public class MainApp extends Application {
MainApp.getConfigBuilder().initialize();
}
+ MainApp.getConfigBuilder().uploadAppStart();
}
public static Bus bus() {
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java
index f842ac9a5b..6aea91ca05 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java
@@ -38,6 +38,7 @@ import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.TempBasalsInterface;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
+import info.nightscout.androidaps.plugins.DanaR.comm.MsgOcclusion;
import info.nightscout.androidaps.plugins.Loop.APSResult;
import info.nightscout.androidaps.plugins.Loop.DeviceStatus;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
@@ -900,4 +901,47 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
}
+ public void uploadDanaROcclusion() {
+ Context context = MainApp.instance().getApplicationContext();
+ Bundle bundle = new Bundle();
+ bundle.putString("action", "dbAdd");
+ bundle.putString("collection", "treatments");
+ JSONObject data = new JSONObject();
+ try {
+ data.put("eventType", "Announcement");
+ data.put("created_at", DateUtil.toISOString(new Date()));
+ data.put("notes", MainApp.sResources.getString(R.string.overview_bolusiprogress_occlusion));
+ data.put("isAnnouncement", true);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ bundle.putString("data", data.toString());
+ Intent intent = new Intent(Intents.ACTION_DATABASE);
+ intent.putExtras(bundle);
+ intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
+ context.sendBroadcast(intent);
+ DbLogger.dbAdd(intent, data.toString(), MsgOcclusion.class);
+ }
+
+ public void uploadAppStart() {
+ Context context = MainApp.instance().getApplicationContext();
+ Bundle bundle = new Bundle();
+ bundle.putString("action", "dbAdd");
+ bundle.putString("collection", "treatments");
+ JSONObject data = new JSONObject();
+ try {
+ data.put("eventType", "Note");
+ data.put("created_at", DateUtil.toISOString(new Date()));
+ data.put("notes", MainApp.sResources.getString(R.string.androidaps_start));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ bundle.putString("data", data.toString());
+ Intent intent = new Intent(Intents.ACTION_DATABASE);
+ intent.putExtras(bundle);
+ intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
+ context.sendBroadcast(intent);
+ DbLogger.dbAdd(intent, data.toString(), ConfigBuilderPlugin.class);
+ }
+
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java
index 45dae09603..d5d7966a56 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java
@@ -602,11 +602,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString());
extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes());
extended.put("IsExtended", getTempBasal().isExtended);
- try {
- extended.put("ActiveProfile", MainApp.getConfigBuilder().getActiveProfile().getProfile().getActiveProfile());
- } catch (Exception e) {}
}
extended.put("BaseBasalRate", getBaseBasalRate());
+ try {
+ extended.put("ActiveProfile", MainApp.getConfigBuilder().getActiveProfile().getProfile().getActiveProfile());
+ } catch (Exception e) {}
pump.put("battery", battery);
pump.put("status", status);
@@ -708,7 +708,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
// Reply for sms communicator
public String shortStatus() {
- final DateFormat formatTime = DateFormat.getTimeInstance(DateFormat.SHORT);
String ret = "";
if (getDanaRPump().lastConnection.getTime() != 0) {
Long agoMsec = new Date().getTime() - getDanaRPump().lastConnection.getTime();
@@ -716,7 +715,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
ret += "LastConn: " + agoMin + " minago\n";
}
if (getDanaRPump().lastBolusTime.getTime() != 0) {
- ret += "LastBolus: " + DecimalFormatter.to2Decimal(getDanaRPump().lastBolusAmount) + "U @" + formatTime.format(getDanaRPump().lastBolusTime) + "\n";
+ ret += "LastBolus: " + DecimalFormatter.to2Decimal(getDanaRPump().lastBolusAmount) + "U @" + android.text.format.DateFormat.format("HH:mm", getDanaRPump().lastBolusTime) + "\n";
}
if (isRealTempBasalInProgress()) {
ret += "Temp: " + getRealTempBasal().toString() + "\n";
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgOcclusion.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgOcclusion.java
index 79c357d36f..464bce3578 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgOcclusion.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgOcclusion.java
@@ -34,28 +34,7 @@ public class MsgOcclusion extends MessageBase {
MsgBolusStop.stopped = true;
bolusingEvent.status = MainApp.sResources.getString(R.string.overview_bolusiprogress_occlusion);
MainApp.bus().post(bolusingEvent);
- sendToNSClient();
+ MainApp.getConfigBuilder().uploadDanaROcclusion();
}
- public void sendToNSClient() {
- Context context = MainApp.instance().getApplicationContext();
- Bundle bundle = new Bundle();
- bundle.putString("action", "dbAdd");
- bundle.putString("collection", "treatments");
- JSONObject data = new JSONObject();
- try {
- data.put("eventType", "Announcement");
- data.put("created_at", DateUtil.toISOString(new Date()));
- data.put("notes", MainApp.sResources.getString(R.string.overview_bolusiprogress_occlusion));
- data.put("isAnnouncement", true);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- bundle.putString("data", data.toString());
- Intent intent = new Intent(Intents.ACTION_DATABASE);
- intent.putExtras(bundle);
- intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
- context.sendBroadcast(intent);
- DbLogger.dbAdd(intent, data.toString(), MsgOcclusion.class);
- }
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java
index af70d89d78..ea97cd8b67 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java
@@ -12,6 +12,7 @@ import android.os.HandlerThread;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
+import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -421,6 +422,7 @@ public class OverviewFragment extends Fragment {
apsModeView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
+ view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
if (activeloop == null){
log.error("no active loop?");
return true;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsPlugin.java
index 86e19c8dc4..8cd51bbd1b 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsPlugin.java
@@ -121,7 +121,7 @@ public class TempBasalsPlugin implements PluginBase, TempBasalsInterface {
queryBuilderExt.orderBy("timeIndex", false);
Where whereExt = queryBuilderExt.where();
whereExt.eq("isExtended", true);
- queryBuilderExt.limit(5L);
+ queryBuilderExt.limit(30L);
PreparedQuery preparedQueryExt = queryBuilderExt.prepare();
extendedBoluses = dao.query(preparedQueryExt);
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java
index 4a441e1c76..a5f05acbc6 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java
@@ -336,6 +336,9 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
battery.put("percent", batteryPercent);
status.put("status", "normal");
extended.put("Version", BuildConfig.VERSION_NAME + "-" + BuildConfig.BUILDVERSION);
+ try {
+ extended.put("ActiveProfile", MainApp.getConfigBuilder().getActiveProfile().getProfile().getActiveProfile());
+ } catch (Exception e) {}
TempBasal tb;
if ((tb = getTempBasal()) != null) {
status.put("tempbasalpct", tb.percent);
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 2a49f66401..2681be63bb 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -6,7 +6,7 @@
최대 허용 탄수화물 [g]
설정
- NS로부터 Treatments 새로고침
+ NS에서 Treatments 새로고침
백업
테스트 알람
데이터베이스 초기화
@@ -154,7 +154,7 @@
CGM Sensor Insert
CGM Sensor Start
Insulin Cartridge Change
- Profile Switch
+ 프로파일 변경
Snack Bolus
Meal Bolus
Correction Bolus
@@ -242,9 +242,9 @@
결과 기다리는 중
허가된 전화번호
+XXXXXXXXXX;+YYYYYYYYYY
- To deliver bolus %.2fU reply with code %s
+ 식사주입 %.2fU 을 실행하려면 %s 를 입력하고 답장하세요
식사주입 실패
- 식사주입 %.2fU 성공적으로 전송됨
+ Bolus %.2fU delivered successfully
%.2fU 주입중
SMS 원격 명령 사용하기
원격 식사주입 허용되지 않음
@@ -307,19 +307,19 @@
허용된 제한값에 도달하였습니다
계산을 위한 목표 혈당 값
프로파일이 선택되지 않았습니다
- Loop has been disabled
- Loop has been enabled
- Loop is disabled
- Loop is enabled
+ Loop가 중지되었습니다.
+ Loop가 실행되었습니다.
+ Loop가 중지중입니다.
+ Loop가 실행중입니다.
값 %s 은 하드리밋(Hard Limit)를 벗어났습니다
- Remote basal setting is not allowed
- To start basal %.2fU/h reply with code %s
+ 원격 기초주입설정이 허가되지 않았습니다
+ 기초주입 %.2fU/h 을 실행하려면 %s 를 입력하고 답장하세요
Temp basal %.2fU/h for %d min started successfully
- Temp basal start failed
- To stop temp basal reply with code %s
+ 임시기초주입이 실패하였습니다
+ 임시기초주입을 중지하려면 %s 를 입력하고 답장하세요
Temp basal canceled
- Canceling temp basal failed
- Uknonwn command or wrong reply
+ 임시기초주입 취소가 실패하였습니다
+ 알려지지 않은 명령이거나 잘못된 답장입니다
퀵마법사
퀵마법사 설정
@@ -332,4 +332,5 @@
Meal
Corr
한국어
+ 액션
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 13a9816ff1..8efd2f7c93 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -335,5 +335,6 @@
Corr
Korean
Actions
+ AndroidAPS started