This commit is contained in:
Milos Kozak 2022-04-29 19:10:02 +02:00
commit 7d93a2ceef
10 changed files with 40 additions and 26 deletions

View file

@ -588,6 +588,7 @@ class LoopPlugin @Inject constructor(
private fun applySMBRequest(request: APSResult, callback: Callback?) {
if (!request.bolusRequested()) {
aapsLogger.debug(LTag.APS, "No SMB requested")
return
}
val pump = activePlugin.activePump

View file

@ -37,7 +37,7 @@ class SafetyPlugin @Inject constructor(
private val constraintChecker: ConstraintChecker,
private val openAPSAMAPlugin: OpenAPSAMAPlugin,
private val openAPSSMBPlugin: OpenAPSSMBPlugin,
private val OpenAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin,
private val openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin,
private val sensitivityOref1Plugin: SensitivityOref1Plugin,
private val activePlugin: ActivePlugin,
private val hardLimits: HardLimits,
@ -190,12 +190,12 @@ class SafetyPlugin @Inject constructor(
override fun applyMaxIOBConstraints(maxIob: Constraint<Double>): Constraint<Double> {
val apsMode = sp.getString(R.string.key_aps_mode, "open")
val maxIobPref: Double = if (openAPSSMBPlugin.isEnabled() || OpenAPSSMBDynamicISFPlugin.isEnabled()) sp.getDouble(R.string.key_openapssmb_max_iob, 3.0) else sp.getDouble(R.string
val maxIobPref: Double = if (openAPSSMBPlugin.isEnabled() || openAPSSMBDynamicISFPlugin.isEnabled()) sp.getDouble(R.string.key_openapssmb_max_iob, 3.0) else sp.getDouble(R.string
.key_openapsma_max_iob, 1.5)
maxIob.setIfSmaller(aapsLogger, maxIobPref, rh.gs(R.string.limitingiob, maxIobPref, rh.gs(R.string.maxvalueinpreferences)), this)
if (openAPSAMAPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobAMA(), rh.gs(R.string.limitingiob, hardLimits.maxIobAMA(), rh.gs(R.string.hardlimit)), this)
if (openAPSSMBPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
if (OpenAPSSMBDynamicISFPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
if (openAPSSMBDynamicISFPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
if (apsMode == "lgs") maxIob.setIfSmaller(aapsLogger, HardLimits.MAX_IOB_LGS, rh.gs(R.string.limitingiob, HardLimits.MAX_IOB_LGS, rh.gs(R.string.lowglucosesuspend)), this)
return maxIob
}

View file

@ -17,6 +17,7 @@ interface SkinInterface {
val mainGraphHeight: Int // in dp
val secondaryGraphHeight: Int // in dp
// no pre processing by default
fun preProcessLandscapeActionsLayout(dm: DisplayMetrics, binding: ActionsFragmentBinding) {
}

View file

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

View file

@ -30,7 +30,7 @@ interface DetermineBasalAdapterInterface {
uamAllowed: Boolean = false,
advancedFiltering: Boolean = false,
isSaveCgmSource: Boolean = false
) {}
)
operator fun invoke(): APSResult?
}

View file

@ -136,7 +136,7 @@ open class NumberPicker(context: Context, attrs: AttributeSet? = null) : LinearL
}
fun updateA11yDescription() {
val description = if (mCustomContentDescription != null) mCustomContentDescription else ""
val description = mCustomContentDescription ?: ""
binding.minusButton.contentDescription = context.getString(R.string.a11y_min_button_description, description, formatter?.format(this.step))
binding.plusButton.contentDescription = context.getString(R.string.a11y_plus_button_description, description, formatter?.format(this.step))
}

View file

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

View file

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

View file

@ -122,7 +122,7 @@ open class MessageBase(injector: HasAndroidInjector) {
}
}
open fun handleMessageNotReceived() {}
open fun handleMessageNotReceived() {} // do nothing by default
val command: Int
get() = byteFromRawBuff(buffer, 5) or (byteFromRawBuff(buffer, 4) shl 8)

View file

@ -58,7 +58,7 @@ public class InsightPairingActivity extends NoSplashAppCompatActivity implements
private RecyclerView deviceList;
private final DeviceAdapter deviceAdapter = new DeviceAdapter();
private final int PERMISSION_REQUEST_BLUETOOTH = 30242;
private static final int PERMISSION_REQUEST_BLUETOOTH = 30242;
private InsightConnectionService service;