diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index b2faaf7c11..901ffd821f 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -60,6 +60,8 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.locale.LocaleHelper import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.isRunningRealPumpTest +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.tabs.TabLayoutMediator import com.google.firebase.crashlytics.FirebaseCrashlytics @@ -68,8 +70,6 @@ import com.joanzapata.iconify.fonts.FontAwesomeModule import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityMainBinding -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin import info.nightscout.ui.activities.ProfileHelperActivity import info.nightscout.ui.activities.StatsActivity diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index 5531e221e4..e1101296b6 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -13,7 +13,6 @@ import androidx.work.Data import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager -import app.aaps.di.DaggerAppComponent import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.ConfigBuilder @@ -28,6 +27,10 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils +import app.aaps.core.ui.locale.LocaleHelper +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.di.DaggerAppComponent import app.aaps.receivers.BTReceiver import app.aaps.receivers.ChargingStateReceiver import app.aaps.receivers.KeepAliveWorker @@ -36,9 +39,6 @@ import dagger.android.AndroidInjector import dagger.android.DaggerApplication import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R -import app.aaps.core.ui.locale.LocaleHelper -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.VersionChangeTransaction diff --git a/core/graphview/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java b/core/graphview/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java index b6a8ff7d9b..b546be7d61 100644 --- a/core/graphview/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java +++ b/core/graphview/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java @@ -1,18 +1,18 @@ /** * GraphView * Copyright (C) 2014 Jonas Gehring - * + *

* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, * with the "Linking Exception", which can be found at the license.txt * file in this program. - * + *

* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + *

* You should have received a copy of the GNU General Public License * with the "Linking Exception" along with this program; if not, * write to the author Jonas Gehring . @@ -39,122 +39,14 @@ import java.util.Map; */ public class GridLabelRenderer { /** - * wrapper for the styles regarding - * to the grid and the labels + * reference to graphview */ - public final class Styles { - /** - * the general text size of the axis titles. - * can be overwritten with #verticalAxisTitleTextSize - * and #horizontalAxisTitleTextSize - */ - public float textSize; - - /** - * the alignment of the vertical labels - */ - public Paint.Align verticalLabelsAlign; - - /** - * the alignment of the labels on the right side - */ - public Paint.Align verticalLabelsSecondScaleAlign; - - /** - * the color of the vertical labels - */ - public int verticalLabelsColor; - - /** - * the color of the labels on the right side - */ - public int verticalLabelsSecondScaleColor; - - /** - * the color of the horizontal labels - */ - public int horizontalLabelsColor; - - /** - * the color of the grid lines - */ - public int gridColor; - - /** - * flag whether the zero-lines (vertical+ - * horizontal) shall be highlighted - */ - public boolean highlightZeroLines; - - /** - * the padding around the graph and labels - */ - public int padding; - - /** - * font size of the vertical axis title - */ - public float verticalAxisTitleTextSize; - - /** - * font color of the vertical axis title - */ - public int verticalAxisTitleColor; - - /** - * font size of the horizontal axis title - */ - public float horizontalAxisTitleTextSize; - - /** - * font color of the horizontal axis title - */ - public int horizontalAxisTitleColor; - - /** - * flag whether the horizontal labels are - * visible - */ - boolean horizontalLabelsVisible; - - /** - * flag whether the vertical labels are - * visible - */ - boolean verticalLabelsVisible; - - /** - * defines which lines will be drawn in the background - */ - GridStyle gridStyle; - - /** - * the space between the labels text and the graph content - */ - int labelsSpace; - } - - /** - * Definition which lines will be drawn in the background - */ - public enum GridStyle { - BOTH, VERTICAL, HORIZONTAL, NONE; - - public boolean drawVertical() { return this == BOTH || this == VERTICAL && this != NONE; } - public boolean drawHorizontal() { return this == BOTH || this == HORIZONTAL && this != NONE; } - } - + private final GraphView mGraphView; /** * wraps the styles regarding the * grid and labels */ protected Styles mStyles; - - /** - * reference to graphview - */ - private final GraphView mGraphView; - /** * cache of the vertical steps * (horizontal lines and vertical labels) @@ -162,7 +54,6 @@ public class GridLabelRenderer { * Value = y-value */ private Map mStepsVertical; - /** * cache of the vertical steps for the * second scale, which is on the right side @@ -171,7 +62,6 @@ public class GridLabelRenderer { * Value = y-value */ private Map mStepsVerticalSecondScale; - /** * cache of the horizontal steps * (vertical lines and horizontal labels) @@ -179,92 +69,75 @@ public class GridLabelRenderer { * Value = x-value */ private Map mStepsHorizontal; - /** * the paint to draw the grid lines */ private Paint mPaintLine; - /** * the paint to draw the labels */ private Paint mPaintLabel; - /** * the paint to draw axis titles */ private Paint mPaintAxisTitle; - /** * flag whether is bounds are automatically * adjusted for nice human-readable numbers */ private boolean mIsAdjusted; - /** * the width of the vertical labels */ private Integer mLabelVerticalWidth; - /** * indicates if the width was set manually */ private boolean mLabelVerticalWidthFixed; - /** * the height of the vertical labels */ private Integer mLabelVerticalHeight; - /** * indicates if the height was set manually */ private boolean mLabelHorizontalHeightFixed; - /** * the width of the vertical labels * of the second scale */ private Integer mLabelVerticalSecondScaleWidth; - /** * the height of the vertical labels * of the second scale */ private Integer mLabelVerticalSecondScaleHeight; - /** * the width of the horizontal labels */ private Integer mLabelHorizontalWidth; - /** * the height of the horizontal labels */ private Integer mLabelHorizontalHeight; - /** * the label formatter, that converts * the raw numbers to strings */ private LabelFormatter mLabelFormatter; - /** * the title of the horizontal axis */ private String mHorizontalAxisTitle; - /** * the title of the vertical axis */ private String mVerticalAxisTitle; - /** * count of the vertical labels, that * will be shown at one time. */ private int mNumVerticalLabels; - /** * count of the horizontal labels, that * will be shown at one time. @@ -326,7 +199,7 @@ public class GridLabelRenderer { mStyles.gridColor = color2; mStyles.textSize = size; mStyles.padding = size2; - mStyles.labelsSpace = (int) mStyles.textSize/5; + mStyles.labelsSpace = (int) mStyles.textSize / 5; mStyles.verticalLabelsAlign = Paint.Align.RIGHT; mStyles.verticalLabelsSecondScaleAlign = Paint.Align.LEFT; @@ -369,6 +242,15 @@ public class GridLabelRenderer { return mStyles.textSize; } + /** + * @param textSize the general text size of the axis titles. + * can be overwritten with {@link #setVerticalAxisTitleTextSize(float)} + * and {@link #setHorizontalAxisTitleTextSize(float)} + */ + public void setTextSize(float textSize) { + mStyles.textSize = textSize; + } + /** * @return the font color of the vertical labels */ @@ -377,13 +259,27 @@ public class GridLabelRenderer { } /** - * @return the alignment of the text of the + * @param verticalLabelsColor the color of the vertical labels + */ + public void setVerticalLabelsColor(int verticalLabelsColor) { + mStyles.verticalLabelsColor = verticalLabelsColor; + } + + /** + * @return the alignment of the text of the * vertical labels */ public Paint.Align getVerticalLabelsAlign() { return mStyles.verticalLabelsAlign; } + /** + * @param verticalLabelsAlign the alignment of the vertical labels + */ + public void setVerticalLabelsAlign(Paint.Align verticalLabelsAlign) { + mStyles.verticalLabelsAlign = verticalLabelsAlign; + } + /** * @return the font color of the horizontal labels */ @@ -391,6 +287,13 @@ public class GridLabelRenderer { return mStyles.horizontalLabelsColor; } + /** + * @param horizontalLabelsColor the color of the horizontal labels + */ + public void setHorizontalLabelsColor(int horizontalLabelsColor) { + mStyles.horizontalLabelsColor = horizontalLabelsColor; + } + /** * clears the internal cache and forces * to redraw the grid and labels. @@ -677,7 +580,7 @@ public class GridLabelRenderer { if (mStepsHorizontal != null) { mStepsHorizontal.clear(); } else { - mStepsHorizontal = new LinkedHashMap((int) numHorizontalLabels); + mStepsHorizontal = new LinkedHashMap(numHorizontalLabels); } int width = mGraphView.getGraphContentWidth(); @@ -910,7 +813,7 @@ public class GridLabelRenderer { } /** - * @return the horizontal axis title height + * @return the horizontal axis title height * or 0 if there is no title */ public int getHorizontalAxisTitleHeight() { @@ -922,7 +825,7 @@ public class GridLabelRenderer { } /** - * @return the vertical axis title width + * @return the vertical axis title width * or 0 if there is no title */ public int getVerticalAxisTitleWidth() { @@ -1119,7 +1022,7 @@ public class GridLabelRenderer { } /** - * @return the vertical label width + * @return the vertical label width * 0 if there are no vertical labels */ public int getLabelVerticalWidth() { @@ -1140,7 +1043,7 @@ public class GridLabelRenderer { } /** - * @return the horizontal label height + * @return the horizontal label height * 0 if there are no horizontal labels */ public int getLabelHorizontalHeight() { @@ -1167,50 +1070,6 @@ public class GridLabelRenderer { return mStyles.gridColor; } - /** - * @return whether the line at 0 are highlighted - */ - public boolean isHighlightZeroLines() { - return mStyles.highlightZeroLines; - } - - /** - * @return the padding around the grid and labels - */ - public int getPadding() { - return mStyles.padding; - } - - /** - * @param textSize the general text size of the axis titles. - * can be overwritten with {@link #setVerticalAxisTitleTextSize(float)} - * and {@link #setHorizontalAxisTitleTextSize(float)} - */ - public void setTextSize(float textSize) { - mStyles.textSize = textSize; - } - - /** - * @param verticalLabelsAlign the alignment of the vertical labels - */ - public void setVerticalLabelsAlign(Paint.Align verticalLabelsAlign) { - mStyles.verticalLabelsAlign = verticalLabelsAlign; - } - - /** - * @param verticalLabelsColor the color of the vertical labels - */ - public void setVerticalLabelsColor(int verticalLabelsColor) { - mStyles.verticalLabelsColor = verticalLabelsColor; - } - - /** - * @param horizontalLabelsColor the color of the horizontal labels - */ - public void setHorizontalLabelsColor(int horizontalLabelsColor) { - mStyles.horizontalLabelsColor = horizontalLabelsColor; - } - /** * @param gridColor the color of the grid lines */ @@ -1218,6 +1077,13 @@ public class GridLabelRenderer { mStyles.gridColor = gridColor; } + /** + * @return whether the line at 0 are highlighted + */ + public boolean isHighlightZeroLines() { + return mStyles.highlightZeroLines; + } + /** * @param highlightZeroLines flag whether the zero-lines (vertical+ * horizontal) shall be highlighted @@ -1226,6 +1092,13 @@ public class GridLabelRenderer { mStyles.highlightZeroLines = highlightZeroLines; } + /** + * @return the padding around the grid and labels + */ + public int getPadding() { + return mStyles.padding; + } + /** * @param padding the padding around the graph and labels */ @@ -1234,7 +1107,7 @@ public class GridLabelRenderer { } /** - * @return the label formatter, that converts + * @return the label formatter, that converts * the raw numbers to strings */ public LabelFormatter getLabelFormatter() { @@ -1363,15 +1236,15 @@ public class GridLabelRenderer { } /** - * @return the width of the vertical labels + * @return the width of the vertical labels * of the second scale */ public int getLabelVerticalSecondScaleWidth() { - return mLabelVerticalSecondScaleWidth==null?0:mLabelVerticalSecondScaleWidth; + return mLabelVerticalSecondScaleWidth == null ? 0 : mLabelVerticalSecondScaleWidth; } /** - * @return flag whether the horizontal labels are + * @return flag whether the horizontal labels are * visible */ public boolean isHorizontalLabelsVisible() { @@ -1387,7 +1260,7 @@ public class GridLabelRenderer { } /** - * @return flag whether the vertical labels are + * @return flag whether the vertical labels are * visible */ public boolean isVerticalLabelsVisible() { @@ -1403,7 +1276,7 @@ public class GridLabelRenderer { } /** - * @return count of the vertical labels, that + * @return count of the vertical labels, that * will be shown at one time. */ public int getNumVerticalLabels() { @@ -1419,7 +1292,7 @@ public class GridLabelRenderer { } /** - * @return count of the horizontal labels, that + * @return count of the horizontal labels, that * will be shown at one time. */ public int getNumHorizontalLabels() { @@ -1465,4 +1338,115 @@ public class GridLabelRenderer { public void setLabelsSpace(int labelsSpace) { mStyles.labelsSpace = labelsSpace; } + + /** + * Definition which lines will be drawn in the background + */ + public enum GridStyle { + BOTH, VERTICAL, HORIZONTAL, NONE; + + public boolean drawVertical() { + return this == BOTH || this == VERTICAL && this != NONE; + } + + public boolean drawHorizontal() { + return this == BOTH || this == HORIZONTAL && this != NONE; + } + } + + /** + * wrapper for the styles regarding + * to the grid and the labels + */ + public final class Styles { + /** + * the general text size of the axis titles. + * can be overwritten with #verticalAxisTitleTextSize + * and #horizontalAxisTitleTextSize + */ + public float textSize; + + /** + * the alignment of the vertical labels + */ + public Paint.Align verticalLabelsAlign; + + /** + * the alignment of the labels on the right side + */ + public Paint.Align verticalLabelsSecondScaleAlign; + + /** + * the color of the vertical labels + */ + public int verticalLabelsColor; + + /** + * the color of the labels on the right side + */ + public int verticalLabelsSecondScaleColor; + + /** + * the color of the horizontal labels + */ + public int horizontalLabelsColor; + + /** + * the color of the grid lines + */ + public int gridColor; + + /** + * flag whether the zero-lines (vertical+ + * horizontal) shall be highlighted + */ + public boolean highlightZeroLines; + + /** + * the padding around the graph and labels + */ + public int padding; + + /** + * font size of the vertical axis title + */ + public float verticalAxisTitleTextSize; + + /** + * font color of the vertical axis title + */ + public int verticalAxisTitleColor; + + /** + * font size of the horizontal axis title + */ + public float horizontalAxisTitleTextSize; + + /** + * font color of the horizontal axis title + */ + public int horizontalAxisTitleColor; + + /** + * flag whether the horizontal labels are + * visible + */ + boolean horizontalLabelsVisible; + + /** + * flag whether the vertical labels are + * visible + */ + boolean verticalLabelsVisible; + + /** + * defines which lines will be drawn in the background + */ + GridStyle gridStyle; + + /** + * the space between the labels text and the graph content + */ + int labelsSpace; + } } diff --git a/core/graphview/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java b/core/graphview/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java index 6b6298c655..c94f732ffc 100644 --- a/core/graphview/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java +++ b/core/graphview/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java @@ -1,18 +1,18 @@ /** * GraphView * Copyright (C) 2014 Jonas Gehring - * + *

* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, * with the "Linking Exception", which can be found at the license.txt * file in this program. - * + *

* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + *

* You should have received a copy of the GNU General Public License * with the "Linking Exception" along with this program; if not, * write to the author Jonas Gehring . @@ -45,33 +45,33 @@ public class BarGraphSeries extends BaseSeries * paint to do drawing on canvas */ private final Paint mPaint; - + /** + * stores the coordinates of the bars to + * trigger tap on series events. + */ + private final Map mDataPoints = new HashMap(); /** * spacing between the bars in percentage. * 0 => no spacing * 100 => the space bewetten the bars is as big as the bars itself */ private int mSpacing; - /** * callback to generate value-dependent colors * of the bars */ private ValueDependentColor mValueDependentColor; - /** * flag whether the values should drawn * above the bars as text */ private boolean mDrawValuesOnTop; - /** * color of the text above the bars. * * @see #mDrawValuesOnTop */ private int mValuesOnTopColor; - /** * font size of the text above the bars. * @@ -79,12 +79,6 @@ public class BarGraphSeries extends BaseSeries */ private float mValuesOnTopSize; - /** - * stores the coordinates of the bars to - * trigger tap on series events. - */ - private final Map mDataPoints = new HashMap(); - /** * creates bar series without any data */ @@ -139,10 +133,10 @@ public class BarGraphSeries extends BaseSeries int numValues = 0; boolean isCurrentSeries; SortedSet xVals = new TreeSet(); - for(Series inspectedSeries: graphView.getSeries()) { - if(inspectedSeries instanceof BarGraphSeries) { + for (Series inspectedSeries : graphView.getSeries()) { + if (inspectedSeries instanceof BarGraphSeries) { isCurrentSeries = (inspectedSeries == this); - if(isCurrentSeries) { + if (isCurrentSeries) { currentSeriesOrder = numBarSeries; } numBarSeries++; @@ -155,10 +149,14 @@ public class BarGraphSeries extends BaseSeries Iterator curValues = inspectedSeries.getValues(minX, maxX); if (curValues.hasNext()) { xVals.add(curValues.next().getX()); - if(isCurrentSeries) { numValues++; } + if (isCurrentSeries) { + numValues++; + } while (curValues.hasNext()) { xVals.add(curValues.next().getX()); - if(isCurrentSeries) { numValues++; } + if (isCurrentSeries) { + numValues++; + } } } } @@ -169,8 +167,8 @@ public class BarGraphSeries extends BaseSeries Double lastVal = null; double minGap = 0; - for(Double curVal: xVals) { - if(lastVal != null) { + for (Double curVal : xVals) { + if (lastVal != null) { double curGap = Math.abs(curVal - lastVal); if (minGap == 0 || (curGap > 0 && curGap < minGap)) { minGap = curGap; @@ -179,23 +177,23 @@ public class BarGraphSeries extends BaseSeries lastVal = curVal; } - int numBarSlots = (minGap == 0) ? 1 : (int)Math.round((maxX - minX)/minGap) + 1; + int numBarSlots = (minGap == 0) ? 1 : (int) Math.round((maxX - minX) / minGap) + 1; Iterator values = getValues(minX, maxX); // Calculate the overall bar slot width - this includes all bars across // all series, and any spacing between sets of bars float barSlotWidth = numBarSlots == 1 - ? graphView.getGraphContentWidth() - : graphView.getGraphContentWidth() / (numBarSlots-1); + ? graphView.getGraphContentWidth() + : graphView.getGraphContentWidth() / (numBarSlots - 1); Log.d("BarGraphSeries", "numBars=" + numBarSlots); // Total spacing (both sides) between sets of bars - float spacing = Math.min((float) barSlotWidth*mSpacing/100, barSlotWidth*0.98f); + float spacing = Math.min(barSlotWidth * mSpacing / 100, barSlotWidth * 0.98f); // Width of an individual bar float barWidth = (barSlotWidth - spacing) / numBarSeries; // Offset from the center of a given bar to start drawing - float offset = barSlotWidth/2; + float offset = barSlotWidth / 2; double diffY = maxY - minY; double diffX = maxX - minX; @@ -205,7 +203,7 @@ public class BarGraphSeries extends BaseSeries float contentTop = graphView.getGraphContentTop(); // draw data - int i=0; + int i = 0; while (values.hasNext()) { E value = values.next(); @@ -228,22 +226,22 @@ public class BarGraphSeries extends BaseSeries mPaint.setColor(getColor()); } - float left = (float)x + contentLeft - offset + spacing/2 + currentSeriesOrder*barWidth; - float top = (contentTop - (float)y) + contentHeight; + float left = (float) x + contentLeft - offset + spacing / 2 + currentSeriesOrder * barWidth; + float top = (contentTop - (float) y) + contentHeight; float right = left + barWidth; - float bottom = (contentTop - (float)y0) + contentHeight - (graphView.getGridLabelRenderer().isHighlightZeroLines()?4:1); + float bottom = (contentTop - (float) y0) + contentHeight - (graphView.getGridLabelRenderer().isHighlightZeroLines() ? 4 : 1); boolean reverse = top > bottom; if (reverse) { float tmp = top; - top = bottom + (graphView.getGridLabelRenderer().isHighlightZeroLines()?4:1); + top = bottom + (graphView.getGridLabelRenderer().isHighlightZeroLines() ? 4 : 1); bottom = tmp; } // overdraw left = Math.max(left, contentLeft); - right = Math.min(right, contentLeft+contentWidth); - bottom = Math.min(bottom, contentTop+contentHeight); + right = Math.min(right, contentLeft + contentWidth); + bottom = Math.min(bottom, contentTop + contentHeight); top = Math.max(top, contentTop); mDataPoints.put(new RectF(left, top, right, bottom), value); @@ -254,16 +252,16 @@ public class BarGraphSeries extends BaseSeries if (mDrawValuesOnTop) { if (reverse) { top = bottom + mValuesOnTopSize + 4; - if (top > contentTop+contentHeight) top = contentTop + contentHeight; + if (top > contentTop + contentHeight) top = contentTop + contentHeight; } else { top -= 4; - if (top<=contentTop) top+=contentTop+4; + if (top <= contentTop) top += contentTop + 4; } mPaint.setColor(mValuesOnTopColor); canvas.drawText( graphView.getGridLabelRenderer().getLabelFormatter().formatLabel(value.getY(), false) - , (left+right)/2, top, mPaint); + , (left + right) / 2, top, mPaint); } i++; @@ -371,7 +369,7 @@ public class BarGraphSeries extends BaseSeries protected E findDataPoint(float x, float y) { for (Map.Entry entry : mDataPoints.entrySet()) { if (x >= entry.getKey().left && x <= entry.getKey().right - && y >= entry.getKey().top && y <= entry.getKey().bottom) { + && y >= entry.getKey().top && y <= entry.getKey().bottom) { return entry.getValue(); } } diff --git a/core/interfaces/build.gradle b/core/interfaces/build.gradle index 7cef0cbe09..08314b4acf 100644 --- a/core/interfaces/build.gradle +++ b/core/interfaces/build.gradle @@ -17,7 +17,7 @@ android { namespace 'app.aaps.core.interfaces' defaultConfig { - minSdkVersion 25 // for wear + minSdkVersion 26 // for wear } } diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/APSResult.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/APSResult.kt index b1dfe22efa..0c67078b5d 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/APSResult.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/APSResult.kt @@ -3,8 +3,8 @@ package app.aaps.core.interfaces.aps import android.text.Spanned import app.aaps.core.interfaces.constraints.Constraint import app.aaps.core.interfaces.iob.IobTotal +import app.aaps.database.entities.GlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import org.json.JSONObject interface APSResult { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/AutosensDataStore.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/AutosensDataStore.kt index a0ccff4d3c..ed1f99ec6f 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/AutosensDataStore.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/AutosensDataStore.kt @@ -4,7 +4,7 @@ import androidx.collection.LongSparseArray import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue interface AutosensDataStore { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/Loop.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/Loop.kt index 6778a6961a..cbefcdf09e 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/Loop.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/aps/Loop.kt @@ -3,7 +3,7 @@ package app.aaps.core.interfaces.aps import app.aaps.core.interfaces.constraints.Constraint import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.pump.PumpEnactResult -import info.nightscout.database.entities.OfflineEvent +import app.aaps.database.entities.OfflineEvent interface Loop { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/db/PersistenceLayer.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/db/PersistenceLayer.kt index f4bcefcf5d..d30acca2cf 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/db/PersistenceLayer.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/db/PersistenceLayer.kt @@ -1,14 +1,14 @@ package app.aaps.core.interfaces.db import app.aaps.core.interfaces.queue.Callback +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry import io.reactivex.rxjava3.core.Single interface PersistenceLayer { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/insulin/Insulin.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/insulin/Insulin.kt index 76ee69147d..2984c59ae9 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/insulin/Insulin.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/insulin/Insulin.kt @@ -2,8 +2,8 @@ package app.aaps.core.interfaces.insulin import app.aaps.core.interfaces.configuration.ConfigExportImport import app.aaps.core.interfaces.iob.Iob -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.embedments.InsulinConfiguration interface Insulin : ConfigExportImport { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/InMemoryGlucoseValue.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/InMemoryGlucoseValue.kt index 4b338ce2ec..d90f6d7c52 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/InMemoryGlucoseValue.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/InMemoryGlucoseValue.kt @@ -1,6 +1,6 @@ package app.aaps.core.interfaces.iob -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue /** * Simplified [GlucoseValue] for storing in memory and calculations diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/IobCobCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/IobCobCalculator.kt index bb61178b6f..8f8ac06943 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/IobCobCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/iob/IobCobCalculator.kt @@ -5,8 +5,8 @@ import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.AutosensResult import app.aaps.core.interfaces.aps.BasalData import app.aaps.core.interfaces.profile.Profile -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal import org.json.JSONArray interface IobCobCalculator { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/logging/UserEntryLogger.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/logging/UserEntryLogger.kt index 2288b084f7..1706f5a837 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/logging/UserEntryLogger.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/logging/UserEntryLogger.kt @@ -2,10 +2,10 @@ package app.aaps.core.interfaces.logging import app.aaps.core.interfaces.userEntry.UserEntryMapper import app.aaps.core.interfaces.userEntry.ValueWithUnitMapper -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit interface UserEntryLogger { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/nsclient/StoreDataForDb.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/nsclient/StoreDataForDb.kt index 062126d0a4..ec57d8811f 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/nsclient/StoreDataForDb.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/nsclient/StoreDataForDb.kt @@ -1,19 +1,19 @@ package app.aaps.core.interfaces.nsclient -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.transactions.TransactionGlucoseValue +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.transactions.TransactionGlucoseValue interface StoreDataForDb { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/ProfileFunction.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/ProfileFunction.kt index e3ecdf6c92..2adf634edc 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/ProfileFunction.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/ProfileFunction.kt @@ -1,7 +1,7 @@ package app.aaps.core.interfaces.profile import app.aaps.core.interfaces.db.GlucoseUnit -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch interface ProfileFunction { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/PureProfile.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/PureProfile.kt index fe1644aec1..adf0d2ff87 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/PureProfile.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/profile/PureProfile.kt @@ -1,8 +1,8 @@ package app.aaps.core.interfaces.profile import app.aaps.core.interfaces.db.GlucoseUnit -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock import org.json.JSONObject import java.util.TimeZone diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/DetailedBolusInfo.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/DetailedBolusInfo.kt index f786979a75..0b8cff5d01 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/DetailedBolusInfo.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/DetailedBolusInfo.kt @@ -2,11 +2,11 @@ package app.aaps.core.interfaces.pump import android.content.Context import app.aaps.core.interfaces.pump.defs.PumpType -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs class DetailedBolusInfo { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/PumpSync.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/PumpSync.kt index 92d5697e17..7125ae74ce 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/PumpSync.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/PumpSync.kt @@ -5,7 +5,7 @@ import app.aaps.core.interfaces.pump.defs.PumpType import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal import kotlin.math.max import kotlin.math.min import kotlin.math.roundToInt diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/WarnColors.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/WarnColors.kt index 847b32b94f..97f3754bc6 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/WarnColors.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/WarnColors.kt @@ -1,7 +1,7 @@ package app.aaps.core.interfaces.pump import android.widget.TextView -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent interface WarnColors { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/source/NSClientSource.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/source/NSClientSource.kt index 5c8a7d72ca..0aaba362e5 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/source/NSClientSource.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/source/NSClientSource.kt @@ -1,6 +1,6 @@ package app.aaps.core.interfaces.source -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue interface NSClientSource { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/stats/TddCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/stats/TddCalculator.kt index d8e2eee00f..9764972d26 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/stats/TddCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/stats/TddCalculator.kt @@ -3,7 +3,7 @@ package app.aaps.core.interfaces.stats import android.content.Context import android.util.LongSparseArray import android.widget.TableLayout -import info.nightscout.database.entities.TotalDailyDose +import app.aaps.database.entities.TotalDailyDose interface TddCalculator { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/sync/DataSyncSelector.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/sync/DataSyncSelector.kt index e1c01ea719..67928c4453 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/sync/DataSyncSelector.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/sync/DataSyncSelector.kt @@ -1,18 +1,18 @@ package app.aaps.core.interfaces.sync -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent import org.json.JSONObject interface DataSyncSelector { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryMapper.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryMapper.kt index b18851b7e4..08e3a3b536 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryMapper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryMapper.kt @@ -1,6 +1,6 @@ package app.aaps.core.interfaces.userEntry -import info.nightscout.database.entities.UserEntry +import app.aaps.database.entities.UserEntry class UserEntryMapper { enum class Action(val db: UserEntry.Action) { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryPresentationHelper.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryPresentationHelper.kt index 848e5c768f..20ba61ed17 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryPresentationHelper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/UserEntryPresentationHelper.kt @@ -3,11 +3,11 @@ package app.aaps.core.interfaces.userEntry import android.text.Spanned import androidx.annotation.ColorRes import androidx.annotation.DrawableRes -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.ColorGroup -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.ColorGroup +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit interface UserEntryPresentationHelper { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/ValueWithUnitMapper.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/ValueWithUnitMapper.kt index ae14dc6b3b..7fb7e2fb10 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/ValueWithUnitMapper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/userEntry/ValueWithUnitMapper.kt @@ -1,9 +1,9 @@ package app.aaps.core.interfaces.userEntry import app.aaps.core.interfaces.db.GlucoseUnit -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.ValueWithUnit sealed class ValueWithUnitMapper { //I use a sealed class because of StringResource that contains a listOf as second parameter diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/Translator.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/Translator.kt index d17fac6bcf..84c62e4f82 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/Translator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/Translator.kt @@ -1,10 +1,10 @@ package app.aaps.core.interfaces.utils -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit interface Translator { diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/TrendCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/TrendCalculator.kt index 9f6de95e3c..9e13b843f4 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/TrendCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/utils/TrendCalculator.kt @@ -2,7 +2,7 @@ package app.aaps.core.interfaces.utils import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue /** * Convert BG direction value to trend arrow or calculate it if not provided diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/BlockExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/BlockExtension.kt index a95b46672a..9e2dc858b6 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/BlockExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/BlockExtension.kt @@ -2,8 +2,8 @@ package app.aaps.core.main.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock import org.json.JSONArray import org.json.JSONObject diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/BolusExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/BolusExtension.kt index f7f776403c..49e013b473 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/BolusExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/BolusExtension.kt @@ -3,7 +3,7 @@ package app.aaps.core.main.extensions import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.iob.Iob import app.aaps.core.interfaces.plugin.ActivePlugin -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { if (!isValid || type == Bolus.Type.PRIMING) return Iob() diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/ExtendedBolusExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/ExtendedBolusExtension.kt index d0eac9d9af..f0b13064e4 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/ExtendedBolusExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/ExtendedBolusExtension.kt @@ -7,10 +7,10 @@ import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.end import kotlin.math.ceil import kotlin.math.max import kotlin.math.min @@ -41,7 +41,7 @@ fun ExtendedBolus.toTemporaryBasal(profile: Profile): TemporaryBasal = isAbsolute = true, isValid = isValid, interfaceIDs_backing = interfaceIDs_backing, - type = info.nightscout.database.entities.TemporaryBasal.Type.FAKE_EXTENDED + type = TemporaryBasal.Type.FAKE_EXTENDED ) fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insulin): IobTotal { @@ -61,7 +61,7 @@ fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insuli val tempBolusPart = Bolus( timestamp = calcDate, amount = tempBolusSize, - type = info.nightscout.database.entities.Bolus.Type.NORMAL + type = Bolus.Type.NORMAL ) val aIOB = insulinInterface.iobCalcForTreatment(tempBolusPart, time, dia) result.iob += aIOB.iobContrib @@ -110,7 +110,7 @@ fun ExtendedBolus.iobCalc( val tempBolusPart = Bolus( timestamp = calcDate, amount = tempBolusSize, - type = info.nightscout.database.entities.Bolus.Type.NORMAL + type = Bolus.Type.NORMAL ) val aIOB = insulinInterface.iobCalcForTreatment(tempBolusPart, time, dia) result.iob += aIOB.iobContrib diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/GlucoseValueExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/GlucoseValueExtension.kt index 5554cd7712..344b5d7e30 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/GlucoseValueExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/GlucoseValueExtension.kt @@ -1,11 +1,11 @@ package app.aaps.core.main.extensions -import app.aaps.core.main.R import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.GlucoseValue +import app.aaps.core.main.R +import app.aaps.database.entities.GlucoseValue import org.json.JSONObject fun GlucoseValue.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/ProfileSwitchExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/ProfileSwitchExtension.kt index a6062fb4b4..cd9f42ae8b 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/ProfileSwitchExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/ProfileSwitchExtension.kt @@ -8,7 +8,7 @@ import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch import org.json.JSONObject import java.util.TimeZone diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryBasalExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryBasalExtension.kt index 133338a977..d7186dcf3b 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryBasalExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryBasalExtension.kt @@ -7,9 +7,9 @@ import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.end import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryTargetExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryTargetExtension.kt index 445ee79914..fcd07cc695 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryTargetExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TemporaryTargetExtension.kt @@ -5,7 +5,7 @@ import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DecimalFormatter -import info.nightscout.database.entities.TemporaryTarget +import app.aaps.database.entities.TemporaryTarget import java.util.concurrent.TimeUnit fun TemporaryTarget.lowValueToUnitsToString(units: GlucoseUnit, decimalFormatter: DecimalFormatter): String = diff --git a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TherapyEventExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TherapyEventExtension.kt index 00e5ba2f5b..57cac9a62c 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/extensions/TherapyEventExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/extensions/TherapyEventExtension.kt @@ -2,7 +2,7 @@ package app.aaps.core.main.extensions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent fun TherapyEvent.isOlderThan(hours: Double, dateUtil: DateUtil): Boolean { return getHoursFromStart(dateUtil) > hours diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/ActivityGraph.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/ActivityGraph.kt index 17ed06a997..fa47800249 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/ActivityGraph.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/ActivityGraph.kt @@ -5,10 +5,10 @@ import android.graphics.Color import android.util.AttributeSet import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.utils.T +import app.aaps.database.entities.Bolus import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.database.entities.Bolus import kotlin.math.floor class ActivityGraph : GraphView { diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/OverviewData.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/OverviewData.kt index 902051fb7e..4e521d0b38 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/OverviewData.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/OverviewData.kt @@ -4,23 +4,23 @@ import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorInt import androidx.annotation.DrawableRes -import app.aaps.core.main.graph.data.DataPointWithLabelInterface -import app.aaps.core.main.graph.data.DeviationDataPoint -import app.aaps.core.main.graph.data.FixedLineGraphSeries -import app.aaps.core.main.graph.data.PointsWithLabelGraphSeries -import app.aaps.core.main.graph.data.Scale -import app.aaps.core.main.graph.data.ScaledDataPoint import app.aaps.core.interfaces.aps.AutosensData import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.CobInfo import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.iob.IobCobCalculator import app.aaps.core.interfaces.iob.IobTotal +import app.aaps.core.main.graph.data.DataPointWithLabelInterface +import app.aaps.core.main.graph.data.DeviationDataPoint +import app.aaps.core.main.graph.data.FixedLineGraphSeries +import app.aaps.core.main.graph.data.PointsWithLabelGraphSeries +import app.aaps.core.main.graph.data.Scale +import app.aaps.core.main.graph.data.ScaledDataPoint +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TemporaryTarget import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TemporaryTarget interface OverviewData { diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/BolusDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/BolusDataPoint.kt index 50f7dd9879..092d811cf4 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/BolusDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/BolusDataPoint.kt @@ -6,7 +6,7 @@ import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.profile.DefaultValueHelper import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DecimalFormatter -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus class BolusDataPoint( val data: Bolus, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/CarbsDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/CarbsDataPoint.kt index 46ec4e974c..409480777b 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/CarbsDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/CarbsDataPoint.kt @@ -2,9 +2,9 @@ package app.aaps.core.main.graph.data import android.content.Context import android.graphics.Paint -import app.aaps.core.main.R import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.database.entities.Carbs +import app.aaps.core.main.R +import app.aaps.database.entities.Carbs class CarbsDataPoint( val data: Carbs, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/EffectiveProfileSwitchDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/EffectiveProfileSwitchDataPoint.kt index 12f895ab9d..1246004459 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/EffectiveProfileSwitchDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/EffectiveProfileSwitchDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import android.graphics.Paint import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch class EffectiveProfileSwitchDataPoint( val data: EffectiveProfileSwitch, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/ExtendedBolusDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/ExtendedBolusDataPoint.kt index 4c3deb3ff7..421e30ad51 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/ExtendedBolusDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/ExtendedBolusDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import android.graphics.Paint import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DecimalFormatter -import info.nightscout.database.entities.ExtendedBolus +import app.aaps.database.entities.ExtendedBolus class ExtendedBolusDataPoint( val data: ExtendedBolus, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/GlucoseValueDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/GlucoseValueDataPoint.kt index 51c7491636..1fbf20336a 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/GlucoseValueDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/GlucoseValueDataPoint.kt @@ -6,7 +6,7 @@ import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue class GlucoseValueDataPoint( val data: GlucoseValue, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/HeartRateDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/HeartRateDataPoint.kt index eec9f7a434..dca2f6a3d7 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/HeartRateDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/HeartRateDataPoint.kt @@ -3,7 +3,7 @@ package app.aaps.core.main.graph.data import android.content.Context import android.graphics.Paint import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.database.entities.HeartRate +import app.aaps.database.entities.HeartRate class HeartRateDataPoint( private val data: HeartRate, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/TherapyEventDataPoint.kt b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/TherapyEventDataPoint.kt index 1a62323e1e..7a0e6015b2 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/graph/data/TherapyEventDataPoint.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/graph/data/TherapyEventDataPoint.kt @@ -6,7 +6,7 @@ import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.Translator -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class TherapyEventDataPoint( val data: TherapyEvent, diff --git a/core/main/src/main/kotlin/app/aaps/core/main/profile/ProfileSealed.kt b/core/main/src/main/kotlin/app/aaps/core/main/profile/ProfileSealed.kt index a23e66893b..577d5b4071 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/profile/ProfileSealed.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/profile/ProfileSealed.kt @@ -20,12 +20,12 @@ import app.aaps.core.main.extensions.shiftBlock import app.aaps.core.main.extensions.shiftTargetBlock import app.aaps.core.main.extensions.targetBlockValueBySeconds import app.aaps.core.utils.MidnightUtils -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONArray import org.json.JSONObject import java.text.DecimalFormat diff --git a/core/main/src/main/kotlin/app/aaps/core/main/pump/PumpTypeExtension.kt b/core/main/src/main/kotlin/app/aaps/core/main/pump/PumpTypeExtension.kt index 5a793e157e..17676bbfcc 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/pump/PumpTypeExtension.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/pump/PumpTypeExtension.kt @@ -1,8 +1,8 @@ package app.aaps.core.main.pump import app.aaps.core.interfaces.pump.defs.PumpType -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.embedments.InterfaceIDs fun PumpType.Companion.fromDbSource(s: UserEntry.Sources): PumpType.Source = when (s) { diff --git a/core/main/src/main/kotlin/app/aaps/core/main/wizard/BolusWizard.kt b/core/main/src/main/kotlin/app/aaps/core/main/wizard/BolusWizard.kt index 8590bf11bb..13e13463e3 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/wizard/BolusWizard.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/wizard/BolusWizard.kt @@ -38,14 +38,14 @@ import app.aaps.core.main.iob.round import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import java.util.LinkedList import javax.inject.Inject import kotlin.math.abs diff --git a/core/main/src/main/kotlin/app/aaps/core/main/wizard/QuickWizardEntry.kt b/core/main/src/main/kotlin/app/aaps/core/main/wizard/QuickWizardEntry.kt index 478d23208f..f60ef5cd89 100644 --- a/core/main/src/main/kotlin/app/aaps/core/main/wizard/QuickWizardEntry.kt +++ b/core/main/src/main/kotlin/app/aaps/core/main/wizard/QuickWizardEntry.kt @@ -16,8 +16,8 @@ import app.aaps.core.main.iob.round import app.aaps.core.utils.JsonHelper.safeGetInt import app.aaps.core.utils.JsonHelper.safeGetString import app.aaps.core.utils.MidnightUtils +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import org.json.JSONException import org.json.JSONObject import java.util.UUID diff --git a/core/main/src/test/kotlin/app/aaps/core/main/extensions/BlockExtensionKtTest.kt b/core/main/src/test/kotlin/app/aaps/core/main/extensions/BlockExtensionKtTest.kt index f98a23abdf..78bedcb913 100644 --- a/core/main/src/test/kotlin/app/aaps/core/main/extensions/BlockExtensionKtTest.kt +++ b/core/main/src/test/kotlin/app/aaps/core/main/extensions/BlockExtensionKtTest.kt @@ -1,10 +1,10 @@ package app.aaps.core.main.extensions import app.aaps.core.interfaces.utils.T +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock +import app.aaps.database.entities.data.checkSanity import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.database.entities.data.checkSanity import org.junit.jupiter.api.Test class BlockExtensionKtTest { diff --git a/core/main/src/test/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValueDataPointTest.kt b/core/main/src/test/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValueDataPointTest.kt index a91ed9073c..e9dc0ac5ba 100644 --- a/core/main/src/test/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValueDataPointTest.kt +++ b/core/main/src/test/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValueDataPointTest.kt @@ -2,13 +2,13 @@ package app.aaps.core.interfaces.iob import android.content.Context import android.graphics.Color -import app.aaps.core.main.graph.data.InMemoryGlucoseValueDataPoint import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.profile.DefaultValueHelper import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.core.main.graph.data.InMemoryGlucoseValueDataPoint +import app.aaps.database.entities.GlucoseValue import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.GlucoseValue import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/core/main/src/test/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoTest.kt b/core/main/src/test/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoTest.kt index d96083969b..46bd4b1c67 100644 --- a/core/main/src/test/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoTest.kt +++ b/core/main/src/test/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoTest.kt @@ -1,12 +1,11 @@ package app.aaps.core.interfaces.pump import android.content.Context +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.TherapyEvent import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import com.google.gson.Gson -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.TherapyEvent import org.apache.commons.lang3.builder.EqualsBuilder import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/core/utils/src/main/kotlin/app/aaps/core/utils/DateTimeUtil.kt b/core/utils/src/main/kotlin/app/aaps/core/utils/DateTimeUtil.kt index 101d7c9d5f..c9a5102216 100644 --- a/core/utils/src/main/kotlin/app/aaps/core/utils/DateTimeUtil.kt +++ b/core/utils/src/main/kotlin/app/aaps/core/utils/DateTimeUtil.kt @@ -82,7 +82,7 @@ object DateTimeUtil { @JvmStatic fun toATechDate(timeInMillis: Long): Long { val gc = GregorianCalendar() - gc.setTimeInMillis(timeInMillis) + gc.timeInMillis = timeInMillis return toATechDate(gc) } @@ -139,7 +139,7 @@ object DateTimeUtil { @JvmStatic fun toStringFromTimeInMillis(timeInMillis: Long): String { val gc = GregorianCalendar() - gc.setTimeInMillis(timeInMillis) + gc.timeInMillis = timeInMillis return toString(gc) } @@ -155,7 +155,7 @@ object DateTimeUtil { fun toMillisFromATD(aTechDateTime: Long): Long { val gc = toGregorianCalendar(aTechDateTime) - return gc.getTimeInMillis() + return gc.timeInMillis } fun getATechDateDifferenceAsMinutes(date1: Long, date2: Long): Int { @@ -171,13 +171,13 @@ object DateTimeUtil { fun getMillisFromATDWithAddedMinutes(atd: Long, minutesDiff: Int): Long { val oldestEntryTime = toGregorianCalendar(atd) oldestEntryTime.add(Calendar.MINUTE, minutesDiff) - return oldestEntryTime.getTimeInMillis() + return oldestEntryTime.timeInMillis } fun getATDWithAddedSeconds(atd: Long, addedSeconds: Int): Long { val oldestEntryTime = toGregorianCalendar(atd) oldestEntryTime.add(Calendar.SECOND, addedSeconds) - return toATechDate(oldestEntryTime.getTimeInMillis()) + return toATechDate(oldestEntryTime.timeInMillis) } /* diff --git a/database/entities/build.gradle b/database/entities/build.gradle index e951e0cbdd..b6e714c355 100644 --- a/database/entities/build.gradle +++ b/database/entities/build.gradle @@ -11,9 +11,9 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle" android { - namespace 'info.nightscout.database.entities' + namespace 'app.aaps.database.entities' defaultConfig { - minSdkVersion 25 // for wear + minSdkVersion 26 // for wear } buildFeatures { diff --git a/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt b/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt deleted file mode 100644 index 7c50fa5057..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt +++ /dev/null @@ -1,45 +0,0 @@ -package info.nightscout.database.entities - -import androidx.room.Embedded -import androidx.room.Entity -import androidx.room.ForeignKey -import androidx.room.Index -import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.TraceableDBEntry - -@Entity(tableName = TABLE_APS_RESULT_LINKS, - foreignKeys = [ForeignKey( - entity = APSResult::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("apsResultId")), ForeignKey( - - entity = Bolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("smbId")), ForeignKey( - - entity = TemporaryBasal::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("tbrId")), ForeignKey( - - entity = APSResultLink::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("referenceId"))], - indices = [Index("referenceId"), Index("apsResultId"), - Index("smbId"), Index("tbrId")]) -data class APSResultLink( - @PrimaryKey(autoGenerate = true) - override var id: Long = 0, - override var version: Int = 0, - override var dateCreated: Long = -1, - override var isValid: Boolean = true, - override var referenceId: Long? = null, - @Embedded - override var interfaceIDs_backing: InterfaceIDs? = null, - var apsResultId: Long, - var smbId: Long? = null, - var tbrId: Long? = null -) : TraceableDBEntry { - override val foreignKeysValid: Boolean - get() = super.foreignKeysValid && apsResultId != 0L && smbId != 0L && tbrId != 0L -} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt b/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt deleted file mode 100644 index b15e90753f..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt +++ /dev/null @@ -1,40 +0,0 @@ -package info.nightscout.database.entities - -import androidx.room.Embedded -import androidx.room.Entity -import androidx.room.ForeignKey -import androidx.room.Index -import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.TraceableDBEntry - -@Entity(tableName = TABLE_MULTIWAVE_BOLUS_LINKS, - foreignKeys = [ForeignKey( - entity = Bolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("bolusId")), ForeignKey( - - entity = ExtendedBolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("extendedBolusId")), ForeignKey( - - entity = MultiwaveBolusLink::class, - parentColumns = ["id"], - childColumns = ["referenceId"])], - indices = [Index("referenceId"), Index("bolusId"), - Index("extendedBolusId")]) -data class MultiwaveBolusLink( - @PrimaryKey(autoGenerate = true) - override var id: Long = 0, - override var version: Int = 0, - override var dateCreated: Long = -1, - override var isValid: Boolean = true, - override var referenceId: Long? = null, - @Embedded - override var interfaceIDs_backing: InterfaceIDs? = null, - var bolusId: Long, - var extendedBolusId: Long -) : TraceableDBEntry { - override val foreignKeysValid: Boolean - get() = super.foreignKeysValid && bolusId != 0L && bolusId != 0L && extendedBolusId != 0L -} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt b/database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt deleted file mode 100644 index a39ea837b6..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt +++ /dev/null @@ -1,205 +0,0 @@ -package info.nightscout.database.entities - -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey -import info.nightscout.database.entities.interfaces.DBEntry -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import java.util.TimeZone - -@Entity(tableName = TABLE_USER_ENTRY, - indices = [ - Index("source"), - Index("timestamp") - ]) -data class UserEntry( - @PrimaryKey(autoGenerate = true) - override var id: Long = 0L, - override var timestamp: Long, - override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(), - var action: Action, - var source: Sources, - var note: String, - var values: List<@JvmSuppressWildcards ValueWithUnit?> -) : DBEntry, DBEntryWithTime { - enum class Action (val colorGroup: ColorGroup) { - BOLUS (ColorGroup.InsulinTreatment), - BOLUS_CALCULATOR_RESULT (ColorGroup.InsulinTreatment), - BOLUS_CALCULATOR_RESULT_REMOVED (ColorGroup.Aaps), - SMB (ColorGroup.InsulinTreatment), - BOLUS_ADVISOR (ColorGroup.InsulinTreatment), - EXTENDED_BOLUS (ColorGroup.InsulinTreatment), - SUPERBOLUS_TBR (ColorGroup.InsulinTreatment), - CARBS (ColorGroup.CarbTreatment), - EXTENDED_CARBS (ColorGroup.CarbTreatment), - TEMP_BASAL (ColorGroup.BasalTreatment), - TT (ColorGroup.TT), - NEW_PROFILE (ColorGroup.Profile), - CLONE_PROFILE (ColorGroup.Profile), - STORE_PROFILE (ColorGroup.Profile), - PROFILE_SWITCH (ColorGroup.Profile), - PROFILE_SWITCH_CLONED (ColorGroup.Profile), - CLOSED_LOOP_MODE (ColorGroup.Loop), - LGS_LOOP_MODE (ColorGroup.Loop), - OPEN_LOOP_MODE (ColorGroup.Loop), - LOOP_DISABLED (ColorGroup.Loop), - LOOP_ENABLED (ColorGroup.Loop), - LOOP_CHANGE (ColorGroup.Loop), - LOOP_REMOVED (ColorGroup.Loop), - RECONNECT (ColorGroup.Pump), - DISCONNECT (ColorGroup.Pump), - RESUME (ColorGroup.Loop), - SUSPEND (ColorGroup.Loop), - HW_PUMP_ALLOWED (ColorGroup.Pump), - CLEAR_PAIRING_KEYS (ColorGroup.Pump), - ACCEPTS_TEMP_BASAL (ColorGroup.BasalTreatment), - CANCEL_TEMP_BASAL (ColorGroup.BasalTreatment), - CANCEL_BOLUS (ColorGroup.InsulinTreatment), - CANCEL_EXTENDED_BOLUS (ColorGroup.InsulinTreatment), - CANCEL_TT (ColorGroup.TT), - CAREPORTAL (ColorGroup.Careportal), - SITE_CHANGE (ColorGroup.Pump), - RESERVOIR_CHANGE (ColorGroup.Pump), - CALIBRATION (ColorGroup.Careportal), - PRIME_BOLUS (ColorGroup.Pump), - TREATMENT (ColorGroup.InsulinTreatment), - CAREPORTAL_NS_REFRESH (ColorGroup.Careportal), - PROFILE_SWITCH_NS_REFRESH (ColorGroup.Profile), - TREATMENTS_NS_REFRESH (ColorGroup.InsulinTreatment), - TT_NS_REFRESH (ColorGroup.TT), - AUTOMATION_REMOVED (ColorGroup.Aaps), - BG_REMOVED (ColorGroup.Aaps), - CAREPORTAL_REMOVED (ColorGroup.Careportal), - EXTENDED_BOLUS_REMOVED (ColorGroup.InsulinTreatment), - FOOD_REMOVED (ColorGroup.CarbTreatment), - PROFILE_REMOVED (ColorGroup.Profile), - PROFILE_SWITCH_REMOVED (ColorGroup.Profile), - RESTART_EVENTS_REMOVED (ColorGroup.Aaps), - TREATMENT_REMOVED (ColorGroup.InsulinTreatment), - BOLUS_REMOVED (ColorGroup.InsulinTreatment), - CARBS_REMOVED (ColorGroup.CarbTreatment), - TEMP_BASAL_REMOVED (ColorGroup.BasalTreatment), - TT_REMOVED (ColorGroup.TT), - NS_PAUSED (ColorGroup.Aaps), - NS_RESUME (ColorGroup.Aaps), - NS_QUEUE_CLEARED (ColorGroup.Aaps), - NS_SETTINGS_COPIED (ColorGroup.Aaps), - ERROR_DIALOG_OK (ColorGroup.Aaps), - ERROR_DIALOG_MUTE (ColorGroup.Aaps), - ERROR_DIALOG_MUTE_5MIN (ColorGroup.Aaps), - OBJECTIVE_STARTED (ColorGroup.Aaps), - OBJECTIVE_UNSTARTED (ColorGroup.Aaps), - OBJECTIVES_SKIPPED (ColorGroup.Aaps), - STAT_RESET (ColorGroup.Aaps), - DELETE_LOGS (ColorGroup.Aaps), - DELETE_FUTURE_TREATMENTS (ColorGroup.Aaps), - EXPORT_SETTINGS (ColorGroup.Aaps), - IMPORT_SETTINGS (ColorGroup.Aaps), - RESET_DATABASES (ColorGroup.Aaps), - CLEANUP_DATABASES (ColorGroup.Aaps), - EXPORT_DATABASES (ColorGroup.Aaps), - IMPORT_DATABASES (ColorGroup.Aaps), - OTP_EXPORT (ColorGroup.Aaps), - OTP_RESET (ColorGroup.Aaps), - STOP_SMS (ColorGroup.Aaps), - FOOD (ColorGroup.CarbTreatment), - EXPORT_CSV (ColorGroup.Aaps), - START_AAPS (ColorGroup.Aaps), - EXIT_AAPS (ColorGroup.Aaps), - PLUGIN_ENABLED (ColorGroup.Aaps), - PLUGIN_DISABLED (ColorGroup.Aaps), - UNKNOWN (ColorGroup.Aaps) - ; - - companion object { - fun fromString(source: String?) = values().firstOrNull { it.name == source } ?: UNKNOWN - } - } - - enum class Sources { - TreatmentDialog, - InsulinDialog, - CarbDialog, - WizardDialog, - QuickWizard, - ExtendedBolusDialog, - TTDialog, - ProfileSwitchDialog, - LoopDialog, - TempBasalDialog, - CalibrationDialog, - FillDialog, - BgCheck, - SensorInsert, - BatteryChange, - Note, - Exercise, - Question, - Announcement, - Actions, //From Actions plugin - Automation, //From Automation plugin - Autotune, //From Autotune plugin - BG, //From BG plugin => Add One Source per BG Source for Calibration or Sensor Change - Aidex, - Dexcom, - Eversense, - Glimp, - MM640g, - NSClientSource, - PocTech, - Tomato, - Glunovo, - Intelligo, - Xdrip, - LocalProfile, //From LocalProfile plugin - Loop, //From Loop plugin - Maintenance, //From Maintenance plugin - NSClient, //From NSClient plugin - NSProfile, //From NSProfile plugin - Objectives, //From Objectives plugin - Pump, //To update with one Source per pump - Dana, //Only one UserEntry in Common module Dana - DanaR, - DanaRC, - DanaRv2, - DanaRS, - DanaI, - DiaconnG8, - Insight, - Combo, - Medtronic, - Omnipod, //No entry currently - OmnipodEros, - OmnipodDash, //No entry currently - EOPatch2, - Medtrum, - MDI, - VirtualPump, - SMS, //From SMS plugin - Treatments, //From Treatments plugin - Wear, //From Wear plugin - Food, //From Food plugin - ConfigBuilder, //From ConfigBuilder Plugin - Overview, //From OverViewPlugin - Stats, //From Stat Activity - Aaps, // MainApp - Unknown //if necessary - ; - - companion object { - fun fromString(source: String?) = values().firstOrNull { it.name == source } ?: Unknown - } - } - - enum class ColorGroup { - InsulinTreatment, - BasalTreatment, - CarbTreatment, - TT, - Profile, - Loop, - Careportal, - Pump, - Aaps - } -} diff --git a/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt b/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt deleted file mode 100644 index fc70f12a17..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt +++ /dev/null @@ -1,41 +0,0 @@ -package info.nightscout.database.entities.data - -import info.nightscout.database.entities.APSResult -import info.nightscout.database.entities.APSResultLink -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.MultiwaveBolusLink -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.PreferenceChange -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.VersionChange - -data class NewEntries( - val apsResults: List, - val apsResultLinks: List, - val bolusCalculatorResults: List, - val boluses: List, - val carbs: List, - val effectiveProfileSwitches: List, - val extendedBoluses: List, - val glucoseValues: List, - val multiwaveBolusLinks: List, - val offlineEvents: List, - val preferencesChanges: List, - val profileSwitches: List, - val temporaryBasals: List, - val temporaryTarget: List, - val therapyEvents: List, - val totalDailyDoses: List, - val versionChanges: List, - val heartRates: List, -) diff --git a/database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt b/database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt deleted file mode 100644 index 98d74cc10e..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt +++ /dev/null @@ -1,7 +0,0 @@ -package info.nightscout.database.entities.embedments - -data class InsulinConfiguration( - var insulinLabel: String, - var insulinEndTime: Long, // DIA before [milliseconds] - var peak: Long // [milliseconds] -) \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt deleted file mode 100644 index ac327c6b40..0000000000 --- a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.database.entities.interfaces - -interface DBEntry { - var id: Long -} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/ValueWrapper.kt b/database/entities/src/main/kotlin/app/aaps/database/ValueWrapper.kt similarity index 80% rename from database/entities/src/main/java/info/nightscout/database/ValueWrapper.kt rename to database/entities/src/main/kotlin/app/aaps/database/ValueWrapper.kt index 3807d6cf2c..bb6304184f 100644 --- a/database/entities/src/main/java/info/nightscout/database/ValueWrapper.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/ValueWrapper.kt @@ -1,4 +1,4 @@ -package info.nightscout.database +package app.aaps.database sealed class ValueWrapper { data class Existing(val value: T) : ValueWrapper() diff --git a/database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/APSResult.kt similarity index 65% rename from database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/APSResult.kt index 817651ff25..a1757ac7ba 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/APSResult.kt @@ -1,24 +1,27 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone -@Entity(tableName = TABLE_APS_RESULTS, - foreignKeys = [ForeignKey( - entity = APSResult::class, - parentColumns = ["id"], - childColumns = ["referenceId"])], - indices = [Index("referenceId"), Index("timestamp")]) +@Entity( + tableName = TABLE_APS_RESULTS, + foreignKeys = [ForeignKey( + entity = APSResult::class, + parentColumns = ["id"], + childColumns = ["referenceId"] + )], + indices = [Index("referenceId"), Index("timestamp")] +) data class APSResult( @PrimaryKey(autoGenerate = true) - override var id: Long = 0, + override var id: Long = 0, override var version: Int = 0, override var dateCreated: Long = -1, override var isValid: Boolean = true, @@ -37,6 +40,7 @@ data class APSResult( var isMicroBolusAllowed: Boolean?, var resultJson: String ) : TraceableDBEntry, DBEntryWithTime { + enum class Algorithm { MA, AMA, diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/APSResultLink.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/APSResultLink.kt new file mode 100644 index 0000000000..a6f2dcbf40 --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/APSResultLink.kt @@ -0,0 +1,52 @@ +package app.aaps.database.entities + +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.TraceableDBEntry + +@Entity( + tableName = TABLE_APS_RESULT_LINKS, + foreignKeys = [ForeignKey( + entity = APSResult::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("apsResultId") + ), ForeignKey( + + entity = Bolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("smbId") + ), ForeignKey( + + entity = TemporaryBasal::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("tbrId") + ), ForeignKey( + + entity = APSResultLink::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("referenceId") + )], + indices = [Index("referenceId"), Index("apsResultId"), + Index("smbId"), Index("tbrId")] +) +data class APSResultLink( + @PrimaryKey(autoGenerate = true) + override var id: Long = 0, + override var version: Int = 0, + override var dateCreated: Long = -1, + override var isValid: Boolean = true, + override var referenceId: Long? = null, + @Embedded + override var interfaceIDs_backing: InterfaceIDs? = null, + var apsResultId: Long, + var smbId: Long? = null, + var tbrId: Long? = null +) : TraceableDBEntry { + + override val foreignKeysValid: Boolean + get() = super.foreignKeysValid && apsResultId != 0L && smbId != 0L && tbrId != 0L +} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/Bolus.kt similarity index 86% rename from database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/Bolus.kt index e1eda21ff7..371e670dc1 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/Bolus.kt @@ -1,14 +1,14 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/BolusCalculatorResult.kt similarity index 93% rename from database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/BolusCalculatorResult.kt index 5a75d3d2f6..e8bcb8c867 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/BolusCalculatorResult.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/Carbs.kt similarity index 86% rename from database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/Carbs.kt index b5329dcca4..abf0fe7a9d 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/Carbs.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/DeviceStatus.kt similarity index 77% rename from database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/DeviceStatus.kt index e48dbf322b..dcdb6802c6 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/DeviceStatus.kt @@ -1,21 +1,23 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntry -import info.nightscout.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntryWithTime import java.util.TimeZone -@Entity(tableName = TABLE_DEVICE_STATUS, - foreignKeys = [], - indices = [ +@Entity( + tableName = TABLE_DEVICE_STATUS, + foreignKeys = [], + indices = [ Index("id"), Index("nightscoutId"), Index("timestamp") - ]) + ] +) data class DeviceStatus( @PrimaryKey(autoGenerate = true) override var id: Long = 0, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/EffectiveProfileSwitch.kt similarity index 86% rename from database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/EffectiveProfileSwitch.kt index 0d69afd1f4..1069a2a765 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/EffectiveProfileSwitch.kt @@ -1,16 +1,16 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/ExtendedBolus.kt similarity index 88% rename from database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/ExtendedBolus.kt index a110c374c0..757ea90f7a 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/ExtendedBolus.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/Food.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/Food.kt similarity index 93% rename from database/entities/src/main/java/info/nightscout/database/entities/Food.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/Food.kt index 790023e0cd..869f7d5367 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/Food.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/Food.kt @@ -1,12 +1,12 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.TraceableDBEntry @Entity( tableName = TABLE_FOODS, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/GlucoseValue.kt similarity index 92% rename from database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/GlucoseValue.kt index 6172dc0b38..f4fd32bacb 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/GlucoseValue.kt @@ -1,10 +1,14 @@ -package info.nightscout.database.entities +package app.aaps.database.entities -import androidx.room.* -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry -import java.util.* +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_GLUCOSE_VALUES, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/HeartRate.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/HeartRate.kt similarity index 83% rename from database/entities/src/main/java/info/nightscout/database/entities/HeartRate.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/HeartRate.kt index edfcb556dc..9eaf81aac0 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/HeartRate.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/HeartRate.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry -import java.util.* +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone /** Heart rate values measured by a user smart watch or the like. */ @Entity( diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/MultiwaveBolusLink.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/MultiwaveBolusLink.kt new file mode 100644 index 0000000000..ed916a705a --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/MultiwaveBolusLink.kt @@ -0,0 +1,46 @@ +package app.aaps.database.entities + +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.TraceableDBEntry + +@Entity( + tableName = TABLE_MULTIWAVE_BOLUS_LINKS, + foreignKeys = [ForeignKey( + entity = Bolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("bolusId") + ), ForeignKey( + + entity = ExtendedBolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("extendedBolusId") + ), ForeignKey( + + entity = MultiwaveBolusLink::class, + parentColumns = ["id"], + childColumns = ["referenceId"] + )], + indices = [Index("referenceId"), Index("bolusId"), + Index("extendedBolusId")] +) +data class MultiwaveBolusLink( + @PrimaryKey(autoGenerate = true) + override var id: Long = 0, + override var version: Int = 0, + override var dateCreated: Long = -1, + override var isValid: Boolean = true, + override var referenceId: Long? = null, + @Embedded + override var interfaceIDs_backing: InterfaceIDs? = null, + var bolusId: Long, + var extendedBolusId: Long +) : TraceableDBEntry { + + override val foreignKeysValid: Boolean + get() = super.foreignKeysValid && bolusId != 0L && bolusId != 0L && extendedBolusId != 0L +} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/OfflineEvent.kt similarity index 88% rename from database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/OfflineEvent.kt index 2c2892fdda..d557a2ad07 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/OfflineEvent.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/PreferenceChange.kt similarity index 65% rename from database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/PreferenceChange.kt index e4d56964c6..e37d700f1b 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/PreferenceChange.kt @@ -1,15 +1,15 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Entity import androidx.room.PrimaryKey -import info.nightscout.database.entities.interfaces.DBEntry -import info.nightscout.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntryWithTime import java.util.TimeZone @Entity(tableName = TABLE_PREFERENCE_CHANGES) data class PreferenceChange( @PrimaryKey(autoGenerate = true) - override var id: Long = 0L, + override var id: Long = 0L, override var timestamp: Long, override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(), var key: String, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/ProfileSwitch.kt similarity index 87% rename from database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/ProfileSwitch.kt index 3195e09270..133dd51e5d 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/ProfileSwitch.kt @@ -1,16 +1,16 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/TableNames.kt similarity index 96% rename from database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/TableNames.kt index 82635f3b47..91c6f28b3e 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/TableNames.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities +package app.aaps.database.entities const val TABLE_APS_RESULTS = "apsResults" const val TABLE_APS_RESULT_LINKS = "apsResultLinks" diff --git a/database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryBasal.kt similarity index 90% rename from database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryBasal.kt index 5aa5b9d9dd..be7a2e9c1e 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryBasal.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryTarget.kt similarity index 89% rename from database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryTarget.kt index 25f2bbe7c2..2a24aa5d85 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/TemporaryTarget.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/TherapyEvent.kt similarity index 95% rename from database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/TherapyEvent.kt index 188980ef85..ac9aec0d3e 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/TherapyEvent.kt @@ -1,13 +1,13 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTimeAndDuration +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/TotalDailyDose.kt similarity index 74% rename from database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/TotalDailyDose.kt index dda1a5b8a5..259bf10aa2 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/TotalDailyDose.kt @@ -1,21 +1,23 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntryWithTime -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone -@Entity(tableName = TABLE_TOTAL_DAILY_DOSES, - foreignKeys = [ForeignKey( +@Entity( + tableName = TABLE_TOTAL_DAILY_DOSES, + foreignKeys = [ForeignKey( entity = TotalDailyDose::class, parentColumns = ["id"], - childColumns = ["referenceId"])], - indices = [ + childColumns = ["referenceId"] + )], + indices = [ Index("id"), Index("pumpId"), Index("pumpType"), @@ -23,7 +25,8 @@ import java.util.TimeZone Index("isValid"), Index("referenceId"), Index("timestamp") - ]) + ] +) data class TotalDailyDose( @PrimaryKey(autoGenerate = true) override var id: Long = 0, @@ -40,5 +43,6 @@ data class TotalDailyDose( var totalAmount: Double = 0.0, // if zero it's calculated as basalAmount + bolusAmount var carbs: Double = 0.0 ) : TraceableDBEntry, DBEntryWithTime { + companion object } \ No newline at end of file diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/UserEntry.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/UserEntry.kt new file mode 100644 index 0000000000..98b04d65ac --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/UserEntry.kt @@ -0,0 +1,210 @@ +package app.aaps.database.entities + +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey +import app.aaps.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntryWithTime +import java.util.TimeZone + +@Entity( + tableName = TABLE_USER_ENTRY, + indices = [ + Index("source"), + Index("timestamp") + ] +) +data class UserEntry( + @PrimaryKey(autoGenerate = true) + override var id: Long = 0L, + override var timestamp: Long, + override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(), + var action: Action, + var source: Sources, + var note: String, + var values: List<@JvmSuppressWildcards ValueWithUnit?> +) : DBEntry, DBEntryWithTime { + + enum class Action(val colorGroup: ColorGroup) { + BOLUS(ColorGroup.InsulinTreatment), + BOLUS_CALCULATOR_RESULT(ColorGroup.InsulinTreatment), + BOLUS_CALCULATOR_RESULT_REMOVED(ColorGroup.Aaps), + SMB(ColorGroup.InsulinTreatment), + BOLUS_ADVISOR(ColorGroup.InsulinTreatment), + EXTENDED_BOLUS(ColorGroup.InsulinTreatment), + SUPERBOLUS_TBR(ColorGroup.InsulinTreatment), + CARBS(ColorGroup.CarbTreatment), + EXTENDED_CARBS(ColorGroup.CarbTreatment), + TEMP_BASAL(ColorGroup.BasalTreatment), + TT(ColorGroup.TT), + NEW_PROFILE(ColorGroup.Profile), + CLONE_PROFILE(ColorGroup.Profile), + STORE_PROFILE(ColorGroup.Profile), + PROFILE_SWITCH(ColorGroup.Profile), + PROFILE_SWITCH_CLONED(ColorGroup.Profile), + CLOSED_LOOP_MODE(ColorGroup.Loop), + LGS_LOOP_MODE(ColorGroup.Loop), + OPEN_LOOP_MODE(ColorGroup.Loop), + LOOP_DISABLED(ColorGroup.Loop), + LOOP_ENABLED(ColorGroup.Loop), + LOOP_CHANGE(ColorGroup.Loop), + LOOP_REMOVED(ColorGroup.Loop), + RECONNECT(ColorGroup.Pump), + DISCONNECT(ColorGroup.Pump), + RESUME(ColorGroup.Loop), + SUSPEND(ColorGroup.Loop), + HW_PUMP_ALLOWED(ColorGroup.Pump), + CLEAR_PAIRING_KEYS(ColorGroup.Pump), + ACCEPTS_TEMP_BASAL(ColorGroup.BasalTreatment), + CANCEL_TEMP_BASAL(ColorGroup.BasalTreatment), + CANCEL_BOLUS(ColorGroup.InsulinTreatment), + CANCEL_EXTENDED_BOLUS(ColorGroup.InsulinTreatment), + CANCEL_TT(ColorGroup.TT), + CAREPORTAL(ColorGroup.Careportal), + SITE_CHANGE(ColorGroup.Pump), + RESERVOIR_CHANGE(ColorGroup.Pump), + CALIBRATION(ColorGroup.Careportal), + PRIME_BOLUS(ColorGroup.Pump), + TREATMENT(ColorGroup.InsulinTreatment), + CAREPORTAL_NS_REFRESH(ColorGroup.Careportal), + PROFILE_SWITCH_NS_REFRESH(ColorGroup.Profile), + TREATMENTS_NS_REFRESH(ColorGroup.InsulinTreatment), + TT_NS_REFRESH(ColorGroup.TT), + AUTOMATION_REMOVED(ColorGroup.Aaps), + BG_REMOVED(ColorGroup.Aaps), + CAREPORTAL_REMOVED(ColorGroup.Careportal), + EXTENDED_BOLUS_REMOVED(ColorGroup.InsulinTreatment), + FOOD_REMOVED(ColorGroup.CarbTreatment), + PROFILE_REMOVED(ColorGroup.Profile), + PROFILE_SWITCH_REMOVED(ColorGroup.Profile), + RESTART_EVENTS_REMOVED(ColorGroup.Aaps), + TREATMENT_REMOVED(ColorGroup.InsulinTreatment), + BOLUS_REMOVED(ColorGroup.InsulinTreatment), + CARBS_REMOVED(ColorGroup.CarbTreatment), + TEMP_BASAL_REMOVED(ColorGroup.BasalTreatment), + TT_REMOVED(ColorGroup.TT), + NS_PAUSED(ColorGroup.Aaps), + NS_RESUME(ColorGroup.Aaps), + NS_QUEUE_CLEARED(ColorGroup.Aaps), + NS_SETTINGS_COPIED(ColorGroup.Aaps), + ERROR_DIALOG_OK(ColorGroup.Aaps), + ERROR_DIALOG_MUTE(ColorGroup.Aaps), + ERROR_DIALOG_MUTE_5MIN(ColorGroup.Aaps), + OBJECTIVE_STARTED(ColorGroup.Aaps), + OBJECTIVE_UNSTARTED(ColorGroup.Aaps), + OBJECTIVES_SKIPPED(ColorGroup.Aaps), + STAT_RESET(ColorGroup.Aaps), + DELETE_LOGS(ColorGroup.Aaps), + DELETE_FUTURE_TREATMENTS(ColorGroup.Aaps), + EXPORT_SETTINGS(ColorGroup.Aaps), + IMPORT_SETTINGS(ColorGroup.Aaps), + RESET_DATABASES(ColorGroup.Aaps), + CLEANUP_DATABASES(ColorGroup.Aaps), + EXPORT_DATABASES(ColorGroup.Aaps), + IMPORT_DATABASES(ColorGroup.Aaps), + OTP_EXPORT(ColorGroup.Aaps), + OTP_RESET(ColorGroup.Aaps), + STOP_SMS(ColorGroup.Aaps), + FOOD(ColorGroup.CarbTreatment), + EXPORT_CSV(ColorGroup.Aaps), + START_AAPS(ColorGroup.Aaps), + EXIT_AAPS(ColorGroup.Aaps), + PLUGIN_ENABLED(ColorGroup.Aaps), + PLUGIN_DISABLED(ColorGroup.Aaps), + UNKNOWN(ColorGroup.Aaps) + ; + + companion object { + + fun fromString(source: String?) = values().firstOrNull { it.name == source } ?: UNKNOWN + } + } + + enum class Sources { + TreatmentDialog, + InsulinDialog, + CarbDialog, + WizardDialog, + QuickWizard, + ExtendedBolusDialog, + TTDialog, + ProfileSwitchDialog, + LoopDialog, + TempBasalDialog, + CalibrationDialog, + FillDialog, + BgCheck, + SensorInsert, + BatteryChange, + Note, + Exercise, + Question, + Announcement, + Actions, //From Actions plugin + Automation, //From Automation plugin + Autotune, //From Autotune plugin + BG, //From BG plugin => Add One Source per BG Source for Calibration or Sensor Change + Aidex, + Dexcom, + Eversense, + Glimp, + MM640g, + NSClientSource, + PocTech, + Tomato, + Glunovo, + Intelligo, + Xdrip, + LocalProfile, //From LocalProfile plugin + Loop, //From Loop plugin + Maintenance, //From Maintenance plugin + NSClient, //From NSClient plugin + NSProfile, //From NSProfile plugin + Objectives, //From Objectives plugin + Pump, //To update with one Source per pump + Dana, //Only one UserEntry in Common module Dana + DanaR, + DanaRC, + DanaRv2, + DanaRS, + DanaI, + DiaconnG8, + Insight, + Combo, + Medtronic, + Omnipod, //No entry currently + OmnipodEros, + OmnipodDash, //No entry currently + EOPatch2, + Medtrum, + MDI, + VirtualPump, + SMS, //From SMS plugin + Treatments, //From Treatments plugin + Wear, //From Wear plugin + Food, //From Food plugin + ConfigBuilder, //From ConfigBuilder Plugin + Overview, //From OverViewPlugin + Stats, //From Stat Activity + Aaps, // MainApp + Unknown //if necessary + ; + + companion object { + + fun fromString(source: String?) = values().firstOrNull { it.name == source } ?: Unknown + } + } + + enum class ColorGroup { + InsulinTreatment, + BasalTreatment, + CarbTreatment, + TT, + Profile, + Loop, + Careportal, + Pump, + Aaps + } +} diff --git a/database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/ValueWithUnit.kt similarity index 97% rename from database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/ValueWithUnit.kt index b0f17f0b9e..c2d63daa18 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/ValueWithUnit.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities +package app.aaps.database.entities sealed class ValueWithUnit { @@ -35,7 +35,7 @@ sealed class ValueWithUnit { data class OfflineEventReason(val value: OfflineEvent.Reason) : ValueWithUnit() fun value(): Any? { - return when(this) { + return when (this) { is Gram -> this.value is Hour -> this.value is Insulin -> this.value @@ -54,6 +54,7 @@ sealed class ValueWithUnit { UNKNOWN -> null } } + companion object { const val MGDL = "mg/dl" // This is Nightscout's representation diff --git a/database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/VersionChange.kt similarity index 68% rename from database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/VersionChange.kt index 7fc3470246..e9200db947 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/VersionChange.kt @@ -1,15 +1,15 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import androidx.room.Entity import androidx.room.PrimaryKey -import info.nightscout.database.entities.interfaces.DBEntry -import info.nightscout.database.entities.interfaces.DBEntryWithTime +import app.aaps.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntryWithTime import java.util.TimeZone @Entity(tableName = TABLE_VERSION_CHANGES) data class VersionChange( @PrimaryKey(autoGenerate = true) - override var id: Long = 0L, + override var id: Long = 0L, override var timestamp: Long, override var utcOffset: Long = TimeZone.getDefault().getOffset(timestamp).toLong(), var versionCode: Int, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/data/Block.kt similarity index 83% rename from database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/data/Block.kt index 473f524d39..bf53549197 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/data/Block.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities.data +package app.aaps.database.entities.data import java.util.concurrent.TimeUnit diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/data/NewEntries.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/data/NewEntries.kt new file mode 100644 index 0000000000..242778740b --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/data/NewEntries.kt @@ -0,0 +1,38 @@ +package app.aaps.database.entities.data + +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.MultiwaveBolusLink +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.PreferenceChange +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.VersionChange + +data class NewEntries( + val apsResults: List, + val apsResultLinks: List, + val bolusCalculatorResults: List, + val boluses: List, + val carbs: List, + val effectiveProfileSwitches: List, + val extendedBoluses: List, + val glucoseValues: List, + val multiwaveBolusLinks: List, + val offlineEvents: List, + val preferencesChanges: List, + val profileSwitches: List, + val temporaryBasals: List, + val temporaryTarget: List, + val therapyEvents: List, + val totalDailyDoses: List, + val versionChanges: List, + val heartRates: List, +) diff --git a/database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/data/TargetBlock.kt similarity index 85% rename from database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/data/TargetBlock.kt index 22572eca16..d858422ce8 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/data/TargetBlock.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities.data +package app.aaps.database.entities.data import java.util.concurrent.TimeUnit diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InsulinConfiguration.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InsulinConfiguration.kt new file mode 100644 index 0000000000..b02fddbc54 --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InsulinConfiguration.kt @@ -0,0 +1,7 @@ +package app.aaps.database.entities.embedments + +data class InsulinConfiguration( + var insulinLabel: String, + var insulinEndTime: Long, // DIA before [milliseconds] + var peak: Long // [milliseconds] +) \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InterfaceIDs.kt similarity index 96% rename from database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InterfaceIDs.kt index 666f310c2e..5bc81af555 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/embedments/InterfaceIDs.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities.embedments +package app.aaps.database.entities.embedments import androidx.room.Ignore diff --git a/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntry.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntry.kt new file mode 100644 index 0000000000..4d398bbed6 --- /dev/null +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntry.kt @@ -0,0 +1,6 @@ +package app.aaps.database.entities.interfaces + +interface DBEntry { + + var id: Long +} \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithDuration.kt similarity index 68% rename from database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithDuration.kt index 34c4f053ff..f54410bb74 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithDuration.kt @@ -1,6 +1,7 @@ -package info.nightscout.database.entities.interfaces +package app.aaps.database.entities.interfaces interface DBEntryWithDuration { + var duration: Long val durationUnknown get() = duration == Long.MAX_VALUE diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTime.kt similarity index 59% rename from database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTime.kt index bae0a704e8..3265e216d7 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTime.kt @@ -1,6 +1,7 @@ -package info.nightscout.database.entities.interfaces +package app.aaps.database.entities.interfaces interface DBEntryWithTime { + var timestamp: Long var utcOffset: Long } \ No newline at end of file diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTimeAndDuration.kt similarity index 87% rename from database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTimeAndDuration.kt index ef7408c0e6..e16d050b35 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/DBEntryWithTimeAndDuration.kt @@ -1,4 +1,4 @@ -package info.nightscout.database.entities.interfaces +package app.aaps.database.entities.interfaces import kotlin.math.min diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/TraceableDBEntry.kt similarity index 89% rename from database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt rename to database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/TraceableDBEntry.kt index fe4745dcde..f92acc79e6 100644 --- a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/entities/interfaces/TraceableDBEntry.kt @@ -1,8 +1,9 @@ -package info.nightscout.database.entities.interfaces +package app.aaps.database.entities.interfaces -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.embedments.InterfaceIDs + +interface TraceableDBEntry : DBEntry { -interface TraceableDBEntry: DBEntry { var version: Int var dateCreated: Long var isValid: Boolean diff --git a/database/entities/src/main/java/info/nightscout/database/transactions/TransactionGlucoseValue.kt b/database/entities/src/main/kotlin/app/aaps/database/transactions/TransactionGlucoseValue.kt similarity index 80% rename from database/entities/src/main/java/info/nightscout/database/transactions/TransactionGlucoseValue.kt rename to database/entities/src/main/kotlin/app/aaps/database/transactions/TransactionGlucoseValue.kt index 1f70eabfdc..c11054c46a 100644 --- a/database/entities/src/main/java/info/nightscout/database/transactions/TransactionGlucoseValue.kt +++ b/database/entities/src/main/kotlin/app/aaps/database/transactions/TransactionGlucoseValue.kt @@ -1,6 +1,6 @@ -package info.nightscout.database.transactions +package app.aaps.database.transactions -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue import java.util.TimeZone data class TransactionGlucoseValue( diff --git a/database/entities/src/test/java/info/nightscout/database/entities/HeartRateTest.kt b/database/entities/src/test/kotlin/app/aaps/database/entities/HeartRateTest.kt similarity index 87% rename from database/entities/src/test/java/info/nightscout/database/entities/HeartRateTest.kt rename to database/entities/src/test/kotlin/app/aaps/database/entities/HeartRateTest.kt index e79ec94c5e..420a194724 100644 --- a/database/entities/src/test/java/info/nightscout/database/entities/HeartRateTest.kt +++ b/database/entities/src/test/kotlin/app/aaps/database/entities/HeartRateTest.kt @@ -1,16 +1,17 @@ -package info.nightscout.database.entities +package app.aaps.database.entities import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.jupiter.api.Test class HeartRateTest { + @Test fun contentEqualsTo_equals() { val hr1 = createHeartRate() assertTrue(hr1.contentEqualsTo(hr1)) assertTrue(hr1.contentEqualsTo(hr1.copy())) - assertTrue(hr1.contentEqualsTo(hr1.copy (id = 2, version = 2, dateCreated = 1L, referenceId = 4L))) + assertTrue(hr1.contentEqualsTo(hr1.copy(id = 2, version = 2, dateCreated = 1L, referenceId = 4L))) } @Test diff --git a/database/impl/src/androidTest/java/info/nightscout/database/impl/HeartRateDaoTest.kt b/database/impl/src/androidTest/java/info/nightscout/database/impl/HeartRateDaoTest.kt index dcd3e6bb6a..29aa8a5e9a 100644 --- a/database/impl/src/androidTest/java/info/nightscout/database/impl/HeartRateDaoTest.kt +++ b/database/impl/src/androidTest/java/info/nightscout/database/impl/HeartRateDaoTest.kt @@ -7,8 +7,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.TABLE_HEART_RATE +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.TABLE_HEART_RATE import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue @@ -112,6 +112,7 @@ internal class HeartRateDaoTest { } companion object { + private const val TEST_DB_NAME = "testDatabase" fun createHeartRate(timestamp: Long? = null, beatsPerMinute: Double = 80.0) = diff --git a/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt b/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt index 4cea6766ba..ecfdfd8fa5 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt @@ -3,6 +3,25 @@ package info.nightscout.database.impl import androidx.room.Database import androidx.room.RoomDatabase import androidx.room.TypeConverters +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.MultiwaveBolusLink +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.PreferenceChange +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.VersionChange import info.nightscout.database.impl.daos.APSResultDao import info.nightscout.database.impl.daos.APSResultLinkDao import info.nightscout.database.impl.daos.BolusCalculatorResultDao @@ -13,6 +32,7 @@ import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao import info.nightscout.database.impl.daos.ExtendedBolusDao import info.nightscout.database.impl.daos.FoodDao import info.nightscout.database.impl.daos.GlucoseValueDao +import info.nightscout.database.impl.daos.HeartRateDao import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao import info.nightscout.database.impl.daos.OfflineEventDao import info.nightscout.database.impl.daos.PreferenceChangeDao @@ -23,39 +43,19 @@ import info.nightscout.database.impl.daos.TherapyEventDao import info.nightscout.database.impl.daos.TotalDailyDoseDao import info.nightscout.database.impl.daos.UserEntryDao import info.nightscout.database.impl.daos.VersionChangeDao -import info.nightscout.database.entities.APSResult -import info.nightscout.database.entities.APSResultLink -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.MultiwaveBolusLink -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.PreferenceChange -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.VersionChange -import info.nightscout.database.impl.daos.HeartRateDao import java.io.Closeable const val DATABASE_VERSION = 24 -@Database(version = DATABASE_VERSION, - entities = [APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class, +@Database( + version = DATABASE_VERSION, + entities = [app.aaps.database.entities.APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class, EffectiveProfileSwitch::class, ExtendedBolus::class, GlucoseValue::class, ProfileSwitch::class, - TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class, APSResultLink::class, + TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class, app.aaps.database.entities.APSResultLink::class, MultiwaveBolusLink::class, PreferenceChange::class, VersionChange::class, UserEntry::class, Food::class, DeviceStatus::class, OfflineEvent::class, HeartRate::class], - exportSchema = true) + exportSchema = true +) @TypeConverters(Converters::class) internal abstract class AppDatabase : Closeable, RoomDatabase() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt b/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt index 103296bbf8..11141cec85 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt @@ -1,26 +1,26 @@ package info.nightscout.database.impl -import info.nightscout.database.ValueWrapper +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.data.NewEntries +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.annotations.DbOpenForTesting -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.data.NewEntries -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.DBEntry import info.nightscout.database.impl.transactions.Transaction import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Maybe diff --git a/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt b/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt index 39d80b5d14..3aeb438cc2 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt @@ -1,21 +1,21 @@ package info.nightscout.database.impl import androidx.room.TypeConverter -import info.nightscout.database.entities.APSResult -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.APSResult +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock +import app.aaps.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.serialisation.SealedClassHelper import info.nightscout.database.impl.serialisation.fromJson import org.json.JSONArray @@ -186,9 +186,11 @@ class Converters { for (i in 0 until jsonArray.length()) { val jsonObject = jsonArray.getJSONObject(i) list.add( - TargetBlock(jsonObject.getLong("duration"), - jsonObject.getDouble("lowTarget"), - jsonObject.getDouble("highTarget")) + TargetBlock( + jsonObject.getLong("duration"), + jsonObject.getDouble("lowTarget"), + jsonObject.getDouble("highTarget") + ) ) } return list diff --git a/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt b/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt index e0d531f2f9..807716b9f9 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt @@ -6,9 +6,9 @@ import androidx.room.Room import androidx.room.RoomDatabase.Callback import androidx.room.migration.Migration import androidx.sqlite.db.SupportSQLiteDatabase +import app.aaps.database.entities.TABLE_HEART_RATE import dagger.Module import dagger.Provides -import info.nightscout.database.entities.TABLE_HEART_RATE import javax.inject.Qualifier import javax.inject.Singleton @@ -54,7 +54,7 @@ open class DatabaseModule { database.execSQL("DROP INDEX IF EXISTS `index_offlineEvents_end`") } - private val migration20to21 = object : Migration(20,21) { + private val migration20to21 = object : Migration(20, 21) { override fun migrate(database: SupportSQLiteDatabase) { database.execSQL("DROP TABLE IF EXISTS offlineEvents") database.execSQL("CREATE TABLE IF NOT EXISTS `offlineEvents` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `reason` TEXT NOT NULL, `duration` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `offlineEvents`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )") @@ -68,7 +68,7 @@ open class DatabaseModule { } } - private val migration21to22 = object : Migration(21,22) { + private val migration21to22 = object : Migration(21, 22) { override fun migrate(database: SupportSQLiteDatabase) { database.execSQL("ALTER TABLE `carbs` ADD COLUMN `notes` TEXT") database.execSQL("ALTER TABLE `boluses` ADD COLUMN `notes` TEXT") @@ -77,7 +77,7 @@ open class DatabaseModule { } } - private val migration22to23 = object : Migration(22,23) { + private val migration22to23 = object : Migration(22, 23) { override fun migrate(database: SupportSQLiteDatabase) { database.execSQL("ALTER TABLE `deviceStatus` ADD COLUMN `isCharging` INTEGER") // Custom indexes must be dropped on migration to pass room schema checking after upgrade diff --git a/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt b/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt index f14bc62d2d..2748dcf9a6 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt @@ -1,5 +1,6 @@ package info.nightscout.database.impl +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.APSResultDao import info.nightscout.database.impl.daos.APSResultLinkDao import info.nightscout.database.impl.daos.BolusCalculatorResultDao @@ -10,6 +11,7 @@ import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao import info.nightscout.database.impl.daos.ExtendedBolusDao import info.nightscout.database.impl.daos.FoodDao import info.nightscout.database.impl.daos.GlucoseValueDao +import info.nightscout.database.impl.daos.HeartRateDao import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao import info.nightscout.database.impl.daos.OfflineEventDao import info.nightscout.database.impl.daos.PreferenceChangeDao @@ -30,6 +32,7 @@ import info.nightscout.database.impl.daos.delegated.DelegatedEffectiveProfileSwi import info.nightscout.database.impl.daos.delegated.DelegatedExtendedBolusDao import info.nightscout.database.impl.daos.delegated.DelegatedFoodDao import info.nightscout.database.impl.daos.delegated.DelegatedGlucoseValueDao +import info.nightscout.database.impl.daos.delegated.DelegatedHeartRateDao import info.nightscout.database.impl.daos.delegated.DelegatedMultiwaveBolusLinkDao import info.nightscout.database.impl.daos.delegated.DelegatedOfflineEventDao import info.nightscout.database.impl.daos.delegated.DelegatedPreferenceChangeDao @@ -40,9 +43,6 @@ import info.nightscout.database.impl.daos.delegated.DelegatedTherapyEventDao import info.nightscout.database.impl.daos.delegated.DelegatedTotalDailyDoseDao import info.nightscout.database.impl.daos.delegated.DelegatedUserEntryDao import info.nightscout.database.impl.daos.delegated.DelegatedVersionChangeDao -import info.nightscout.database.entities.interfaces.DBEntry -import info.nightscout.database.impl.daos.HeartRateDao -import info.nightscout.database.impl.daos.delegated.DelegatedHeartRateDao internal class DelegatedAppDatabase(val changes: MutableList, val database: AppDatabase) { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt index 4b24b308be..ea287dd1b0 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.APSResult -import info.nightscout.database.entities.TABLE_APS_RESULTS +import app.aaps.database.entities.APSResult +import app.aaps.database.entities.TABLE_APS_RESULTS @Suppress("FunctionName") @Dao diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt index 68263c75e5..2f7886ba99 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.APSResultLink -import info.nightscout.database.entities.TABLE_APS_RESULTS -import info.nightscout.database.entities.TABLE_APS_RESULT_LINKS +import app.aaps.database.entities.APSResultLink +import app.aaps.database.entities.TABLE_APS_RESULTS +import app.aaps.database.entities.TABLE_APS_RESULT_LINKS @Dao internal interface APSResultLinkDao : TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt index 1758a12f74..3fe0a07061 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.TABLE_BOLUS_CALCULATOR_RESULTS +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.TABLE_BOLUS_CALCULATOR_RESULTS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt index 636a235b02..ae9941be0c 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.TABLE_BOLUSES -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.TABLE_BOLUSES +import app.aaps.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt index c5cb525201..245a640091 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.TABLE_CARBS +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.TABLE_CARBS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt index b4fd87f225..faa0f3499e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt @@ -4,8 +4,8 @@ import androidx.room.Dao import androidx.room.Insert import androidx.room.Query import androidx.room.Update -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.TABLE_DEVICE_STATUS +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.TABLE_DEVICE_STATUS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt index 3b4270e583..dbd99030cd 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.TABLE_EFFECTIVE_PROFILE_SWITCHES +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.TABLE_EFFECTIVE_PROFILE_SWITCHES import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt index cb138a01b7..57b7db53eb 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TABLE_EXTENDED_BOLUSES -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TABLE_EXTENDED_BOLUSES +import app.aaps.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt index aae37a724a..a0bb8682d3 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.TABLE_FOODS +import app.aaps.database.entities.Food +import app.aaps.database.entities.TABLE_FOODS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt index 89ad9a57cf..d1f3ebea26 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TABLE_GLUCOSE_VALUES +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TABLE_GLUCOSE_VALUES import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/HeartRateDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/HeartRateDao.kt index b234f8d460..4c450a9e37 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/HeartRateDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/HeartRateDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.TABLE_HEART_RATE +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.TABLE_HEART_RATE import io.reactivex.rxjava3.core.Single @Dao diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt index 85a7d34fe0..1ec4abfdb3 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.MultiwaveBolusLink -import info.nightscout.database.entities.TABLE_MULTIWAVE_BOLUS_LINKS +import app.aaps.database.entities.MultiwaveBolusLink +import app.aaps.database.entities.TABLE_MULTIWAVE_BOLUS_LINKS @Dao internal interface MultiwaveBolusLinkDao : TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt index 45f38f69bf..746c704d28 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.TABLE_OFFLINE_EVENTS +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TABLE_OFFLINE_EVENTS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt index c189e31c92..cd5a3cee4b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt @@ -3,8 +3,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.database.entities.PreferenceChange -import info.nightscout.database.entities.TABLE_PREFERENCE_CHANGES +import app.aaps.database.entities.PreferenceChange +import app.aaps.database.entities.TABLE_PREFERENCE_CHANGES @Dao interface PreferenceChangeDao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt index f867ca04ae..9139493380 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TABLE_PROFILE_SWITCHES -import info.nightscout.database.entities.data.checkSanity +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TABLE_PROFILE_SWITCHES +import app.aaps.database.entities.data.checkSanity import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt index 8e9683ca7f..0f01fdc340 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.TABLE_TEMPORARY_BASALS -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.TABLE_TEMPORARY_BASALS +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt index 7e728d8766..4cfee98587 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.TABLE_TEMPORARY_TARGETS -import info.nightscout.database.entities.TemporaryTarget +import app.aaps.database.entities.TABLE_TEMPORARY_TARGETS +import app.aaps.database.entities.TemporaryTarget import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt index 29c069bd97..8e2ee77294 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt @@ -2,8 +2,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.TABLE_THERAPY_EVENTS -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TABLE_THERAPY_EVENTS +import app.aaps.database.entities.TherapyEvent import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt index 7dbfa8ee41..2bc9d64b3b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.database.entities.TABLE_TOTAL_DAILY_DOSES -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.TABLE_TOTAL_DAILY_DOSES +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt index 7dfefd28fd..1b6adc255e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt @@ -2,7 +2,7 @@ package info.nightscout.database.impl.daos import androidx.room.Insert import androidx.room.Update -import info.nightscout.database.entities.interfaces.TraceableDBEntry +import app.aaps.database.entities.interfaces.TraceableDBEntry import info.nightscout.database.impl.daos.workaround.TraceableDaoWorkaround internal interface TraceableDao : TraceableDaoWorkaround { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt index 751591f1b3..f03f2e684c 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt @@ -3,9 +3,9 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.database.entities.TABLE_USER_ENTRY -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.TABLE_USER_ENTRY +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources import io.reactivex.rxjava3.core.Single @Dao diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt index be65faff0d..0f285f0dbc 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt @@ -3,8 +3,8 @@ package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.database.entities.TABLE_VERSION_CHANGES -import info.nightscout.database.entities.VersionChange +import app.aaps.database.entities.TABLE_VERSION_CHANGES +import app.aaps.database.entities.VersionChange @Dao interface VersionChangeDao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt index e99f80efd7..9d1a7dffed 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt @@ -1,17 +1,16 @@ package info.nightscout.database.impl.daos.delegated -import info.nightscout.database.entities.APSResult -import info.nightscout.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.APSResultDao internal class DelegatedAPSResultDao(changes: MutableList, private val dao: APSResultDao) : DelegatedDao(changes), APSResultDao by dao { - override fun insertNewEntry(entry: APSResult): Long { + override fun insertNewEntry(entry: app.aaps.database.entities.APSResult): Long { changes.add(entry) return dao.insertNewEntry(entry) } - override fun updateExistingEntry(entry: APSResult): Long { + override fun updateExistingEntry(entry: app.aaps.database.entities.APSResult): Long { changes.add(entry) return dao.updateExistingEntry(entry) } diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt index 756b07c20f..3d9208cf29 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt @@ -1,17 +1,16 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.APSResultLinkDao -import info.nightscout.database.entities.APSResultLink -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedAPSResultLinkDao(changes: MutableList, private val dao: APSResultLinkDao) : DelegatedDao(changes), APSResultLinkDao by dao { - override fun insertNewEntry(entry: APSResultLink): Long { + override fun insertNewEntry(entry: app.aaps.database.entities.APSResultLink): Long { changes.add(entry) return dao.insertNewEntry(entry) } - override fun updateExistingEntry(entry: APSResultLink): Long { + override fun updateExistingEntry(entry: app.aaps.database.entities.APSResultLink): Long { changes.add(entry) return dao.updateExistingEntry(entry) } diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt index 0a6817a3c3..57cec728bb 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.BolusCalculatorResultDao -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedBolusCalculatorResultDao(changes: MutableList, private val dao: BolusCalculatorResultDao) : DelegatedDao(changes), BolusCalculatorResultDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt index d35b0f38ce..d076f75778 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.BolusDao -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedBolusDao(changes: MutableList, private val dao: BolusDao) : DelegatedDao(changes), BolusDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt index 58bb4f809e..704219997f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.CarbsDao -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedCarbsDao(changes: MutableList, private val dao: CarbsDao) : DelegatedDao(changes), CarbsDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt index 2c22734e97..0fcb1d02ab 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.daos.delegated -import info.nightscout.database.entities.interfaces.DBEntry +import app.aaps.database.entities.interfaces.DBEntry /** * A DAO that adds updated or inserted entries to a list diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt index cc11ece89c..69512fefa8 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.DeviceStatusDao -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedDeviceStatusDao(changes: MutableList, private val dao: DeviceStatusDao) : DelegatedDao(changes), DeviceStatusDao by dao \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt index 4180653fdc..994c4d0eb4 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedEffectiveProfileSwitchDao(changes: MutableList, private val dao: EffectiveProfileSwitchDao) : DelegatedDao(changes), EffectiveProfileSwitchDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt index f650e3588e..deb3653907 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.ExtendedBolusDao -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedExtendedBolusDao(changes: MutableList, private val dao: ExtendedBolusDao) : DelegatedDao(changes), ExtendedBolusDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt index d78aac0fa8..bb3ceaf616 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.Food +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.FoodDao -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedFoodDao(changes: MutableList, private val dao: FoodDao) : DelegatedDao(changes), FoodDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt index e2eec39c07..b5015708a5 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.GlucoseValueDao -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedGlucoseValueDao(changes: MutableList, private val dao: GlucoseValueDao) : DelegatedDao(changes), GlucoseValueDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedHeartRateDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedHeartRateDao.kt index 1ea08ad704..94be3da672 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedHeartRateDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedHeartRateDao.kt @@ -1,12 +1,13 @@ package info.nightscout.database.impl.daos.delegated -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.interfaces.DBEntry +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.HeartRateDao internal class DelegatedHeartRateDao( changes: MutableList, - private val dao:HeartRateDao): DelegatedDao(changes), HeartRateDao by dao { + private val dao: HeartRateDao +) : DelegatedDao(changes), HeartRateDao by dao { override fun insertNewEntry(entry: HeartRate): Long { changes.add(entry) diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt index c4263e79d9..054a4e6edf 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.MultiwaveBolusLink +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao -import info.nightscout.database.entities.MultiwaveBolusLink -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedMultiwaveBolusLinkDao(changes: MutableList, private val dao: MultiwaveBolusLinkDao) : DelegatedDao(changes), MultiwaveBolusLinkDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt index bd25c6afdc..9584a4f88b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.OfflineEventDao -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedOfflineEventDao(changes: MutableList, private val dao: OfflineEventDao) : DelegatedDao(changes), OfflineEventDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt index 37210a727f..466329706b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.PreferenceChange +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.PreferenceChangeDao -import info.nightscout.database.entities.PreferenceChange -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedPreferenceChangeDao(changes: MutableList, private val dao: PreferenceChangeDao) : DelegatedDao(changes), PreferenceChangeDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt index 4d22152451..d3e0b5684a 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.ProfileSwitchDao -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedProfileSwitchDao(changes: MutableList, private val dao: ProfileSwitchDao) : DelegatedDao(changes), ProfileSwitchDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt index 13ef3fe130..17539d2a5e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.TemporaryBasalDao -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTemporaryBasalDao(changes: MutableList, private val dao: TemporaryBasalDao) : DelegatedDao(changes), TemporaryBasalDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt index 9b0b0307c3..3951195567 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.TemporaryTargetDao -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTemporaryTargetDao(changes: MutableList, private val dao: TemporaryTargetDao) : DelegatedDao(changes), TemporaryTargetDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt index 099d043f4f..674d0b2b62 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.TherapyEventDao -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTherapyEventDao(changes: MutableList, private val dao: TherapyEventDao) : DelegatedDao(changes), TherapyEventDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt index f69e83e6f9..4e86c03916 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.TotalDailyDoseDao -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTotalDailyDoseDao(changes: MutableList, private val dao: TotalDailyDoseDao) : DelegatedDao(changes), TotalDailyDoseDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt index 9faed2f2c0..4d2b52b3d3 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.UserEntryDao -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedUserEntryDao(changes: MutableList, private val dao: UserEntryDao) : DelegatedDao(changes), UserEntryDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt index 4f2564efa9..9130ab9edd 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.daos.delegated +import app.aaps.database.entities.VersionChange +import app.aaps.database.entities.interfaces.DBEntry import info.nightscout.database.impl.daos.VersionChangeDao -import info.nightscout.database.entities.VersionChange -import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedVersionChangeDao(changes: MutableList, private val dao: VersionChangeDao) : DelegatedDao(changes), VersionChangeDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java index 04fc586e06..0dc1cb86f5 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos.workaround; import androidx.room.Transaction; -import info.nightscout.database.impl.daos.ProfileSwitchDaoKt; -import info.nightscout.database.entities.ProfileSwitch; +import app.aaps.database.entities.ProfileSwitch; import info.nightscout.database.impl.daos.ProfileSwitchDao; +import info.nightscout.database.impl.daos.ProfileSwitchDaoKt; import info.nightscout.database.impl.daos.TraceableDao; public interface ProfileSwitchDaoWorkaround extends TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java index 355d750a9d..f84ded9aff 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java @@ -2,9 +2,9 @@ package info.nightscout.database.impl.daos.workaround; import androidx.room.Transaction; -import info.nightscout.database.impl.daos.TraceableDaoKt; -import info.nightscout.database.entities.interfaces.TraceableDBEntry; +import app.aaps.database.entities.interfaces.TraceableDBEntry; import info.nightscout.database.impl.daos.TraceableDao; +import info.nightscout.database.impl.daos.TraceableDaoKt; // keep in java, it's easier public interface TraceableDaoWorkaround { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt index a7e1144d48..eaa8cc776e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.interfaces.end class CancelCurrentOfflineEventIfAnyTransaction( val timestamp: Long diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt index 79ee6841b3..60cc6c0a8e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.interfaces.end class CancelCurrentTemporaryTargetIfAnyTransaction( val timestamp: Long diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt index 50546ce4da..03976f0fa7 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt @@ -1,13 +1,13 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.transactions.TransactionGlucoseValue +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.transactions.TransactionGlucoseValue /** * Inserts data from a CGM source into the database */ -class CgmSourceTransaction constructor( +class CgmSourceTransaction( private val glucoseValues: List, private val calibrations: List, private val sensorInsertionTime: Long? diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt index 8b789e3434..608b645a91 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.interfaces.end import kotlin.math.roundToInt class CutCarbsTransaction(val id: Long, val end: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt index 2b49d95e37..be5f90c632 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.interfaces.end class InsertAndCancelCurrentOfflineEventTransaction( val offlineEvent: OfflineEvent @@ -24,6 +24,7 @@ class InsertAndCancelCurrentOfflineEventTransaction( } class TransactionResult { + val inserted = mutableListOf() val updated = mutableListOf() } diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt index 687c27442b..85ef76915e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.interfaces.end class InsertAndCancelCurrentTemporaryTargetTransaction( val temporaryTarget: TemporaryTarget @@ -24,6 +24,7 @@ class InsertAndCancelCurrentTemporaryTargetTransaction( } class TransactionResult { + val inserted = mutableListOf() val updated = mutableListOf() } diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt index 2d5f572dc1..da91b12de2 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization @@ -10,8 +10,7 @@ class InsertBolusWithTempIdTransaction( ) : Transaction() { override fun run(): TransactionResult { - bolus.interfaceIDs.temporaryId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: - throw IllegalStateException("Some pump ID is null") + bolus.interfaceIDs.temporaryId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: throw IllegalStateException("Some pump ID is null") val result = TransactionResult() val current = database.bolusDao.findByPumpTempIds(bolus.interfaceIDs.temporaryId!!, bolus.interfaceIDs.pumpType!!, bolus.interfaceIDs.pumpSerial!!) if (current == null) { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt index 5d2cdfe2a1..53cc53afc0 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.embedments.InterfaceIDs /** * Creates Carbs if record doesn't exist @@ -17,11 +17,11 @@ class InsertIfNewByTimestampCarbsTransaction( interfaceIDs_backing: InterfaceIDs? = null ) : this( Carbs( - timestamp = timestamp, - amount = amount, - duration = duration, - interfaceIDs_backing = interfaceIDs_backing - ) + timestamp = timestamp, + amount = amount, + duration = duration, + interfaceIDs_backing = interfaceIDs_backing + ) ) override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt index 1214595809..d22797a322 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt @@ -1,12 +1,21 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class InsertIfNewByTimestampTherapyEventTransaction( val therapyEvent: TherapyEvent ) : Transaction() { - constructor(timestamp: Long, type: TherapyEvent.Type, duration: Long = 0, note: String? = null, enteredBy: String? = null, glucose: Double? = null, glucoseType: TherapyEvent.MeterType? = null, glucoseUnit: TherapyEvent.GlucoseUnit) : + constructor( + timestamp: Long, + type: TherapyEvent.Type, + duration: Long = 0, + note: String? = null, + enteredBy: String? = null, + glucose: Double? = null, + glucoseType: TherapyEvent.MeterType? = null, + glucoseUnit: TherapyEvent.GlucoseUnit + ) : this(TherapyEvent(timestamp = timestamp, type = type, duration = duration, note = note, enteredBy = enteredBy, glucose = glucose, glucoseType = glucoseType, glucoseUnit = glucoseUnit)) override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt index 0f4fee61d5..7e2ffa6a15 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.BolusCalculatorResult +import app.aaps.database.entities.BolusCalculatorResult /** * Creates or updates the BolusCalculatorResult diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt index 9d3d2ff894..43cfa8d9d6 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs /** * Creates or updates the Bolus @@ -21,14 +21,14 @@ class InsertOrUpdateBolusTransaction( interfaceIDs_backing: InterfaceIDs? = null ) : this( Bolus( - timestamp = timestamp, - amount = amount, - type = type, - notes = notes, - isBasalInsulin = isBasalInsulin, - insulinConfiguration = insulinConfiguration, - interfaceIDs_backing = interfaceIDs_backing - ) + timestamp = timestamp, + amount = amount, + type = type, + notes = notes, + isBasalInsulin = isBasalInsulin, + insulinConfiguration = insulinConfiguration, + interfaceIDs_backing = interfaceIDs_backing + ) ) override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt index 57d58dfb67..8e697a4d3f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.embedments.InterfaceIDs /** * Creates or updates the Carbs @@ -18,12 +18,12 @@ class InsertOrUpdateCarbsTransaction( interfaceIDs_backing: InterfaceIDs? = null ) : this( Carbs( - timestamp = timestamp, - amount = amount, - duration = duration, - notes = notes, - interfaceIDs_backing = interfaceIDs_backing - ) + timestamp = timestamp, + amount = amount, + duration = duration, + notes = notes, + interfaceIDs_backing = interfaceIDs_backing + ) ) override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt index e72bcb51db..2053989200 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Food +import app.aaps.database.entities.Food /** * Inserts or updates the Food diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateHeartRateTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateHeartRateTransaction.kt index 4271c82ba8..26560f0674 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateHeartRateTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateHeartRateTransaction.kt @@ -1,19 +1,20 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.HeartRate +import app.aaps.database.entities.HeartRate -class InsertOrUpdateHeartRateTransaction(private val heartRate: HeartRate): +class InsertOrUpdateHeartRateTransaction(private val heartRate: HeartRate) : Transaction() { override fun run(): TransactionResult { val existing = if (heartRate.id == 0L) null else database.heartRateDao.findById(heartRate.id) - return if (existing == null) { + return if (existing == null) { database.heartRateDao.insertNewEntry(heartRate).let { - TransactionResult(listOf(heartRate), emptyList()) } + TransactionResult(listOf(heartRate), emptyList()) + } } else { database.heartRateDao.updateExistingEntry(heartRate) TransactionResult(emptyList(), listOf(heartRate)) - } + } } data class TransactionResult(val inserted: List, val updated: List) diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt index c420df5d69..d9a4f50778 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch class InsertOrUpdateProfileSwitch(val profileSwitch: ProfileSwitch) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt index 2e44a4984c..196e9acd5a 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt @@ -1,11 +1,12 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal /** * Creates or updates the TemporaryBasal from pump synchronization */ -class InsertTemporaryBasalWithTempIdTransaction(private val temporaryBasal: TemporaryBasal +class InsertTemporaryBasalWithTempIdTransaction( + private val temporaryBasal: TemporaryBasal ) : Transaction() { override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt index dca1c8afb2..6afb417759 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs class InsertTherapyEventAnnouncementTransaction( val therapyEvent: TherapyEvent @@ -20,7 +20,8 @@ class InsertTherapyEventAnnouncementTransaction( interfaceIDs_backing = InterfaceIDs( pumpId = pumpId, pumpType = pumpType, - pumpSerial = pumpSerial) + pumpSerial = pumpSerial + ) ) ) diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt index 1c7ddc8c0e..309ee6b56f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class InvalidateAAPSStartedTherapyEventTransaction(private val note: String) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt index 9b3580e9bb..dc7435741b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.BolusCalculatorResult +import app.aaps.database.entities.BolusCalculatorResult class InvalidateBolusCalculatorResultTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt index 665fbde3d4..dffab31840 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt @@ -1,10 +1,8 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus - class InvalidateBolusTransaction(val id: Long) : Transaction() { - override fun run() : TransactionResult { + override fun run(): TransactionResult { val result = TransactionResult() val bolus = database.bolusDao.findById(id) ?: throw IllegalArgumentException("There is no such Bolus with the specified ID.") @@ -17,6 +15,7 @@ class InvalidateBolusTransaction(val id: Long) : Transaction() + + val invalidated = mutableListOf() } } \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt index a2ac7932f0..8bad38ee15 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs +import app.aaps.database.entities.Carbs class InvalidateCarbsTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateEffectiveProfileSwitchTransaction.kt index f65091c788..465b11194b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateEffectiveProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateEffectiveProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch class InvalidateEffectiveProfileSwitchTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt index e9b4a486fe..3a2d0caea3 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ExtendedBolus +import app.aaps.database.entities.ExtendedBolus class InvalidateExtendedBolusTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt index bfdcda05fd..b5692f8d89 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue /** * Invalidates the GlucoseValue with the specified id diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt index 897acf78f3..bba982c5de 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.OfflineEvent +import app.aaps.database.entities.OfflineEvent class InvalidateOfflineEventTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt index 7d2bcfcc27..72c280a3f9 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch class InvalidateProfileSwitchTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt index 878f66bf23..1bbd359fad 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal class InvalidateTemporaryBasalTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt index 8980a098d9..83b512aeff 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.embedments.InterfaceIDs class InvalidateTemporaryBasalTransactionWithPumpId(val pumpId: Long, val pumpType: InterfaceIDs.PumpType, val pumpSerial: String) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt index 629ae1cec1..8780520646 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal class InvalidateTemporaryBasalWithTempIdTransaction(val tempId: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt index ae219cc94b..b09732e98b 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryTarget +import app.aaps.database.entities.TemporaryTarget class InvalidateTemporaryTargetTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt index b846312bab..b6ad3aa242 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class InvalidateTherapyEventTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt index 46624928d1..f3cdc928e5 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization @@ -11,8 +11,7 @@ class SyncBolusWithTempIdTransaction( ) : Transaction() { override fun run(): TransactionResult { - bolus.interfaceIDs.temporaryId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: - throw IllegalStateException("Some pump ID is null") + bolus.interfaceIDs.temporaryId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: throw IllegalStateException("Some pump ID is null") val result = TransactionResult() val current = database.bolusDao.findByPumpTempIds(bolus.interfaceIDs.temporaryId!!, bolus.interfaceIDs.pumpType!!, bolus.interfaceIDs.pumpSerial!!) if (current != null) { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt index c81cdaaadc..1ee13c0b7a 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.BolusCalculatorResult +import app.aaps.database.entities.BolusCalculatorResult /** * Sync the BolusCalculatorResult from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt index 4098dc194a..a18655e488 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus /** * Sync the Bolus from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt index c228bc1c4d..d2088ab52e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs +import app.aaps.database.entities.Carbs /** * Sync the carbs from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt index 18f0c87203..37e1ddfd70 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch /** * Sync the EffectiveProfileSwitch from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt index 1424c4c137..50b61555a1 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt index f13dd84749..2ea6b862f5 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Food +import app.aaps.database.entities.Food /** * Sync the Foods from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt index 8ac6d7f80f..9143580ac4 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt index 33e90ecb9b..e4ec08688f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch /** * Sync the ProfileSwitch from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt index 28202a8aae..5be241d04c 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt index 6229136192..c7f2e427a9 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt index cd228bba85..55e0809738 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent /** * Sync the TherapyEvents from NS diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt index 7063fb0db3..018e79ca62 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization @@ -11,8 +11,7 @@ class SyncPumpBolusTransaction( ) : Transaction() { override fun run(): TransactionResult { - bolus.interfaceIDs.pumpId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: - throw IllegalStateException("Some pump ID is null") + bolus.interfaceIDs.pumpId ?: bolus.interfaceIDs.pumpType ?: bolus.interfaceIDs.pumpSerial ?: throw IllegalStateException("Some pump ID is null") val result = TransactionResult() val current = database.bolusDao.findByPumpIds(bolus.interfaceIDs.pumpId!!, bolus.interfaceIDs.pumpType!!, bolus.interfaceIDs.pumpSerial!!) if (current == null) { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt index e22e819d7a..b08dfd5de2 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.end class SyncPumpCancelExtendedBolusIfAnyTransaction( private val timestamp: Long, private val endPumpId: Long, private val pumpType: InterfaceIDs.PumpType, private val pumpSerial: String diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt index 2523adbe18..c2dd0d4d26 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt @@ -1,8 +1,8 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.interfaces.end class SyncPumpCancelTemporaryBasalIfAnyTransaction( private val timestamp: Long, private val endPumpId: Long, private val pumpType: InterfaceIDs.PumpType, private val pumpSerial: String diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt index 2f93d98b13..d10d00bc07 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.interfaces.end /** * Creates or updates the extended bolus from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt index fc8abfe8e0..8d02d321bd 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt @@ -1,7 +1,7 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.end /** * Creates or updates the Temporary basal from pump synchronization @@ -21,7 +21,7 @@ class SyncPumpTemporaryBasalTransaction( if ( existing.timestamp != temporaryBasal.timestamp || existing.rate != temporaryBasal.rate || - existing.duration != temporaryBasal.duration && existing.interfaceIDs.endId == null || + existing.duration != temporaryBasal.duration && existing.interfaceIDs.endId == null || existing.type != type ?: existing.type ) { val old = existing.copy() diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt index 0321099227..35bc6ca1ec 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt @@ -1,11 +1,12 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TotalDailyDose +import app.aaps.database.entities.TotalDailyDose /** * Creates or updates the TotalDailyDose from pump synchronization */ -class SyncPumpTotalDailyDoseTransaction(private val tdd: TotalDailyDose +class SyncPumpTotalDailyDoseTransaction( + private val tdd: TotalDailyDose ) : Transaction() { override fun run(): TransactionResult { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt index b08f64f961..9d3ea24069 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal /** * Creates or updates the TemporaryBasal from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt index 3ffa9fad5a..b2bc0820ca 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue /** * Updates the GlucoseValue diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt index d0796b6c70..690cf850db 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.BolusCalculatorResult +import app.aaps.database.entities.BolusCalculatorResult class UpdateNsIdBolusCalculatorResultTransaction(private val bolusCalculatorResults: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt index b75b15f303..fb0da68bea 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus class UpdateNsIdBolusTransaction(private val boluses: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt index 15b376ef47..622dd9e94f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Carbs +import app.aaps.database.entities.Carbs class UpdateNsIdCarbsTransaction(private val carbs: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt index 5b63815049..c061b109d9 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.DeviceStatus +import app.aaps.database.entities.DeviceStatus class UpdateNsIdDeviceStatusTransaction(private val deviceStatuses: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt index 89cb509d40..6c3f98382e 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch class UpdateNsIdEffectiveProfileSwitchTransaction(private val effectiveProfileSwitches: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt index 43beaebd3d..4258ccc1ce 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ExtendedBolus +import app.aaps.database.entities.ExtendedBolus class UpdateNsIdExtendedBolusTransaction(val boluses: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt index 228d8665ff..29cd5f4805 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.Food +import app.aaps.database.entities.Food class UpdateNsIdFoodTransaction(private val foods: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt index 073b7f2fcf..ed8e7895a9 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue class UpdateNsIdGlucoseValueTransaction(private val glucoseValues: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt index b568b5b3f9..771c7c402f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.OfflineEvent +import app.aaps.database.entities.OfflineEvent class UpdateNsIdOfflineEventTransaction(private val offlineEvents: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt index d15421d316..eebb05ae07 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch class UpdateNsIdProfileSwitchTransaction(val profileSwitches: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt index 667daae619..4d09720c91 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal class UpdateNsIdTemporaryBasalTransaction(private val temporaryBasals: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt index f629302486..a1a2f0340f 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TemporaryTarget +import app.aaps.database.entities.TemporaryTarget class UpdateNsIdTemporaryTargetTransaction(private val temporaryTargets: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt index d82086e9b1..f3e1d06952 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class UpdateNsIdTherapyEventTransaction(val therapyEvents: List) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt index 34468cbc66..1be3c14a92 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt @@ -1,6 +1,6 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.UserEntry +import app.aaps.database.entities.UserEntry class UserEntryTransaction(private val entries: List) : Transaction>() { diff --git a/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt index b1a7dcab4b..9dddb17e91 100644 --- a/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt @@ -1,12 +1,13 @@ package info.nightscout.database.impl.transactions -import info.nightscout.database.entities.VersionChange +import app.aaps.database.entities.VersionChange class VersionChangeTransaction( private val versionName: String, private val versionCode: Int, private val gitRemote: String?, - private val commitHash: String?) : Transaction() { + private val commitHash: String? +) : Transaction() { override fun run() { val current = database.versionChangeDao.getMostRecentVersionChange() @@ -14,15 +15,16 @@ class VersionChangeTransaction( || current.versionName != versionName || current.versionCode != versionCode || current.gitRemote != gitRemote - || current.commitHash != commitHash) { + || current.commitHash != commitHash + ) { database.versionChangeDao.insert( VersionChange( - timestamp = System.currentTimeMillis(), - versionCode = versionCode, - versionName = versionName, - gitRemote = gitRemote, - commitHash = commitHash - ) + timestamp = System.currentTimeMillis(), + versionCode = versionCode, + versionName = versionName, + gitRemote = gitRemote, + commitHash = commitHash + ) ) } } diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index 6bbecb45a1..a0a093706d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -1,6 +1,5 @@ package info.nightscout.implementation -import app.aaps.core.main.events.EventNewNotification import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Constants @@ -17,11 +16,12 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.core.main.events.EventNewNotification +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt index e968f7a350..3d83c7cc83 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt @@ -2,13 +2,13 @@ package info.nightscout.implementation import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.Translator +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.Reusable -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import javax.inject.Inject @Reusable diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt index 7a7df0088a..7e99e1fba9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt @@ -5,7 +5,7 @@ import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.T import app.aaps.core.interfaces.utils.TrendCalculator -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt index 0395aa5a22..83eedf6647 100644 --- a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt @@ -7,11 +7,11 @@ import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.userEntry.UserEntryMapper import app.aaps.core.interfaces.userEntry.ValueWithUnitMapper import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.Reusable -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.UserEntryTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt index 892214743b..d0cf4fefab 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt +++ b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt @@ -17,19 +17,19 @@ import app.aaps.core.interfaces.rx.events.EventTempTargetChange import app.aaps.core.interfaces.rx.events.EventTherapyEventChange import app.aaps.core.interfaces.rx.events.EventTreatmentChange import app.aaps.core.interfaces.ui.UiInteraction -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import io.reactivex.rxjava3.disposables.Disposable import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt index 44916ebe3b..bcd9739154 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt @@ -5,15 +5,15 @@ import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry import dagger.Reusable import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction diff --git a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt b/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt index 6857b482bb..8b4c40d9c7 100644 --- a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt @@ -4,20 +4,6 @@ import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorInt import androidx.annotation.DrawableRes -import app.aaps.core.main.R -import app.aaps.core.main.extensions.convertedToPercent -import app.aaps.core.main.extensions.isInProgress -import app.aaps.core.main.extensions.toStringFull -import app.aaps.core.main.extensions.toStringShort -import app.aaps.core.main.extensions.valueToUnits -import app.aaps.core.main.graph.OverviewData -import app.aaps.core.main.graph.data.DataPointWithLabelInterface -import app.aaps.core.main.graph.data.DeviationDataPoint -import app.aaps.core.main.graph.data.FixedLineGraphSeries -import app.aaps.core.main.graph.data.PointsWithLabelGraphSeries -import app.aaps.core.main.graph.data.Scale -import app.aaps.core.main.graph.data.ScaledDataPoint -import app.aaps.core.main.iob.round import app.aaps.core.interfaces.aps.AutosensData import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.CobInfo @@ -33,12 +19,26 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.R +import app.aaps.core.main.extensions.convertedToPercent +import app.aaps.core.main.extensions.isInProgress +import app.aaps.core.main.extensions.toStringFull +import app.aaps.core.main.extensions.toStringShort +import app.aaps.core.main.extensions.valueToUnits +import app.aaps.core.main.graph.OverviewData +import app.aaps.core.main.graph.data.DataPointWithLabelInterface +import app.aaps.core.main.graph.data.DeviationDataPoint +import app.aaps.core.main.graph.data.FixedLineGraphSeries +import app.aaps.core.main.graph.data.PointsWithLabelGraphSeries +import app.aaps.core.main.graph.data.Scale +import app.aaps.core.main.graph.data.ScaledDataPoint +import app.aaps.core.main.iob.round +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TemporaryTarget import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.AppRepository import java.util.Calendar import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt index 8cfe7fddae..f8070ab999 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt @@ -1,8 +1,5 @@ package info.nightscout.implementation.profile -import app.aaps.core.main.extensions.fromConstant -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.logging.AAPSLogger @@ -20,8 +17,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.T -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.core.main.extensions.fromConstant +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.ProfileSwitch import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 22e3fbbf09..974e4ab88f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,9 +1,5 @@ package info.nightscout.implementation.pump -import app.aaps.core.main.events.EventNewNotification -import app.aaps.core.main.pump.fromDbPumpType -import app.aaps.core.main.pump.toDbPumpType -import app.aaps.core.main.pump.toDbSource import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.logging.UserEntryLogger @@ -19,16 +15,20 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.core.main.events.EventNewNotification +import app.aaps.core.main.pump.fromDbPumpType +import app.aaps.core.main.pump.toDbPumpType +import app.aaps.core.main.pump.toDbSource +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertBolusWithTempIdTransaction import info.nightscout.database.impl.transactions.InsertIfNewByTimestampCarbsTransaction @@ -513,5 +513,4 @@ class PumpSyncImplementation @Inject constructor( return result.inserted.size > 0 } } - } \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt index 2fd10ab928..469e9f4504 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.pump import android.widget.TextView -import app.aaps.core.main.extensions.isOlderThan import app.aaps.core.interfaces.pump.WarnColors import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.TherapyEvent +import app.aaps.core.main.extensions.isOlderThan +import app.aaps.database.entities.TherapyEvent import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 417a492818..ac0fdacc9f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -44,11 +44,11 @@ import app.aaps.core.main.extensions.getCustomizedName import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.utils.HtmlHelper +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.interfaces.end import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index 22ed44b5fa..3dc7688039 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -10,8 +10,8 @@ import app.aaps.core.interfaces.queue.Command import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt index 0f5704d1df..1455634531 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt @@ -19,10 +19,10 @@ import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.interfaces.utils.T -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt index 8a4ebdf164..6b97d2056b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt @@ -7,7 +7,7 @@ import android.widget.TableRow import android.widget.TextView import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.TotalDailyDose +import app.aaps.database.entities.TotalDailyDose import info.nightscout.implementation.R val TotalDailyDose.total diff --git a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt index f76292c46a..09f4be2d0b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt @@ -11,12 +11,12 @@ import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.Translator import app.aaps.core.main.R import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.ColorGroup +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.Reusable -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.ColorGroup -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import javax.inject.Inject @Reusable diff --git a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt b/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt index cdf17940f3..4620e4560d 100644 --- a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.iob -import app.aaps.core.main.iob.asRounded -import app.aaps.core.main.iob.log import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.GlucoseStatus import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.iob.IobCobCalculator import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.iob.asRounded +import app.aaps.core.main.iob.log +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.GlucoseValue import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt index dcd5213978..9754b90432 100644 --- a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt @@ -5,10 +5,10 @@ import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.interfaces.profile.DefaultValueHelper import app.aaps.core.interfaces.utils.T +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.BeforeEach diff --git a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt index bcc23cb00f..3900f4c8dd 100644 --- a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt @@ -3,9 +3,9 @@ package info.nightscout.implementation.profile import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.GlucoseValue import info.nightscout.implementation.utils.DecimalFormatterImpl import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 3ce1d1c710..3ca25cffc6 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -3,8 +3,6 @@ package info.nightscout.implementation.queue import android.content.Context import android.os.Handler import android.os.PowerManager -import app.aaps.core.main.constraints.ConstraintObject -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.constraints.ConstraintsChecker @@ -25,13 +23,15 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus import app.aaps.shared.tests.TestBaseWithProfile import app.aaps.shared.tests.TestPumpPlugin import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCustomCommand diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt index 057cf65077..2a7fc50211 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt @@ -19,8 +19,8 @@ import app.aaps.core.main.extensions.convertedToAbsolute import app.aaps.core.main.extensions.convertedToPercent import app.aaps.core.ui.R import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.GlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt index ca2969cade..365182e60f 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt @@ -13,13 +13,6 @@ import android.os.HandlerThread import android.os.SystemClock import androidx.core.app.NotificationCompat import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.constraints.ConstraintObject -import app.aaps.core.main.events.EventNewNotification -import app.aaps.core.main.extensions.convertedToAbsolute -import app.aaps.core.main.extensions.convertedToPercent -import app.aaps.core.main.extensions.plannedRemainingMinutes -import app.aaps.core.main.iob.json -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.APSResult import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.aps.Loop @@ -62,20 +55,27 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.core.main.events.EventNewNotification +import app.aaps.core.main.extensions.convertedToAbsolute +import app.aaps.core.main.extensions.convertedToPercent +import app.aaps.core.main.extensions.plannedRemainingMinutes +import app.aaps.core.main.iob.json +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.nssdk.interfaces.RunningConfiguration +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.plugins.aps.loop.extensions.json -import app.aaps.core.nssdk.interfaces.RunningConfiguration import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 492a591c20..5a81ba714e 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -29,8 +29,8 @@ import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.main.extensions.target import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.utils.MidnightUtils +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.aps.OpenAPSFragment import info.nightscout.plugins.aps.R diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index d2b544ad66..113bd10f5b 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -32,8 +32,8 @@ import app.aaps.core.interfaces.utils.Round import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.main.extensions.target import app.aaps.core.utils.MidnightUtils +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.events.EventResetOpenAPSGui diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 177c0932c7..158e262a3d 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -17,8 +17,6 @@ import android.widget.ArrayAdapter import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.extensions.runOnUiThread @@ -39,12 +37,14 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.interfaces.utils.Round import app.aaps.core.interfaces.utils.SafeParse -import dagger.android.HasAndroidInjector -import dagger.android.support.DaggerFragment +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.elements.WeekDay -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import dagger.android.HasAndroidInjector +import dagger.android.support.DaggerFragment import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.databinding.AutotuneFragmentBinding import info.nightscout.plugins.general.autotune.data.ATProfile diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index 4f2836dc14..23f9dc7ea8 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -17,13 +17,13 @@ import app.aaps.core.main.extensions.toJson import app.aaps.core.main.extensions.toTemporaryBasal import app.aaps.core.main.iob.round import app.aaps.core.utils.MidnightUtils -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin @@ -327,7 +327,7 @@ open class AutotuneIob @Inject constructor( fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() - .put("eventType", if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else info.nightscout.database.entities.TherapyEvent.Type.MEAL_BOLUS.text) + .put("eventType", if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else TherapyEvent.Type.MEAL_BOLUS.text) .put("insulin", amount) .put("created_at", dateUtil.toISOString(timestamp)) .put("date", timestamp) @@ -404,7 +404,7 @@ open class AutotuneIob @Inject constructor( JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.TEMPORARY_BASAL.text) + .put("eventType", TherapyEvent.Type.TEMPORARY_BASAL.text) .put("isValid", isValid) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) // rounded duration leads to different basal IOB @@ -431,7 +431,7 @@ open class AutotuneIob @Inject constructor( JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.COMBO_BOLUS.text) + .put("eventType", TherapyEvent.Type.COMBO_BOLUS.text) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) .put("splitNow", 0) @@ -450,7 +450,7 @@ open class AutotuneIob @Inject constructor( fun Carbs.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() - .put("eventType", if (amount < 12) info.nightscout.database.entities.TherapyEvent.Type.CARBS_CORRECTION.text else info.nightscout.database.entities.TherapyEvent.Type.MEAL_BOLUS.text) + .put("eventType", if (amount < 12) TherapyEvent.Type.CARBS_CORRECTION.text else TherapyEvent.Type.MEAL_BOLUS.text) .put("carbs", amount) .put("notes", notes) .put("created_at", dateUtil.toISOString(timestamp)) diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 02324e0f88..2de1ec425b 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -27,9 +27,9 @@ import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.ui.elements.WeekDay import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.plugins.aps.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt index a0bea8c636..17453b6dbe 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt @@ -5,9 +5,9 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.interfaces.utils.Round import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.GlucoseValue import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.BGDatum import info.nightscout.plugins.general.autotune.data.CRDatum diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index a929ce73cb..de8165fc62 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -22,8 +22,8 @@ import app.aaps.core.main.extensions.blockValueBySeconds import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.MidnightUtils +import app.aaps.database.entities.data.Block import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.data.Block import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt index 96c764fa8a..19781f3500 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.general.autotune.data import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.GlucoseValue.TrendArrow +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue.TrendArrow import org.json.JSONException import org.json.JSONObject import java.util.TimeZone diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt index 2036306de8..dbaf58f3b7 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.general.autotune.data import app.aaps.core.interfaces.iob.Iob -import info.nightscout.database.entities.Bolus +import app.aaps.database.entities.Bolus import kotlin.math.exp import kotlin.math.pow diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index a8855e6364..bf732a3f1a 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -6,10 +6,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose import org.json.JSONArray diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 3bf5eda939..012fed9ea2 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -11,13 +11,13 @@ import app.aaps.core.interfaces.utils.T import app.aaps.core.main.extensions.shiftBlock import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.data.TargetBlock import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.data.TargetBlock import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.general.autotune.data.PreppedGlucose import org.json.JSONArray diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index 069d36ca8c..ed55e8c554 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -34,6 +34,8 @@ import app.aaps.core.ui.dragHelpers.ItemTouchHelperAdapter import app.aaps.core.ui.dragHelpers.OnStartDragListener import app.aaps.core.ui.dragHelpers.SimpleItemTouchHelperCallback import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.automation.databinding.AutomationEventItemBinding @@ -42,8 +44,6 @@ import info.nightscout.automation.dialogs.EditEventDialog import info.nightscout.automation.events.EventAutomationDataChanged import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt index 17b28ecec0..b96a8894d2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt @@ -12,15 +12,15 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.extensions.fromConstant import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index bc4c7f6736..4469cf7c4a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -11,10 +11,10 @@ import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources import dagger.android.HasAndroidInjector import info.nightscout.automation.R -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources import javax.inject.Inject class ActionLoopDisable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index b312859874..e7e21128b9 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -10,10 +10,10 @@ import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources import dagger.android.HasAndroidInjector import info.nightscout.automation.R -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources import javax.inject.Inject class ActionLoopEnable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index a769d7960a..a040b86f87 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -10,10 +10,10 @@ import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources import dagger.android.HasAndroidInjector import info.nightscout.automation.R -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt index fe4de6d8f5..fd1b437c82 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt @@ -9,14 +9,14 @@ import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt index 8ae5968095..882e583c63 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt @@ -10,14 +10,14 @@ import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt index 61357b3326..a6f91abdb3 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt @@ -8,6 +8,9 @@ import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator @@ -16,9 +19,6 @@ import info.nightscout.automation.elements.InputPercent import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.triggers.TriggerProfilePercent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index 0d86a1468e..1d0ea2f846 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -15,6 +15,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.extensions.friendlyDescription import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.JsonHelper.safeGetDouble +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists @@ -23,10 +27,6 @@ import info.nightscout.automation.elements.InputTempTarget import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.triggers.TriggerTempTarget -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt index 485efcc5e4..8e520b226d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt @@ -5,10 +5,10 @@ import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Sources import dagger.android.HasAndroidInjector import info.nightscout.automation.R -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt index 3ccff61d94..9efd5e198c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt @@ -9,7 +9,7 @@ import android.widget.Spinner import androidx.annotation.DrawableRes import androidx.annotation.StringRes import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent class InputCarePortalMenu(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt index 5431c86565..7d3b244747 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt @@ -4,6 +4,8 @@ import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.JsonHelper.safeGetString +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -12,8 +14,6 @@ import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus import org.json.JSONObject class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt index 0ee60d9f3e..71dd6429cc 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt @@ -3,13 +3,13 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper +import app.aaps.database.ValueWrapper import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel -import info.nightscout.database.ValueWrapper import org.json.JSONObject class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt index 1de5632db2..6ef316e9d4 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt @@ -4,6 +4,7 @@ import android.widget.LinearLayout import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper +import app.aaps.database.ValueWrapper import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -12,7 +13,6 @@ import info.nightscout.automation.elements.InputBg import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel -import info.nightscout.database.ValueWrapper import org.json.JSONObject class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt index c1066931b2..2c474b06af 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions import app.aaps.core.interfaces.queue.Callback +import app.aaps.database.entities.TemporaryTarget import info.nightscout.automation.R -import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.Transaction import io.reactivex.rxjava3.core.Single diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt index e1d09111de..e7d67035fa 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt @@ -2,10 +2,10 @@ package info.nightscout.automation.actions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.queue.Callback +import app.aaps.database.entities.TemporaryTarget import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputTempTarget -import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.database.impl.transactions.Transaction import io.reactivex.rxjava3.core.Single diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt index 15b92cdca6..61dc90ee9d 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions import app.aaps.core.interfaces.queue.Callback +import app.aaps.database.entities.TemporaryTarget import info.nightscout.automation.R -import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.Transaction import io.reactivex.rxjava3.core.Single diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index eeee78aa85..30b009e32c 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -1,6 +1,5 @@ package info.nightscout.automation.actions -import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.ConfigBuilder import app.aaps.core.interfaces.constraints.Constraint @@ -16,11 +15,12 @@ import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.database.entities.OfflineEvent import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.automation.triggers.Trigger -import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.impl.AppRepository import org.junit.jupiter.api.BeforeEach import org.mockito.Mock diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt index 6ee04b562e..12e7e67b21 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt @@ -2,9 +2,9 @@ package info.nightscout.automation.triggers import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.InMemoryGlucoseValue +import app.aaps.database.entities.GlucoseValue import com.google.common.base.Optional import info.nightscout.automation.elements.Comparator -import info.nightscout.database.entities.GlucoseValue import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt index 2e3c09f82b..d7f15e2684 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus import com.google.common.base.Optional import info.nightscout.automation.elements.Comparator -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus import io.reactivex.rxjava3.core.Single import org.json.JSONException import org.json.JSONObject diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt index 8c056aee44..2178b47397 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt @@ -2,11 +2,11 @@ package info.nightscout.automation.triggers import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.InMemoryGlucoseValue +import app.aaps.database.entities.GlucoseValue import com.google.common.truth.Truth.assertThat import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDelta.DeltaType -import info.nightscout.database.entities.GlucoseValue import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerHeartRateTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerHeartRateTest.kt index f01384b12a..0a34264a2a 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerHeartRateTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerHeartRateTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.triggers +import app.aaps.database.entities.HeartRate import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator -import info.nightscout.database.entities.HeartRate import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.jupiter.api.Assertions diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt index c0acc86840..f2cf81bc85 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt @@ -1,11 +1,11 @@ package info.nightscout.automation.triggers import app.aaps.core.interfaces.db.GlucoseUnit +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.TemporaryTarget import com.google.common.base.Optional import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.TemporaryTarget import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.jupiter.api.Assertions diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt index 9d1280e732..64a4be1670 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt @@ -41,11 +41,11 @@ import app.aaps.core.interfaces.smoothing.Smoothing import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.ui.UiInteraction -import dagger.android.HasAndroidInjector import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import dagger.android.HasAndroidInjector import java.security.InvalidParameterException import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt index d634257d93..2ab11b3515 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt @@ -27,7 +27,6 @@ import app.aaps.configuration.maintenance.data.PrefsFormat import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.configuration.maintenance.dialogs.PrefImportSummaryDialog import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.db.PersistenceLayer @@ -54,14 +53,15 @@ import app.aaps.core.interfaces.userEntry.UserEntryPresentationHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.interfaces.utils.T -import dagger.android.HasAndroidInjector +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.dialogs.TwoMessagesAlertDialog import app.aaps.core.ui.dialogs.WarningDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.HasAndroidInjector import kotlinx.coroutines.Dispatchers import java.io.File import java.io.FileNotFoundException diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt index ab762e9bc2..c86042b276 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt @@ -32,9 +32,9 @@ import app.aaps.core.main.graph.OverviewData import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources import dagger.android.support.DaggerFragment -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt index 8832e63116..2ff18f015c 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt @@ -29,10 +29,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import dagger.android.support.DaggerFragment -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.databinding.ObjectivesFragmentBinding import info.nightscout.plugins.constraints.databinding.ObjectivesItemBinding diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt index c8bb09cafb..e487400646 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt @@ -7,8 +7,8 @@ import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.plugin.PluginBase import app.aaps.core.interfaces.pump.VirtualPump import app.aaps.core.interfaces.sync.Tidepool +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import info.nightscout.plugins.constraints.R import javax.inject.Inject diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index a3e0857d43..5d1b1fba89 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -1,7 +1,5 @@ package info.nightscout.plugins.constraints.bgQualityCheck -import app.aaps.core.main.constraints.ConstraintObject -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.bgQualityCheck.BgQualityCheck import app.aaps.core.interfaces.iob.InMemoryGlucoseValue @@ -10,11 +8,13 @@ import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.plugins.constraints.R import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt index 066c677b82..776e9d5f66 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt @@ -14,9 +14,9 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.T +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.embedments.InsulinConfiguration import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InsulinConfiguration import kotlin.math.exp import kotlin.math.pow diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt index 17898c8f4a..95f1785189 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt @@ -9,10 +9,10 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.HardLimits +import app.aaps.database.entities.Bolus import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.Bolus import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt index 1990619dbf..326378da3f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt @@ -7,9 +7,6 @@ import android.view.View import android.view.ViewGroup import android.widget.LinearLayout import androidx.core.content.ContextCompat -import app.aaps.core.main.extensions.toStringMedium -import app.aaps.core.main.extensions.toStringShort -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility @@ -34,13 +31,16 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.toStringMedium +import app.aaps.core.main.extensions.toStringShort +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.UIRunnable import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.elements.SingleClickButton -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ActionsFragmentBinding diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt index b0329c6b14..278e7eca7c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt @@ -29,4 +29,4 @@ class ActionsPlugin @Inject constructor( .shortName(R.string.actions_shortname) .description(R.string.description_actions), aapsLogger, rh, injector -), app.aaps.core.interfaces.actions.Actions +), Actions diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt index b88d16144a..0f74cfc83e 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt @@ -11,7 +11,6 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -22,12 +21,13 @@ import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventFoodDatabaseChanged import app.aaps.core.interfaces.ui.UiInteraction -import dagger.android.support.DaggerFragment +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.UIRunnable import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.Food +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateFoodTransaction import info.nightscout.plugins.R diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt index 9586511d95..7905c1e49f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt @@ -88,12 +88,12 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.elements.SingleClickButton import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.interfaces.end import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.R import info.nightscout.plugins.databinding.OverviewFragmentBinding diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt index f51ce907f9..cbf955a81c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt @@ -15,8 +15,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.R import java.util.concurrent.TimeUnit diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 9f47171c50..ac9084b278 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -53,13 +53,13 @@ import app.aaps.core.main.iob.round import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage -import dagger.android.HasAndroidInjector import app.aaps.core.validators.ValidatingEditTextPreference -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index 1b15bb5c58..7c8f20f3a6 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -10,17 +10,17 @@ import android.text.Editable import android.text.TextWatcher import android.view.View import android.view.WindowManager -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator -import com.google.common.primitives.Ints.min -import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import com.google.common.primitives.Ints.min +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt index b1bcdcee15..f7e6dec4a1 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -2,17 +2,6 @@ package info.nightscout.plugins.general.wear.wearintegration import android.app.NotificationManager import android.content.Context -import app.aaps.core.main.constraints.ConstraintObject -import app.aaps.core.main.extensions.convertedToAbsolute -import app.aaps.core.main.extensions.toStringShort -import app.aaps.core.main.extensions.valueToUnits -import app.aaps.core.main.graph.data.GlucoseValueDataPoint -import app.aaps.core.main.iob.generateCOBString -import app.aaps.core.main.iob.round -import app.aaps.core.main.utils.fabric.FabricPrivacy -import app.aaps.core.main.wizard.BolusWizard -import app.aaps.core.main.wizard.QuickWizard -import app.aaps.core.main.wizard.QuickWizardEntry import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Constants @@ -50,19 +39,30 @@ import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.T import app.aaps.core.interfaces.utils.TrendCalculator -import dagger.android.HasAndroidInjector +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.core.main.extensions.convertedToAbsolute +import app.aaps.core.main.extensions.toStringShort +import app.aaps.core.main.extensions.valueToUnits +import app.aaps.core.main.graph.data.GlucoseValueDataPoint +import app.aaps.core.main.iob.generateCOBString +import app.aaps.core.main.iob.round +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.main.wizard.BolusWizard +import app.aaps.core.main.wizard.QuickWizard +import app.aaps.core.main.wizard.QuickWizardEntry import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.HeartRate -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.HeartRate +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TotalDailyDose +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.interfaces.end +import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction diff --git a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 0c4d0e0c09..fcab7c6a2f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -2,17 +2,6 @@ package info.nightscout.plugins.iob.iobCobCalculator import androidx.collection.LongSparseArray import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.extensions.convertedToAbsolute -import app.aaps.core.main.extensions.iobCalc -import app.aaps.core.main.extensions.toTemporaryBasal -import app.aaps.core.main.graph.OverviewData -import app.aaps.core.main.iob.combine -import app.aaps.core.main.iob.copy -import app.aaps.core.main.iob.determineBasalJson -import app.aaps.core.main.iob.plus -import app.aaps.core.main.iob.round -import app.aaps.core.main.utils.fabric.FabricPrivacy -import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.interfaces.aps.AutosensData import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.AutosensResult @@ -44,12 +33,23 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.extensions.convertedToAbsolute +import app.aaps.core.main.extensions.iobCalc +import app.aaps.core.main.extensions.toTemporaryBasal +import app.aaps.core.main.graph.OverviewData +import app.aaps.core.main.iob.combine +import app.aaps.core.main.iob.copy +import app.aaps.core.main.iob.determineBasalJson +import app.aaps.core.main.iob.plus +import app.aaps.core.main.iob.round +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.main.workflow.CalculationWorkflow +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.interfaces.end import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.R import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt index 09785f53c1..1b3e9afa44 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt @@ -10,7 +10,7 @@ import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue import kotlin.math.abs import kotlin.math.roundToLong diff --git a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index 383cafc230..5ed55c7308 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -8,8 +8,6 @@ import android.view.View import android.view.ViewGroup import android.widget.AdapterView import android.widget.ArrayAdapter -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger @@ -28,11 +26,13 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.SafeParse +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.ui.dialogs.OKDialog +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment -import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ProfileFragmentBinding import info.nightscout.plugins.profile.ui.TimeListEdit diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt index 15a0b8e9be..04f3046745 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt @@ -1,13 +1,13 @@ package info.nightscout.core.extensions -import app.aaps.core.main.extensions.iobCalc import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.extensions.iobCalc +import app.aaps.database.entities.Bolus import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.Bolus import info.nightscout.insulin.InsulinLyumjevPlugin import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt index e540b3ddfe..e8ee8f4d6e 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt @@ -1,18 +1,18 @@ package info.nightscout.core.extensions -import app.aaps.core.main.extensions.iobCalc -import app.aaps.core.main.extensions.isInProgress -import app.aaps.core.main.extensions.toTemporaryBasal import app.aaps.core.interfaces.aps.AutosensResult import app.aaps.core.interfaces.aps.SMBDefaults import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.extensions.iobCalc +import app.aaps.core.main.extensions.isInProgress +import app.aaps.core.main.extensions.toTemporaryBasal +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal import info.nightscout.insulin.InsulinLyumjevPlugin import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt index 5893da9e54..302287225c 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt @@ -1,13 +1,13 @@ package info.nightscout.core.extensions +import app.aaps.core.interfaces.db.GlucoseUnit +import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.core.main.R import app.aaps.core.main.extensions.directionToIcon import app.aaps.core.main.extensions.valueToUnits -import app.aaps.core.interfaces.db.GlucoseUnit -import app.aaps.core.interfaces.iob.InMemoryGlucoseValue +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.GlucoseValue import org.junit.jupiter.api.Test class GlucoseValueExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt index 774d7713f6..a8fe630f3b 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt @@ -1,15 +1,15 @@ package info.nightscout.core.extensions -import app.aaps.core.main.extensions.iobCalc import app.aaps.core.interfaces.aps.AutosensResult import app.aaps.core.interfaces.aps.SMBDefaults import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.extensions.iobCalc +import app.aaps.database.entities.TemporaryBasal import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TemporaryBasal import info.nightscout.insulin.InsulinLyumjevPlugin import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt index 1fd5a5b7dc..7623f52ea9 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt @@ -1,12 +1,12 @@ package info.nightscout.core.extensions +import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.main.extensions.highValueToUnitsToString import app.aaps.core.main.extensions.lowValueToUnitsToString import app.aaps.core.main.extensions.target -import app.aaps.core.interfaces.db.GlucoseUnit +import app.aaps.database.entities.TemporaryTarget import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TemporaryTarget import org.junit.jupiter.api.Test class TemporaryTargetExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt index ee8e905e0c..6b68ff6ee9 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.core.extensions -import app.aaps.core.main.extensions.isOlderThan import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.extensions.isOlderThan +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs import org.junit.jupiter.api.Test import org.mockito.Mockito diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index 21f9e00e8c..a77bdfcff1 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -1,7 +1,6 @@ package info.nightscout.plugins.general.smsCommunicator import android.telephony.SmsManager -import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.Loop @@ -20,11 +19,12 @@ import app.aaps.core.interfaces.smsCommunicator.Sms import app.aaps.core.interfaces.sync.XDripBroadcast import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction diff --git a/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt index fdc205bad1..9488a44957 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt @@ -8,12 +8,12 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.database.entities.GlucoseValue import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject import org.junit.jupiter.api.BeforeEach diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt index b683c2bdaa..0dff696855 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt @@ -15,8 +15,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils import app.aaps.core.utils.Percentile +import app.aaps.database.entities.TherapyEvent import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt index 53e5e66190..640bc4976e 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt @@ -18,8 +18,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils import app.aaps.core.utils.Percentile +import app.aaps.database.entities.TherapyEvent import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt index c5e1706617..3f303056f6 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -15,8 +15,8 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils +import app.aaps.database.entities.TherapyEvent import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt index 1627b61317..dddbf7b901 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt @@ -1,7 +1,7 @@ package info.nightscout.sensitivity.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.ProfileSwitch +import app.aaps.database.entities.ProfileSwitch fun List.isPSEvent5minBack(time: Long): Boolean { for (event in this) { diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt index d12d3e75c0..dc2af0a6b4 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt @@ -1,7 +1,7 @@ package info.nightscout.sensitivity.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent fun List.isTherapyEventEvent5minBack(time: Long): Boolean { for (event in this) { diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt b/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt index 9cd4f53a48..136ff5012c 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt @@ -10,8 +10,8 @@ import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.smoothing.Smoothing import app.aaps.core.interfaces.utils.T +import app.aaps.database.entities.GlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt b/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt index d7a95dc76d..53aebb3394 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.plugin.PluginDescription import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.smoothing.Smoothing +import app.aaps.database.entities.GlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max diff --git a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt index 9a60436d48..96bf398456 100644 --- a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt @@ -15,11 +15,11 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt b/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt index 5ada3bc9eb..4996c20ae8 100644 --- a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt +++ b/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt @@ -13,9 +13,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.directionToIcon -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.extensions.toVisibilityKeepSpace import app.aaps.core.interfaces.logging.AAPSLogger @@ -31,12 +28,15 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNewBG import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.directionToIcon +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.source.databinding.SourceFragmentBinding diff --git a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt index 1c17d2d400..18743f2071 100644 --- a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt @@ -23,17 +23,17 @@ import app.aaps.core.interfaces.utils.T import app.aaps.core.main.extensions.fromConstant import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.transactions.TransactionGlucoseValue import app.aaps.shared.impl.extensions.safeGetInstalledPackages import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import info.nightscout.source.activities.RequestDexcomPermissionActivity import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt index 0c10879fe0..2533bba486 100644 --- a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt @@ -13,13 +13,13 @@ import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import java.util.Arrays import javax.inject.Inject diff --git a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt index 90199aa6fb..b483243991 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt @@ -4,7 +4,6 @@ import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.PluginBase @@ -12,11 +11,12 @@ import app.aaps.core.interfaces.plugin.PluginDescription import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt index cd225ee60b..55dfd52cc4 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt @@ -4,7 +4,6 @@ import android.content.Context import android.net.Uri import android.os.Handler import android.os.HandlerThread -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -17,14 +16,15 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt index 1c0b834266..ac84ef3f74 100644 --- a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt @@ -6,7 +6,6 @@ import android.net.Uri import android.os.Handler import android.os.HandlerThread import android.util.Log -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -19,15 +18,16 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.transactions.TransactionGlucoseValue import app.aaps.shared.impl.extensions.safeGetInstalledPackages import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt index 75acc88bc4..d33baafc5e 100644 --- a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt @@ -3,7 +3,6 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.PluginBase @@ -12,11 +11,12 @@ import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import org.json.JSONArray import org.json.JSONException diff --git a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt index 3e97e5177e..84c8290063 100644 --- a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.source.NSClientSource +import app.aaps.database.entities.GlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt index c582c5dfd6..49f18097fb 100644 --- a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt @@ -14,11 +14,11 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.JsonHelper.safeGetString +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import org.json.JSONArray import org.json.JSONException diff --git a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt index 15873828ed..2611862eef 100644 --- a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt @@ -14,11 +14,11 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.isRunningTest +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.security.SecureRandom diff --git a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt index b95b09640d..fadcaff381 100644 --- a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt @@ -3,7 +3,6 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.PluginBase @@ -12,11 +11,12 @@ import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.BgSource +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt index e9bccf1e69..9e5a093c63 100644 --- a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt @@ -14,11 +14,11 @@ import app.aaps.core.interfaces.source.BgSource import app.aaps.core.interfaces.source.XDripSource import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 21a83fa2da..90aff1265f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -33,8 +33,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry import dagger.android.support.DaggerFragment -import info.nightscout.database.entities.UserEntry import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.databinding.NsClientFragmentBinding import info.nightscout.plugins.sync.databinding.NsClientLogItemBinding diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt index a5a77d7860..e38bcbbbfe 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt @@ -31,9 +31,9 @@ import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryTarget import app.aaps.core.nssdk.localmodel.treatment.NSTherapyEvent import app.aaps.core.nssdk.localmodel.treatment.NSTreatment import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.transactions.TransactionGlucoseValue +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.extensions.fromJson import info.nightscout.plugins.sync.nsclientV3.extensions.toBolus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt index 214f616d68..b96409c8fc 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt @@ -15,21 +15,22 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.transactions.TransactionGlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction @@ -67,7 +68,6 @@ import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransac import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction -import info.nightscout.database.transactions.TransactionGlucoseValue import info.nightscout.plugins.sync.R import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt index 3c288262d9..e0d047fd97 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt @@ -18,8 +18,8 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action import info.nightscout.plugins.sync.R import org.json.JSONException import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt index b367132df5..df10cfdd55 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt @@ -3,14 +3,15 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.TherapyEvent import com.google.gson.Gson import com.google.gson.JsonSyntaxException -import info.nightscout.database.entities.BolusCalculatorResult import org.json.JSONObject fun BolusCalculatorResult.toJson(isAdd: Boolean, dateUtil: DateUtil, profileUtil: ProfileUtil): JSONObject = JSONObject() - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.BOLUS_WIZARD.text) + .put("eventType", TherapyEvent.Type.BOLUS_WIZARD.text) .put("created_at", dateUtil.toISOString(timestamp)) .put("isValid", isValid) .put("bolusCalculatorResult", Gson().toJson(this)) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt index 9114a64488..598d88909c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -2,15 +2,16 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() .put( "eventType", - if (type == Bolus.Type.SMB) info.nightscout.database.entities.TherapyEvent.Type.CORRECTION_BOLUS.text else info.nightscout.database.entities.TherapyEvent.Type.MEAL_BOLUS.text + if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else TherapyEvent.Type.MEAL_BOLUS.text ) .put("insulin", amount) .put("created_at", dateUtil.toISOString(timestamp)) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt index 70f5eaac7c..b1ef4b2784 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -2,9 +2,9 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun Carbs.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index 9e2d6c03ea..ec08658c0e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.DeviceStatus +import app.aaps.database.entities.DeviceStatus import org.json.JSONObject fun DeviceStatus.toJson(dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index a45dae1c88..60bdbec5d1 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -5,8 +5,9 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun EffectiveProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = @@ -14,7 +15,7 @@ fun EffectiveProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObjec .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") .put("isValid", isValid) - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.NOTE.text) // move to separate collection when available in NS + .put("eventType", TherapyEvent.Type.NOTE.text) // move to separate collection when available in NS .put("profileJson", ProfileSealed.EPS(this).toPureNsJson(dateUtil).toString()) .put("originalProfileName", originalProfileName) .put("originalCustomizedName", originalCustomizedName) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 658acf231b..6a2b3bb383 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -5,8 +5,9 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.extensions.toTemporaryBasal import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun ExtendedBolus.toJson(isAdd: Boolean, profile: Profile?, dateUtil: DateUtil): JSONObject? = @@ -22,7 +23,7 @@ fun ExtendedBolus.toRealJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.COMBO_BOLUS.text) + .put("eventType", TherapyEvent.Type.COMBO_BOLUS.text) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) .put("splitNow", 0) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt index 0e28d86073..ddbd71fa3a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.Food +import app.aaps.database.entities.Food import org.json.JSONObject fun Food.Companion.fromJson(jsonObject: JSONObject): Food? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index 02294b9a47..d30cedc088 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -3,15 +3,16 @@ package info.nightscout.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun OfflineEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.APS_OFFLINE.text) + .put("eventType", TherapyEvent.Type.APS_OFFLINE.text) .put("isValid", isValid) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index b9e9987fc2..a66fb92dc4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -9,9 +9,9 @@ import app.aaps.core.main.extensions.getCustomizedName import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil, decimalFormatter: DecimalFormatter): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 53d461770a..68b71b9169 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -5,9 +5,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.extensions.convertedToAbsolute import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryBasal.Type.Companion.fromString -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryBasal.Type.Companion.fromString +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import org.json.JSONObject fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile?, dateUtil: DateUtil): JSONObject? = @@ -15,7 +16,7 @@ fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile?, dateUtil: DateUtil) JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.TEMPORARY_BASAL.text) + .put("eventType", TherapyEvent.Type.TEMPORARY_BASAL.text) .put("isValid", isValid) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) // rounded duration leads to different basal IOB diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 2986d346a7..2bb851ff0f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -6,7 +6,8 @@ import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.TemporaryTarget +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent import org.json.JSONObject fun TemporaryTarget.Companion.fromJson(jsonObject: JSONObject, profileUtil: ProfileUtil): TemporaryTarget? { @@ -54,7 +55,7 @@ fun TemporaryTarget.Companion.fromJson(jsonObject: JSONObject, profileUtil: Prof fun TemporaryTarget.toJson(isAdd: Boolean, dateUtil: DateUtil, profileUtil: ProfileUtil): JSONObject = JSONObject() - .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.TEMPORARY_TARGET.text) + .put("eventType", TherapyEvent.Type.TEMPORARY_TARGET.text) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) .put("isValid", isValid) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt index 3104f1f81e..9bc2096318 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -4,7 +4,7 @@ import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.data.NSMbg import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index ee38f8934c..da7438370c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -15,16 +15,16 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.extensions.extendedBolusFromJson diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 844ddc4941..7524ebdd50 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -12,7 +12,6 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.logging.AAPSLogger @@ -48,11 +47,19 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.nssdk.NSAndroidClientImpl +import app.aaps.core.nssdk.interfaces.NSAndroidClient +import app.aaps.core.nssdk.mapper.toNSDeviceStatus +import app.aaps.core.nssdk.mapper.toNSFood +import app.aaps.core.nssdk.mapper.toNSSgvV3 +import app.aaps.core.nssdk.mapper.toNSTreatment +import app.aaps.core.nssdk.remotemodel.LastModified +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.interfaces.TraceableDBEntry import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.interfaces.TraceableDBEntry import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.NSAlarmObject @@ -84,13 +91,6 @@ import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorke import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker -import app.aaps.core.nssdk.NSAndroidClientImpl -import app.aaps.core.nssdk.interfaces.NSAndroidClient -import app.aaps.core.nssdk.mapper.toNSDeviceStatus -import app.aaps.core.nssdk.mapper.toNSFood -import app.aaps.core.nssdk.mapper.toNSSgvV3 -import app.aaps.core.nssdk.mapper.toNSTreatment -import app.aaps.core.nssdk.remotemodel.LastModified import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.Ack diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index 40b2b56a14..a77ad46a4a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import com.google.gson.Gson -import com.google.gson.JsonSyntaxException -import info.nightscout.database.entities.BolusCalculatorResult import app.aaps.core.nssdk.localmodel.entry.NsUnits import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSBolusWizard +import app.aaps.database.entities.BolusCalculatorResult +import com.google.gson.Gson +import com.google.gson.JsonSyntaxException fun NSBolusWizard.toBolusCalculatorResult(): BolusCalculatorResult? = try { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt index 86b9b74060..3a5ac1ee72 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSBolus +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSBolus.toBolus(): Bolus = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index 7ec6824c63..ddb44c4d3f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSCarbs +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSCarbs.toCarbs(): Carbs = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt index 36bb5e7b44..6584001b84 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus +import app.aaps.database.entities.DeviceStatus import com.google.gson.GsonBuilder import com.google.gson.JsonDeserializer -import info.nightscout.database.entities.DeviceStatus -import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus import org.json.JSONObject fun DeviceStatus.toNSDeviceStatus(): NSDeviceStatus { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index a3c5a3ced2..3587d6c516 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.core.main.extensions.pureProfileFromJson -import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.plugins.sync.nsclient.extensions.fromConstant +import app.aaps.core.main.extensions.pureProfileFromJson +import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSEffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.embedments.InterfaceIDs +import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import java.security.InvalidParameterException fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index bc8e43354d..4af49def32 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.core.main.extensions.toTemporaryBasal import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.core.main.extensions.toTemporaryBasal import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSExtendedBolus import app.aaps.core.nssdk.localmodel.treatment.NSTreatment +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSExtendedBolus.toExtendedBolus(): ExtendedBolus = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt index d5ecc06945..1dcdf77506 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.food.NSFood +import app.aaps.database.entities.Food +import app.aaps.database.entities.embedments.InterfaceIDs fun NSFood.toFood(): Food = Food( diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt index d63129351d..694e35907c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.transactions.TransactionGlucoseValue import app.aaps.core.nssdk.localmodel.entry.Direction import app.aaps.core.nssdk.localmodel.entry.NSSgvV3 import app.aaps.core.nssdk.localmodel.entry.NsUnits +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.transactions.TransactionGlucoseValue import java.security.InvalidParameterException fun NSSgvV3.toTransactionGlucoseValue(): TransactionGlucoseValue { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index aa8815a87c..985f260735 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSOfflineEvent +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSOfflineEvent.toOfflineEvent(): OfflineEvent = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index f29274a689..5989402b30 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.core.main.extensions.fromConstant -import app.aaps.core.main.extensions.getCustomizedName -import app.aaps.core.main.extensions.pureProfileFromJson -import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.core.main.extensions.fromConstant +import app.aaps.core.main.extensions.getCustomizedName +import app.aaps.core.main.extensions.pureProfileFromJson +import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSProfileSwitch +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSProfileSwitch.toProfileSwitch(activePlugin: ActivePlugin, dateUtil: DateUtil): ProfileSwitch? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index 68b067b5ed..af33bf2f0c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.core.main.extensions.convertedToAbsolute import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.core.main.extensions.convertedToAbsolute import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryBasal +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSTemporaryBasal.toTemporaryBasal(): TemporaryBasal = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index 5cead33db1..c973a09fa7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.entry.NsUnits import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryTarget +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSTemporaryTarget.toTemporaryTarget(): TemporaryTarget = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index 3790ca3e60..f1549b6369 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.entry.NsUnits import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSTherapyEvent +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs import java.security.InvalidParameterException fun NSTherapyEvent.toTherapyEvent(): TherapyEvent = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt index 769aed7565..3c6f0f93e2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt @@ -27,9 +27,9 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.sync.Sync +import app.aaps.database.entities.data.Block +import app.aaps.database.entities.interfaces.TraceableDBEntry import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.interfaces.TraceableDBEntry import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.openhumans.delegates.OHAppIDDelegate diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt index 61c73eb04a..243db6e182 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt @@ -9,8 +9,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.TemporaryBasal +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.TemporaryBasal import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.tidepool.elements.BasalElement diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt index c9c4392492..50738eec2c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.tidepool.elements -import app.aaps.core.main.extensions.convertedToAbsolute import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.core.main.extensions.convertedToAbsolute +import app.aaps.database.entities.TemporaryBasal import com.google.gson.annotations.Expose -import info.nightscout.database.entities.TemporaryBasal import java.util.UUID class BasalElement(tbr: TemporaryBasal, profile: Profile, dateUtil: DateUtil) : BaseElement(tbr.timestamp, UUID.nameUUIDFromBytes(("AAPS-basal" + tbr.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index f29d29f106..3069c5da98 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.TherapyEvent import com.google.gson.annotations.Expose -import info.nightscout.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import java.util.LinkedList import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt index 84ddfc07a6..6d142c457d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.Bolus import com.google.gson.annotations.Expose -import info.nightscout.database.entities.Bolus import java.util.UUID class BolusElement(bolus: Bolus, dateUtil: DateUtil) : BaseElement(bolus.timestamp, UUID.nameUUIDFromBytes(("AAPS-bolus" + bolus.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt index 51ede83d72..c46b3513a5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.tidepool.elements -import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.database.entities.EffectiveProfileSwitch import com.google.gson.annotations.Expose -import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index db7c6a1de5..5fb5270eac 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.GlucoseValue import com.google.gson.annotations.Expose -import info.nightscout.database.entities.GlucoseValue import java.util.LinkedList import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt index bbe533f54d..1e91e9d70c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.Carbs import com.google.gson.annotations.Expose -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs import java.util.UUID class WizardElement(carbs: Carbs, dateUtil: DateUtil) : BaseElement(carbs.timestamp, UUID.nameUUIDFromBytes(("AAPS-wizard" + carbs.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt index 74ad5d95dd..5ddd00be89 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt @@ -1,7 +1,6 @@ package info.nightscout.plugins.sync.xdrip.extensions - -import info.nightscout.database.entities.GlucoseValue +import app.aaps.database.entities.GlucoseValue import org.json.JSONObject fun GlucoseValue.toXdripJson(): JSONObject = diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt index bc8b885224..97b85f3114 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt @@ -13,13 +13,13 @@ import app.aaps.core.interfaces.profile.DefaultValueHelper import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.receivers.ReceiverStatusStore import app.aaps.core.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.TemporaryBasal import app.aaps.shared.tests.BundleMock import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.TemporaryBasal import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt index 4b6352e376..ef5e5e4116 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt @@ -1,6 +1,5 @@ package info.nightscout.plugins.sync.nsclientV3 -import app.aaps.core.main.extensions.fromConstant import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.nsclient.StoreDataForDb @@ -9,33 +8,34 @@ import app.aaps.core.interfaces.pump.VirtualPump import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.sync.DataSyncSelector import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.core.main.extensions.fromConstant +import app.aaps.core.nssdk.interfaces.NSAndroidClient +import app.aaps.core.nssdk.localmodel.treatment.CreateUpdateResponse +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.DeviceStatus +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.Food +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsShared.StoreDataForDbImpl import info.nightscout.plugins.sync.nsclient.ReceiverDelegate import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler import info.nightscout.plugins.sync.nsclient.extensions.fromConstant -import app.aaps.core.nssdk.interfaces.NSAndroidClient -import app.aaps.core.nssdk.localmodel.treatment.CreateUpdateResponse import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtensionKtTest.kt index 800584fac4..b89c9618bf 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSBolusWizard import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.embedments.InterfaceIDs +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtensionKtTest.kt index 5ac924568a..0c044ebf9c 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtensionKtTest.kt @@ -1,11 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSBolus import app.aaps.core.nssdk.mapper.convertToRemoteAndBack - +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.embedments.InterfaceIDs +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtensionKtTest.kt index a4e3cefdf0..38744a07b1 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSCarbs import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.embedments.InterfaceIDs +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt index aec496d91d..8c7c3d4d41 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt @@ -6,13 +6,13 @@ import app.aaps.core.interfaces.objects.Instantiator import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil -import app.aaps.shared.tests.TestBase -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.DeviceStatus -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl import app.aaps.core.nssdk.interfaces.RunningConfiguration import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.DeviceStatus +import app.aaps.shared.tests.TestBase +import com.google.common.truth.Truth.assertThat +import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt index a05a0ea490..b0f0094cec 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.insulin.Insulin -import app.aaps.shared.tests.TestBaseWithProfile -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import app.aaps.core.nssdk.localmodel.treatment.NSEffectiveProfileSwitch import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.shared.tests.TestBaseWithProfile +import com.google.common.truth.Truth.assertThat +import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtensionKtTest.kt index 9192f46763..472dbe1964 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtensionKtTest.kt @@ -3,12 +3,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import app.aaps.core.nssdk.localmodel.treatment.NSExtendedBolus import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryBasal import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.embedments.InterfaceIDs -import kotlin.test.assertIs import org.junit.jupiter.api.Test +import kotlin.test.assertIs @Suppress("SpellCheckingInspection") internal class ExtendedBolusExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtensionKtTest.kt index d789f9caac..7accc9f5b1 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.Food -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.food.NSFood import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.Food +import app.aaps.database.entities.embedments.InterfaceIDs +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtensionKtTest.kt index 70a7bf1e42..582166346e 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.embedments.InterfaceIDs -import app.aaps.core.nssdk.mapper.convertToRemoteAndBack import org.junit.jupiter.api.Test internal class GlucoseValueExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtensionKtTest.kt index f171e81a8d..51c78de901 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSOfflineEvent import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.embedments.InterfaceIDs +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt index dec3d6993f..5a43779c62 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.core.main.extensions.fromConstant import app.aaps.core.interfaces.insulin.Insulin -import app.aaps.shared.tests.TestBaseWithProfile -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.core.main.extensions.fromConstant import app.aaps.core.nssdk.localmodel.treatment.NSProfileSwitch import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.ProfileSwitch +import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.shared.tests.TestBaseWithProfile +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtensionKtTest.kt index 11e8f6bb40..7ac2797ccc 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.shared.tests.TestBaseWithProfile -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryBasal import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.shared.tests.TestBaseWithProfile +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtensionKtTest.kt index 8e5d88c0df..03fe4900c7 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.shared.tests.TestBaseWithProfile -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSTemporaryTarget import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.shared.tests.TestBaseWithProfile +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtensionKtTest.kt index d943a7d455..b12a6c51c5 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import app.aaps.shared.tests.TestBaseWithProfile -import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.embedments.InterfaceIDs import app.aaps.core.nssdk.localmodel.treatment.NSTherapyEvent import app.aaps.core.nssdk.mapper.convertToRemoteAndBack +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.shared.tests.TestBaseWithProfile +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt index a4af6599e8..c764ac8102 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt @@ -19,12 +19,12 @@ import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.nssdk.remotemodel.LastModified import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.entities.GlucoseValue +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.GlucoseValue -import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.utils.DecimalFormatterImpl import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor diff --git a/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/Pump.kt b/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/Pump.kt index 0e76257bde..d937a8bfed 100644 --- a/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/Pump.kt +++ b/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/Pump.kt @@ -24,6 +24,8 @@ import info.nightscout.comboctl.base.Tbr import info.nightscout.comboctl.base.TransportLayer import info.nightscout.comboctl.base.toStringWithDecimal import info.nightscout.comboctl.base.withFixedYearFrom +import info.nightscout.comboctl.main.Pump.CommandExecutionAttemptsFailedException +import info.nightscout.comboctl.main.Pump.Event import info.nightscout.comboctl.parser.AlertScreenContent import info.nightscout.comboctl.parser.AlertScreenException import info.nightscout.comboctl.parser.BatteryState @@ -228,7 +230,9 @@ class Pump( initialBasalProfile: BasalProfile? = null, private val onEvent: (event: Event) -> Unit = { } ) { + private val pumpIO = PumpIO(pumpStateStore, bluetoothDevice, this::processDisplayFrame, this::packetReceiverExceptionThrown) + // Updated by updateStatusImpl(). true if the Combo // is currently in the stop mode. If true, commands // are not executed, and an exception is thrown instead. @@ -250,6 +254,7 @@ class Pump( // (necessary since the screen may change its contents but still be the same screen). private var rtScreenAlreadyDismissed = false private var seenAlertAfterDismissingCounter = 0 + // Used in handleAlertScreenContent() to check if the current alert // screen contains the same alert as the previous one. private var lastObservedAlertScreenContent: AlertScreenContent? = null @@ -275,12 +280,15 @@ class Pump( // progress range. when (stage) { BasicProgressStage.Finished, - is BasicProgressStage.Aborted -> 1.0 + is BasicProgressStage.Aborted -> 1.0 + is RTCommandProgressStage.SettingTBRPercentage -> 0.0 + stage.settingProgress.toDouble() / 100.0 * 0.5 - is RTCommandProgressStage.SettingTBRDuration -> + + is RTCommandProgressStage.SettingTBRDuration -> 0.5 + stage.settingProgress.toDouble() / 100.0 * 0.5 - else -> 0.0 + + else -> 0.0 } } @@ -297,10 +305,12 @@ class Pump( // so we use that for the overall progress. when (stage) { BasicProgressStage.Finished, - is BasicProgressStage.Aborted -> 1.0 + is BasicProgressStage.Aborted -> 1.0 + is RTCommandProgressStage.DeliveringBolus -> stage.deliveredImmediateAmount.toDouble() / stage.totalImmediateAmount.toDouble() - else -> 0.0 + + else -> 0.0 } } @@ -336,10 +346,12 @@ class Pump( // read, which is suitable for a progress indicator, // so we use that for the overall progress. BasicProgressStage.Finished, - is BasicProgressStage.Aborted -> 1.0 + is BasicProgressStage.Aborted -> 1.0 + is RTCommandProgressStage.FetchingTDDHistory -> stage.historyEntryIndex.toDouble() / stage.totalNumEntries.toDouble() - else -> 0.0 + + else -> 0.0 } } @@ -370,12 +382,13 @@ class Pump( val type: Tbr.Type, val force100Percent: Boolean ) : CommandDescription() + class DeliveringBolusCommandDesc( val totalBolusAmount: Int, val immediateBolusAmount: Int, val durationInMinutes: Int, val standardBolusReason: StandardBolusReason, - val bolusType: ApplicationLayer.CMDDeliverBolusType + val bolusType: CMDDeliverBolusType ) : CommandDescription() /** @@ -422,7 +435,7 @@ class Pump( BolusDeliveryException( totalImmediateAmount, "Bolus cancelled (delivered amount: ${deliveredImmediateAmount.toStringWithDecimal(1)} IU " + - "total programmed amount: ${totalImmediateAmount.toStringWithDecimal(1)} IU" + "total programmed amount: ${totalImmediateAmount.toStringWithDecimal(1)} IU" ) /** @@ -435,7 +448,7 @@ class Pump( BolusDeliveryException( totalImmediateAmount, "Bolus aborted due to an error (delivered amount: ${deliveredImmediateAmount.toStringWithDecimal(1)} IU " + - "total programmed amount: ${totalImmediateAmount.toStringWithDecimal(1)} IU" + "total programmed amount: ${totalImmediateAmount.toStringWithDecimal(1)} IU" ) /** @@ -451,7 +464,7 @@ class Pump( BolusDeliveryException( bolusAmount, "Insufficient insulin in reservoir for bolus: bolus amount: ${bolusAmount.toStringWithDecimal(1)} IU " + - "available units in reservoir: $availableUnitsInReservoir" + "available units in reservoir: $availableUnitsInReservoir" ) /** @@ -471,7 +484,7 @@ class Pump( ) : ComboException( if (actualTbrPercentage != null) "Expected TBR: $expectedTbrPercentage% $expectedTbrDuration minutes ; " + - "actual TBR: $actualTbrPercentage% $actualTbrDuration minutes" + "actual TBR: $actualTbrPercentage% $actualTbrDuration minutes" else if (expectedTbrPercentage == 100) "Did not expect a TBR during active extended/multiwave bolus, observed one" else @@ -484,6 +497,7 @@ class Pump( * A standard bolus may be delivered for various reasons. */ enum class StandardBolusReason { + /** * This is a normal bolus. */ @@ -509,6 +523,7 @@ class Pump( * so for example, "57" means 5.7 IU. */ sealed class Event { + object BatteryLow : Event() object ReservoirLow : Event() data class QuickBolusRequested( @@ -516,11 +531,13 @@ class Pump( val timestamp: Instant, val bolusAmount: Int ) : Event() + data class QuickBolusInfused( val bolusId: Long, val timestamp: Instant, val bolusAmount: Int ) : Event() + data class StandardBolusRequested( val bolusId: Long, val timestamp: Instant, @@ -528,6 +545,7 @@ class Pump( val bolusAmount: Int, val standardBolusReason: StandardBolusReason ) : Event() + data class StandardBolusInfused( val bolusId: Long, val timestamp: Instant, @@ -535,18 +553,21 @@ class Pump( val bolusAmount: Int, val standardBolusReason: StandardBolusReason ) : Event() + data class ExtendedBolusStarted( val bolusId: Long, val timestamp: Instant, val totalBolusAmount: Int, val totalDurationMinutes: Int ) : Event() + data class ExtendedBolusEnded( val bolusId: Long, val timestamp: Instant, val totalBolusAmount: Int, val totalDurationMinutes: Int ) : Event() + data class MultiwaveBolusStarted( val bolusId: Long, val timestamp: Instant, @@ -554,6 +575,7 @@ class Pump( val immediateBolusAmount: Int, val totalDurationMinutes: Int ) : Event() + data class MultiwaveBolusEnded( val bolusId: Long, val timestamp: Instant, @@ -561,6 +583,7 @@ class Pump( val immediateBolusAmount: Int, val totalDurationMinutes: Int ) : Event() + data class TbrStarted(val tbr: Tbr) : Event() data class TbrEnded(val tbr: Tbr, val timestampWhenTbrEnded: Instant) : Event() data class UnknownTbrDetected( @@ -594,6 +617,7 @@ class Pump( * Possible states the pump can be in. */ sealed class State { + /** * There is no connection to the pump. This is the initial state. */ @@ -652,11 +676,12 @@ class Pump( * This is meant for logging purposes. */ data class Error(val throwable: Throwable? = null, val message: String? = null) : State() { + override fun toString(): String { return if (throwable != null) - "Error (\"$message\"); throwable: $throwable" - else - "Error (\"$message\")" + "Error (\"$message\"); throwable: $throwable" + else + "Error (\"$message\")" } } } @@ -909,10 +934,12 @@ class Pump( logger(LogLevel.DEBUG) { "Attempt no. $connectionAttemptNr to establish connection" } - connectProgressReporter.setCurrentProgressStage(BasicProgressStage.EstablishingBtConnection( - currentAttemptNr = connectionAttemptNr, - totalNumAttempts = maxNumAttempts - )) + connectProgressReporter.setCurrentProgressStage( + BasicProgressStage.EstablishingBtConnection( + currentAttemptNr = connectionAttemptNr, + totalNumAttempts = maxNumAttempts + ) + ) try { connectInternal() @@ -939,7 +966,8 @@ class Pump( setState(State.Error(throwable = e, "Connection error")) throw e } - else -> Unit + + else -> Unit } if (connectionAttemptNr < actualMaxNumAttempts) { logger(LogLevel.DEBUG) { "Got exception while connecting; will try again; exception was: $e" } @@ -948,7 +976,7 @@ class Pump( } else { logger(LogLevel.ERROR) { "Got exception $e while connecting, and max number of " + - "connection establishing attempts reached; not trying again" + "connection establishing attempts reached; not trying again" } connectProgressReporter.setCurrentProgressStage(BasicProgressStage.Error(e)) setState(State.Error(throwable = e, "Connection error")) @@ -1173,6 +1201,7 @@ class Pump( * [setTbr] throws an exception. */ enum class SetTbrOutcome { + SET_NORMAL_TBR, SET_EMULATED_100_TBR, LETTING_EMULATED_100_TBR_FINISH, @@ -1283,8 +1312,8 @@ class Pump( result = SetTbrOutcome.LETTING_EMULATED_100_TBR_FINISH logger(LogLevel.INFO) { "Current TBR percentage is in the 90-110% range (${currentStatus.tbrPercentage}%)," + - "and it will finish in ${currentStatus.remainingTbrDurationInMinutes} minute(s); " + - "letting it finish and faking a successful TBR set operation" + "and it will finish in ${currentStatus.remainingTbrDurationInMinutes} minute(s); " + + "letting it finish and faking a successful TBR set operation" } } else { val newPercentage = if (currentStatus.tbrPercentage < 100) 110 else 90 @@ -1331,11 +1360,11 @@ class Pump( val mainScreen = waitUntilScreenAppears(rtNavigationContext, ParsedScreen.MainScreen::class) val mainScreenContent = when (mainScreen) { is ParsedScreen.MainScreen -> mainScreen.content - else -> throw NoUsableRTScreenException() + else -> throw NoUsableRTScreenException() } val (actualTbrPercentage, actualTbrDuration) = when (mainScreenContent) { - is MainScreenContent.Stopped -> + is MainScreenContent.Stopped -> // This should never be reached. The Combo can switch to the Stopped // state on its own, but only if an error occurs, and errors are // already caught by ParsedDisplayFrameStream.getParsedDisplayFrame(). @@ -1352,22 +1381,22 @@ class Pump( } } - is MainScreenContent.Normal -> + is MainScreenContent.Normal -> Pair(100, 0) - is MainScreenContent.Tbr -> + is MainScreenContent.Tbr -> Pair(mainScreenContent.tbrPercentage, mainScreenContent.remainingTbrDurationInMinutes) } logger(LogLevel.DEBUG) { "Main screen content after setting TBR: $mainScreenContent; expected TBR " + - "percentage / duration: $expectedTbrPercentage / $expectedTbrDuration" + "percentage / duration: $expectedTbrPercentage / $expectedTbrDuration" } val tbrVisibleOnMainScreen = when (mainScreenContent) { - is MainScreenContent.Tbr -> true + is MainScreenContent.Tbr -> true is MainScreenContent.ExtendedOrMultiwaveBolus -> mainScreenContent.tbrIsActive - else -> false + else -> false } // Verify that the TBR state is OK according to these criteria: @@ -1390,8 +1419,8 @@ class Pump( } else { logger(LogLevel.ERROR) { "Mismatch between expected TBR and actually active TBR; " + - "expected TBR percentage / duration: $expectedTbrPercentage / $expectedTbrDuration; " + - "actual TBR: percentage / remaining duration: $actualTbrPercentage / $actualTbrDuration" + "expected TBR percentage / duration: $expectedTbrPercentage / $expectedTbrDuration; " + + "actual TBR: percentage / remaining duration: $actualTbrPercentage / $actualTbrDuration" } false } @@ -1435,7 +1464,7 @@ class Pump( immediateBolusAmount = 0, durationInMinutes = 0, standardBolusReason = bolusReason, - bolusType = ApplicationLayer.CMDDeliverBolusType.STANDARD_BOLUS, + bolusType = CMDDeliverBolusType.STANDARD_BOLUS, bolusStatusUpdateIntervalInMs = bolusStatusUpdateIntervalInMs ) @@ -1525,7 +1554,7 @@ class Pump( immediateBolusAmount: Int, durationInMinutes: Int, standardBolusReason: StandardBolusReason, - bolusType: ApplicationLayer.CMDDeliverBolusType, + bolusType: CMDDeliverBolusType, bolusStatusUpdateIntervalInMs: Long = 250 ) = executeCommand( // Instruct executeCommand() to not set the mode on its own. @@ -1564,35 +1593,35 @@ class Pump( } when (bolusType) { - CMDDeliverBolusType.STANDARD_BOLUS -> Unit + CMDDeliverBolusType.STANDARD_BOLUS -> Unit - CMDDeliverBolusType.EXTENDED_BOLUS -> + CMDDeliverBolusType.EXTENDED_BOLUS -> require( (durationInMinutes >= 15) && - (durationInMinutes <= 720) && - ((durationInMinutes % 15) == 0) + (durationInMinutes <= 720) && + ((durationInMinutes % 15) == 0) ) { "extended bolus duration must be in the 15-720 range and an integer multiple of 15; " + - "actual duration: $durationInMinutes" + "actual duration: $durationInMinutes" } CMDDeliverBolusType.MULTIWAVE_BOLUS -> { require( (durationInMinutes >= 15) && - (durationInMinutes <= 720) && - ((durationInMinutes % 15) == 0) + (durationInMinutes <= 720) && + ((durationInMinutes % 15) == 0) ) { "multiwave bolus duration must be in the 15-720 range and an integer multiple of 15; " + - "actual duration: $durationInMinutes" + "actual duration: $durationInMinutes" } require(immediateBolusAmount >= 1) { "immediate bolus portion of multiwave bolus must be at least 0.1 IU; actual" + - "amount: ${immediateBolusAmount.toStringWithDecimal(1)}" + "amount: ${immediateBolusAmount.toStringWithDecimal(1)}" } require(immediateBolusAmount < totalBolusAmount) { "immediate bolus duration must be < total bolus amount; actual immediate/total " + - "amount: ${immediateBolusAmount.toStringWithDecimal(1)}" + - " / ${totalBolusAmount.toStringWithDecimal(1)}" + "amount: ${immediateBolusAmount.toStringWithDecimal(1)}" + + " / ${totalBolusAmount.toStringWithDecimal(1)}" } } } @@ -1610,8 +1639,8 @@ class Pump( val roundedBolusIU = (totalBolusAmount + 9) / 10 logger(LogLevel.DEBUG) { "Checking if there is enough insulin in reservoir; reservoir fill level: " + - "${status.availableUnitsInReservoir} IU; bolus amount: ${totalBolusAmount.toStringWithDecimal(1)} IU" + - "(rounded: $roundedBolusIU IU)" + "${status.availableUnitsInReservoir} IU; bolus amount: ${totalBolusAmount.toStringWithDecimal(1)} IU" + + "(rounded: $roundedBolusIU IU)" } if (status.availableUnitsInReservoir < roundedBolusIU) throw InsufficientInsulinAvailableException(totalBolusAmount, status.availableUnitsInReservoir) @@ -1660,9 +1689,10 @@ class Pump( logger(LogLevel.VERBOSE) { "Got current bolus delivery status: $status" } val deliveredAmount = when (status.deliveryState) { - ApplicationLayer.CMDBolusDeliveryState.DELIVERING -> expectedImmediateAmount - status.remainingAmount - ApplicationLayer.CMDBolusDeliveryState.DELIVERED -> expectedImmediateAmount - ApplicationLayer.CMDBolusDeliveryState.CANCELLED_BY_USER -> { + ApplicationLayer.CMDBolusDeliveryState.DELIVERING -> expectedImmediateAmount - status.remainingAmount + ApplicationLayer.CMDBolusDeliveryState.DELIVERED -> expectedImmediateAmount + + ApplicationLayer.CMDBolusDeliveryState.CANCELLED_BY_USER -> { logger(LogLevel.DEBUG) { "Bolus cancelled by user" } throw BolusCancelledByUserException( deliveredImmediateAmount = expectedImmediateAmount - status.remainingAmount, @@ -1678,7 +1708,7 @@ class Pump( ) } - else -> continue + else -> continue } bolusDeliveryProgressReporter.setCurrentProgressStage( @@ -1705,7 +1735,8 @@ class Pump( when (e) { is BolusCancelledByUserException -> bolusDeliveryProgressReporter.setCurrentProgressStage(BasicProgressStage.Cancelled) - else -> + + else -> bolusDeliveryProgressReporter.setCurrentProgressStage(BasicProgressStage.Error(e)) } throw e @@ -1751,9 +1782,9 @@ class Pump( reasonForLastStandardBolusInfusion = standardBolusReason ) { entry -> when (bolusType) { - CMDDeliverBolusType.STANDARD_BOLUS -> + CMDDeliverBolusType.STANDARD_BOLUS -> when (val detail = entry.detail) { - is CMDHistoryEventDetail.StandardBolusInfused -> { + is CMDHistoryEventDetail.StandardBolusInfused -> { numRelevantBolusEntries++ if (numRelevantBolusEntries > 1) unexpectedBolusEntriesDetected = true @@ -1763,13 +1794,13 @@ class Pump( is CMDHistoryEventDetail.StandardBolusRequested -> Unit - else -> { + else -> { if (detail.isBolusDetail) unexpectedBolusEntriesDetected = true } } - CMDDeliverBolusType.EXTENDED_BOLUS -> + CMDDeliverBolusType.EXTENDED_BOLUS -> when (val detail = entry.detail) { is CMDHistoryEventDetail.ExtendedBolusStarted -> { numRelevantBolusEntries++ @@ -1777,7 +1808,7 @@ class Pump( unexpectedBolusEntriesDetected = true } - else -> { + else -> { if (detail.isBolusDetail) unexpectedBolusEntriesDetected = true } @@ -1791,7 +1822,7 @@ class Pump( unexpectedBolusEntriesDetected = true } - else -> { + else -> { if (detail.isBolusDetail) unexpectedBolusEntriesDetected = true } @@ -1918,7 +1949,8 @@ class Pump( val firstTDDScreen = navigateToRTScreen( rtNavigationContext, ParsedScreen.MyDataDailyTotalsScreen::class, - pumpSuspended) as ParsedScreen.MyDataDailyTotalsScreen + pumpSuspended + ) as ParsedScreen.MyDataDailyTotalsScreen processTDDScreen(firstTDDScreen) longPressRTButtonUntil(rtNavigationContext, RTNavigationButton.DOWN) { parsedScreen -> @@ -2022,12 +2054,15 @@ class Pump( // the overall progress. when (stage) { BasicProgressStage.Finished, - is BasicProgressStage.Aborted -> 1.0 + is BasicProgressStage.Aborted -> 1.0 + is RTCommandProgressStage.SettingBasalProfile -> stage.numSetFactors.toDouble() / NUM_COMBO_BASAL_PROFILE_FACTORS.toDouble() + is RTCommandProgressStage.GettingBasalProfile -> stage.numSetFactors.toDouble() / NUM_COMBO_BASAL_PROFILE_FACTORS.toDouble() - else -> 0.0 + + else -> 0.0 } } @@ -2052,8 +2087,8 @@ class Pump( ): T { check( (stateFlow.value == State.ReadyForCommands) || - (allowExecutionWhileSuspended && (stateFlow.value == State.Suspended)) || - (allowExecutionWhileChecking && (stateFlow.value == State.CheckingPump)) + (allowExecutionWhileSuspended && (stateFlow.value == State.Suspended)) || + (allowExecutionWhileChecking && (stateFlow.value == State.CheckingPump)) ) { "Cannot execute command in the ${stateFlow.value} state" } val previousState = stateFlow.value @@ -2142,8 +2177,8 @@ class Pump( // "pump terminated connection" case to initiate a reconnect attempt. val pumpTerminatedConnection = when (val it = e.cause) { is ApplicationLayer.ErrorCodeException -> it.appLayerPacket.command == ApplicationLayer.Command.CTRL_DISCONNECT - is ComboIOException -> true - else -> false + is ComboIOException -> true + else -> false } // Packet receiver exceptions can happen for a number of reasons. @@ -2355,13 +2390,13 @@ class Pump( // screens, since they are not an error. The next time // handleAlertScreenContent() is called, we hopefully // get recognizable content. - is AlertScreenContent.None -> Unit + is AlertScreenContent.None -> Unit // Error screen contents always cause a rethrow since all error // screens are considered non-recoverable errors that must not // be ignored / dismissed. Instead, let the code fail by rethrowing // the exception. The user needs to check out the error manually. - is AlertScreenContent.Error -> throw AlertScreenException(alertScreenContent) + is AlertScreenContent.Error -> throw AlertScreenException(alertScreenContent) is AlertScreenContent.Warning -> { // Check if the alert screen content changed in case @@ -2389,10 +2424,10 @@ class Pump( // and ignored. // Any other warnings are intentionally rethrown for safety. when (warningCode) { - 1 -> onEvent(Event.ReservoirLow) - 2 -> onEvent(Event.BatteryLow) + 1 -> onEvent(Event.ReservoirLow) + 2 -> onEvent(Event.BatteryLow) 3, 6, 7, 8 -> Unit - else -> throw AlertScreenException(alertScreenContent) + else -> throw AlertScreenException(alertScreenContent) } // Warning screens are dismissed by pressing CHECK twice. @@ -2404,9 +2439,9 @@ class Pump( // for the second screen - just press twice right away. if (!rtScreenAlreadyDismissed) { val numRequiredButtonPresses = when (alertScreenContent.state) { - AlertScreenContent.AlertScreenState.TO_SNOOZE -> 2 + AlertScreenContent.AlertScreenState.TO_SNOOZE -> 2 AlertScreenContent.AlertScreenState.TO_CONFIRM -> 1 - else -> throw AlertScreenException(alertScreenContent) + else -> throw AlertScreenException(alertScreenContent) } logger(LogLevel.DEBUG) { "Dismissing W$warningCode by short-pressing CHECK $numRequiredButtonPresses time(s)" } for (i in 1..numRequiredButtonPresses) @@ -2498,46 +2533,57 @@ class Pump( val timestamp = entry.timestamp.toInstant(currentPumpUtcOffset!!) when (val detail = entry.detail) { - is CMDHistoryEventDetail.QuickBolusRequested -> - onEvent(Event.QuickBolusRequested( - bolusId = entry.eventCounter, - timestamp = timestamp, - bolusAmount = detail.bolusAmount - )) - is CMDHistoryEventDetail.QuickBolusInfused -> { - onEvent(Event.QuickBolusInfused( - bolusId = entry.eventCounter, - timestamp = timestamp, - bolusAmount = detail.bolusAmount - )) + is CMDHistoryEventDetail.QuickBolusRequested -> + onEvent( + Event.QuickBolusRequested( + bolusId = entry.eventCounter, + timestamp = timestamp, + bolusAmount = detail.bolusAmount + ) + ) + + is CMDHistoryEventDetail.QuickBolusInfused -> { + onEvent( + Event.QuickBolusInfused( + bolusId = entry.eventCounter, + timestamp = timestamp, + bolusAmount = detail.bolusAmount + ) + ) if (lastBolusInfusionTimestamp == null) { lastBolusId = entry.eventCounter lastBolusAmount = detail.bolusAmount lastBolusInfusionTimestamp = timestamp } } + is CMDHistoryEventDetail.StandardBolusRequested -> { val standardBolusReason = if (lastStandardBolusRequestedTypeSet) StandardBolusReason.NORMAL else reasonForLastStandardBolusInfusion - onEvent(Event.StandardBolusRequested( - bolusId = entry.eventCounter, - timestamp = timestamp, - manual = detail.manual, - bolusAmount = detail.bolusAmount, - standardBolusReason = standardBolusReason - )) + onEvent( + Event.StandardBolusRequested( + bolusId = entry.eventCounter, + timestamp = timestamp, + manual = detail.manual, + bolusAmount = detail.bolusAmount, + standardBolusReason = standardBolusReason + ) + ) lastStandardBolusRequestedTypeSet = true } - is CMDHistoryEventDetail.StandardBolusInfused -> { + + is CMDHistoryEventDetail.StandardBolusInfused -> { val standardBolusReason = if (lastStandardBolusInfusedTypeSet) StandardBolusReason.NORMAL else reasonForLastStandardBolusInfusion - onEvent(Event.StandardBolusInfused( - bolusId = entry.eventCounter, - timestamp = timestamp, - manual = detail.manual, - bolusAmount = detail.bolusAmount, - standardBolusReason = standardBolusReason - )) + onEvent( + Event.StandardBolusInfused( + bolusId = entry.eventCounter, + timestamp = timestamp, + manual = detail.manual, + bolusAmount = detail.bolusAmount, + standardBolusReason = standardBolusReason + ) + ) lastStandardBolusInfusedTypeSet = true if (lastBolusInfusionTimestamp == null) { lastBolusId = entry.eventCounter @@ -2545,39 +2591,52 @@ class Pump( lastBolusInfusionTimestamp = timestamp } } - is CMDHistoryEventDetail.ExtendedBolusStarted -> - onEvent(Event.ExtendedBolusStarted( - bolusId = entry.eventCounter, - timestamp = timestamp, - totalBolusAmount = detail.totalBolusAmount, - totalDurationMinutes = detail.totalDurationMinutes - )) - is CMDHistoryEventDetail.ExtendedBolusEnded -> { - onEvent(Event.ExtendedBolusEnded( - bolusId = entry.eventCounter, - timestamp = timestamp, - totalBolusAmount = detail.totalBolusAmount, - totalDurationMinutes = detail.totalDurationMinutes - )) + + is CMDHistoryEventDetail.ExtendedBolusStarted -> + onEvent( + Event.ExtendedBolusStarted( + bolusId = entry.eventCounter, + timestamp = timestamp, + totalBolusAmount = detail.totalBolusAmount, + totalDurationMinutes = detail.totalDurationMinutes + ) + ) + + is CMDHistoryEventDetail.ExtendedBolusEnded -> { + onEvent( + Event.ExtendedBolusEnded( + bolusId = entry.eventCounter, + timestamp = timestamp, + totalBolusAmount = detail.totalBolusAmount, + totalDurationMinutes = detail.totalDurationMinutes + ) + ) } - is CMDHistoryEventDetail.MultiwaveBolusStarted -> - onEvent(Event.MultiwaveBolusStarted( - bolusId = entry.eventCounter, - timestamp = timestamp, - totalBolusAmount = detail.totalBolusAmount, - immediateBolusAmount = detail.immediateBolusAmount, - totalDurationMinutes = detail.totalDurationMinutes - )) - is CMDHistoryEventDetail.MultiwaveBolusEnded -> { - onEvent(Event.MultiwaveBolusEnded( - bolusId = entry.eventCounter, - timestamp = timestamp, - totalBolusAmount = detail.totalBolusAmount, - immediateBolusAmount = detail.immediateBolusAmount, - totalDurationMinutes = detail.totalDurationMinutes - )) + + is CMDHistoryEventDetail.MultiwaveBolusStarted -> + onEvent( + Event.MultiwaveBolusStarted( + bolusId = entry.eventCounter, + timestamp = timestamp, + totalBolusAmount = detail.totalBolusAmount, + immediateBolusAmount = detail.immediateBolusAmount, + totalDurationMinutes = detail.totalDurationMinutes + ) + ) + + is CMDHistoryEventDetail.MultiwaveBolusEnded -> { + onEvent( + Event.MultiwaveBolusEnded( + bolusId = entry.eventCounter, + timestamp = timestamp, + totalBolusAmount = detail.totalBolusAmount, + immediateBolusAmount = detail.immediateBolusAmount, + totalDurationMinutes = detail.totalDurationMinutes + ) + ) } - else -> Unit + + else -> Unit } } @@ -2605,7 +2664,7 @@ class Pump( logger(LogLevel.DEBUG) { "Found a last bolus in history delta; details: $lastBolus; now: $now; " + - "lastBolusInfusionTimestamp: $lastBolusInfusionTimestamp -> bolusTimestamp: $bolusTimestamp" + "lastBolusInfusionTimestamp: $lastBolusInfusionTimestamp -> bolusTimestamp: $bolusTimestamp" } _lastBolusFlow.value = lastBolus @@ -2685,7 +2744,7 @@ class Pump( val tbrInfoShownOnMainScreen = (status.tbrPercentage != 100) when (currentTbrState) { - is CurrentTbrState.TbrStarted -> { + is CurrentTbrState.TbrStarted -> { if (!tbrInfoShownOnMainScreen) { // Handle case #1. @@ -2722,20 +2781,23 @@ class Pump( // TBR durations are set in 15-minute steps, and a strict value equality check // would raise false positives due to jitter caused by using the current time. if ((expectedCurrentTbrPercentage != actualCurrentTbrPercentage) || - ((expectedRemainingDurationInMinutes - actualRemainingDurationInMinutes).absoluteValue >= 10)) { - logger(LogLevel.DEBUG) { - "Unknown/unexpected TBR detected; expected TBR with percentage $expectedCurrentTbrPercentage " + + ((expectedRemainingDurationInMinutes - actualRemainingDurationInMinutes).absoluteValue >= 10) + ) { + logger(LogLevel.DEBUG) { + "Unknown/unexpected TBR detected; expected TBR with percentage $expectedCurrentTbrPercentage " + "and remaining duration expectedRemainingDurationInMinutes; actual TBR has percentage " + "$actualRemainingDurationInMinutes and remaining duration $actualRemainingDurationInMinutes" - } + } - pumpIO.switchMode(PumpIO.Mode.REMOTE_TERMINAL) - setCurrentTbr(percentage = 100, durationInMinutes = 0) + pumpIO.switchMode(PumpIO.Mode.REMOTE_TERMINAL) + setCurrentTbr(percentage = 100, durationInMinutes = 0) - onEvent(Event.UnknownTbrDetected( + onEvent( + Event.UnknownTbrDetected( tbrPercentage = status.tbrPercentage, remainingTbrDurationInMinutes = status.remainingTbrDurationInMinutes - )) + ) + ) } _currentTbrFlow.value = currentTbrState.tbr @@ -2751,17 +2813,19 @@ class Pump( logger(LogLevel.DEBUG) { "Unknown TBR detected with percentage ${status.tbrPercentage} " + - "and remaining duration ${status.remainingTbrDurationInMinutes}; " + - "aborting this TBR" + "and remaining duration ${status.remainingTbrDurationInMinutes}; " + + "aborting this TBR" } pumpIO.switchMode(PumpIO.Mode.REMOTE_TERMINAL) setCurrentTbr(percentage = 100, durationInMinutes = 0) - onEvent(Event.UnknownTbrDetected( - tbrPercentage = status.tbrPercentage, - remainingTbrDurationInMinutes = status.remainingTbrDurationInMinutes - )) + onEvent( + Event.UnknownTbrDetected( + tbrPercentage = status.tbrPercentage, + remainingTbrDurationInMinutes = status.remainingTbrDurationInMinutes + ) + ) } } } @@ -2782,7 +2846,7 @@ class Pump( var currentFactorFromProfile = currentBasalProfile!![timestampOfStatusUpdate.hour] logger(LogLevel.DEBUG) { "Current basal rate factor according to profile: $currentFactorFromProfile; current one" + - " according to pump: $currentBasalRateFactor" + " according to pump: $currentBasalRateFactor" } // We don't read the profile from the pump right away, and instead retry @@ -2851,8 +2915,8 @@ class Pump( if (dateTimeDelta.absoluteValue >= 2.toDuration(DurationUnit.MINUTES)) { logger(LogLevel.INFO) { "Current system datetime differs from pump's too much, updating pump datetime; " + - "system / pump datetime (UTC): $currentSystemDateTime / $currentPumpDateTime; " + - "datetime delta: $dateTimeDelta" + "system / pump datetime (UTC): $currentSystemDateTime / $currentPumpDateTime; " + + "datetime delta: $dateTimeDelta" } needsPumpDateTimeAdjustment = true } @@ -2862,8 +2926,8 @@ class Pump( if (currentSystemUtcOffset != currentPumpUtcOffset!!) { logger(LogLevel.INFO) { "System UTC offset differs from pump's; system timezone: $currentSystemTimeZone; " + - "system UTC offset: $currentSystemUtcOffset; pump state UTC offset: ${currentPumpUtcOffset!!}; " + - "updating pump state and datetime" + "system UTC offset: $currentSystemUtcOffset; pump state UTC offset: ${currentPumpUtcOffset!!}; " + + "updating pump state and datetime" } pumpStateStore.setCurrentUtcOffset(bluetoothDevice.address, currentSystemUtcOffset) currentPumpUtcOffset = currentSystemUtcOffset @@ -2891,9 +2955,9 @@ class Pump( } else { logger(LogLevel.INFO) { "Current system datetime is close enough to pump's current datetime, " + - "and timezones did not change; no pump datetime adjustment needed; " + - "system / pump datetime (UTC): $currentSystemDateTime / $currentPumpDateTime; " + - "datetime delta: $dateTimeDelta" + "and timezones did not change; no pump datetime adjustment needed; " + + "system / pump datetime (UTC): $currentSystemDateTime / $currentPumpDateTime; " + + "datetime delta: $dateTimeDelta" } } } @@ -2958,7 +3022,7 @@ class Pump( numRetrievedFactors++ logger(LogLevel.DEBUG) { "Got basal profile factor #$factorIndexOnScreen : $factor; $numRetrievedFactors " + - "factor(s) read and $numObservedScreens screen(s) observed thus far" + "factor(s) read and $numObservedScreens screen(s) observed thus far" } getBasalProfileReporter.setCurrentProgressStage( @@ -3013,7 +3077,8 @@ class Pump( // This is not the correct basal profile factor, so keep // navigating through them to find the correct factor. return@shortPressRTButtonsUntil ShortPressRTButtonsCommand.PressButton( - RTNavigationButton.MENU) + RTNavigationButton.MENU + ) } } @@ -3085,12 +3150,16 @@ class Pump( else Pair(now, (now - tbr.timestamp).inWholeMinutes.toInt()) - onEvent(Event.TbrEnded(Tbr( - timestamp = tbr.timestamp, - percentage = tbr.percentage, - durationInMinutes = newDurationInMinutes, - tbr.type - ), endTbrTimestamp)) + onEvent( + Event.TbrEnded( + Tbr( + timestamp = tbr.timestamp, + percentage = tbr.percentage, + durationInMinutes = newDurationInMinutes, + tbr.type + ), endTbrTimestamp + ) + ) _currentTbrFlow.value = null } } @@ -3222,9 +3291,11 @@ class Pump( val simpleDistance = (end - begin).absoluteValue return if (simpleDistance <= (range / 2)) simpleDistance else (range - simpleDistance) } + fun calcNormalDistance(begin: Int, end: Int): Int { return (end - begin).absoluteValue } + fun calcLongRTButtonPressObservationPeriod(distance: Int): Duration { // Check if the distance is large enough to trigger a long RT button press. If so, // factor in 2 seconds. This is the time it takes after the long button @@ -3249,24 +3320,24 @@ class Pump( val estimatedDuration = // 2 seconds to account for navigation to the time and date settings screens. 2.toDuration(DurationUnit.SECONDS) + - // 1 second per quantity to factor in the waiting period while reading each initial quantity. - // We handle 5 quantities (hour/minute/year/month/day), so we factor in 5*1 seconds. - 5.toDuration(DurationUnit.SECONDS) + - // Factor in the individual factor changes (1 increment/decrement takes ~300 ms to finish). - (totalDistance * 300).toDuration(DurationUnit.MILLISECONDS) + - // if a long RT button press happens, there's a waiting period after the button press stopped. - // IMPORTANT: This is evaluated for each distance individually instead of evaluating - // totalDistance once. That's because whether to do long RT button press is decided per-quantity - // and not once for all quantities. - calcLongRTButtonPressObservationPeriod(hourDistance) + - calcLongRTButtonPressObservationPeriod(minuteDistance) + - calcLongRTButtonPressObservationPeriod(yearDistance) + - calcLongRTButtonPressObservationPeriod(monthDistance) + - calcLongRTButtonPressObservationPeriod(dayDistance) + // 1 second per quantity to factor in the waiting period while reading each initial quantity. + // We handle 5 quantities (hour/minute/year/month/day), so we factor in 5*1 seconds. + 5.toDuration(DurationUnit.SECONDS) + + // Factor in the individual factor changes (1 increment/decrement takes ~300 ms to finish). + (totalDistance * 300).toDuration(DurationUnit.MILLISECONDS) + + // if a long RT button press happens, there's a waiting period after the button press stopped. + // IMPORTANT: This is evaluated for each distance individually instead of evaluating + // totalDistance once. That's because whether to do long RT button press is decided per-quantity + // and not once for all quantities. + calcLongRTButtonPressObservationPeriod(hourDistance) + + calcLongRTButtonPressObservationPeriod(minuteDistance) + + calcLongRTButtonPressObservationPeriod(yearDistance) + + calcLongRTButtonPressObservationPeriod(monthDistance) + + calcLongRTButtonPressObservationPeriod(dayDistance) logger(LogLevel.DEBUG) { "Current local pump / local system datetime: $currentLocalPumpDateTime / $currentLocalSystemDateTime " + - "; estimated duration: $estimatedDuration" + "; estimated duration: $estimatedDuration" } return estimatedDuration @@ -3407,7 +3478,7 @@ class Pump( val mainScreenContent = when (mainScreen) { is ParsedScreen.MainScreen -> mainScreen.content - else -> throw NoUsableRTScreenException() + else -> throw NoUsableRTScreenException() } val quickinfoScreen = navigateToRTScreen(rtNavigationContext, ParsedScreen.QuickinfoMainScreen::class, pumpSuspended) @@ -3418,11 +3489,12 @@ class Pump( rtNavigationContext.shortPressButton(RTNavigationButton.BACK) quickinfoScreen.quickinfo } - else -> throw NoUsableRTScreenException() + + else -> throw NoUsableRTScreenException() } _statusFlow.value = when (mainScreenContent) { - is MainScreenContent.Normal -> { + is MainScreenContent.Normal -> { pumpSuspended = false Status( availableUnitsInReservoir = quickinfo.availableUnits, @@ -3436,7 +3508,7 @@ class Pump( ) } - is MainScreenContent.Stopped -> { + is MainScreenContent.Stopped -> { pumpSuspended = true Status( availableUnitsInReservoir = quickinfo.availableUnits, @@ -3453,7 +3525,7 @@ class Pump( ) } - is MainScreenContent.Tbr -> { + is MainScreenContent.Tbr -> { pumpSuspended = false Status( availableUnitsInReservoir = quickinfo.availableUnits, diff --git a/pump/combov2/comboctl/src/jvmTest/kotlin/info/nightscout/comboctl/main/RTNavigationTest.kt b/pump/combov2/comboctl/src/jvmTest/kotlin/info/nightscout/comboctl/main/RTNavigationTest.kt index 14d7cf6818..b46eb99ac0 100644 --- a/pump/combov2/comboctl/src/jvmTest/kotlin/info/nightscout/comboctl/main/RTNavigationTest.kt +++ b/pump/combov2/comboctl/src/jvmTest/kotlin/info/nightscout/comboctl/main/RTNavigationTest.kt @@ -56,6 +56,7 @@ class RTNavigationTest { testParsedScreenList: List, private val automaticallyAdvanceScreens: Boolean = false ) : RTNavigationContext { + private val mainJob = SupervisorJob() private val mainScope = CoroutineScope(mainJob) private val testParsedScreenListIter = testParsedScreenList.listIterator() @@ -125,7 +126,7 @@ class RTNavigationTest { // here by moving to the next screen if keepGoing() returns true. // If keepGoing is not set, this behaves as if keepGoing() always // returned true. - if (keepGoing?.let { !it() } ?: false) + if (keepGoing?.let { !it() } == true) break currentParsedScreen = testParsedScreenListIter.next() } @@ -151,6 +152,7 @@ class RTNavigationTest { } companion object { + @BeforeAll @JvmStatic fun commonInit() { @@ -188,16 +190,31 @@ class RTNavigationTest { assertNotNull(path) assertEquals(5, path.size) - assertEquals(PathSegment( - ParsedScreen.TemporaryBasalRateMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[0]) - assertEquals(PathSegment( - ParsedScreen.MyDataMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[1]) - assertEquals(PathSegment( - ParsedScreen.BasalRate1ProgrammingMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[2]) - assertEquals(PathSegment( - ParsedScreen.BasalRateTotalScreen::class, RTEdgeValue(RTNavigationButton.CHECK)), path[3]) - assertEquals(PathSegment( - ParsedScreen.BasalRateFactorSettingScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[4]) + assertEquals( + PathSegment( + ParsedScreen.TemporaryBasalRateMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[0] + ) + assertEquals( + PathSegment( + ParsedScreen.MyDataMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[1] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRate1ProgrammingMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[2] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRateTotalScreen::class, RTEdgeValue(RTNavigationButton.CHECK) + ), path[3] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRateFactorSettingScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[4] + ) } @Test @@ -214,14 +231,26 @@ class RTNavigationTest { assertNotNull(path) assertEquals(4, path.size) - assertEquals(PathSegment( - ParsedScreen.MyDataMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[0]) - assertEquals(PathSegment( - ParsedScreen.BasalRate1ProgrammingMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[1]) - assertEquals(PathSegment( - ParsedScreen.BasalRateTotalScreen::class, RTEdgeValue(RTNavigationButton.CHECK)), path[2]) - assertEquals(PathSegment( - ParsedScreen.BasalRateFactorSettingScreen::class, RTEdgeValue(RTNavigationButton.MENU)), path[3]) + assertEquals( + PathSegment( + ParsedScreen.MyDataMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[0] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRate1ProgrammingMenuScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[1] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRateTotalScreen::class, RTEdgeValue(RTNavigationButton.CHECK) + ), path[2] + ) + assertEquals( + PathSegment( + ParsedScreen.BasalRateFactorSettingScreen::class, RTEdgeValue(RTNavigationButton.MENU) + ), path[3] + ) } @Test @@ -470,15 +499,19 @@ class RTNavigationTest { // the latter case, the watchdog will eventually cancel the // coroutine and report the test as failed. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.QuickinfoMainScreen(Quickinfo(availableUnits = 105, reservoirState = ReservoirState.FULL)) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.QuickinfoMainScreen(Quickinfo(availableUnits = 105, reservoirState = ReservoirState.FULL)) + ) + ) runBlockingWithWatchdog(6000) { navigateToRTScreen(rtNavigationContext, ParsedScreen.QuickinfoMainScreen::class, isComboStopped = false) @@ -491,18 +524,22 @@ class RTNavigationTest { // otherwise the navigation may incorrectly press RT buttons more often // than necessary. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.TemporaryBasalRateMenuScreen, - ParsedScreen.TemporaryBasalRatePercentageScreen(percentage = 110, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(percentage = null, remainingDurationInMinutes = null), - ParsedScreen.TemporaryBasalRateDurationScreen(durationInMinutes = 45) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.TemporaryBasalRateMenuScreen, + ParsedScreen.TemporaryBasalRatePercentageScreen(percentage = 110, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(percentage = null, remainingDurationInMinutes = null), + ParsedScreen.TemporaryBasalRateDurationScreen(durationInMinutes = 45) + ) + ) runBlockingWithWatchdog(6000) { navigateToRTScreen(rtNavigationContext, ParsedScreen.TemporaryBasalRateDurationScreen::class, isComboStopped = false) @@ -523,14 +560,18 @@ class RTNavigationTest { // Check edge case handling when we want to navigate to // a target screen type, but we are in fact already there. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ) + ) + ) runBlockingWithWatchdog(6000) { navigateToRTScreen(rtNavigationContext, ParsedScreen.MainScreen::class, isComboStopped = false) @@ -541,29 +582,33 @@ class RTNavigationTest { fun checkRTNavigationFromMainScreenToBasalRateFactorSettingScreen() { // Check the result of a more complex navigation. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 23, minute = 11), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 800, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.StopPumpMenuScreen, - ParsedScreen.StandardBolusMenuScreen, - ParsedScreen.ExtendedBolusMenuScreen, - ParsedScreen.MultiwaveBolusMenuScreen, - ParsedScreen.TemporaryBasalRateMenuScreen, - ParsedScreen.MyDataMenuScreen, - ParsedScreen.BasalRateProfileSelectionMenuScreen, - ParsedScreen.BasalRate1ProgrammingMenuScreen, - ParsedScreen.BasalRateTotalScreen(1840, 1), - ParsedScreen.BasalRateFactorSettingScreen( - LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 0, minute = 0), - LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 1, minute = 0), - 1000, - 1 + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 23, minute = 11), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 800, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.StopPumpMenuScreen, + ParsedScreen.StandardBolusMenuScreen, + ParsedScreen.ExtendedBolusMenuScreen, + ParsedScreen.MultiwaveBolusMenuScreen, + ParsedScreen.TemporaryBasalRateMenuScreen, + ParsedScreen.MyDataMenuScreen, + ParsedScreen.BasalRateProfileSelectionMenuScreen, + ParsedScreen.BasalRate1ProgrammingMenuScreen, + ParsedScreen.BasalRateTotalScreen(1840, 1), + ParsedScreen.BasalRateFactorSettingScreen( + LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 0, minute = 0), + LocalDateTime(year = 0, monthNumber = 1, dayOfMonth = 1, hour = 1, minute = 0), + 1000, + 1 + ) ) - )) + ) runBlockingWithWatchdog(6000) { val targetScreen = navigateToRTScreen( @@ -609,25 +654,31 @@ class RTNavigationTest { // second TBR main screen is skipped by the detection). Without // the screen type check, it would press CHECK _twice_. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Tbr( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - remainingTbrDurationInMinutes = 28, - tbrPercentage = 110, - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.MainScreen(MainScreenContent.Tbr( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - remainingTbrDurationInMinutes = 27, - tbrPercentage = 110, - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.QuickinfoMainScreen(Quickinfo(availableUnits = 105, reservoirState = ReservoirState.FULL)) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Tbr( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + remainingTbrDurationInMinutes = 28, + tbrPercentage = 110, + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.MainScreen( + MainScreenContent.Tbr( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + remainingTbrDurationInMinutes = 27, + tbrPercentage = 110, + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.QuickinfoMainScreen(Quickinfo(availableUnits = 105, reservoirState = ReservoirState.FULL)) + ) + ) runBlockingWithWatchdog(6000) { navigateToRTScreen(rtNavigationContext, ParsedScreen.QuickinfoMainScreen::class, isComboStopped = false) @@ -649,19 +700,23 @@ class RTNavigationTest { // 4th one, which is the target. To test for "overshoots", // there's a 5th one after that. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.BasalRate1ProgrammingMenuScreen, - ParsedScreen.BasalRate2ProgrammingMenuScreen, - ParsedScreen.BasalRate3ProgrammingMenuScreen, - ParsedScreen.BasalRate4ProgrammingMenuScreen, - ParsedScreen.BasalRate5ProgrammingMenuScreen - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.BasalRate1ProgrammingMenuScreen, + ParsedScreen.BasalRate2ProgrammingMenuScreen, + ParsedScreen.BasalRate3ProgrammingMenuScreen, + ParsedScreen.BasalRate4ProgrammingMenuScreen, + ParsedScreen.BasalRate5ProgrammingMenuScreen + ) + ) runBlockingWithWatchdog(6000) { val finalScreen = longPressRTButtonUntil(rtNavigationContext, RTNavigationButton.MENU) { parsedScreen -> @@ -683,19 +738,23 @@ class RTNavigationTest { // 4th one, which is the target. To test for "overshoots", // there's a 5th one after that. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.BasalRate1ProgrammingMenuScreen, - ParsedScreen.BasalRate2ProgrammingMenuScreen, - ParsedScreen.BasalRate3ProgrammingMenuScreen, - ParsedScreen.BasalRate4ProgrammingMenuScreen, - ParsedScreen.BasalRate5ProgrammingMenuScreen - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.BasalRate1ProgrammingMenuScreen, + ParsedScreen.BasalRate2ProgrammingMenuScreen, + ParsedScreen.BasalRate3ProgrammingMenuScreen, + ParsedScreen.BasalRate4ProgrammingMenuScreen, + ParsedScreen.BasalRate5ProgrammingMenuScreen + ) + ) runBlockingWithWatchdog(6000) { val finalScreen = shortPressRTButtonsUntil(rtNavigationContext) { parsedScreen -> @@ -714,20 +773,24 @@ class RTNavigationTest { // screen in between. We except the long button press to be aborted // and an AlertScreenException to be thrown. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.BasalRate1ProgrammingMenuScreen, - ParsedScreen.BasalRate2ProgrammingMenuScreen, - ParsedScreen.AlertScreen(AlertScreenContent.Warning(code = 6, AlertScreenContent.AlertScreenState.TO_SNOOZE)), - ParsedScreen.BasalRate3ProgrammingMenuScreen, - ParsedScreen.BasalRate4ProgrammingMenuScreen, - ParsedScreen.BasalRate5ProgrammingMenuScreen - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.BasalRate1ProgrammingMenuScreen, + ParsedScreen.BasalRate2ProgrammingMenuScreen, + ParsedScreen.AlertScreen(AlertScreenContent.Warning(code = 6, AlertScreenContent.AlertScreenState.TO_SNOOZE)), + ParsedScreen.BasalRate3ProgrammingMenuScreen, + ParsedScreen.BasalRate4ProgrammingMenuScreen, + ParsedScreen.BasalRate5ProgrammingMenuScreen + ) + ) runBlockingWithWatchdog(6000) { val e = assertFailsWith { @@ -756,19 +819,23 @@ class RTNavigationTest { // press MENU until it reaches basal rate programming screen 4 // in our simulated sequence of screens. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.MainScreen(MainScreenContent.Normal( - currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), - activeBasalProfileNumber = 1, - currentBasalRateFactor = 300, - batteryState = BatteryState.FULL_BATTERY - )), - ParsedScreen.BasalRate1ProgrammingMenuScreen, - ParsedScreen.BasalRate2ProgrammingMenuScreen, - ParsedScreen.BasalRate3ProgrammingMenuScreen, - ParsedScreen.BasalRate4ProgrammingMenuScreen, - ParsedScreen.BasalRate5ProgrammingMenuScreen - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.MainScreen( + MainScreenContent.Normal( + currentTime = LocalDateTime(year = 2020, monthNumber = 10, dayOfMonth = 4, hour = 0, minute = 0), + activeBasalProfileNumber = 1, + currentBasalRateFactor = 300, + batteryState = BatteryState.FULL_BATTERY + ) + ), + ParsedScreen.BasalRate1ProgrammingMenuScreen, + ParsedScreen.BasalRate2ProgrammingMenuScreen, + ParsedScreen.BasalRate3ProgrammingMenuScreen, + ParsedScreen.BasalRate4ProgrammingMenuScreen, + ParsedScreen.BasalRate5ProgrammingMenuScreen + ) + ) runBlockingWithWatchdog(6000) { val finalScreen = cycleToRTScreen( @@ -813,20 +880,22 @@ class RTNavigationTest { // expect adjustQuantityOnScreen() to catch this and correct it // using short RT button presses until the target quantity is observed. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.TemporaryBasalRatePercentageScreen(100, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(110, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(120, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(130, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(140, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(150, remainingDurationInMinutes = 30), - // No 160 quantity here, on purpose, to test overshoot handling - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.TemporaryBasalRatePercentageScreen(100, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(110, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(120, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(130, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(140, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(150, remainingDurationInMinutes = 30), + // No 160 quantity here, on purpose, to test overshoot handling + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30) + ) + ) runBlockingWithWatchdog(6000) { adjustQuantityOnScreen( @@ -849,25 +918,27 @@ class RTNavigationTest { // to be thrown. Such a warning screen interrupts and aborts whatever operation we // were doing and returns the Combo back to the main screen. - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.TemporaryBasalRatePercentageScreen(100, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(110, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(120, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(130, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(140, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(150, remainingDurationInMinutes = 30), - // No 160 quantity here, on purpose, to test overshoot handling. - // During the screens below, short button presses will be used - // to fix the overshoot, so we place the W6 in between these - // to test that the AlertScreenException is correctly thrown - // while short-pressing the button. - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), - ParsedScreen.AlertScreen(AlertScreenContent.Warning(code = 6, AlertScreenContent.AlertScreenState.TO_SNOOZE)), - ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30), - ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.TemporaryBasalRatePercentageScreen(100, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(110, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(120, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(130, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(140, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(150, remainingDurationInMinutes = 30), + // No 160 quantity here, on purpose, to test overshoot handling. + // During the screens below, short button presses will be used + // to fix the overshoot, so we place the W6 in between these + // to test that the AlertScreenException is correctly thrown + // while short-pressing the button. + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(170, remainingDurationInMinutes = 30), + ParsedScreen.AlertScreen(AlertScreenContent.Warning(code = 6, AlertScreenContent.AlertScreenState.TO_SNOOZE)), + ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30), + ParsedScreen.TemporaryBasalRatePercentageScreen(160, remainingDurationInMinutes = 30) + ) + ) val e = assertFailsWith { runBlockingWithWatchdog(6000) { @@ -901,17 +972,19 @@ class RTNavigationTest { // without wraparound, it goes 58 -> 2 by decrementing, which // is a total distance of 55 steps.) - val rtNavigationContext = TestRTNavigationContext(listOf( - ParsedScreen.TimeAndDateSettingsMinuteScreen(58), - ParsedScreen.TimeAndDateSettingsMinuteScreen(59), - ParsedScreen.TimeAndDateSettingsMinuteScreen(0), - ParsedScreen.TimeAndDateSettingsMinuteScreen(1), - // No 2 quantity here, on purpose, to test overshoot handling - ParsedScreen.TimeAndDateSettingsMinuteScreen(3), - ParsedScreen.TimeAndDateSettingsMinuteScreen(2), - // This is a dummy screen to avoid an exception due to the next() call in TestRTNavigationContext.shortButtonPress() - ParsedScreen.TimeAndDateSettingsMinuteScreen(0) - )) + val rtNavigationContext = TestRTNavigationContext( + listOf( + ParsedScreen.TimeAndDateSettingsMinuteScreen(58), + ParsedScreen.TimeAndDateSettingsMinuteScreen(59), + ParsedScreen.TimeAndDateSettingsMinuteScreen(0), + ParsedScreen.TimeAndDateSettingsMinuteScreen(1), + // No 2 quantity here, on purpose, to test overshoot handling + ParsedScreen.TimeAndDateSettingsMinuteScreen(3), + ParsedScreen.TimeAndDateSettingsMinuteScreen(2), + // This is a dummy screen to avoid an exception due to the next() call in TestRTNavigationContext.shortButtonPress() + ParsedScreen.TimeAndDateSettingsMinuteScreen(0) + ) + ) runBlockingWithWatchdog(6000) { adjustQuantityOnScreen( diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java index a9945a7b3d..45acd03de8 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java @@ -21,7 +21,7 @@ public class OmnipodPacket implements RLMessage { if (encoded.length < 7) { return; } - this.packetAddress = ByteUtil.INSTANCE.toInt((int) encoded[0], (int) encoded[1], + this.packetAddress = ByteUtil.INSTANCE.toInt(encoded[0], (int) encoded[1], (int) encoded[2], (int) encoded[3], ByteUtil.BitConversion.BIG_ENDIAN); try { this.packetType = PacketType.fromByte((byte) (((int) encoded[4] & 0xFF) >> 5)); diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java index 11616bd09d..f4e29cd13d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java @@ -28,25 +28,25 @@ public class VersionResponse extends MessageBlock { podProgressStatus = PodProgressStatus.fromByte(data[9]); pmVersion = new FirmwareVersion(data[2], data[3], data[4]); piVersion = new FirmwareVersion(data[5], data[6], data[7]); - lot = ByteUtil.INSTANCE.toInt((int) data[10], (int) data[11], + lot = ByteUtil.INSTANCE.toInt(data[10], (int) data[11], (int) data[12], (int) data[13], ByteUtil.BitConversion.BIG_ENDIAN); - tid = ByteUtil.INSTANCE.toInt((int) data[14], (int) data[15], + tid = ByteUtil.INSTANCE.toInt(data[14], (int) data[15], (int) data[16], (int) data[17], ByteUtil.BitConversion.BIG_ENDIAN); gain = (byte) ((data[18] & 0xc0) >>> 6); rssi = (byte) (data[18] & 0x3f); - address = ByteUtil.INSTANCE.toInt((int) data[19], (int) data[20], + address = ByteUtil.INSTANCE.toInt(data[19], (int) data[20], (int) data[21], (int) data[22], ByteUtil.BitConversion.BIG_ENDIAN); break; case SETUP_POD_VERSION_RESPONSE_LENGTH: podProgressStatus = PodProgressStatus.fromByte(data[16]); pmVersion = new FirmwareVersion(data[9], data[10], data[11]); piVersion = new FirmwareVersion(data[12], data[13], data[14]); - lot = ByteUtil.INSTANCE.toInt((int) data[17], (int) data[18], + lot = ByteUtil.INSTANCE.toInt(data[17], (int) data[18], (int) data[19], (int) data[20], ByteUtil.BitConversion.BIG_ENDIAN); - tid = ByteUtil.INSTANCE.toInt((int) data[21], (int) data[22], + tid = ByteUtil.INSTANCE.toInt(data[21], (int) data[22], (int) data[23], (int) data[24], ByteUtil.BitConversion.BIG_ENDIAN); - address = ByteUtil.INSTANCE.toInt((int) data[25], (int) data[26], + address = ByteUtil.INSTANCE.toInt(data[25], (int) data[26], (int) data[27], (int) data[28], ByteUtil.BitConversion.BIG_ENDIAN); break; default: diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java index 0d579f05a8..3d37938207 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java @@ -74,7 +74,7 @@ class BasalScheduleExtraCommandTest { @Test void testEncodingFromBasalScheduleWithSingleEntry() { - BasalSchedule basalSchedule = new BasalSchedule(Arrays.asList(new BasalScheduleEntry(1.05, Duration.ZERO))); + BasalSchedule basalSchedule = new BasalSchedule(List.of(new BasalScheduleEntry(1.05, Duration.ZERO))); BasalScheduleExtraCommand basalScheduleExtraCommand = new BasalScheduleExtraCommand(basalSchedule, Duration.standardMinutes((0x20 + 1) * 30).minus(Duration.standardSeconds(0x33c0 / 8)), false, true, Duration.ZERO); @@ -137,7 +137,7 @@ class BasalScheduleExtraCommandTest { @Test void testBasalScheduleExtraCommandRoundsToNearestSecond() { - BasalSchedule basalSchedule = new BasalSchedule(Arrays.asList(new BasalScheduleEntry(1.00, Duration.ZERO))); + BasalSchedule basalSchedule = new BasalSchedule(List.of(new BasalScheduleEntry(1.00, Duration.ZERO))); BasalScheduleExtraCommand basalScheduleExtraCommand = new BasalScheduleExtraCommand(basalSchedule, Duration.standardMinutes((0x2b + 1) * 30).minus(Duration.standardSeconds(0x1b38 / 8).plus(Duration.millis(456))), @@ -164,6 +164,6 @@ class BasalScheduleExtraCommandTest { } private double extractDelayUntilNextPulseInSeconds(byte[] message) { - return ByteUtil.INSTANCE.toInt((int) message[6], (int) message[7], (int) message[8], (int) message[9], ByteUtil.BitConversion.BIG_ENDIAN) / 1_000_000.0; + return ByteUtil.INSTANCE.toInt(message[6], (int) message[7], (int) message[8], (int) message[9], ByteUtil.BitConversion.BIG_ENDIAN) / 1_000_000.0; } } diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 49b75232fa..d36c93af77 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -275,7 +275,7 @@ public abstract class RileyLinkCommunicationManager { for (int k = 0; k < results.trials.size(); k++) { FrequencyTrial one = results.trials.get(k); - stringBuilder.append(String.format("Scan Result[%s]: Freq=%s, avg RSSI = %s\n", String.valueOf(k), String.valueOf(one.frequencyMHz), one.averageRSSI + ", RSSIs =" + one.rssiList)); + stringBuilder.append(String.format("Scan Result[%s]: Freq=%s, avg RSSI = %s\n", k, one.frequencyMHz, one.averageRSSI + ", RSSIs =" + one.rssiList)); } aapsLogger.info(LTag.PUMPBTCOMM, stringBuilder.toString()); diff --git a/shared/impl/build.gradle b/shared/impl/build.gradle index 0eeda8927f..e67cbd5e0d 100644 --- a/shared/impl/build.gradle +++ b/shared/impl/build.gradle @@ -16,7 +16,7 @@ android { namespace 'app.aaps.shared.impl' defaultConfig { - minSdkVersion 25 // for wear + minSdkVersion 26 // for wear } } diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/BundleMock.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/BundleMock.kt index 9111002ab5..1e3696c8db 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/BundleMock.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/BundleMock.kt @@ -24,7 +24,7 @@ object BundleMock { } val bundle = Mockito.mock(Bundle::class.java) Mockito.doAnswer { map.size }.`when`(bundle).size() - Mockito.doAnswer { map.isEmpty() }.`when`(bundle).isEmpty() + Mockito.doAnswer { map.isEmpty() }.`when`(bundle).isEmpty Mockito.doAnswer { map.clear() null @@ -36,7 +36,7 @@ object BundleMock { null }.`when`(bundle).remove(ArgumentMatchers.anyString()) Mockito.doAnswer { map.keys }.`when`(bundle).keySet() - Mockito.doAnswer { BundleMock::class.java.getSimpleName() + "{map=" + map.toString() + "}" }.`when`(bundle).toString() + Mockito.doAnswer { BundleMock::class.java.simpleName + "{map=" + map.toString() + "}" }.`when`(bundle).toString() Mockito.doAnswer(put).`when`(bundle).putBoolean(ArgumentMatchers.anyString(), ArgumentMatchers.anyBoolean()) Mockito.`when`(bundle.getBoolean(ArgumentMatchers.anyString())).thenAnswer(get) Mockito.`when`(bundle.getBoolean(ArgumentMatchers.anyString(), ArgumentMatchers.anyBoolean())).thenAnswer(getOrDefault) diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt index f24b275692..942b3080df 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt @@ -1,9 +1,6 @@ package app.aaps.shared.tests import android.content.Context -import app.aaps.core.main.extensions.pureProfileFromJson -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.IobCobCalculator @@ -16,11 +13,14 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.HardLimits +import app.aaps.core.main.extensions.pureProfileFromJson +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.embedments.InsulinConfiguration import app.aaps.shared.impl.utils.DateUtilImpl import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.implementation.profile.ProfileStoreObject import info.nightscout.implementation.profile.ProfileUtilImpl import info.nightscout.implementation.utils.DecimalFormatterImpl diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index 654938f6dd..e9d9ce8e0a 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -6,8 +6,6 @@ import android.text.Editable import android.text.TextWatcher import android.widget.ArrayAdapter import android.widget.TextView -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.profile.ProfileFunction @@ -20,12 +18,14 @@ import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import com.google.android.material.tabs.TabLayout -import com.google.common.collect.Lists +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.EffectiveProfileSwitch +import app.aaps.database.entities.EffectiveProfileSwitch +import com.google.android.material.tabs.TabLayout +import com.google.common.collect.Lists import info.nightscout.database.impl.AppRepository import info.nightscout.ui.R import info.nightscout.ui.databinding.ActivityProfilehelperBinding @@ -107,10 +107,10 @@ class ProfileHelperActivity : TranslatedDaggerAppCompatActivity() { binding.profileType.setOnItemClickListener { _, _, _, _ -> when (binding.profileType.text.toString()) { - rh.gs(R.string.motol_default_profile) -> switchTab(tabSelected, ProfileType.MOTOL_DEFAULT) - rh.gs(R.string.dpv_default_profile) -> switchTab(tabSelected, ProfileType.DPV_DEFAULT) - rh.gs(R.string.current_profile) -> switchTab(tabSelected, ProfileType.CURRENT) - rh.gs(R.string.available_profile) -> switchTab(tabSelected, ProfileType.AVAILABLE_PROFILE) + rh.gs(R.string.motol_default_profile) -> switchTab(tabSelected, ProfileType.MOTOL_DEFAULT) + rh.gs(R.string.dpv_default_profile) -> switchTab(tabSelected, ProfileType.DPV_DEFAULT) + rh.gs(R.string.current_profile) -> switchTab(tabSelected, ProfileType.CURRENT) + rh.gs(R.string.available_profile) -> switchTab(tabSelected, ProfileType.AVAILABLE_PROFILE) rh.gs(app.aaps.core.ui.R.string.careportal_profileswitch) -> switchTab(tabSelected, ProfileType.PROFILE_SWITCH) } } diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index ee4671c7b7..b31f9e11e3 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -5,17 +5,17 @@ import android.os.Bundle import android.os.Handler import android.os.HandlerThread import android.widget.TextView -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.stats.DexcomTirCalculator import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.stats.TirCalculator +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.ui.R import info.nightscout.ui.activityMonitor.ActivityMonitor diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index 9eada2ef72..a518fe58ca 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -14,7 +14,6 @@ import android.widget.EditText import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.profile.ProfileFunction @@ -29,8 +28,9 @@ import app.aaps.core.interfaces.rx.events.EventPumpStatusChanged import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.SafeParse import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.database.entities.TotalDailyDose +import app.aaps.database.entities.TotalDailyDose import info.nightscout.database.impl.AppRepository import info.nightscout.ui.databinding.ActivityTddStatsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 61358d6416..90f20ceab9 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -15,9 +15,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.iobCalc -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger @@ -32,16 +29,19 @@ import app.aaps.core.interfaces.rx.events.EventTreatmentChange import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import com.google.gson.Gson -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.iobCalc +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.BolusCalculatorResult +import app.aaps.database.entities.Carbs +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import com.google.gson.Gson +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CutCarbsTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index bcec529123..33e99806d9 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -13,8 +13,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger @@ -28,13 +26,15 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.interfaces.utils.Translator -import dagger.android.support.DaggerFragment +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.database.impl.transactions.InvalidateTherapyEventTransaction diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 4da760398f..a4ccad549b 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -14,10 +14,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.iobCalc -import app.aaps.core.main.extensions.isInProgress -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -30,14 +26,18 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventExtendedBolusChange import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.iobCalc +import app.aaps.core.main.extensions.isInProgress +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.interfaces.end +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 86ddf6dad8..88d925c0ef 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -15,10 +15,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.getCustomizedName -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger @@ -36,12 +32,16 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.getCustomizedName +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index cfed6e1142..ab92b23e54 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -14,11 +14,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.friendlyDescription -import app.aaps.core.main.extensions.highValueToUnitsToString -import app.aaps.core.main.extensions.lowValueToUnitsToString -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger @@ -34,15 +29,20 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T import app.aaps.core.interfaces.utils.Translator -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.friendlyDescription +import app.aaps.core.main.extensions.highValueToUnitsToString +import app.aaps.core.main.extensions.lowValueToUnitsToString +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.interfaces.end +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateTemporaryTargetTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index f117dd9091..583d022a25 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -14,11 +14,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.extensions.iobCalc -import app.aaps.core.main.extensions.toStringFull -import app.aaps.core.main.extensions.toTemporaryBasal -import app.aaps.core.main.utils.ActionModeHelper -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.iob.IobTotal import app.aaps.core.interfaces.logging.AAPSLogger @@ -33,16 +28,21 @@ import app.aaps.core.interfaces.rx.events.EventTempBasalChange import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerFragment +import app.aaps.core.main.extensions.iobCalc +import app.aaps.core.main.extensions.toStringFull +import app.aaps.core.main.extensions.toTemporaryBasal +import app.aaps.core.main.utils.ActionModeHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.interfaces.end +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.ExtendedBolus +import app.aaps.database.entities.TemporaryBasal +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit +import app.aaps.database.entities.interfaces.end +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 7cf334a91e..1b7f5c54b0 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -11,7 +11,6 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.maintenance.ImportExportPrefs @@ -23,12 +22,13 @@ import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.userEntry.UserEntryPresentationHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerFragment +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.ui.R import info.nightscout.ui.databinding.TreatmentsUserEntryFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index ebe315ea66..7c5fdd5c18 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -13,10 +13,10 @@ import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.UserEntryLogger import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T -import dagger.android.support.DaggerDialogFragment import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.support.DaggerDialogFragment import info.nightscout.ui.databinding.DialogErrorBinding import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt index cc3b641378..2a919dc44c 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt @@ -18,10 +18,10 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventDismissBolusProgressIfRunning import app.aaps.core.interfaces.rx.events.EventOverviewBolusProgress import app.aaps.core.interfaces.rx.events.EventPumpStatusChanged -import dagger.android.support.DaggerDialogFragment import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import dagger.android.support.DaggerDialogFragment import info.nightscout.ui.databinding.DialogBolusprogressBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index 241a63d268..5a1ae44b3b 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -12,11 +12,11 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sync.XDripBroadcast import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.ui.databinding.DialogCalibrationBinding import java.text.DecimalFormat import java.util.LinkedList diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 7622da623d..6f55bc0b98 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -33,12 +33,12 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry.Action +import app.aaps.database.entities.UserEntry.Sources +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index 08bc6be8a3..9e36c7b299 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -22,11 +22,11 @@ import app.aaps.core.interfaces.utils.Translator import app.aaps.core.main.extensions.fromConstant import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt index 0f95785baa..956f235c60 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt @@ -20,10 +20,10 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogExtendedbolusBinding import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt index 1987beb112..edaa077451 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt @@ -22,11 +22,11 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.TherapyEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt index aff4586db5..5a2891bc1e 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt @@ -36,11 +36,11 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt index 26560ab0ec..e729ac4f1c 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt @@ -10,8 +10,6 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import androidx.fragment.app.FragmentManager -import app.aaps.core.main.constraints.ConstraintObject -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.ConfigBuilder @@ -38,13 +36,15 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T -import dagger.android.HasAndroidInjector -import dagger.android.support.DaggerDialogFragment +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils -import info.nightscout.database.entities.OfflineEvent -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit +import app.aaps.database.entities.OfflineEvent +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit +import dagger.android.HasAndroidInjector +import dagger.android.support.DaggerDialogFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt index 3a8d8ead93..96f4dfdf38 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt @@ -26,10 +26,10 @@ import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt index 500c393b5b..0a4497bc42 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt @@ -24,9 +24,9 @@ import app.aaps.core.main.extensions.getCustomizedName import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.HtmlHelper +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import info.nightscout.ui.databinding.DialogProfileviewerBinding import org.json.JSONObject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt index a22b0ccb5d..46ec6fb416 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt @@ -23,10 +23,10 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogTempbasalBinding import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt index 863275febc..609ed2c967 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt @@ -19,12 +19,12 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.ValueWrapper +import app.aaps.database.entities.TemporaryTarget +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import com.google.common.collect.Lists -import info.nightscout.database.ValueWrapper -import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction @@ -231,7 +231,7 @@ class TempTargetDialog : DialogFragmentWithDate() { rh.gs(app.aaps.core.ui.R.string.eatingsoon) -> TemporaryTarget.Reason.EATING_SOON rh.gs(app.aaps.core.ui.R.string.activity) -> TemporaryTarget.Reason.ACTIVITY rh.gs(app.aaps.core.ui.R.string.hypo) -> TemporaryTarget.Reason.HYPOGLYCEMIA - else -> TemporaryTarget.Reason.CUSTOM + else -> TemporaryTarget.Reason.CUSTOM }, lowTarget = profileUtil.convertToMgdl(target, profileFunction.getUnits()), highTarget = profileUtil.convertToMgdl(target, profileFunction.getUnits()) diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt index af75666e83..1c9106d315 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt @@ -26,10 +26,10 @@ import app.aaps.core.main.utils.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.entities.UserEntry +import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogTreatmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt index 810d5e1621..07067fc3cb 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt @@ -48,9 +48,9 @@ import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.main.wizard.BolusWizard import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogWizardBinding diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt index ba886aaf69..5801977701 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt @@ -10,9 +10,9 @@ import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.database.entities.BolusCalculatorResult import com.google.gson.Gson import dagger.android.support.DaggerDialogFragment -import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogWizardinfoBinding import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt b/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt index 10700728e4..e757904c9f 100644 --- a/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt +++ b/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt @@ -1,5 +1,5 @@ package info.nightscout.ui.extensions -import info.nightscout.database.entities.embedments.InterfaceIDs +import app.aaps.database.entities.embedments.InterfaceIDs fun InterfaceIDs.isPumpHistory() = pumpSerial != null && pumpId != null \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index c709796c57..48d031420a 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -12,10 +12,6 @@ import android.os.Handler import android.os.HandlerThread import android.view.View import android.widget.RemoteViews -import app.aaps.core.main.extensions.directionToIcon -import app.aaps.core.main.graph.OverviewData -import app.aaps.core.main.iob.displayText -import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.aps.VariableSensitivityResult import app.aaps.core.interfaces.configuration.Config @@ -36,8 +32,12 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.TrendCalculator +import app.aaps.core.main.extensions.directionToIcon +import app.aaps.core.main.graph.OverviewData +import app.aaps.core.main.iob.displayText +import app.aaps.core.main.profile.ProfileSealed +import app.aaps.database.entities.interfaces.end import dagger.android.HasAndroidInjector -import info.nightscout.database.entities.interfaces.end import info.nightscout.ui.R import java.util.Locale import javax.inject.Inject diff --git a/ui/src/test/java/info/nightscout/ui/extensions/InterfaceIDsExtensionKtTest.kt b/ui/src/test/java/info/nightscout/ui/extensions/InterfaceIDsExtensionKtTest.kt index 14e149c92e..73a9b4ec5d 100644 --- a/ui/src/test/java/info/nightscout/ui/extensions/InterfaceIDsExtensionKtTest.kt +++ b/ui/src/test/java/info/nightscout/ui/extensions/InterfaceIDsExtensionKtTest.kt @@ -1,8 +1,8 @@ package info.nightscout.ui.extensions +import app.aaps.database.entities.embedments.InterfaceIDs import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.database.entities.embedments.InterfaceIDs import org.junit.jupiter.api.Test class InterfaceIDsExtensionKtTest : TestBase() { diff --git a/workflow/src/main/java/info/nightscout/workflow/PrepareIobAutosensGraphDataWorker.kt b/workflow/src/main/java/info/nightscout/workflow/PrepareIobAutosensGraphDataWorker.kt index 99593c6218..f6368cf573 100644 --- a/workflow/src/main/java/info/nightscout/workflow/PrepareIobAutosensGraphDataWorker.kt +++ b/workflow/src/main/java/info/nightscout/workflow/PrepareIobAutosensGraphDataWorker.kt @@ -30,9 +30,9 @@ import app.aaps.core.main.iob.copy import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.ValueWrapper import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/workflow/src/main/java/info/nightscout/workflow/PrepareTemporaryTargetDataWorker.kt b/workflow/src/main/java/info/nightscout/workflow/PrepareTemporaryTargetDataWorker.kt index 644a781cc9..15b2d5d089 100644 --- a/workflow/src/main/java/info/nightscout/workflow/PrepareTemporaryTargetDataWorker.kt +++ b/workflow/src/main/java/info/nightscout/workflow/PrepareTemporaryTargetDataWorker.kt @@ -14,9 +14,9 @@ import app.aaps.core.main.graph.OverviewData import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.ValueWrapper import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/workflow/src/main/java/info/nightscout/workflow/PrepareTreatmentsDataWorker.kt b/workflow/src/main/java/info/nightscout/workflow/PrepareTreatmentsDataWorker.kt index 46a09f55a5..8bb9e4fd82 100644 --- a/workflow/src/main/java/info/nightscout/workflow/PrepareTreatmentsDataWorker.kt +++ b/workflow/src/main/java/info/nightscout/workflow/PrepareTreatmentsDataWorker.kt @@ -26,8 +26,8 @@ import app.aaps.core.main.graph.data.TherapyEventDataPoint import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.TherapyEvent +import app.aaps.database.entities.Bolus +import app.aaps.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/workflow/src/main/java/info/nightscout/workflow/iob/CarbsInPastExtension.kt b/workflow/src/main/java/info/nightscout/workflow/iob/CarbsInPastExtension.kt index ed904f8a62..3fd4c02dbb 100644 --- a/workflow/src/main/java/info/nightscout/workflow/iob/CarbsInPastExtension.kt +++ b/workflow/src/main/java/info/nightscout/workflow/iob/CarbsInPastExtension.kt @@ -8,7 +8,7 @@ import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.profile.ProfileFunction import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.database.entities.Carbs +import app.aaps.database.entities.Carbs fun fromCarbs(t: Carbs, isAAPSOrWeighted: Boolean, profileFunction: ProfileFunction, aapsLogger: AAPSLogger, dateUtil: DateUtil, sp: SP): AutosensData.CarbsInPast { val time = t.timestamp diff --git a/workflow/src/main/java/info/nightscout/workflow/iob/IobCobOref1Worker.kt b/workflow/src/main/java/info/nightscout/workflow/iob/IobCobOref1Worker.kt index 282a99b2de..956d453fd3 100644 --- a/workflow/src/main/java/info/nightscout/workflow/iob/IobCobOref1Worker.kt +++ b/workflow/src/main/java/info/nightscout/workflow/iob/IobCobOref1Worker.kt @@ -27,8 +27,8 @@ import app.aaps.core.main.extensions.target import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector -import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository import kotlinx.coroutines.Dispatchers import java.util.Calendar