From 9ae3d88f9c4c40ca44fe8ee3ea04923682ac4d11 Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Tue, 8 Nov 2016 19:59:54 +0900 Subject: [PATCH 1/6] Update DanaRPlugin.java --- .../info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 9e530cd236..f0cab4e8b5 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 @@ -706,7 +706,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(); @@ -714,7 +713,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"; From 1f35018148bd7bacc6fada079f0307a65be1624e Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Tue, 8 Nov 2016 20:04:19 +0900 Subject: [PATCH 2/6] Update strings.xml --- app/src/main/res/values-ko/strings.xml | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 한국어 + 액션 From 3ee1cf5023b4be3235d3815fb4688a752310ab7f Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 9 Nov 2016 23:58:41 +0100 Subject: [PATCH 3/6] haptic feedback for loop pill on overview --- app/src/main/AndroidManifest.xml | 1 + .../androidaps/plugins/Overview/OverviewFragment.java | 2 ++ 2 files changed, 3 insertions(+) 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/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; From 156f42da5fc625261ff1905d336118ae521d6ef8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2016 13:15:23 +0100 Subject: [PATCH 4/6] always report active profile --- .../nightscout/androidaps/plugins/DanaR/DanaRPlugin.java | 6 +++--- .../androidaps/plugins/VirtualPump/VirtualPumpPlugin.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) 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 5b1991d0b8..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); 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); From 5088b84417fac6b2e45612c87a6b2d9bf8aebecb Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 9 Nov 2016 21:01:21 +0100 Subject: [PATCH 5/6] Receive profile updates on uploadOnly when NS-Profiles are used --- .../androidaps/plugins/TempBasals/TempBasalsPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 21f732b378c42d448d9ec3a3a475d674f8f6ca7a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2016 16:42:59 +0100 Subject: [PATCH 6/6] report app start/restart to NS --- .../info/nightscout/androidaps/MainApp.java | 1 + .../ConfigBuilder/ConfigBuilderPlugin.java | 44 +++++++++++++++++++ .../plugins/DanaR/comm/MsgOcclusion.java | 23 +--------- app/src/main/res/values/strings.xml | 1 + 4 files changed, 47 insertions(+), 22 deletions(-) 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/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/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