pump manufacters etc
This commit is contained in:
parent
c49da9a818
commit
243e6c5801
20 changed files with 116 additions and 57 deletions
|
@ -15,7 +15,7 @@ import android.text.TextUtils;
|
|||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||
import info.nightscout.androidaps.events.EventRefreshGui;
|
||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||
|
@ -209,11 +209,12 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
|||
|
||||
initSummary(getPreferenceScreen());
|
||||
|
||||
final Preference tidepoolTestLogin = findPreference("tidepool_test_login");
|
||||
tidepoolTestLogin.setOnPreferenceClickListener(preference -> {
|
||||
TidepoolUploader.INSTANCE.testLogin(getActivity());
|
||||
return false;
|
||||
});
|
||||
final Preference tidepoolTestLogin = findPreference(MainApp.gs(R.string.key_tidepool_test_login));
|
||||
if (tidepoolTestLogin != null)
|
||||
tidepoolTestLogin.setOnPreferenceClickListener(preference -> {
|
||||
TidepoolUploader.INSTANCE.testLogin(getActivity());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.data.OverlappingIntervals;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
import info.nightscout.androidaps.data.ProfileStore;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps
|
||||
package info.nightscout.androidaps.plugins.bus
|
||||
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.subjects.PublishSubject
|
|
@ -232,26 +232,32 @@ public class ConfigBuilderPlugin extends PluginBase {
|
|||
return commandQueue;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public BgSourceInterface getActiveBgSource() {
|
||||
return activeBgSource;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ProfileInterface getActiveProfileInterface() {
|
||||
return activeProfile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public InsulinInterface getActiveInsulin() {
|
||||
return activeInsulin;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public APSInterface getActiveAPS() {
|
||||
return activeAPS;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PumpInterface getActivePump() {
|
||||
return activePump;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public SensitivityInterface getActiveSensitivity() {
|
||||
return activeSensitivity;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import info.nightscout.androidaps.Config;
|
|||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.events.EventAppExit;
|
||||
import info.nightscout.androidaps.events.EventChargingState;
|
||||
import info.nightscout.androidaps.events.EventNetworkChange;
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.squareup.otto.Bus;
|
|||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.events.EventChargingState;
|
||||
import info.nightscout.androidaps.events.EventNetworkChange;
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||
|
|
|
@ -12,7 +12,7 @@ import android.widget.TextView;
|
|||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.plugins.common.SubscriberFragment;
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.comm.TidepoolUploader;
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolDoUpload;
|
||||
|
|
|
@ -5,7 +5,7 @@ import android.text.Spanned
|
|||
import info.nightscout.androidaps.Constants
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.RxBus
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus
|
||||
import info.nightscout.androidaps.events.EventNetworkChange
|
||||
import info.nightscout.androidaps.events.EventNewBG
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.general.tidepool.comm
|
||||
|
||||
import info.nightscout.androidaps.RxBus
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus
|
||||
import info.nightscout.androidaps.logging.L
|
||||
import org.slf4j.LoggerFactory
|
||||
import retrofit2.Call
|
||||
|
|
|
@ -2,10 +2,11 @@ package info.nightscout.androidaps.plugins.general.tidepool.comm
|
|||
|
||||
import android.content.Context
|
||||
import android.os.PowerManager
|
||||
import android.os.SystemClock
|
||||
import info.nightscout.androidaps.BuildConfig
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.RxBus
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus
|
||||
import info.nightscout.androidaps.logging.L
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolStatus
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.messages.*
|
||||
|
@ -137,7 +138,8 @@ object TidepoolUploader {
|
|||
connectionStatus = TidepoolUploader.ConnectionStatus.CONNECTED
|
||||
RxBus.send(EventTidepoolStatus(("New dataset OK")))
|
||||
if (doUpload) doUpload()
|
||||
releaseWakeLock()
|
||||
else
|
||||
releaseWakeLock()
|
||||
}, {
|
||||
RxBus.send(EventTidepoolStatus(("New dataset FAILED")))
|
||||
connectionStatus = TidepoolUploader.ConnectionStatus.FAILED
|
||||
|
@ -151,7 +153,8 @@ object TidepoolUploader {
|
|||
connectionStatus = TidepoolUploader.ConnectionStatus.CONNECTED
|
||||
RxBus.send(EventTidepoolStatus(("Appending to existing dataset")))
|
||||
if (doUpload) doUpload()
|
||||
releaseWakeLock()
|
||||
else
|
||||
releaseWakeLock()
|
||||
}
|
||||
}, {
|
||||
connectionStatus = TidepoolUploader.ConnectionStatus.FAILED
|
||||
|
@ -170,6 +173,7 @@ object TidepoolUploader {
|
|||
fun doUpload() {
|
||||
if (session == null) {
|
||||
log.error("Session is null, cannot proceed")
|
||||
releaseWakeLock()
|
||||
return
|
||||
}
|
||||
extendWakeLock(60000)
|
||||
|
@ -184,6 +188,7 @@ object TidepoolUploader {
|
|||
if (L.isEnabled(L.TIDEPOOL)) log.debug("Empty dataset - marking as succeeded")
|
||||
RxBus.send(EventTidepoolStatus(("No data to upload")))
|
||||
releaseWakeLock()
|
||||
unploadNext()
|
||||
}
|
||||
else -> {
|
||||
val body = RequestBody.create(MediaType.parse("application/json"), chunk)
|
||||
|
@ -194,13 +199,22 @@ object TidepoolUploader {
|
|||
setLastEnd(session!!.end)
|
||||
RxBus.send(EventTidepoolStatus(("Upload completed OK")))
|
||||
releaseWakeLock()
|
||||
unploadNext()
|
||||
}, {
|
||||
RxBus.send(EventTidepoolStatus(("Upload FAILED")))
|
||||
releaseWakeLock()
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun unploadNext() {
|
||||
if (getLastEnd() < DateUtil.now() - T.mins(1).msecs()) {
|
||||
SystemClock.sleep(3000)
|
||||
if (L.isEnabled(L.TIDEPOOL))
|
||||
log.debug("Restarting doUpload. Last: " + DateUtil.dateAndTimeString(getLastEnd()))
|
||||
doUpload()
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteDataSet() {
|
||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.tidepool.comm
|
|||
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.RxBus
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus
|
||||
import info.nightscout.androidaps.logging.L
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.elements.*
|
||||
import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolStatus
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.google.gson.annotations.Expose
|
|||
import info.nightscout.androidaps.data.Profile
|
||||
import info.nightscout.androidaps.db.ProfileSwitch
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.androidaps.utils.InstanceId
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
@ -23,7 +24,13 @@ class ProfileElement(ps: ProfileSwitch)
|
|||
@Expose
|
||||
internal var insulinSensitivities: IsfProfile = IsfProfile()
|
||||
@Expose
|
||||
internal var deviceId: String = (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Unknown") + ":" + (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Unknown")
|
||||
internal var deviceId: String = (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Medtronic") + ":" + (ConfigBuilderPlugin.getPlugin().activePump?.serialNumber() ?: InstanceId.instanceId())
|
||||
@Expose
|
||||
internal var deviceSerialNumber: String = ConfigBuilderPlugin.getPlugin().activePump?.serialNumber() ?: InstanceId.instanceId()
|
||||
@Expose
|
||||
internal var clockDriftOffset: Long = 0
|
||||
@Expose
|
||||
internal var conversionOffset: Long = 0
|
||||
|
||||
init {
|
||||
type = "pumpSettings"
|
||||
|
|
|
@ -2,17 +2,18 @@ package info.nightscout.androidaps.plugins.general.tidepool.messages
|
|||
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.BuildConfig
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.InstanceId
|
||||
import info.nightscout.androidaps.utils.T
|
||||
import java.util.*
|
||||
|
||||
class OpenDatasetRequestMessage : BaseMessage() {
|
||||
|
||||
@Expose
|
||||
var deviceId: String = (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Unknown") + ":" + (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Unknown")
|
||||
var deviceId: String = (ConfigBuilderPlugin.getPlugin().activePump?.model()
|
||||
?: "Medtronic") + ":" + (ConfigBuilderPlugin.getPlugin().activePump?.serialNumber()
|
||||
?: InstanceId.instanceId())
|
||||
@Expose
|
||||
var time = DateUtil.toISOAsUTC(DateUtil.now())
|
||||
@Expose
|
||||
|
@ -27,9 +28,9 @@ class OpenDatasetRequestMessage : BaseMessage() {
|
|||
@Expose
|
||||
var dataSetType = "continuous"
|
||||
@Expose
|
||||
var deviceManufacturers = arrayOf("Dexcom", "Medtronic")
|
||||
var deviceManufacturers = arrayOf("Medtronic")
|
||||
@Expose
|
||||
var deviceModel = (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Unknown")
|
||||
var deviceModel = (ConfigBuilderPlugin.getPlugin().activePump?.model() ?: "Medtronic")
|
||||
@Expose
|
||||
var deviceTags = arrayOf("bgm", "cgm", "insulin-pump")
|
||||
@Expose
|
||||
|
|
|
@ -65,6 +65,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
|||
import info.nightscout.androidaps.plugins.treatments.Treatment;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.InstanceId;
|
||||
import info.nightscout.androidaps.utils.SP;
|
||||
/**
|
||||
* Created by mike on 05.08.2016.
|
||||
|
@ -1323,7 +1324,7 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint
|
|||
|
||||
@Override
|
||||
public String serialNumber() {
|
||||
return "Unknown";
|
||||
return InstanceId.INSTANCE.instanceId(); // TODO replace by real serial
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,7 @@ import info.nightscout.androidaps.plugins.pump.common.data.DoseSettings;
|
|||
|
||||
public enum PumpType {
|
||||
|
||||
GenericAAPS("Generic AAPS", 0.1d, null, //
|
||||
GenericAAPS("Generic AAPS", "AndroidAPS", "VirutalPump", 0.1d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Percent, //
|
||||
new DoseSettings(10,30, 24*60, 0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
|
@ -26,7 +26,7 @@ public enum PumpType {
|
|||
|
||||
// Cellnovo
|
||||
|
||||
Cellnovo1("Cellnovo", 0.05d, null, //
|
||||
Cellnovo1("Cellnovo", "Cellnovo", "Cellnovo", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 24*60, 1d, null),
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(5,30, 24*60, 0d, 200d), PumpCapability.BasalRate_Duration30minAllowed, //
|
||||
|
@ -34,105 +34,107 @@ public enum PumpType {
|
|||
|
||||
// Accu-Chek
|
||||
|
||||
AccuChekCombo("Accu-Chek Combo", 0.1d, null, //
|
||||
AccuChekCombo("Accu-Chek Combo", "Roche", "Combo", 0.1d, null, //
|
||||
new DoseSettings(0.1d, 15, 12*60, 0.1d), //
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(10, 15, 12*60,0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.01d, 0.01d, DoseStepSize.ComboBasal, PumpCapability.ComboCapabilities), //
|
||||
|
||||
AccuChekSpirit("Accu-Chek Spirit", 0.1d, null, //
|
||||
AccuChekSpirit("Accu-Chek Spirit", "Roche", "Spirit", 0.1d, null, //
|
||||
new DoseSettings(0.1d, 15, 12*60, 0.1d), //
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(10, 15, 12*60,0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.01d, 0.1d, null, PumpCapability.VirtualPumpCapabilities), //
|
||||
|
||||
AccuChekInsight("Accu-Chek Insight", 0.05d, DoseStepSize.InsightBolus, //
|
||||
AccuChekInsight("Accu-Chek Insight", "Roche", "Insight", 0.05d, DoseStepSize.InsightBolus, //
|
||||
new DoseSettings(0.05d, 15, 24*60, 0.05d), //
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(10, 15, 24*60,0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.02d, 0.01d, null, PumpCapability.InsightCapabilities), //
|
||||
|
||||
AccuChekInsightBluetooth("Accu-Chek Insight", 0.01d, null, //
|
||||
AccuChekInsightBluetooth("Accu-Chek Insight", "Roche", "Insight", 0.01d, null, //
|
||||
new DoseSettings(0.01d, 15, 24*60, 0.05d), //
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(10, 15, 24*60,0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.02d, 0.01d, DoseStepSize.InsightBolus, PumpCapability.InsightCapabilities), //
|
||||
|
||||
// Animas
|
||||
AnimasVibe("Animas Vibe", 0.05d, null, // AnimasBolus?
|
||||
AnimasVibe("Animas Vibe","Animas", "Vibe", 0.05d, null, // AnimasBolus?
|
||||
new DoseSettings(0.05d, 30, 12*60, 0.05d), //
|
||||
PumpTempBasalType.Percent, //
|
||||
new DoseSettings(10, 30, 24*60, 0d, 300d), PumpCapability.BasalRate_Duration30minAllowed, //
|
||||
0.025d, 5d, 0d, null, PumpCapability.VirtualPumpCapabilities), //
|
||||
|
||||
AnimasPing("Animas Ping", AnimasVibe),
|
||||
AnimasPing("Animas Ping", "Ping", AnimasVibe),
|
||||
|
||||
// Dana
|
||||
DanaR("DanaR", 0.05d, null, //
|
||||
DanaR("DanaR", "SOOIL", "DanaR", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Percent, //
|
||||
new DoseSettings(10d, 60, 24*60, 0d, 200d), PumpCapability.BasalRate_Duration15and30minNotAllowed, //
|
||||
0.04d, 0.01d, null, PumpCapability.DanaCapabilities),
|
||||
|
||||
DanaRKorean("DanaR Korean", 0.05d, null, //
|
||||
DanaRKorean("DanaR Korean", "SOOIL", "DanaRKorean", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Percent, //
|
||||
new DoseSettings(10d, 60, 24*60, 0d, 200d), PumpCapability.BasalRate_Duration15and30minNotAllowed, //
|
||||
0.1d, 0.01d, null, PumpCapability.DanaCapabilities),
|
||||
|
||||
DanaRS("DanaRS", 0.05d, null, //
|
||||
DanaRS("DanaRS", "SOOIL", "DanaRS", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Percent, //
|
||||
new DoseSettings(10d, 60, 24*60, 0d, 200d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.04d, 0.01d, null, PumpCapability.DanaWithHistoryCapabilities),
|
||||
|
||||
DanaRv2("DanaRv2", DanaRS),
|
||||
DanaRv2("DanaRv2", "DanaRv2", DanaRS),
|
||||
|
||||
|
||||
// Insulet
|
||||
Insulet_Omnipod("Insulet Omnipod", 0.05d, null, //
|
||||
Insulet_Omnipod("Insulet Omnipod", "Insulet", "Omnipod", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Absolute, //
|
||||
new DoseSettings(0.05d, 30, 12*60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // cannot exceed max basal rate 30u/hr
|
||||
0.05d, 0.05d, null, PumpCapability.VirtualPumpCapabilities),
|
||||
|
||||
// Medtronic
|
||||
Medtronic_512_712("Medtronic 512/712", 0.05d, null, //
|
||||
Medtronic_512_712("Medtronic 512/712", "Medtronic", "512/712", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Absolute, //
|
||||
new DoseSettings(0.05d, 30, 24*60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
|
||||
0.05d, 0.05d, null, PumpCapability.VirtualPumpCapabilities), // TODO
|
||||
|
||||
Medtronic_515_715("Medtronic 515/715", Medtronic_512_712),
|
||||
Medtronic_522_722("Medtronic 522/722", Medtronic_512_712),
|
||||
Medtronic_515_715("Medtronic 515/715", "515/715", Medtronic_512_712),
|
||||
Medtronic_522_722("Medtronic 522/722", "522/722", Medtronic_512_712),
|
||||
|
||||
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", 0.05d, null, //
|
||||
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", "Medtronic", "523/723 (Revel)", 0.05d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Absolute, //
|
||||
new DoseSettings(0.05d, 30, 24*60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
|
||||
0.025d, 0.025d, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPumpCapabilities), //
|
||||
|
||||
Medtronic_554_754_Veo("Medtronic 554/754 (Veo)", Medtronic_523_723_Revel), // TODO
|
||||
Medtronic_554_754_Veo("Medtronic 554/754 (Veo)", "554/754 (Veo)", Medtronic_523_723_Revel), // TODO
|
||||
|
||||
Medtronic_640G("Medtronic 640G", 0.025d, null, //
|
||||
Medtronic_640G("Medtronic 640G", "Medtronic", "640G", 0.025d, null, //
|
||||
new DoseSettings(0.05d, 30, 8*60, 0.05d), //
|
||||
PumpTempBasalType.Absolute, //
|
||||
new DoseSettings(0.05d, 30, 24*60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
|
||||
0.025d, 0.025d, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPumpCapabilities), //
|
||||
|
||||
// Tandem
|
||||
TandemTSlim("Tandem t:slim", 0.01d, null, //
|
||||
TandemTSlim("Tandem t:slim", "Tandem", "t:slim", 0.01d, null, //
|
||||
new DoseSettings(0.01d,15, 8*60, 0.4d),
|
||||
PumpTempBasalType.Percent,
|
||||
new DoseSettings(1,15, 8*60, 0d, 250d), PumpCapability.BasalRate_Duration15and30minAllowed, //
|
||||
0.1d, 0.001d, null, PumpCapability.VirtualPumpCapabilities),
|
||||
|
||||
TandemTFlex("Tandem t:flex", TandemTSlim), //
|
||||
TandemTSlimG4("Tandem t:slim G4", TandemTSlim), //
|
||||
TandemTSlimX2("Tandem t:slim X2", TandemTSlim), //
|
||||
TandemTFlex("Tandem t:flex", "t:flex", TandemTSlim), //
|
||||
TandemTSlimG4("Tandem t:slim G4", "t:slim G4", TandemTSlim), //
|
||||
TandemTSlimX2("Tandem t:slim X2", "t:slim X2", TandemTSlim), //
|
||||
;
|
||||
|
||||
private String description;
|
||||
private String manufacter;
|
||||
private String model;
|
||||
private double bolusSize;
|
||||
private DoseStepSize specialBolusSize;
|
||||
private DoseSettings extendedBolusSettings;
|
||||
|
@ -158,33 +160,37 @@ public enum PumpType {
|
|||
}
|
||||
|
||||
|
||||
PumpType(String description, PumpType parent)
|
||||
PumpType(String description, String model, PumpType parent)
|
||||
{
|
||||
this.description = description;
|
||||
this.parent = parent;
|
||||
parent.model = model;
|
||||
}
|
||||
|
||||
PumpType(String description, PumpType parent, PumpCapability pumpCapability)
|
||||
PumpType(String description, String model, PumpType parent, PumpCapability pumpCapability)
|
||||
{
|
||||
this.description = description;
|
||||
this.parent = parent;
|
||||
this.pumpCapability = pumpCapability;
|
||||
parent.model = model;
|
||||
}
|
||||
|
||||
PumpType(String description, double bolusSize, DoseStepSize specialBolusSize, //
|
||||
PumpType(String description, String manufacter, String model, double bolusSize, DoseStepSize specialBolusSize, //
|
||||
DoseSettings extendedBolusSettings, //
|
||||
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
|
||||
double baseBasalMinValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
|
||||
{
|
||||
this(description, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
|
||||
this(description, manufacter, model, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
|
||||
}
|
||||
|
||||
PumpType(String description, double bolusSize, DoseStepSize specialBolusSize, //
|
||||
PumpType(String description, String manufacter, String model, double bolusSize, DoseStepSize specialBolusSize, //
|
||||
DoseSettings extendedBolusSettings, //
|
||||
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
|
||||
double baseBasalMinValue, Double baseBasalMaxValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
|
||||
{
|
||||
this.description = description;
|
||||
this.manufacter = manufacter;
|
||||
this.model = model;
|
||||
this.bolusSize = bolusSize;
|
||||
this.specialBolusSize = specialBolusSize;
|
||||
this.extendedBolusSettings = extendedBolusSettings;
|
||||
|
@ -203,6 +209,14 @@ public enum PumpType {
|
|||
return description;
|
||||
}
|
||||
|
||||
public String getManufacter() {
|
||||
return isParentSet() ? parent.manufacter : manufacter;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return isParentSet() ? parent.model : model;
|
||||
}
|
||||
|
||||
public PumpCapability getPumpCapability() {
|
||||
|
||||
if (isParentSet())
|
||||
|
|
|
@ -23,6 +23,7 @@ import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
|
|||
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.InstanceId;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -247,7 +248,7 @@ public class MDIPlugin extends PluginBase implements PumpInterface {
|
|||
|
||||
@Override
|
||||
public String serialNumber() {
|
||||
return "Unknown";
|
||||
return InstanceId.INSTANCE.instanceId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,6 +39,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
|||
import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.InstanceId;
|
||||
import info.nightscout.androidaps.utils.SP;
|
||||
|
||||
|
||||
|
@ -438,17 +439,17 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
|
|||
|
||||
@Override
|
||||
public String manufacter() {
|
||||
return "AndroidAPS";
|
||||
return pumpDescription.pumpType.getManufacter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String model() {
|
||||
return "VirtualPump";
|
||||
return pumpDescription.pumpType.getModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String serialNumber() {
|
||||
return "Unknown";
|
||||
return InstanceId.INSTANCE.instanceId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.concurrent.ScheduledFuture;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.RxBus;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBus;
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package info.nightscout.androidaps.utils
|
||||
|
||||
import android.provider.Settings
|
||||
import com.google.firebase.iid.FirebaseInstanceId
|
||||
import info.nightscout.androidaps.R
|
||||
|
||||
object InstanceId {
|
||||
fun instanceId(): String {
|
||||
var id = FirebaseInstanceId.getInstance().id
|
||||
return id
|
||||
}
|
||||
}
|
|
@ -1373,6 +1373,7 @@
|
|||
<string name="tidepool_upload_profile">Upload profile switches, temp targets</string>
|
||||
<string name="key_tidepool_upload_bg" translatable="false">tidepool_upload_bg</string>
|
||||
<string name="tidepool_upload_bg">Upload BG tests</string>
|
||||
<string name="key_instanceid" translatable="false">instanceid</string>
|
||||
|
||||
<plurals name="objective_days">
|
||||
<item quantity="one">%1$d day</item>
|
||||
|
|
Loading…
Reference in a new issue