remove profile interface from dana pumps
This commit is contained in:
parent
f2734a6c89
commit
4d953cf305
3 changed files with 4 additions and 38 deletions
|
@ -589,7 +589,7 @@ public class Profile {
|
||||||
public double getMaxDailyBasal() {
|
public double getMaxDailyBasal() {
|
||||||
double max = 0d;
|
double max = 0d;
|
||||||
for (int hour = 0; hour < 24; hour++) {
|
for (int hour = 0; hour < 24; hour++) {
|
||||||
double value = getBasalTimeFromMidnight((Integer) (hour * 60 * 60));
|
double value = getBasalTimeFromMidnight(hour * 60 * 60);
|
||||||
if (value > max) max = value;
|
if (value > max) max = value;
|
||||||
}
|
}
|
||||||
return max;
|
return max;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.danaR;
|
package info.nightscout.androidaps.plugins.pump.danaR;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
@ -15,7 +14,6 @@ import info.nightscout.androidaps.BuildConfig;
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.data.Profile;
|
import info.nightscout.androidaps.data.Profile;
|
||||||
import info.nightscout.androidaps.data.ProfileStore;
|
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
import info.nightscout.androidaps.db.ExtendedBolus;
|
import info.nightscout.androidaps.db.ExtendedBolus;
|
||||||
import info.nightscout.androidaps.db.TemporaryBasal;
|
import info.nightscout.androidaps.db.TemporaryBasal;
|
||||||
|
@ -25,7 +23,6 @@ import info.nightscout.androidaps.interfaces.DanaRInterface;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.interfaces.PluginDescription;
|
import info.nightscout.androidaps.interfaces.PluginDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PluginType;
|
import info.nightscout.androidaps.interfaces.PluginType;
|
||||||
import info.nightscout.androidaps.interfaces.ProfileInterface;
|
|
||||||
import info.nightscout.androidaps.interfaces.PumpDescription;
|
import info.nightscout.androidaps.interfaces.PumpDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
|
@ -49,7 +46,7 @@ import info.nightscout.androidaps.utils.SP;
|
||||||
* Created by mike on 28.01.2018.
|
* Created by mike on 28.01.2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface, ProfileInterface {
|
public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface {
|
||||||
protected Logger log = LoggerFactory.getLogger(L.PUMP);
|
protected Logger log = LoggerFactory.getLogger(L.PUMP);
|
||||||
|
|
||||||
protected AbstractDanaRExecutionService sExecutionService;
|
protected AbstractDanaRExecutionService sExecutionService;
|
||||||
|
@ -143,7 +140,6 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte
|
||||||
for (int h = 0; h < basalValues; h++) {
|
for (int h = 0; h < basalValues; h++) {
|
||||||
Double pumpValue = pump.pumpProfiles[pump.activeProfile][h];
|
Double pumpValue = pump.pumpProfiles[pump.activeProfile][h];
|
||||||
Double profileValue = profile.getBasalTimeFromMidnight(h * basalIncrement);
|
Double profileValue = profile.getBasalTimeFromMidnight(h * basalIncrement);
|
||||||
if (profileValue == null) return true;
|
|
||||||
if (Math.abs(pumpValue - profileValue) > getPumpDescription().basalStep) {
|
if (Math.abs(pumpValue - profileValue) > getPumpDescription().basalStep) {
|
||||||
if (L.isEnabled(L.PUMP))
|
if (L.isEnabled(L.PUMP))
|
||||||
log.debug("Diff found. Hour: " + h + " Pump: " + pumpValue + " Profile: " + profileValue);
|
log.debug("Diff found. Hour: " + h + " Pump: " + pumpValue + " Profile: " + profileValue);
|
||||||
|
@ -436,19 +432,6 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte
|
||||||
return applyBolusConstraints(insulin);
|
return applyBolusConstraints(insulin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ProfileStore getProfile() {
|
|
||||||
if (DanaRPump.getInstance().lastSettingsRead == 0)
|
|
||||||
return null; // no info now
|
|
||||||
return DanaRPump.getInstance().createConvertedProfile();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getProfileName() {
|
|
||||||
return DanaRPump.getInstance().createConvertedProfileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PumpEnactResult loadTDDs() {
|
public PumpEnactResult loadTDDs() {
|
||||||
return loadHistory(RecordTypes.RECORD_TYPE_DAILY);
|
return loadHistory(RecordTypes.RECORD_TYPE_DAILY);
|
||||||
|
|
|
@ -34,7 +34,6 @@ import info.nightscout.androidaps.interfaces.DanaRInterface;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.interfaces.PluginDescription;
|
import info.nightscout.androidaps.interfaces.PluginDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PluginType;
|
import info.nightscout.androidaps.interfaces.PluginType;
|
||||||
import info.nightscout.androidaps.interfaces.ProfileInterface;
|
|
||||||
import info.nightscout.androidaps.interfaces.PumpDescription;
|
import info.nightscout.androidaps.interfaces.PumpDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
|
@ -70,7 +69,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||||
* Created by mike on 03.09.2017.
|
* Created by mike on 03.09.2017.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface, ProfileInterface {
|
public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInterface, ConstraintsInterface {
|
||||||
private Logger log = LoggerFactory.getLogger(L.PUMP);
|
private Logger log = LoggerFactory.getLogger(L.PUMP);
|
||||||
private CompositeDisposable disposable = new CompositeDisposable();
|
private CompositeDisposable disposable = new CompositeDisposable();
|
||||||
|
|
||||||
|
@ -275,21 +274,6 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
|
||||||
return applyBolusConstraints(insulin);
|
return applyBolusConstraints(insulin);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Profile interface
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ProfileStore getProfile() {
|
|
||||||
if (DanaRPump.getInstance().lastSettingsRead == 0)
|
|
||||||
return null; // no info now
|
|
||||||
return DanaRPump.getInstance().createConvertedProfile();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getProfileName() {
|
|
||||||
return DanaRPump.getInstance().createConvertedProfileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pump interface
|
// Pump interface
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -354,8 +338,7 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
|
||||||
int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60;
|
int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60;
|
||||||
for (int h = 0; h < basalValues; h++) {
|
for (int h = 0; h < basalValues; h++) {
|
||||||
Double pumpValue = pump.pumpProfiles[pump.activeProfile][h];
|
Double pumpValue = pump.pumpProfiles[pump.activeProfile][h];
|
||||||
Double profileValue = profile.getBasalTimeFromMidnight((Integer) (h * basalIncrement));
|
Double profileValue = profile.getBasalTimeFromMidnight(h * basalIncrement);
|
||||||
if (profileValue == null) return true;
|
|
||||||
if (Math.abs(pumpValue - profileValue) > getPumpDescription().basalStep) {
|
if (Math.abs(pumpValue - profileValue) > getPumpDescription().basalStep) {
|
||||||
if (L.isEnabled(L.PUMP))
|
if (L.isEnabled(L.PUMP))
|
||||||
log.debug("Diff found. Hour: " + h + " Pump: " + pumpValue + " Profile: " + profileValue);
|
log.debug("Diff found. Hour: " + h + " Pump: " + pumpValue + " Profile: " + profileValue);
|
||||||
|
|
Loading…
Reference in a new issue