Changed files with changes to PumpInterface and Profile

This commit is contained in:
Andy Rozman 2019-07-14 22:24:41 +01:00
parent f0cc3d4ab2
commit c3de5d7f58
4 changed files with 31 additions and 16 deletions

View file

@ -290,7 +290,7 @@ public class MainApp extends Application {
break; break;
case BluetoothAdapter.STATE_ON: { case BluetoothAdapter.STATE_ON: {
if ("Medtronic".equals(activePump.deviceID())) { if ("Medtronic".equals(activePump.manufacter())) {
Log.v("MainApp", "Bluetooth on"); Log.v("MainApp", "Bluetooth on");
RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.BluetoothReconnected); RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.BluetoothReconnected);
} }

View file

@ -6,9 +6,9 @@ import android.content.ServiceConnection;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.os.SystemClock; import android.os.SystemClock;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity;
import org.joda.time.LocalDateTime; import org.joda.time.LocalDateTime;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -42,6 +42,7 @@ import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction; import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType; import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
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.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract; import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract;
@ -633,7 +634,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
StringBuilder stringBuilder = new StringBuilder("Requested Basals (h): "); StringBuilder stringBuilder = new StringBuilder("Requested Basals (h): ");
for (Profile.BasalValue basalValue : profile.getBasalValues()) { for (Profile.ProfileValue basalValue : profile.getBasalValues()) {
double basalValueValue = pumpType.determineCorrectBasalSize(basalValue.value); double basalValueValue = pumpType.determineCorrectBasalSize(basalValue.value);
@ -1368,6 +1369,20 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
} }
} }
@Override
public String manufacter() {
return "Medtronic";
}
@Override
public String model() {
return getMDTPumpStatus().medtronicDeviceType.getPumpModel();
}
@Override
public String serialNumber() {
return getMDTPumpStatus().serialNumber;
}
@Override @Override
public PumpEnactResult setNewBasalProfile(Profile profile) { public PumpEnactResult setNewBasalProfile(Profile profile) {

View file

@ -1,8 +1,20 @@
package info.nightscout.androidaps.plugins.pump.medtronic.util; package info.nightscout.androidaps.plugins.pump.medtronic.util;
import android.content.Context; import android.content.Context;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import org.joda.time.LocalTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.androidaps.interfaces.PluginType;
@ -27,15 +39,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicDeviceStatusChange;
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService; import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService;
import info.nightscout.androidaps.utils.OKDialog; import info.nightscout.androidaps.utils.OKDialog;
import org.joda.time.LocalTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* Created by andy on 5/9/18. * Created by andy on 5/9/18.

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.treatments;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.firebase.analytics.FirebaseAnalytics; import com.google.firebase.analytics.FirebaseAnalytics;
@ -579,10 +580,6 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
return newRecordCreated; return newRecordCreated;
} }
private boolean isMedtronicPump() {
return ConfigBuilderPlugin.getPlugin().getActivePump().deviceID().equals("Medtronic");
}
@Override @Override
public long oldestDataAvailable() { public long oldestDataAvailable() {
long oldestTime = System.currentTimeMillis(); long oldestTime = System.currentTimeMillis();