- moved PumpHistoryEntryGroup to commons package
- added ProfileUtil with method to show basal profile so that we can display it - changed PodHistoryActivity to display values (for Bolus, TBR and SetProfile)
This commit is contained in:
parent
827eee0c3a
commit
5230a2dda0
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump;
|
||||
package info.nightscout.androidaps.plugins.pump.common.defs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -9,7 +9,7 @@ import info.nightscout.androidaps.R;
|
|||
/**
|
||||
* This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes
|
||||
* management and modified/extended for AAPS.
|
||||
*
|
||||
* <p>
|
||||
* Author: Andy {andy.rozman@gmail.com}
|
||||
*/
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.utils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||
|
||||
public class ProfileUtil {
|
||||
|
||||
|
||||
public static String getProfileDisplayable(Profile profile, PumpType pumpType) {
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (Profile.ProfileValue basalValue : profile.getBasalValues()) {
|
||||
|
||||
double basalValueValue = pumpType.determineCorrectBasalSize(basalValue.value);
|
||||
|
||||
int hour = basalValue.timeAsSeconds / (60 * 60);
|
||||
|
||||
stringBuilder.append((hour < 10 ? "0" : "") + hour + ":00");
|
||||
|
||||
stringBuilder.append(String.format(Locale.ENGLISH, "%.3f", basalValueValue));
|
||||
stringBuilder.append(", ");
|
||||
}
|
||||
if (stringBuilder.length() > 3)
|
||||
return stringBuilder.toString().substring(0, stringBuilder.length() - 2);
|
||||
else
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -5,13 +5,14 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
||||
|
||||
/**
|
||||
* This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes
|
||||
* management and modified/extended for AAPS.
|
||||
*
|
||||
* <p>
|
||||
* Author: Andy {andy.rozman@gmail.com}
|
||||
*/
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ import java.util.List;
|
|||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.activities.NoSplashActivity;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryGroup;
|
||||
|
||||
public class MedtronicHistoryActivity extends NoSplashActivity {
|
||||
|
||||
|
|
|
@ -1,22 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.tech.freak.wizardpager.model.Page;
|
||||
|
||||
import org.joda.time.LocalDateTime;
|
||||
import org.mozilla.javascript.tools.jsc.Main;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -27,7 +20,6 @@ import java.util.GregorianCalendar;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import info.nightscout.androidaps.BuildConfig;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
|
@ -46,7 +38,6 @@ import info.nightscout.androidaps.plugins.bus.RxBus;
|
|||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
|
||||
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin;
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||
|
@ -192,18 +183,23 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
.observeOn(Schedulers.io())
|
||||
.subscribe(event -> {
|
||||
if ((event.isChanged(R.string.key_omnipod_beep_basal_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_beep_bolus_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_beep_tbr_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_pod_debugging_options_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_beep_smb_enabled)))
|
||||
(event.isChanged(R.string.key_omnipod_beep_bolus_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_beep_tbr_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_pod_debugging_options_enabled)) ||
|
||||
(event.isChanged(R.string.key_omnipod_beep_smb_enabled)))
|
||||
refreshConfiguration();
|
||||
}, FabricPrivacy::logException)
|
||||
);
|
||||
refreshConfiguration();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected void onResume() {
|
||||
//
|
||||
// }
|
||||
|
||||
private void refreshConfiguration() {
|
||||
if (pumpStatusLocal!=null) {
|
||||
if (pumpStatusLocal != null) {
|
||||
pumpStatusLocal.refreshConfiguration();
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +365,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
@Override
|
||||
public boolean isSuspended() {
|
||||
return (pumpStatusLocal != null && !pumpStatusLocal.podAvailable) ||
|
||||
(OmnipodUtil.getPodSessionState()!=null && OmnipodUtil.getPodSessionState().isSuspended());
|
||||
(OmnipodUtil.getPodSessionState() != null && OmnipodUtil.getPodSessionState().isSuspended());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -383,12 +379,12 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
List<OmnipodStatusRequest> removeList = new ArrayList<>();
|
||||
|
||||
for (OmnipodStatusRequest omnipodStatusRequest : omnipodStatusRequestList) {
|
||||
if (omnipodStatusRequest==OmnipodStatusRequest.GetPodPulseLog) {
|
||||
if (omnipodStatusRequest == OmnipodStatusRequest.GetPodPulseLog) {
|
||||
OmnipodUITask omnipodUITask = omnipodUIComm.executeCommand(omnipodStatusRequest.getCommandType());
|
||||
|
||||
PodInfoRecentPulseLog result = (PodInfoRecentPulseLog)omnipodUITask.returnDataObject;
|
||||
PodInfoRecentPulseLog result = (PodInfoRecentPulseLog) omnipodUITask.returnDataObject;
|
||||
|
||||
if (result==null) {
|
||||
if (result == null) {
|
||||
LOG.warn("Result was null.");
|
||||
} else {
|
||||
LOG.warn("Result was NOT null.");
|
||||
|
@ -483,7 +479,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
|
||||
PodSessionState podSessionState = null;
|
||||
|
||||
if (OmnipodUtil.getPodSessionState()!=null) {
|
||||
if (OmnipodUtil.getPodSessionState() != null) {
|
||||
podSessionState = OmnipodUtil.getPodSessionState();
|
||||
} else {
|
||||
String podState = SP.getString(OmnipodConst.Prefs.PodState, null);
|
||||
|
@ -494,7 +490,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
}
|
||||
}
|
||||
|
||||
if (podSessionState!=null) {
|
||||
if (podSessionState != null) {
|
||||
LOG.debug("PodSessionState (saved): " + podSessionState);
|
||||
|
||||
// TODO handle if session state too old
|
||||
|
@ -767,9 +763,6 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PumpEnactResult cancelTempBasal(boolean enforceNew) {
|
||||
|
||||
|
|
|
@ -18,18 +18,21 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.activities.NoSplashActivity;
|
||||
import info.nightscout.androidaps.db.DatabaseHelper;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry;
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryGroup;
|
||||
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.db.PodHistory;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
|
||||
|
||||
public class PodHistoryActivity extends NoSplashActivity {
|
||||
|
||||
|
@ -71,12 +74,11 @@ public class PodHistoryActivity extends NoSplashActivity {
|
|||
this.filteredHistoryList.clear();
|
||||
|
||||
|
||||
|
||||
//LOG.debug("Items on full list: {}", list.size());
|
||||
|
||||
this.filteredHistoryList.addAll(fullHistoryList);
|
||||
|
||||
// TODO
|
||||
// TODO grouping
|
||||
|
||||
// if (group == PumpHistoryEntryGroup.All) {
|
||||
// this.filteredHistoryList.addAll(list);
|
||||
|
@ -220,6 +222,8 @@ public class PodHistoryActivity extends NoSplashActivity {
|
|||
|
||||
this.historyList = historyList;
|
||||
|
||||
Collections.sort(this.historyList);
|
||||
|
||||
// this.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
@ -239,11 +243,74 @@ public class PodHistoryActivity extends NoSplashActivity {
|
|||
if (record != null) {
|
||||
holder.timeView.setText(record.getDateTimeString());
|
||||
holder.typeView.setText(record.getPodDbEntryType().getResourceId());
|
||||
holder.valueView.setText(""); // TODO
|
||||
//holder.valueView.setText(""); // TODO
|
||||
setValue(record, holder.valueView);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setValue(PodHistory historyEntry, TextView valueView) {
|
||||
if (historyEntry.isSuccess()) {
|
||||
switch (historyEntry.getPodDbEntryType()) {
|
||||
|
||||
case FillCannulaSetBasalProfile: {
|
||||
if (historyEntry.getData() != null) {
|
||||
Profile profile = OmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), Profile.class);
|
||||
valueView.setText(ProfileUtil.getProfileDisplayable(profile, PumpType.Insulet_Omnipod));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SetTemporaryBasal: {
|
||||
TempBasalPair tempBasalPair = OmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), TempBasalPair.class);
|
||||
valueView.setText(MainApp.gs(R.string.omnipod_cmd_tbr_value, tempBasalPair.getInsulinRate(), tempBasalPair.getDurationMinutes()));
|
||||
}
|
||||
break;
|
||||
|
||||
case SetBasalSchedule: {
|
||||
Profile profile = OmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), Profile.class);
|
||||
valueView.setText(ProfileUtil.getProfileDisplayable(profile, PumpType.Insulet_Omnipod));
|
||||
}
|
||||
break;
|
||||
case GetPodStatus:
|
||||
break;
|
||||
case GetPodInfo:
|
||||
break;
|
||||
case SetTime:
|
||||
break;
|
||||
|
||||
case SetBolus: {
|
||||
if (historyEntry.getData().contains(";")) {
|
||||
valueView.setText(MainApp.gs(R.string.omnipod_cmd_bolus_value, Double.valueOf(historyEntry.getData())));
|
||||
} else {
|
||||
String[] splitVal = historyEntry.getData().split(";");
|
||||
valueView.setText(MainApp.gs(R.string.omnipod_cmd_bolus_value_with_carbs, Double.valueOf(splitVal[0]), Double.valueOf(splitVal[1])));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PairAndPrime:
|
||||
case CancelTemporaryBasal:
|
||||
case CancelTemporaryBasalForce:
|
||||
case ConfigureAlerts:
|
||||
case CancelBolus:
|
||||
case DeactivatePod:
|
||||
case ResetPodState:
|
||||
case AcknowledgeAlerts:
|
||||
case SuspendDelivery:
|
||||
case ResumeDelivery:
|
||||
case UnknownEntryType:
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
} else {
|
||||
valueView.setText(historyEntry.getData());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return historyList.size();
|
||||
|
|
|
@ -168,7 +168,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
if (PodInitActionType.PairAndPrimeWizardStep.equals(podInitActionType)) {
|
||||
try {
|
||||
Disposable disposable = delegate.pairAndPrime().subscribe(res -> //
|
||||
handleSetupActionResult(podInitActionType, podInitReceiver, res, time));
|
||||
handleSetupActionResult(podInitActionType, podInitReceiver, res, time, null));
|
||||
return new PumpEnactResult().success(true).enacted(true);
|
||||
} catch (Exception ex) {
|
||||
String comment = handleAndTranslateException(ex);
|
||||
|
@ -185,7 +185,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
throw new CommandInitializationException("Basal profile mapping failed", ex);
|
||||
}
|
||||
Disposable disposable = delegate.insertCannula(basalSchedule).subscribe(res -> //
|
||||
handleSetupActionResult(podInitActionType, podInitReceiver, res, time));
|
||||
handleSetupActionResult(podInitActionType, podInitReceiver, res, time, profile));
|
||||
return new PumpEnactResult().success(true).enacted(true);
|
||||
} catch (Exception ex) {
|
||||
String comment = handleAndTranslateException(ex);
|
||||
|
@ -316,7 +316,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
lastBolusUnits = pumpStatus.lastBolusAmount = unitsDelivered;
|
||||
}
|
||||
|
||||
long pumpId = addSuccessToHistory(bolusStarted.getTime(), PodHistoryEntryType.SetBolus, unitsDelivered);
|
||||
long pumpId = addSuccessToHistory(bolusStarted.getTime(), PodHistoryEntryType.SetBolus, unitsDelivered + ";" + detailedBolusInfo.carbs);
|
||||
|
||||
detailedBolusInfo.date = bolusStarted.getTime();
|
||||
detailedBolusInfo.insulin = unitsDelivered;
|
||||
|
@ -556,7 +556,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
|
||||
}
|
||||
|
||||
private void handleSetupActionResult(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, SetupActionResult res, long time) {
|
||||
private void handleSetupActionResult(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, SetupActionResult res, long time, Profile profile) {
|
||||
String comment = null;
|
||||
switch (res.getResultType()) {
|
||||
case FAILURE:
|
||||
|
@ -573,8 +573,11 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
break;
|
||||
}
|
||||
|
||||
addToHistory(time, podInitActionType == PodInitActionType.PairAndPrimeWizardStep ?
|
||||
PodHistoryEntryType.PairAndPrime : PodHistoryEntryType.FillCannulaSetBasalProfile, comment, res.getResultType().isSuccess());
|
||||
if (podInitActionType == PodInitActionType.PairAndPrimeWizardStep) {
|
||||
addToHistory(time, PodHistoryEntryType.PairAndPrime, comment, res.getResultType().isSuccess());
|
||||
} else {
|
||||
addToHistory(time, PodHistoryEntryType.FillCannulaSetBasalProfile, res.getResultType().isSuccess() ? profile : comment, res.getResultType().isSuccess());
|
||||
}
|
||||
|
||||
podInitReceiver.returnInitTaskStatus(podInitActionType, res.getResultType().isSuccess(), comment);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
|||
* Created by andy on 30.11.2019.
|
||||
*/
|
||||
@DatabaseTable(tableName = DatabaseHelper.DATABASE_POD_HISTORY)
|
||||
public class PodHistory implements DbObjectBase {
|
||||
public class PodHistory implements DbObjectBase, Comparable<PodHistory> {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(L.DATABASE);
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class PodHistory implements DbObjectBase {
|
|||
}
|
||||
|
||||
public PodHistoryEntryType getPodDbEntryType() {
|
||||
return PodHistoryEntryType.getByCode((int)this.podEntryTypeCode);
|
||||
return PodHistoryEntryType.getByCode((int) this.podEntryTypeCode);
|
||||
}
|
||||
|
||||
public void setPodDbEntryType(PodHistoryEntryType podDbEntryType) {
|
||||
|
@ -134,4 +134,9 @@ public class PodHistory implements DbObjectBase {
|
|||
public void setPodSerial(String podSerial) {
|
||||
this.podSerial = podSerial;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(PodHistory otherOne) {
|
||||
return (int) (this.date - otherOne.date);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1713,7 +1713,11 @@
|
|||
<string name="omnipod_cmd_acknowledge_alerts">Acknowledge Alerts</string>
|
||||
<string name="omnipod_cmd_suspend_delivery">Suspend Delivery</string>
|
||||
<string name="omnipod_cmd_resume_delivery">Resume Delivery</string>
|
||||
<string name="omnipod_cmd_umknown_entry">Unknown Entry</string>
|
||||
<string name="omnipod_cmd_unknown_entry">Unknown Entry</string>
|
||||
|
||||
<string name="omnipod_cmd_bolus_value">%1$.1f U</string>
|
||||
<string name="omnipod_cmd_bolus_value_with_carbs">%1$.1f U, CH=%2$.1f g</string>
|
||||
<string name="omnipod_cmd_tbr_value">Rate: %1$.1f U, Duration: %2$d min</string>
|
||||
|
||||
<string name="omnipod_cmd_reset_pod_desc">If you press <b>OK</b>, the Pod state will be forcibly reset and you will not be able to communicate with the Pod anymore. Do this only if you can not communicate with the Pod anymore. If you can still communicate with the Pod, please use the <b>Deactivate Pod</b> option.</string>
|
||||
<string name="omnipod_cmd_pod_history_na">Pod History not available at the moment.</string>
|
||||
|
|
|
@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump;
|
|||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +34,7 @@ public class MedtronicPumpHistoryDecoderUTest {
|
|||
// @Test
|
||||
public void decodeRecord() throws Exception {
|
||||
|
||||
byte[] data = new byte[] { 0x07, 0x00, 0x00, 0x05, (byte)0xFA, (byte)0xBF, 0x12 };
|
||||
byte[] data = new byte[]{0x07, 0x00, 0x00, 0x05, (byte) 0xFA, (byte) 0xBF, 0x12};
|
||||
|
||||
PumpHistoryEntryType entryType = PumpHistoryEntryType.getByCode(0x07);
|
||||
|
||||
|
@ -50,7 +51,7 @@ public class MedtronicPumpHistoryDecoderUTest {
|
|||
|
||||
// @Test
|
||||
public void decodeLowAmount() {
|
||||
byte[] data = new byte[] { 52, -12, 22, -81, 46, 3, 19 };
|
||||
byte[] data = new byte[]{52, -12, 22, -81, 46, 3, 19};
|
||||
|
||||
PumpHistoryEntryGroup.doNotTranslate = true;
|
||||
PumpHistoryEntryType entryType = PumpHistoryEntryType.getByCode(52);
|
||||
|
@ -73,15 +74,15 @@ public class MedtronicPumpHistoryDecoderUTest {
|
|||
// Data=0x6D 0xA1 0x92 0x05 0x0C 0x00 0xE8 0x00 0x00 0x00 0x00 0x04 0x0A 0x04 0x0A 0x64 0x00 0x00 0x00 0x00 0x00
|
||||
// 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0C 0x00 0xE8 0x00 0x00
|
||||
// 0x00}]
|
||||
byte[] data4443 = new byte[] {
|
||||
0x6D, (byte)0xA1, (byte)0x92, 0x05, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0A, 0x04, 0x0A,
|
||||
0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00 };
|
||||
byte[] data4443 = new byte[]{
|
||||
0x6D, (byte) 0xA1, (byte) 0x92, 0x05, 0x0C, 0x00, (byte) 0xE8, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0A, 0x04, 0x0A,
|
||||
0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, (byte) 0xE8, 0x00, 0x00, 0x00};
|
||||
|
||||
byte[] data = new byte[] {
|
||||
0x6D, (byte)0xA2, (byte)0x92, 0x05, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00, 0x00, 0x03, 0x18, 0x02,
|
||||
(byte)0xD4, 0x5B, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x44, 0x64, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00 };
|
||||
byte[] data = new byte[]{
|
||||
0x6D, (byte) 0xA2, (byte) 0x92, 0x05, 0x0C, 0x00, (byte) 0xE8, 0x00, 0x00, 0x00, 0x00, 0x03, 0x18, 0x02,
|
||||
(byte) 0xD4, 0x5B, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x44, 0x64, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x00, (byte) 0xE8, 0x00, 0x00, 0x00};
|
||||
|
||||
// basal 18.1, bolus 1.7 manual = 1.7
|
||||
// All (bg low hi, number Bgs, Sen Lo/Hi, Sens Cal/Data, Basal, Bolus, Carbs, Fodd, Corr, Manual=1.7, food/corr,
|
||||
|
@ -95,8 +96,8 @@ public class MedtronicPumpHistoryDecoderUTest {
|
|||
public void decodeDailyTotals515() {
|
||||
|
||||
byte[] data = ByteUtil
|
||||
.createByteArrayFromHexString("0x6C 0x17 0x93 0x06 0x08 0x00 0x2B 0x00 0x00 0x00 0x00 0x04 0x24 0x03 0x7C 0x54 0x00 0xA8 0x10 0x00 0x00 0x00 0xA8 0x10"
|
||||
+ " 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xA8 0x64 0x03 0x00 0x00");
|
||||
.createByteArrayFromHexString("0x6C 0x17 0x93 0x06 0x08 0x00 0x2B 0x00 0x00 0x00 0x00 0x04 0x24 0x03 0x7C 0x54 0x00 0xA8 0x10 0x00 0x00 0x00 0xA8 0x10"
|
||||
+ " 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xA8 0x64 0x03 0x00 0x00");
|
||||
|
||||
// 0x6C 0x17 0x93 0x06 0x08 0x00 0x2B 0x00 0x00 0x00 0x00 0x04 0x24 0x03 0x7C 0x54 0x00 0xA8 0x10 0x00 0x00 0x00
|
||||
// 0xA8 0x10
|
||||
|
@ -115,11 +116,11 @@ public class MedtronicPumpHistoryDecoderUTest {
|
|||
// @Test
|
||||
public void decodeDailyTotals523() {
|
||||
|
||||
byte[] data = new byte[] {
|
||||
0x6E, (byte)0xB1, (byte)0x92, 0x05, 0x00, (byte)0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, (byte)0x9A, 0x00,
|
||||
0x50, 0x34, 0x00, 0x4A, 0x30, 0x00, 0x0B, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x80, (byte)0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00 };
|
||||
byte[] data = new byte[]{
|
||||
0x6E, (byte) 0xB1, (byte) 0x92, 0x05, 0x00, (byte) 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, (byte) 0x9A, 0x00,
|
||||
0x50, 0x34, 0x00, 0x4A, 0x30, 0x00, 0x0B, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0x80, (byte) 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
// Carbs=11, total=3.850,basal=2.000, bolus=1.850, basal 52%, blus=48%, Manual=0.95, #manual=5,
|
||||
// Food only=0.9, #Food Only=1,Corr Only =0, #Corr only=0,Food+Corr=0
|
||||
|
|
Loading…
Reference in a new issue