Merge branch 'dev', remote-tracking branch 'origin' into dagger3

This commit is contained in:
Milos Kozak 2020-01-02 19:38:06 +01:00
commit 88994d1b54
14 changed files with 188 additions and 39 deletions

View file

@ -1,2 +1,4 @@
#Demo certificate
51:6D:12:67:4C:27:F4:9B:9F:E5:42:9B:01:B3:98:E4:66:2B:85:B7:A8:DD:70:32:B7:6A:D7:97:9A:0D:97:10
#Leaked
55:5D:70:C9:BE:10:41:7E:4B:01:A9:C4:C6:44:4A:F8:69:71:35:25:ED:95:23:16:C7:15:E8:EB:C6:08:FC:B1

View file

@ -164,7 +164,8 @@ class CarbsDialog : DialogFragmentWithDate() {
actions.add(resourceHelper.gs(R.string.temptargetshort) + ": " + "<font color='" + resourceHelper.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to1Decimal(hypoTT) + " " + unitLabel + " (" + hypoTTDuration + " " + resourceHelper.gs(R.string.unit_minute_short) + ")</font>")
val timeOffset = overview_carbs_time.value.toInt()
val time = DateUtil.now() + timeOffset * 1000 * 60
eventTime -= eventTime % 1000
val time = eventTime + timeOffset * 1000 * 60
if (timeOffset != 0)
actions.add(resourceHelper.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(time))
val duration = overview_carbs_duration.value.toInt()
@ -179,6 +180,9 @@ class CarbsDialog : DialogFragmentWithDate() {
if (notes.isNotEmpty())
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes)
if (eventTimeChanged)
actions.add(resourceHelper.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime))
if (carbsAfterConstraints > 0 || activitySelected || eatingSoonSelected || hypoSelected) {
activity?.let { activity ->
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), Runnable {

View file

@ -13,6 +13,7 @@ import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.db.CareportalEvent
import info.nightscout.androidaps.db.Source
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
@ -130,10 +131,13 @@ class CareDialog : DialogFragmentWithDate() {
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes)
json.put("notes", notes)
}
eventTime -= eventTime % 1000
if (eventTimeChanged)
actions.add(resourceHelper.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime))
json.put("created_at", DateUtil.toISOString(eventTime))
json.put("mills", eventTime)
json.put("eventType", when (options) {
EventType.BGCHECK -> CareportalEvent.BGCHECK
EventType.SENSOR_INSERT -> CareportalEvent.SENSORCHANGE
@ -145,7 +149,16 @@ class CareDialog : DialogFragmentWithDate() {
activity?.let { activity ->
OKDialog.showConfirmation(activity, resourceHelper.gs(event), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), Runnable {
MainApp.getDbHelper().createCareportalEventFromJsonIfNotExists(json)
val careportalEvent = CareportalEvent()
careportalEvent.date = eventTime
careportalEvent.source = Source.USER
careportalEvent.eventType = when (options) {
EventType.BGCHECK -> CareportalEvent.BGCHECK
EventType.SENSOR_INSERT -> CareportalEvent.SENSORCHANGE
EventType.BATTERY_CHANGE -> CareportalEvent.PUMPBATTERYCHANGE
}
careportalEvent.json = json.toString()
MainApp.getDbHelper().createOrUpdate(careportalEvent)
NSUpload.uploadCareportalEntryToNS(json)
}, null)
}

View file

@ -26,6 +26,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
import kotlinx.android.synthetic.main.dialog_fill.*
import kotlinx.android.synthetic.main.notes.*
import kotlinx.android.synthetic.main.okcancel.*
import org.json.JSONException
import org.json.JSONObject
import java.util.*
import javax.inject.Inject
import kotlin.math.abs
@ -102,6 +104,8 @@ class FillDialog : DialogFragmentWithDate() {
val notes = notes.text.toString()
if (notes.isNotEmpty())
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes)
eventTime -= eventTime % 1000
if (eventTimeChanged)
actions.add(resourceHelper.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime))
@ -128,8 +132,21 @@ class FillDialog : DialogFragmentWithDate() {
}
})
}
if (siteChange) NSUpload.uploadEvent(CareportalEvent.SITECHANGE, eventTime, notes)
if (insulinChange) NSUpload.uploadEvent(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes)
val careportalEvent = CareportalEvent()
careportalEvent.date = eventTime
careportalEvent.source = Source.USER
if (siteChange) {
careportalEvent.json = generateJson(CareportalEvent.SITECHANGE, eventTime, notes).toString()
careportalEvent.eventType = CareportalEvent.SITECHANGE
NSUpload.uploadEvent(CareportalEvent.SITECHANGE, eventTime, notes)
}
if (insulinChange) {
// add a second for case of both checked
careportalEvent.json = generateJson(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes).toString()
careportalEvent.eventType = CareportalEvent.INSULINCHANGE
NSUpload.uploadEvent(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes)
}
MainApp.getDbHelper().createOrUpdate(careportalEvent)
}, null)
}
} else {
@ -140,4 +157,18 @@ class FillDialog : DialogFragmentWithDate() {
dismiss()
return true
}
fun generateJson(careportalEvent: String, time: Long, notes: String): JSONObject {
val data = JSONObject()
try {
data.put("eventType", careportalEvent)
data.put("created_at", DateUtil.toISOString(time))
data.put("mills", time)
data.put("enteredBy", sp.getString("careportal_enteredby", resourceHelper.gs(R.string.app_name)))
if (notes.isNotEmpty()) data.put("notes", notes)
} catch (ignored: JSONException) {
}
return data
}
}

View file

@ -204,6 +204,8 @@
<include layout="@layout/notes" />
<include layout="@layout/datetime" />
<include layout="@layout/okcancel" />
</LinearLayout>

View file

@ -105,7 +105,7 @@
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
@ -120,9 +120,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="6dp"
android:layout_marginStart="2dp"
android:text="00.0"
android:textSize="42sp"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
@ -135,7 +135,7 @@
android:paddingStart="-2dp"
android:paddingEnd="0dp"
android:text="→"
android:textSize="28sp"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
@ -152,7 +152,7 @@
android:id="@+id/overview_timeago"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginStart="6dp"
android:layout_marginTop="-2dp"
android:paddingStart="2dp"
android:layout_weight="0.5"
@ -166,7 +166,7 @@
android:layout_marginTop="-2dp"
android:paddingStart="2dp"
android:layout_weight="0.5"
android:textSize="14sp" />
android:textSize="12sp" />
<TextView
android:id="@+id/overview_avgdelta"
@ -179,9 +179,9 @@
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="2"
android:layout_marginTop="6dp"
android:orientation="vertical">
@ -193,24 +193,24 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="1dp"
android:text="@string/iob"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:text=":"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/overview_iob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginStart="12dp"
android:text=""
android:textSize="16sp"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>
@ -222,7 +222,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="1dp"
android:text="@string/cob"
android:textSize="16sp" />
@ -231,15 +231,15 @@
android:layout_width="5dp"
android:layout_height="wrap_content"
android:text=":"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/overview_cob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginStart="4dp"
android:text=""
android:textSize="16sp"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>
@ -252,24 +252,24 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="1dp"
android:text="@string/basal_short"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:text=":"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/overview_basebasal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginStart="6dp"
android:text="0.50U/h @17:35 1/30min - 0.40U/h"
android:textSize="16sp"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>
@ -281,24 +281,24 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="1dp"
android:text="AS"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:text=":"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/overview_sensitivity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginStart="18dp"
android:text=""
android:textSize="16sp"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>

View file

@ -1002,7 +1002,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="openaps_noasdata">Pas de données d\'Autosens disponibles</string>
<string name="nav_logsettings">Paramètres journal</string>
<string name="resettodefaults">Réinitialiser les valeurs par défaut</string>
<string name="nsmalfunction">Dysfonctionnement du NSClient. Considérerez une réinitialisation de NS et de NSClient.</string>
<string name="nsmalfunction">Dysfonctionnement NSClient. Faites une réinitialisation de NS et de NSClient.</string>
<string name="as">AS</string>
<string name="versionavailable">Version %1$s disponible</string>
<string name="time_offset">Décalage horaire</string>
@ -1197,13 +1197,13 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="startprofileforever">Début du profil %1$d%%</string>
<string name="exists">existe</string>
<string name="notexists">n\'existe pas</string>
<string name="temptargetcompared">Temp cible %1$s</string>
<string name="temptargetcompared">Cible Temp. %1$s</string>
<string name="wifissidcompared">SSID WiFi %1$s %2$s</string>
<string name="autosenscompared">Autosens %1$s %2$s %%</string>
<string name="autosenslabel">Autosens %</string>
<string name="deltacompared">%3$s %1$s %2$s</string>
<string name="deltalabel">Différence de glycémies</string>
<string name="deltalabel_u">Différence Glycémie [%1$s]</string>
<string name="deltalabel">Delta de glycémies</string>
<string name="deltalabel_u">Delta Glyc. [%1$s]</string>
<string name="currentlocation">Localisation actuelle</string>
<string name="location">Localisation</string>
<string name="latitude_short">Lat :</string>
@ -1364,8 +1364,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="profilename">Remplacer le profil par</string>
<string name="changengetoprofilename">Remplacer le profil par %1$s</string>
<string name="automation_trigger_pump_last_connection_label">Dernière connexion à la pompe</string>
<string name="automation_trigger_pump_last_connection_description">Dernière connexion de pompe [minutes]</string>
<string name="automation_trigger_pump_last_connection_compared">Dernière connexion à la pompe %1$s il y a %2$s min</string>
<string name="automation_trigger_pump_last_connection_description">Dernière connexion [min]</string>
<string name="automation_trigger_pump_last_connection_compared">Dernière connexion pompe %1$s il y a %2$s min</string>
<string name="sendsmsactionlabel">Envoyer SMS : %1$s</string>
<string name="sendsmsactiondescription">Envoyer SMS à tous les numéros</string>
<string name="sendsmsactiontext">Envoyer SMS avec du texte</string>

View file

@ -14,7 +14,7 @@
<color name="activity">#d3f166</color>
<color name="devslopepos">#FFFFFF00</color>
<color name="devslopeneg">#FFFF00FF</color>
<color name="inrange">#A4ECEA</color>
<color name="inrange">#00FF00</color>
<color name="low">#FF0000</color>
<color name="high">#FFFF00</color>
<color name="actionsConfirm">#FFFF00</color>

View file

@ -51,6 +51,7 @@
<string name="pref_low">Niedrig</string>
<string name="pref_medium">Mittel</string>
<string name="pref_high">Hoch</string>
<string name="pref_auto">Auto</string>
<string name="pref_big_numbers">Große Zahlen</string>
<string name="pref_ring_history">Ring BZ-Historie</string>
<string name="pref_light_ring_history">Ring BZ-Historie light</string>

View file

@ -51,6 +51,7 @@
<string name="pref_low">Basso</string>
<string name="pref_medium">Medio</string>
<string name="pref_high">Alto</string>
<string name="pref_auto">Auto</string>
<string name="pref_big_numbers">Numeri grandi</string>
<string name="pref_ring_history">Storico Ring</string>
<string name="pref_light_ring_history">Storico Light Ring</string>

View file

@ -8,10 +8,102 @@
<string name="label_xdrip_big_chart">AAPS(GrafGrande)</string>
<string name="label_xdrip_no_chart">AAPS(SemGraf)</string>
<string name="label_xdrip_circle">AAPS(Círculo)</string>
<string name="label_xdrip_v2">AAPSv2</string>
<string name="label_xdrip_cockpit">AAPS(Cockpit)</string>
<string name="label_xdrip_steampunk">AAPS(Steampunk)</string>
<string name="label_warning_sync">Sem dados!</string>
<string name="label_warning_old">Dados antigos!</string>
<string name="label_warning_since">Desde %1$s</string>
<string name="label_warning_sync_aaps">Sincronizar com AAPS!</string>
<string name="msg_warning_sync">Nenhum dado recebido desde %1$s! Confira se o AAPS no telefone envia dados para o relógio</string>
<string name="msg_warning_old">Dados AAPS são %1$s antigos! Verifique sensor, xDrip+, NS, configuração AAPS ou outra!</string>
<string name="pref_on">Lig.</string>
<string name="pref_off">Desl.</string>
<string name="pref_vibrate_on_bolus">Vibrar no Bólus</string>
<string name="pref_units_for_actions">Unidades para Acções</string>
<string name="pref_show_date">Mostrar Data</string>
<string name="pref_show_iob">Mostrar IOB</string>
<string name="pref_show_cob">Mostrar COB</string>
<string name="pref_show_delta">Mostrar Delta</string>
<string name="pref_show_avgdelta">Mostrar MedDelta</string>
<string name="pref_show_phone_battery">Mostrar Bateria Telefone</string>
<string name="pref_show_rig_battery">Mostrar Bateria Equipamento</string>
<string name="pref_show_basal_rate">Mostrar Taxa Basal</string>
<string name="pref_show_loop_status">Mostrar Estado Loop</string>
<string name="pref_show_bg">Mostrar Glic.</string>
<string name="pref_show_direction_arrow">Mostrar Seta Direcção</string>
<string name="pref_show_ago">Mostrar Atrás</string>
<string name="pref_dark" comment="Enables dark visual theme">Escuro</string>
<string name="pref_highlight_basals">Destacar Basais</string>
<string name="pref_matching_divider" comment="To make divider match its background with background of whole watchface">Divisor correspondente</string>
<string name="pref_chart_timeframe">Cronograma do Gráfico</string>
<string name="pref_1_hour">1 hora</string>
<string name="pref_2_hours">2 horas</string>
<string name="pref_3_hours">3 horas</string>
<string name="pref_4_hours">4 horas</string>
<string name="pref_5_hours">5 horas</string>
<string name="pref_input_design">Design de Entrada</string>
<string name="pref_default">Padrão</string>
<string name="pref_quick_righty">Rápido Direito</string>
<string name="pref_quick_lefty">Rápido Esquerdo</string>
<string name="pref_modern_sparse">Moderno Esparso</string>
<string name="pref_delta_granularity">Delta Granularidade (Steampunk)</string>
<string name="pref_low">Baixo</string>
<string name="pref_medium">Médio</string>
<string name="pref_high">Alto</string>
<string name="pref_big_numbers">Números Grandes</string>
<string name="pref_ring_history">Anel Histórico</string>
<string name="pref_light_ring_history">Anel Suave Histórico</string>
<string name="pref_animations">Animações</string>
<string name="pref_wizard_in_menu">Assistente no Menu</string>
<string name="pref_prime_in_menu">Purgar no Menu</string>
<string name="pref_single_target">Alvo Único</string>
<string name="pref_wizard_percentage">Assistente Percentagem</string>
<string name="pref_complication_tap_action">Complicação de Toque</string>
<string name="pref_unicode_in_complications">Unicode em Complicações</string>
<string name="pref_version">Versão:</string>
<string name="menu_tempt">AlvoT</string>
<string name="menu_wizard">Assistente</string>
<string name="menu_bolus">Bólus</string>
<string name="menu_ecarb">eCarb</string>
<string name="menu_settings">Definições</string>
<string name="menu_status">Estado</string>
<string name="menu_prime_fill">Purgar/Preencher</string>
<string name="menu_none">Nenhum</string>
<string name="menu_default">Padrão</string>
<string name="menu_menu">Menu</string>
<string name="action_duration">duração</string>
<string name="action_target" comment="In temp target menu, single target value">alvo</string>
<string name="action_low" comment="In temp target menu, lower value from range">hipo</string>
<string name="action_high" comment="In temp target menu, higher value from range">hiper</string>
<string name="action_carbs">hidratos</string>
<string name="action_percentage">percentagem</string>
<string name="action_start_min">iniciar [min]</string>
<string name="action_duration_h">duração [h]</string>
<string name="action_insulin">insulina</string>
<string name="action_preset_1">Predefinição 1</string>
<string name="action_preset_2">Predefinição 2</string>
<string name="action_preset_3">Predefinição 3</string>
<string name="action_free_amount" comment="In prime/fill menu, allows to enter any amount to be used for priming/filling">Valor livre</string>
<string name="action_confirm">CONFIRMAR</string>
<string name="action_status_pump">ESTADO BOMBA</string>
<string name="action_status_loop">ESTADO LOOP</string>
<string name="action_timeshift">alteração turno</string>
<string name="action_tdd_weighted">TDD ponderada</string>
<string name="action_bolus">bólus</string>
<string name="status_pump">Bomba</string>
<string name="status_loop">Loop</string>
<string name="status_cpp">CPP</string>
<string name="status_tdd">TDD</string>
<string name="activity_carb">Hidratos</string>
<string name="activity_IOB">IOB</string>
<string name="activity_no_status">sem estado</string>
<string name="unit_mg_dl">mg/dL</string>
<string name="unit_mmol_l">mmol/L</string>
<string name="unit_g" comment="Shortcut for ISO unit: gram">g</string>
<string name="unit_u" comment="Shortcut for: insulin Unit">U</string>
<string name="unit_u_p_h" comment="Shortcut for: insulin Unit per Hour">U/h</string>
<string name="unit_h" comment="One letter shortcut for: Hour" maxLength="1">h</string>
<string name="unit_d" comment="One letter shortcut for: Day" maxLength="1">d</string>
<string name="unit_w" comment="One letter shortcut for: Week" maxLength="1">s</string>
</resources>

View file

@ -51,6 +51,7 @@
<string name="pref_low">Baixo</string>
<string name="pref_medium">Médio</string>
<string name="pref_high">Alto</string>
<string name="pref_auto">Auto</string>
<string name="pref_big_numbers">Números Grandes</string>
<string name="pref_ring_history">Anel Histórico</string>
<string name="pref_light_ring_history">Anel Suave Histórico</string>

View file

@ -51,6 +51,7 @@
<string name="pref_low">Низкий</string>
<string name="pref_medium">Средний</string>
<string name="pref_high">Высокий</string>
<string name="pref_auto">Авто</string>
<string name="pref_big_numbers">Цифры крупно</string>
<string name="pref_ring_history">Показывать историю в кольце</string>
<string name="pref_light_ring_history">Показывать историю в кольце менее подробно</string>

View file

@ -51,6 +51,7 @@
<string name="pref_low">Låg</string>
<string name="pref_medium">Mellan</string>
<string name="pref_high">Hög</string>
<string name="pref_auto">Auto</string>
<string name="pref_big_numbers">Stora siffror</string>
<string name="pref_ring_history">Ringhistorik</string>
<string name="pref_light_ring_history">Ljus ringhistorik</string>