visualize SMB
This commit is contained in:
parent
204c39880f
commit
aad168c50f
3 changed files with 28 additions and 9 deletions
|
@ -14,6 +14,7 @@ import java.util.Objects;
|
|||
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.data.Iob;
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface;
|
||||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||
|
@ -160,6 +161,9 @@ public class Treatment implements DataPointWithLabelInterface {
|
|||
|
||||
@Override
|
||||
public PointsWithLabelGraphSeries.Shape getShape() {
|
||||
if (isSMB)
|
||||
return PointsWithLabelGraphSeries.Shape.SMB;
|
||||
else
|
||||
return PointsWithLabelGraphSeries.Shape.BOLUS;
|
||||
}
|
||||
|
||||
|
@ -170,6 +174,9 @@ public class Treatment implements DataPointWithLabelInterface {
|
|||
|
||||
@Override
|
||||
public int getColor() {
|
||||
if (isSMB)
|
||||
return MainApp.sResources.getColor(R.color.tempbasal);
|
||||
else
|
||||
return Color.CYAN;
|
||||
}
|
||||
|
||||
|
|
|
@ -1595,6 +1595,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
if (!t.isValid)
|
||||
continue;
|
||||
if (t.getX() < fromTime || t.getX() > endTime) continue;
|
||||
if (t.isSMB)
|
||||
t.setY(lowLine);
|
||||
else
|
||||
t.setY(getNearestBg((long) t.getX(), bgReadingsArray));
|
||||
filteredTreatments.add(t);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
|||
TRIANGLE,
|
||||
RECTANGLE,
|
||||
BOLUS,
|
||||
SMB,
|
||||
EXTENDEDBOLUS,
|
||||
PROFILE,
|
||||
MBG,
|
||||
|
@ -218,6 +219,14 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
|||
if (value.getLabel() != null) {
|
||||
drawLabel45(endX, endY, value, canvas);
|
||||
}
|
||||
} else if (value.getShape() == Shape.SMB) {
|
||||
mPaint.setStrokeWidth(2);
|
||||
Point[] points = new Point[3];
|
||||
points[0] = new Point((int)endX, (int)(endY-value.getSize()));
|
||||
points[1] = new Point((int)(endX+value.getSize()), (int)(endY+value.getSize()*0.67));
|
||||
points[2] = new Point((int)(endX-value.getSize()), (int)(endY+value.getSize()*0.67));
|
||||
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
drawArrows(points, canvas, mPaint);
|
||||
} else if (value.getShape() == Shape.EXTENDEDBOLUS) {
|
||||
mPaint.setStrokeWidth(0);
|
||||
if (value.getLabel() != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue