Merge branch 'dev' into newdb

This commit is contained in:
Milos Kozak 2021-02-11 12:01:12 +01:00
commit e374cdfa98
18 changed files with 112 additions and 76 deletions

View file

@ -1,6 +1,5 @@
buildscript { buildscript {
repositories { repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2 maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2
} }
@ -22,7 +21,6 @@ jacoco {
} }
repositories { repositories {
jcenter { url "https://jcenter.bintray.com/" }
mavenCentral() mavenCentral()
google() google()
} }
@ -245,6 +243,9 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
// https://github.com/DavidProdinger/Weekdays-Selector (used outdated 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1')
implementation(name: 'weekdaysselector-1.1.1', ext: 'aar')
testImplementation "junit:junit:$junit_version" testImplementation "junit:junit:$junit_version"
testImplementation 'org.json:json:20201115' testImplementation 'org.json:json:20201115'
testImplementation "org.mockito:mockito-core:${mockitoVersion}" testImplementation "org.mockito:mockito-core:${mockitoVersion}"

Binary file not shown.

Binary file not shown.

View file

@ -333,24 +333,27 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
var useDevForScale = false var useDevForScale = false
var useRatioForScale = false var useRatioForScale = false
var useDSForScale = false var useDSForScale = false
var useIAForScale = false var useBGIForScale = false
var useABSForScale = false var useABSForScale = false
when { when {
menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal] -> useIobForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal] -> useIobForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] -> useCobForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] -> useCobForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] -> useDevForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] -> useDevForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] -> useRatioForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] -> useRatioForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.ACT.ordinal] -> useIAForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal] -> useBGIForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] -> useABSForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] -> useABSForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] -> useDSForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] -> useDSForScale = true
} }
if (menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]) secondGraphData.addIob(fromTime, toTime, useIobForScale, 1.0, menuChartSettings[g + 1][OverviewMenus.CharType.PRE.ordinal]) var alignIobScale = menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] && menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]
if (menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal]) secondGraphData.addCob(fromTime, toTime, useCobForScale, if (useCobForScale) 1.0 else 0.5) var alignDevBgiScale = menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] && menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal]
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal]) secondGraphData.addDeviations(fromTime, toTime, useDevForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal]) secondGraphData.addRatio(fromTime, toTime, useRatioForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.ACT.ordinal]) secondGraphData.addActivity(fromTime, toTime, useIAForScale, 0.8)
if (menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal]) secondGraphData.addAbsIob(fromTime, toTime, useABSForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal]) secondGraphData.addAbsIob(fromTime, toTime, useABSForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]) secondGraphData.addIob(fromTime, toTime, useIobForScale, 1.0, menuChartSettings[g + 1][OverviewMenus.CharType.PRE.ordinal], alignIobScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal]) secondGraphData.addCob(fromTime, toTime, useCobForScale, if (useCobForScale) 1.0 else 0.5)
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal]) secondGraphData.addDeviations(fromTime, toTime, useDevForScale, 1.0, alignDevBgiScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal]) secondGraphData.addRatio(fromTime, toTime, useRatioForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal]) secondGraphData.addMinusBGI(fromTime, toTime, useBGIForScale, if (alignDevBgiScale) 1.0 else 0.8, alignDevBgiScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] && buildHelper.isDev()) secondGraphData.addDeviationSlope(fromTime, toTime, useDSForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] && buildHelper.isDev()) secondGraphData.addDeviationSlope(fromTime, toTime, useDSForScale, 1.0)
// set manual x bounds to have nice steps // set manual x bounds to have nice steps

View file

@ -889,23 +889,25 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
var useDevForScale = false var useDevForScale = false
var useRatioForScale = false var useRatioForScale = false
var useDSForScale = false var useDSForScale = false
var useIAForScale = false var useBGIForScale = false
when { when {
menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] -> useABSForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] -> useABSForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal] -> useIobForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal] -> useIobForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] -> useCobForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] -> useCobForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] -> useDevForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] -> useDevForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] -> useRatioForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] -> useRatioForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.ACT.ordinal] -> useIAForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal] -> useBGIForScale = true
menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] -> useDSForScale = true menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] -> useDSForScale = true
} }
var alignIobScale = menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal] && menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]
var alignDevBgiScale = menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] && menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal]
if (menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal]) secondGraphData.addAbsIob(fromTime, now, useABSForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.ABS.ordinal]) secondGraphData.addAbsIob(fromTime, now, useABSForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]) secondGraphData.addIob(fromTime, now, useIobForScale, 1.0, menuChartSettings[g + 1][OverviewMenus.CharType.PRE.ordinal]) if (menuChartSettings[g + 1][OverviewMenus.CharType.IOB.ordinal]) secondGraphData.addIob(fromTime, now, useIobForScale, 1.0, menuChartSettings[g + 1][OverviewMenus.CharType.PRE.ordinal], alignIobScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal]) secondGraphData.addCob(fromTime, now, useCobForScale, if (useCobForScale) 1.0 else 0.5) if (menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal]) secondGraphData.addCob(fromTime, now, useCobForScale, if (useCobForScale) 1.0 else 0.5)
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal]) secondGraphData.addDeviations(fromTime, now, useDevForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal]) secondGraphData.addDeviations(fromTime, now, useDevForScale, 1.0, alignDevBgiScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal]) secondGraphData.addRatio(fromTime, now, useRatioForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal]) secondGraphData.addRatio(fromTime, now, useRatioForScale, 1.0)
if (menuChartSettings[g + 1][OverviewMenus.CharType.ACT.ordinal]) secondGraphData.addActivity(fromTime, endTime, useIAForScale, 0.8) if (menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal]) secondGraphData.addMinusBGI(fromTime, endTime, useBGIForScale, if(alignDevBgiScale) 1.0 else 0.8, alignDevBgiScale)
if (menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] && buildHelper.isDev()) secondGraphData.addDeviationSlope(fromTime, now, useDSForScale, 1.0) if (menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] && buildHelper.isDev()) secondGraphData.addDeviationSlope(fromTime, now, useDSForScale, 1.0)
// set manual x bounds to have nice steps // set manual x bounds to have nice steps
@ -926,7 +928,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] || menuChartSettings[g + 1][OverviewMenus.CharType.COB.ordinal] ||
menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] || menuChartSettings[g + 1][OverviewMenus.CharType.DEV.ordinal] ||
menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] || menuChartSettings[g + 1][OverviewMenus.CharType.SEN.ordinal] ||
menuChartSettings[g + 1][OverviewMenus.CharType.ACT.ordinal] || menuChartSettings[g + 1][OverviewMenus.CharType.BGI.ordinal] ||
menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal] menuChartSettings[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal]
).toVisibility() ).toVisibility()
secondaryGraphsData[g].performUpdate() secondaryGraphsData[g].performUpdate()

View file

@ -40,7 +40,8 @@ class OverviewMenus @Inject constructor(
COB(R.string.overview_show_cob, R.color.cob, primary = false, secondary = true,shortnameId = R.string.cob), COB(R.string.overview_show_cob, R.color.cob, primary = false, secondary = true,shortnameId = R.string.cob),
DEV(R.string.overview_show_deviations, R.color.deviations, primary = false, secondary = true,shortnameId = R.string.deviation_shortname), DEV(R.string.overview_show_deviations, R.color.deviations, primary = false, secondary = true,shortnameId = R.string.deviation_shortname),
SEN(R.string.overview_show_sensitivity, R.color.ratio, primary = false, secondary = true,shortnameId = R.string.sensitivity_shortname), SEN(R.string.overview_show_sensitivity, R.color.ratio, primary = false, secondary = true,shortnameId = R.string.sensitivity_shortname),
ACT(R.string.overview_show_activity, R.color.activity, primary = true, secondary = true,shortnameId = R.string.activity_shortname), ACT(R.string.overview_show_activity, R.color.activity, primary = true, secondary = false,shortnameId = R.string.activity_shortname),
BGI(R.string.overview_show_bgi, R.color.bgi, primary = false, secondary = true,shortnameId = R.string.bgi_shortname),
DEVSLOPE(R.string.overview_show_deviationslope, R.color.devslopepos, primary = false, secondary = true,shortnameId = R.string.devslope_shortname) DEVSLOPE(R.string.overview_show_deviationslope, R.color.devslopepos, primary = false, secondary = true,shortnameId = R.string.devslope_shortname)
} }

View file

@ -329,8 +329,51 @@ class GraphData(
actScale.setMultiplier(maxY * scale / maxIAValue) actScale.setMultiplier(maxY * scale / maxIAValue)
} }
//Function below show -BGI to be able to compare curves with deviations
fun addMinusBGI(fromTime: Long, toTime: Long, useForScale: Boolean, scale: Double, devBgiScale: Boolean) {
val bgiArrayHist: MutableList<ScaledDataPoint> = ArrayList()
val bgiArrayPred: MutableList<ScaledDataPoint> = ArrayList()
val now = System.currentTimeMillis().toDouble()
val bgiScale = Scale()
var total: IobTotal
var maxBGIValue = 0.0
var time = fromTime
while (time <= toTime) {
val profile = profileFunction.getProfile(time)
if (profile == null) {
time += 5 * 60 * 1000L
continue
}
val deviation = if (devBgiScale) iobCobCalculatorPlugin.getAutosensData(time)?.deviation ?:0.0 else 0.0
total = iobCobCalculatorPlugin.calculateFromTreatmentsAndTempsSynchronized(time, profile)
val bgi: Double = total.activity * profile.getIsfMgdl(time) * 5.0
if (time <= now) bgiArrayHist.add(ScaledDataPoint(time, bgi, bgiScale)) else bgiArrayPred.add(ScaledDataPoint(time, bgi, bgiScale))
maxBGIValue = max(maxBGIValue, max(abs(bgi), deviation))
time += 5 * 60 * 1000L
}
addSeries(FixedLineGraphSeries(Array(bgiArrayHist.size) { i -> bgiArrayHist[i] }).also {
it.isDrawBackground = false
it.color = resourceHelper.gc(R.color.bgi)
it.thickness = 3
})
addSeries(FixedLineGraphSeries(Array(bgiArrayPred.size) { i -> bgiArrayPred[i] }).also {
it.setCustomPaint(Paint().also { paint ->
paint.style = Paint.Style.STROKE
paint.strokeWidth = 3f
paint.pathEffect = DashPathEffect(floatArrayOf(4f, 4f), 0f)
paint.color = resourceHelper.gc(R.color.bgi)
})
})
if (useForScale) {
maxY = maxBGIValue
minY = -maxBGIValue
}
bgiScale.setMultiplier(maxY * scale / maxBGIValue)
}
// scale in % of vertical size (like 0.3) // scale in % of vertical size (like 0.3)
fun addIob(fromTime: Long, toTime: Long, useForScale: Boolean, scale: Double, showPrediction: Boolean) { fun addIob(fromTime: Long, toTime: Long, useForScale: Boolean, scale: Double, showPrediction: Boolean, absScale: Boolean) {
val iobSeries: FixedLineGraphSeries<ScaledDataPoint?> val iobSeries: FixedLineGraphSeries<ScaledDataPoint?>
val iobArray: MutableList<ScaledDataPoint> = ArrayList() val iobArray: MutableList<ScaledDataPoint> = ArrayList()
var maxIobValueFound = Double.MIN_VALUE var maxIobValueFound = Double.MIN_VALUE
@ -340,11 +383,15 @@ class GraphData(
while (time <= toTime) { while (time <= toTime) {
val profile = profileFunction.getProfile(time) val profile = profileFunction.getProfile(time)
var iob = 0.0 var iob = 0.0
if (profile != null) iob = iobCobCalculatorPlugin.calculateFromTreatmentsAndTempsSynchronized(time, profile).iob var absIob = 0.0
if (profile != null) {
iob = iobCobCalculatorPlugin.calculateFromTreatmentsAndTempsSynchronized(time, profile).iob
if (absScale) absIob = iobCobCalculatorPlugin.calculateAbsInsulinFromTreatmentsAndTempsSynchronized(time, profile).iob
}
if (abs(lastIob - iob) > 0.02) { if (abs(lastIob - iob) > 0.02) {
if (abs(lastIob - iob) > 0.2) iobArray.add(ScaledDataPoint(time, lastIob, iobScale)) if (abs(lastIob - iob) > 0.2) iobArray.add(ScaledDataPoint(time, lastIob, iobScale))
iobArray.add(ScaledDataPoint(time, iob, iobScale)) iobArray.add(ScaledDataPoint(time, iob, iobScale))
maxIobValueFound = max(maxIobValueFound, abs(iob)) maxIobValueFound = if (absScale) max(maxIobValueFound, abs(absIob)) else max(maxIobValueFound, abs(iob))
lastIob = iob lastIob = iob
} }
time += 5 * 60 * 1000L time += 5 * 60 * 1000L
@ -460,14 +507,23 @@ class GraphData(
} }
// scale in % of vertical size (like 0.3) // scale in % of vertical size (like 0.3)
fun addDeviations(fromTime: Long, toTime: Long, useForScale: Boolean, scale: Double) { fun addDeviations(fromTime: Long, toTime: Long, useForScale: Boolean, scale: Double, devBgiScale: Boolean) {
class DeviationDataPoint(x: Double, y: Double, var color: Int, scale: Scale) : ScaledDataPoint(x, y, scale) class DeviationDataPoint(x: Double, y: Double, var color: Int, scale: Scale) : ScaledDataPoint(x, y, scale)
val devArray: MutableList<DeviationDataPoint> = ArrayList() val devArray: MutableList<DeviationDataPoint> = ArrayList()
var maxDevValueFound = 0.0 var maxDevValueFound = 0.0
val devScale = Scale() val devScale = Scale()
var time = fromTime var time = fromTime
var total: IobTotal
while (time <= toTime) { while (time <= toTime) {
// if align Dev Scale with BGI scale, then calculate BGI value, else bgi = 0.0
val bgi: Double = if (devBgiScale) {
val profile = profileFunction.getProfile(time)
total = iobCobCalculatorPlugin.calculateFromTreatmentsAndTempsSynchronized(time, profile)
total.activity * (profile?.getIsfMgdl(time) ?: 0.0) * 5.0
} else 0.0
iobCobCalculatorPlugin.getAutosensData(time)?.let { autosensData -> iobCobCalculatorPlugin.getAutosensData(time)?.let { autosensData ->
var color = resourceHelper.gc(R.color.deviationblack) // "=" var color = resourceHelper.gc(R.color.deviationblack) // "="
if (autosensData.type == "" || autosensData.type == "non-meal") { if (autosensData.type == "" || autosensData.type == "non-meal") {
@ -480,7 +536,7 @@ class GraphData(
color = resourceHelper.gc(R.color.deviationgrey) color = resourceHelper.gc(R.color.deviationgrey)
} }
devArray.add(DeviationDataPoint(time.toDouble(), autosensData.deviation, color, devScale)) devArray.add(DeviationDataPoint(time.toDouble(), autosensData.deviation, color, devScale))
maxDevValueFound = max(maxDevValueFound, abs(autosensData.deviation)) maxDevValueFound = max(maxDevValueFound, max(abs(autosensData.deviation), abs(bgi)))
} }
time += 5 * 60 * 1000L time += 5 * 60 * 1000L
} }

View file

@ -7,7 +7,7 @@
android:pathData="M60.558,17.9c-0,-7.782 -6.318,-14.1 -14.1,-14.1l-29.149,-0c-7.782,-0 -14.1,6.318 -14.1,14.1l0,28.2c0,7.782 6.318,14.1 14.1,14.1l29.149,0c7.782,0 14.1,-6.318 14.1,-14.1l-0,-28.2Z" android:pathData="M60.558,17.9c-0,-7.782 -6.318,-14.1 -14.1,-14.1l-29.149,-0c-7.782,-0 -14.1,6.318 -14.1,14.1l0,28.2c0,7.782 6.318,14.1 14.1,14.1l29.149,0c7.782,0 14.1,-6.318 14.1,-14.1l-0,-28.2Z"
android:strokeAlpha="0.96" android:strokeAlpha="0.96"
android:strokeWidth="0.84" android:strokeWidth="0.84"
android:fillColor="?attr/text_color" android:fillColor="@android:color/transparent"
android:strokeColor="#fff"/> android:strokeColor="#fff"/>
<path <path
android:pathData="M11.708,14.729l0,-1.224l3.819,-0.008l-0,3.874c-0.586,0.541 -1.191,0.948 -1.814,1.221c-0.623,0.273 -1.263,0.41 -1.919,0.41c-0.885,-0 -1.69,-0.22 -2.413,-0.659c-0.724,-0.439 -1.27,-1.074 -1.639,-1.905c-0.369,-0.83 -0.553,-1.759 -0.553,-2.784c-0,-1.016 0.183,-1.964 0.55,-2.845c0.367,-0.88 0.895,-1.534 1.584,-1.961c0.688,-0.428 1.481,-0.641 2.379,-0.641c0.652,-0 1.241,0.122 1.768,0.366c0.527,0.245 0.94,0.586 1.239,1.022c0.299,0.437 0.527,1.007 0.682,1.709l-1.076,0.342c-0.135,-0.532 -0.303,-0.949 -0.504,-1.253c-0.201,-0.304 -0.488,-0.547 -0.861,-0.73c-0.373,-0.183 -0.787,-0.274 -1.242,-0.274c-0.545,-0 -1.016,0.096 -1.414,0.288c-0.398,0.192 -0.718,0.445 -0.962,0.759c-0.244,0.313 -0.434,0.657 -0.569,1.032c-0.23,0.646 -0.344,1.346 -0.344,2.101c-0,0.93 0.138,1.709 0.415,2.335c0.276,0.627 0.679,1.092 1.208,1.396c0.529,0.304 1.09,0.456 1.685,0.456c0.516,-0 1.02,-0.115 1.512,-0.346c0.492,-0.23 0.865,-0.476 1.119,-0.737l0,-1.944l-2.65,0Z" android:pathData="M11.708,14.729l0,-1.224l3.819,-0.008l-0,3.874c-0.586,0.541 -1.191,0.948 -1.814,1.221c-0.623,0.273 -1.263,0.41 -1.919,0.41c-0.885,-0 -1.69,-0.22 -2.413,-0.659c-0.724,-0.439 -1.27,-1.074 -1.639,-1.905c-0.369,-0.83 -0.553,-1.759 -0.553,-2.784c-0,-1.016 0.183,-1.964 0.55,-2.845c0.367,-0.88 0.895,-1.534 1.584,-1.961c0.688,-0.428 1.481,-0.641 2.379,-0.641c0.652,-0 1.241,0.122 1.768,0.366c0.527,0.245 0.94,0.586 1.239,1.022c0.299,0.437 0.527,1.007 0.682,1.709l-1.076,0.342c-0.135,-0.532 -0.303,-0.949 -0.504,-1.253c-0.201,-0.304 -0.488,-0.547 -0.861,-0.73c-0.373,-0.183 -0.787,-0.274 -1.242,-0.274c-0.545,-0 -1.016,0.096 -1.414,0.288c-0.398,0.192 -0.718,0.445 -0.962,0.759c-0.244,0.313 -0.434,0.657 -0.569,1.032c-0.23,0.646 -0.344,1.346 -0.344,2.101c-0,0.93 0.138,1.709 0.415,2.335c0.276,0.627 0.679,1.092 1.208,1.396c0.529,0.304 1.09,0.456 1.685,0.456c0.516,-0 1.02,-0.115 1.512,-0.346c0.492,-0.23 0.865,-0.476 1.119,-0.737l0,-1.944l-2.65,0Z"

View file

@ -6,6 +6,7 @@
<color name="bolus">#1ea3e5</color> <color name="bolus">#1ea3e5</color>
<color name="ratio">#FFFFFF</color> <color name="ratio">#FFFFFF</color>
<color name="activity">#d3f166</color> <color name="activity">#d3f166</color>
<color name="bgi">#00EEEE</color>
<color name="devslopepos">#FFFFFF00</color> <color name="devslopepos">#FFFFFF00</color>
<color name="devslopeneg">#FFFF00FF</color> <color name="devslopeneg">#FFFF00FF</color>
<color name="actionsConfirm">#FFFF00</color> <color name="actionsConfirm">#FFFF00</color>

View file

@ -495,6 +495,7 @@
<string name="basal_shortname">BAS</string> <string name="basal_shortname">BAS</string>
<string name="deviation_shortname">DEV</string> <string name="deviation_shortname">DEV</string>
<string name="activity_shortname">ACT</string> <string name="activity_shortname">ACT</string>
<string name="bgi_shortname">-BGI</string>
<string name="abs_insulin_shortname">ABS</string> <string name="abs_insulin_shortname">ABS</string>
<string name="devslope_shortname">DEVSLOPE</string> <string name="devslope_shortname">DEVSLOPE</string>
<string name="nav_about">About</string> <string name="nav_about">About</string>
@ -749,6 +750,7 @@
<string name="key_ns_autobackfill" translatable="false">ns_autobackfill</string> <string name="key_ns_autobackfill" translatable="false">ns_autobackfill</string>
<string name="loop_smbsetbypump_label">SMB set by pump</string> <string name="loop_smbsetbypump_label">SMB set by pump</string>
<string name="overview_show_activity">Activity</string> <string name="overview_show_activity">Activity</string>
<string name="overview_show_bgi">Blood Glucose Impact</string>
<string name="overview_show_sensitivity">Sensitivity</string> <string name="overview_show_sensitivity">Sensitivity</string>
<string name="overview_show_deviations">Deviations</string> <string name="overview_show_deviations">Deviations</string>
<string name="overview_show_cob">Carbs On Board</string> <string name="overview_show_cob">Carbs On Board</string>

View file

@ -34,7 +34,12 @@ buildscript {
} }
repositories { repositories {
google() google()
jcenter() mavenCentral()
jcenter() {
content {
includeModule("org.jetbrains.trove4j", "trove4j")
}
}
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.android.tools.build:gradle:4.0.1'
@ -51,8 +56,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
maven { maven {
url "https://maven.google.com" url "https://maven.google.com"
} }
@ -63,6 +67,12 @@ allprojects {
} }
} }
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
jcenter() {
content {
includeModule("com.google.android", "flexbox")
includeModule("org.jetbrains.trove4j", "trove4j")
}
}
} }
//Support @JvmDefault //Support @JvmDefault
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {

View file

@ -109,8 +109,6 @@ dependencies {
api 'org.mozilla:rhino:1.7.13' api 'org.mozilla:rhino:1.7.13'
api 'com.github.DavidProdinger:weekdays-selector:1.1.0'
api 'com.github.kenglxn.QRGen:android:2.6.0' api 'com.github.kenglxn.QRGen:android:2.6.0'
api 'com.eatthepath:java-otp:0.2.0' api 'com.eatthepath:java-otp:0.2.0'

View file

@ -1,25 +0,0 @@
package info.nightscout.database
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("info.nightscout.database.test", appContext.packageName)
}
}

View file

@ -1,18 +0,0 @@
package info.nightscout.database
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View file

@ -28,6 +28,8 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager;
import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.rx.AapsSchedulers;
import info.nightscout.androidaps.utils.rx.TestAapsSchedulers;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
@ -41,7 +43,7 @@ public class OmnipodPumpPluginTest {
@Mock HasAndroidInjector injector; @Mock HasAndroidInjector injector;
AAPSLogger aapsLogger = new AAPSLoggerTest(); AAPSLogger aapsLogger = new AAPSLoggerTest();
RxBusWrapper rxBusWrapper = new RxBusWrapper(); RxBusWrapper rxBusWrapper = new RxBusWrapper(new TestAapsSchedulers());
@Mock ResourceHelper resourceHelper; @Mock ResourceHelper resourceHelper;
@Mock(answer = Answers.RETURNS_DEEP_STUBS) ActivePluginProvider activePluginProvider; @Mock(answer = Answers.RETURNS_DEEP_STUBS) ActivePluginProvider activePluginProvider;
@Mock AapsOmnipodManager aapsOmnipodManager; @Mock AapsOmnipodManager aapsOmnipodManager;
@ -57,7 +59,7 @@ public class OmnipodPumpPluginTest {
// mock all the things // mock all the things
PowerMockito.mockStatic(Looper.class); PowerMockito.mockStatic(Looper.class);
OmnipodPumpPlugin plugin = new OmnipodPumpPlugin(injector, aapsLogger, rxBusWrapper, null, OmnipodPumpPlugin plugin = new OmnipodPumpPlugin(injector, aapsLogger, new TestAapsSchedulers(), rxBusWrapper, null,
resourceHelper, activePluginProvider, null, null, aapsOmnipodManager, commandQueueProvider, resourceHelper, activePluginProvider, null, null, aapsOmnipodManager, commandQueueProvider,
null, null, null, null, null, null, null, null,
rileyLinkUtil, null, null, null, null rileyLinkUtil, null, null, null, null

View file

@ -14,6 +14,7 @@ import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FirmwareVersion; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FirmwareVersion;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
import info.nightscout.androidaps.utils.rx.TestAapsSchedulers;
import info.nightscout.androidaps.utils.sharedPreferences.SP; import info.nightscout.androidaps.utils.sharedPreferences.SP;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -23,7 +24,7 @@ public class AapsPodStateManagerTest {
@Mock AAPSLogger aapsLogger; @Mock AAPSLogger aapsLogger;
@Mock SP sp; @Mock SP sp;
private RxBusWrapper rxBus = new RxBusWrapper(); private RxBusWrapper rxBus = new RxBusWrapper(new TestAapsSchedulers());
@Test @Test
public void times() { public void times() {

View file

@ -1,6 +1,7 @@
buildscript { buildscript {
repositories { repositories {
jcenter() google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2 maven { url "https://plugins.gradle.org/m2/" } // jacoco 0.2
} }
@ -99,7 +100,8 @@ android {
allprojects { allprojects {
repositories { repositories {
jcenter() google()
mavenCentral()
flatDir { flatDir {
dirs 'libs' dirs 'libs'
} }
@ -119,10 +121,10 @@ dependencies {
implementation "com.google.android.support:wearable:${wearableVersion}" implementation "com.google.android.support:wearable:${wearableVersion}"
implementation "com.google.android.gms:play-services-wearable:${playServicesWearable}" implementation "com.google.android.gms:play-services-wearable:${playServicesWearable}"
implementation(name: 'ustwo-clockwise-debug', ext: 'aar') implementation(name: 'ustwo-clockwise-debug', ext: 'aar')
implementation(name: 'wearpreferenceactivity-0.5.0', ext: 'aar')
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0' implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.wear:wear:1.1.0' implementation 'androidx.wear:wear:1.1.0'
implementation('me.denley.wearpreferenceactivity:wearpreferenceactivity:0.5.0')
implementation('com.github.lecho:hellocharts-library:1.5.8@aar') implementation('com.github.lecho:hellocharts-library:1.5.8@aar')
testImplementation "junit:junit:$junit_version" testImplementation "junit:junit:$junit_version"

Binary file not shown.