Merge branch 'nightscout:dev' into dev

This commit is contained in:
miyeongkim 2022-05-04 13:25:34 +09:00 committed by GitHub
commit 3a640d91ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 49 additions and 26 deletions

View file

@ -109,7 +109,7 @@ android {
defaultConfig { defaultConfig {
multiDexEnabled true multiDexEnabled true
versionCode 1500 versionCode 1500
version "3.0.0.1-dev-i" version "3.0.0.2-dev-i"
buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'

View file

@ -101,7 +101,7 @@ abstract class InsulinOrefBasePlugin(
return comment return comment
} }
abstract val peak: Int override abstract val peak: Int
abstract fun commentStandardText(): String abstract fun commentStandardText(): String
companion object { companion object {

View file

@ -302,6 +302,7 @@
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="@string/activate_profile" android:text="@string/activate_profile"
android:visibility="gone"
app:icon="@drawable/ic_local_activate" app:icon="@drawable/ic_local_activate"
app:iconTint="@color/ic_local_activate" /> app:iconTint="@color/ic_local_activate" />
@ -323,6 +324,7 @@
android:paddingStart="1dp" android:paddingStart="1dp"
android:paddingEnd="1dp" android:paddingEnd="1dp"
android:text="@string/reset" android:text="@string/reset"
android:visibility="gone"
app:icon="@drawable/ic_local_reset" app:icon="@drawable/ic_local_reset"
app:iconTint="@color/ic_local_reset" /> app:iconTint="@color/ic_local_reset" />
@ -338,6 +340,7 @@
android:paddingStart="1dp" android:paddingStart="1dp"
android:paddingEnd="1dp" android:paddingEnd="1dp"
android:text="@string/save" android:text="@string/save"
android:visibility="gone"
app:icon="@drawable/ic_local_save" app:icon="@drawable/ic_local_save"
app:iconTint="@color/ic_local_save" /> app:iconTint="@color/ic_local_save" />
</LinearLayout> </LinearLayout>

View file

@ -70,7 +70,14 @@ public class RuffyScripter implements RuffyCommands {
private final IRTHandler mHandler = new IRTHandler.Stub() { private final IRTHandler mHandler = new IRTHandler.Stub() {
@Override @Override
public void log(String message) { public void log(String message) {
aapsLogger.debug(LTag.PUMP, "Ruffy says: " + message); // Ruffy is very verbose at this level, but the data provided isn't too helpful for
// debugging. For debugging Ruffy, it makes more sense to check logcat, where other
// possibly relevant (BT) events are also logged.
// Due to the amount of calls, logging this causes timing issues as reported in
// https://github.com/nightscout/AndroidAPS/issues/1619#issuecomment-1115811485
// This was caused by changing the log level from trace to debug so these messages
// where logged by default.
//aapsLogger.debug(LTag.PUMP, "Ruffy says: " + message);
} }
@Override @Override

View file

@ -27,6 +27,7 @@ interface Insulin : ConfigExportImport {
val friendlyName: String val friendlyName: String
val comment: String val comment: String
val dia: Double val dia: Double
val peak: Int
fun iobCalcForTreatment(bolus: Bolus, time: Long, dia: Double): Iob fun iobCalcForTreatment(bolus: Bolus, time: Long, dia: Double): Iob

View file

@ -271,7 +271,7 @@ class PumpSyncImplementation @Inject constructor(
.blockingGet() .blockingGet()
.also { result -> .also { result ->
result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it") } result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it") }
result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated TemporaryBasal $it") } result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated ${it.first} TemporaryBasal ${it.second}") }
return result.inserted.size > 0 return result.inserted.size > 0
} }
} }

View file

@ -7,24 +7,24 @@
android:pathData="M5.719,19.125L5.719,11.828" android:pathData="M5.719,19.125L5.719,11.828"
android:strokeWidth="2.2677" android:strokeWidth="2.2677"
android:fillColor="#00000000" android:fillColor="#00000000"
android:strokeColor="#FEAF05" android:strokeColor="?attr/statsColor"
android:strokeLineCap="round"/> android:strokeLineCap="round"/>
<path <path
android:pathData="M9.792,19.125L9.792,8.01" android:pathData="M9.792,19.125L9.792,8.01"
android:strokeWidth="2.2677" android:strokeWidth="2.2677"
android:fillColor="#00000000" android:fillColor="#00000000"
android:strokeColor="#FEAF05" android:strokeColor="?attr/statsColor"
android:strokeLineCap="round"/> android:strokeLineCap="round"/>
<path <path
android:pathData="M13.865,19.125L13.865,9.51" android:pathData="M13.865,19.125L13.865,9.51"
android:strokeWidth="2.2677" android:strokeWidth="2.2677"
android:fillColor="#00000000" android:fillColor="#00000000"
android:strokeColor="#FEAF05" android:strokeColor="?attr/statsColor"
android:strokeLineCap="round"/> android:strokeLineCap="round"/>
<path <path
android:pathData="M17.938,19.125L17.938,4.594" android:pathData="M17.938,19.125L17.938,4.594"
android:strokeWidth="2.2677" android:strokeWidth="2.2677"
android:fillColor="#00000000" android:fillColor="#00000000"
android:strokeColor="#FEAF05" android:strokeColor="?attr/statsColor"
android:strokeLineCap="round"/> android:strokeLineCap="round"/>
</vector> </vector>

View file

@ -2,6 +2,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="info.nightscout.androidaps.dana.DanaFragment" tools:context="info.nightscout.androidaps.dana.DanaFragment"
android:orientation="vertical"> android:orientation="vertical">
@ -658,50 +659,58 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/view_profile" android:id="@+id/view_profile"
style="@style/ButtonSmallFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginEnd="-2dp"
android:drawableTop="@drawable/ic_danarprofile" android:drawableTop="@drawable/ic_danarprofile"
android:paddingStart="0dp" android:text="@string/viewprofile"
android:paddingEnd="0dp" android:maxLines="2"
android:text="@string/viewprofile" /> android:ellipsize="end"
app:iconPadding="-4dp"/>
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/history" android:id="@+id/history"
style="@style/ButtonSmallFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginEnd="-2dp"
android:drawableTop="@drawable/ic_pump_history" android:drawableTop="@drawable/ic_pump_history"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/pumphistory" android:text="@string/pumphistory"
android:maxLines="2"
android:ellipsize="end"
app:iconPadding="-4dp"
tools:ignore="TooManyViews" /> tools:ignore="TooManyViews" />
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/stats" android:id="@+id/stats"
style="@style/ButtonSmallFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginEnd="-2dp"
android:drawableTop="@drawable/ic_danarstats" android:drawableTop="@drawable/ic_danarstats"
android:paddingStart="0dp" android:text="@string/stats"
android:paddingEnd="0dp" android:maxLines="2"
android:text="@string/stats" /> android:ellipsize="end"
app:iconPadding="-4dp"/>
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/user_options" android:id="@+id/user_options"
style="@style/ButtonSmallFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginEnd="-2dp"
android:drawableTop="@drawable/ic_danar_useropt" android:drawableTop="@drawable/ic_danar_useropt"
android:paddingStart="0dp" android:text="@string/danar_useroptions"
android:paddingEnd="0dp" android:maxLines="2"
android:text="@string/danar_useroptions" /> android:ellipsize="end"
app:iconPadding="-4dp"/>
</LinearLayout> </LinearLayout>

View file

@ -29,7 +29,7 @@ class SyncPumpTemporaryBasalTransaction(
existing.duration = temporaryBasal.duration existing.duration = temporaryBasal.duration
existing.type = type ?: existing.type existing.type = type ?: existing.type
database.temporaryBasalDao.updateExistingEntry(existing) database.temporaryBasalDao.updateExistingEntry(existing)
result.updated.add(existing) result.updated.add(Pair(Reason.EXISTING_ID, existing))
} }
} else { } else {
val running = database.temporaryBasalDao.getTemporaryBasalActiveAt(temporaryBasal.timestamp).blockingGet() val running = database.temporaryBasalDao.getTemporaryBasalActiveAt(temporaryBasal.timestamp).blockingGet()
@ -37,7 +37,7 @@ class SyncPumpTemporaryBasalTransaction(
running.end = temporaryBasal.timestamp running.end = temporaryBasal.timestamp
running.interfaceIDs.endId = temporaryBasal.interfaceIDs.pumpId running.interfaceIDs.endId = temporaryBasal.interfaceIDs.pumpId
database.temporaryBasalDao.updateExistingEntry(running) database.temporaryBasalDao.updateExistingEntry(running)
result.updated.add(running) result.updated.add(Pair(Reason.ACTIVE, running))
} }
database.temporaryBasalDao.insertNewEntry(temporaryBasal) database.temporaryBasalDao.insertNewEntry(temporaryBasal)
result.inserted.add(temporaryBasal) result.inserted.add(temporaryBasal)
@ -45,9 +45,12 @@ class SyncPumpTemporaryBasalTransaction(
return result return result
} }
enum class Reason {
EXISTING_ID, ACTIVE
}
class TransactionResult { class TransactionResult {
val inserted = mutableListOf<TemporaryBasal>() val inserted = mutableListOf<TemporaryBasal>()
val updated = mutableListOf<TemporaryBasal>() val updated = mutableListOf<Pair<Reason,TemporaryBasal>>()
} }
} }