- some changes with package fixes
This commit is contained in:
parent
23cd1d9143
commit
8e438f05fe
8 changed files with 27 additions and 53 deletions
|
@ -76,7 +76,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
@Inject lateinit var insulinOrefFreePeakPlugin: InsulinOrefFreePeakPlugin
|
||||
@Inject lateinit var loopPlugin: LoopPlugin
|
||||
@Inject lateinit var localInsightPlugin: LocalInsightPlugin
|
||||
@Inject lateinit var medtronicPumpPlugin: info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
@Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin
|
||||
@Inject lateinit var nsClientPlugin: NSClientPlugin
|
||||
@Inject lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin
|
||||
@Inject lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin
|
||||
|
|
|
@ -10,6 +10,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImp
|
|||
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity
|
||||
import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity
|
||||
import info.nightscout.androidaps.plugins.pump.common.dialog.RileyLinkBLEScanActivity
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
|
||||
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
|
||||
|
@ -30,7 +31,7 @@ abstract class ActivitiesModule {
|
|||
@ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity
|
||||
@ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity
|
||||
@ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity
|
||||
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusActivity(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
||||
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusActivity(): RileyLinkStatusActivity
|
||||
@ContributesAndroidInjector abstract fun contributesRileyLinkBLEScanActivity(): RileyLinkBLEScanActivity
|
||||
@ContributesAndroidInjector abstract fun contributesSetupWizardActivity(): SetupWizardActivity
|
||||
@ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity
|
||||
|
|
|
@ -85,7 +85,7 @@ class OmnipodFragment : DaggerFragment() {
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
omnipod_rl_status.text = resourceHelper.gs(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod))
|
||||
omnipod_rl_status.text = resourceHelper.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.Omnipod))
|
||||
|
||||
omnipod_pod_status.setTextColor(Color.WHITE)
|
||||
omnipod_pod_status.text = "{fa-bed}"
|
||||
|
@ -114,7 +114,7 @@ class OmnipodFragment : DaggerFragment() {
|
|||
|
||||
omnipod_stats.setOnClickListener {
|
||||
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
||||
startActivity(Intent(context, info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity::class.java))
|
||||
startActivity(Intent(context, RileyLinkStatusActivity::class.java))
|
||||
} else {
|
||||
displayNotConfiguredDialog()
|
||||
}
|
||||
|
@ -211,12 +211,12 @@ class OmnipodFragment : DaggerFragment() {
|
|||
|
||||
aapsLogger.info(LTag.PUMP, "setDeviceStatus: [pumpStatus={}]", omnipodPumpStatus)
|
||||
|
||||
val resourceId = omnipodPumpStatus.rileyLinkServiceState.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod)
|
||||
val resourceId = omnipodPumpStatus.rileyLinkServiceState.getResourceId(RileyLinkTargetDevice.Omnipod)
|
||||
val rileyLinkError = omnipodPumpPlugin.rileyLinkService?.error
|
||||
|
||||
omnipod_rl_status.text =
|
||||
when {
|
||||
omnipodPumpStatus.rileyLinkServiceState == info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId)
|
||||
omnipodPumpStatus.rileyLinkServiceState == RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId)
|
||||
omnipodPumpStatus.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId)
|
||||
omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId)
|
||||
omnipodPumpStatus.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump))
|
||||
|
@ -229,7 +229,7 @@ class OmnipodFragment : DaggerFragment() {
|
|||
|
||||
omnipod_errors.text =
|
||||
omnipodPumpStatus.rileyLinkError?.let {
|
||||
resourceHelper.gs(it.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.Omnipod))
|
||||
resourceHelper.gs(it.getResourceId(RileyLinkTargetDevice.Omnipod))
|
||||
} ?: "-"
|
||||
|
||||
val driverState = omnipodUtil.getDriverState();
|
||||
|
|
|
@ -11,14 +11,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionStat
|
|||
*/
|
||||
class EventOmnipodDeviceStatusChange : Event {
|
||||
|
||||
var rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState? = null
|
||||
var rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError? = null
|
||||
var rileyLinkServiceState: RileyLinkServiceState? = null
|
||||
var rileyLinkError: RileyLinkError? = null
|
||||
var podSessionState: PodSessionState? = null
|
||||
var errorDescription: String? = null
|
||||
var podDeviceState: PodDeviceState? = null
|
||||
|
||||
@JvmOverloads
|
||||
constructor(rileyLinkServiceState: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState?, rileyLinkError: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError? = null) {
|
||||
constructor(rileyLinkServiceState: RileyLinkServiceState?, rileyLinkError: RileyLinkError? = null) {
|
||||
this.rileyLinkServiceState = rileyLinkServiceState
|
||||
this.rileyLinkError = rileyLinkError
|
||||
}
|
||||
|
|
|
@ -21,10 +21,12 @@ abstract class AbstractSensitivityPlugin(
|
|||
injector: HasAndroidInjector,
|
||||
aapsLogger: AAPSLogger,
|
||||
resourceHelper:
|
||||
ResourceHelper,
|
||||
val sp: SP
|
||||
ResourceHelper //,
|
||||
//var sp: SP
|
||||
) : PluginBase(pluginDescription, aapsLogger, resourceHelper, injector), SensitivityInterface {
|
||||
|
||||
lateinit var sp: SP
|
||||
|
||||
abstract override fun detectSensitivity(plugin: IobCobCalculatorInterface, fromTime: Long, toTime: Long): AutosensResult
|
||||
|
||||
fun fillResult(ratio: Double, carbsAbsorbed: Double, pastSensitivity: String,
|
||||
|
|
|
@ -24,6 +24,11 @@ import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDevic
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.androidaps.queue.Callback
|
||||
import info.nightscout.androidaps.queue.events.EventQueueChanged
|
||||
|
@ -49,10 +54,10 @@ class MedtronicFragment : DaggerFragment() {
|
|||
@Inject lateinit var activePlugin: ActivePluginProvider
|
||||
@Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin
|
||||
@Inject lateinit var warnColors: WarnColors
|
||||
@Inject lateinit var rileyLinkUtil: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
@Inject lateinit var rileyLinkUtil: RileyLinkUtil
|
||||
@Inject lateinit var medtronicUtil: MedtronicUtil
|
||||
@Inject lateinit var medtronicPumpStatus: MedtronicPumpStatus
|
||||
@Inject lateinit var rileyLinkServiceData: info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
|
||||
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
|
||||
|
||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||
|
||||
|
@ -75,7 +80,7 @@ class MedtronicFragment : DaggerFragment() {
|
|||
|
||||
medtronic_pumpstatus.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder))
|
||||
|
||||
medtronic_rl_status.text = resourceHelper.gs(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump))
|
||||
medtronic_rl_status.text = resourceHelper.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.MedtronicPump))
|
||||
|
||||
medtronic_pump_status.setTextColor(Color.WHITE)
|
||||
medtronic_pump_status.text = "{fa-bed}"
|
||||
|
@ -104,7 +109,7 @@ class MedtronicFragment : DaggerFragment() {
|
|||
|
||||
medtronic_stats.setOnClickListener {
|
||||
if (medtronicPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
||||
startActivity(Intent(context, info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity::class.java))
|
||||
startActivity(Intent(context, RileyLinkStatusActivity::class.java))
|
||||
} else {
|
||||
displayNotConfiguredDialog()
|
||||
}
|
||||
|
@ -167,11 +172,11 @@ class MedtronicFragment : DaggerFragment() {
|
|||
|
||||
@Synchronized
|
||||
private fun setDeviceStatus() {
|
||||
val resourceId = rileyLinkServiceData.rileyLinkServiceState.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump)
|
||||
val resourceId = rileyLinkServiceData.rileyLinkServiceState.getResourceId(RileyLinkTargetDevice.MedtronicPump)
|
||||
val rileyLinkError = medtronicPumpPlugin.rileyLinkService?.error
|
||||
medtronic_rl_status.text =
|
||||
when {
|
||||
rileyLinkServiceData.rileyLinkServiceState == info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId)
|
||||
rileyLinkServiceData.rileyLinkServiceState == RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId)
|
||||
rileyLinkServiceData.rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId)
|
||||
rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError == null -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId)
|
||||
rileyLinkServiceData.rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump))
|
||||
|
@ -181,7 +186,7 @@ class MedtronicFragment : DaggerFragment() {
|
|||
|
||||
medtronic_errors.text =
|
||||
rileyLinkServiceData.rileyLinkError?.let {
|
||||
resourceHelper.gs(it.getResourceId(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice.MedtronicPump))
|
||||
resourceHelper.gs(it.getResourceId(RileyLinkTargetDevice.MedtronicPump))
|
||||
} ?: "-"
|
||||
|
||||
when (medtronicPumpStatus.pumpDeviceState) {
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue