Merge branch 'omnipod_eros_dev' into omnipod_eros_dev_upstream_merge
This commit is contained in:
commit
b383c26889
|
@ -25,6 +25,7 @@ import javax.inject.Provider
|
|||
abstract class OmnipodWizardModule {
|
||||
|
||||
companion object {
|
||||
|
||||
@Provides
|
||||
@OmnipodPluginQualifier
|
||||
fun providesViewModelFactory(@OmnipodPluginQualifier viewModels: MutableMap<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>): ViewModelProvider.Factory {
|
||||
|
|
|
@ -50,7 +50,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFault
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodProgressStatusVerificationFailedException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PrecedingCommandFailedUncertainlyException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Flowable;
|
||||
import io.reactivex.Single;
|
||||
|
@ -62,17 +61,16 @@ public class OmnipodManager {
|
|||
private static final int ACTION_VERIFICATION_TRIES = 1;
|
||||
|
||||
private final OmnipodRileyLinkCommunicationManager communicationService;
|
||||
private PodStateManager podStateManager;
|
||||
private final PodStateManager podStateManager;
|
||||
|
||||
private ActiveBolusData activeBolusData;
|
||||
private SingleSubject<Boolean> bolusCommandExecutionSubject;
|
||||
|
||||
private final Object bolusDataMutex = new Object();
|
||||
|
||||
private AAPSLogger aapsLogger;
|
||||
private final AAPSLogger aapsLogger;
|
||||
|
||||
public OmnipodManager(AAPSLogger aapsLogger,
|
||||
SP sp,
|
||||
OmnipodRileyLinkCommunicationManager communicationService,
|
||||
PodStateManager podStateManager) {
|
||||
if (communicationService == null) {
|
||||
|
|
|
@ -143,7 +143,7 @@ public class AapsOmnipodManager {
|
|||
this.nsUpload = nsUpload;
|
||||
this.profileFunction = profileFunction;
|
||||
|
||||
delegate = new OmnipodManager(aapsLogger, sp, communicationService, podStateManager);
|
||||
delegate = new OmnipodManager(aapsLogger, communicationService, podStateManager);
|
||||
|
||||
reloadSettings();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import javax.inject.Inject
|
|||
|
||||
class PodActivationWizardActivity : OmnipodWizardActivityBase() {
|
||||
companion object {
|
||||
|
||||
const val KEY_START_DESTINATION = "startDestination"
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment
|
|||
import kotlinx.android.synthetic.main.omnipod_wizard_nav_buttons.*
|
||||
|
||||
class AttachPodInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_title
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase
|
||||
|
||||
class FillPodInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_title
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.activation.view
|
|||
import javax.inject.Inject
|
||||
|
||||
class InitializePodActionFragment : PodActivationActionFragmentBase() {
|
||||
|
||||
@Inject
|
||||
@OmnipodPluginQualifier
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
|
|
@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.activation.view
|
|||
import javax.inject.Inject
|
||||
|
||||
class InsertCannulaActionFragment : PodActivationActionFragmentBase() {
|
||||
|
||||
@Inject
|
||||
@OmnipodPluginQualifier
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase
|
||||
|
||||
class PodActivatedInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_pod_activated_title
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.*
|
|||
import javax.inject.Inject
|
||||
|
||||
abstract class PodActivationActionFragmentBase : ActionFragmentBase() {
|
||||
|
||||
@Inject
|
||||
protected lateinit var podStateManager: PodStateManager
|
||||
|
||||
|
|
|
@ -6,5 +6,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.viewmode
|
|||
import javax.inject.Inject
|
||||
|
||||
class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() {
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult = aapsOmnipodManager.initializePod()
|
||||
}
|
|
@ -7,5 +7,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.viewmode
|
|||
import javax.inject.Inject
|
||||
|
||||
class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() {
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult = aapsOmnipodManager.insertCannula(profileFunction.getProfile())
|
||||
}
|
|
@ -7,6 +7,7 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||
|
||||
abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() {
|
||||
|
||||
override fun onBackPressed() {
|
||||
exitActivityAfterConfirmation()
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.*
|
|||
import kotlinx.android.synthetic.main.omnipod_wizard_nav_buttons.*
|
||||
|
||||
abstract class ActionFragmentBase : WizardFragmentBase() {
|
||||
|
||||
protected lateinit var viewModel: ActionViewModelBase
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -19,6 +19,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_progress_indication.*
|
|||
import kotlin.math.roundToInt
|
||||
|
||||
abstract class WizardFragmentBase : DaggerFragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
|
|
|
@ -5,6 +5,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.activity.OmnipodWizardActivityBase
|
||||
|
||||
class PodDeactivationWizardActivity : OmnipodWizardActivityBase() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.*
|
|||
import javax.inject.Inject
|
||||
|
||||
class DeactivatePodActionFragment : ActionFragmentBase() {
|
||||
|
||||
@Inject
|
||||
@OmnipodPluginQualifier
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase
|
||||
|
||||
class DeactivatePodInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivate_pod_title
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase
|
||||
|
||||
class PodDeactivatedInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_deactivated_title
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase
|
||||
|
||||
class PodDiscardedInfoFragment : InfoFragmentBase() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_discarded_title
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import io.reactivex.subjects.SingleSubject
|
|||
import javax.inject.Inject
|
||||
|
||||
class DeactivatePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val commandQueueProvider: CommandQueueProvider) : ActionViewModelBase() {
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult {
|
||||
val singleSubject = SingleSubject.create<PumpEnactResult>()
|
||||
commandQueueProvider.customCommand(CommandDeactivatePod(), object : Callback() {
|
||||
|
|
Loading…
Reference in a new issue