package com.grkj.iscs.presentation

import com.grkj.iscs.BusinessManager
import com.grkj.iscs.view.base.BasePresenter
import com.grkj.iscs.model.DeviceConst.DEVICE_TYPE_KEY
import com.grkj.iscs.model.DeviceConst.DEVICE_TYPE_LOCK
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_PORTABLE

class PresentationPresenter : BasePresenter<IPresentationView>() {
    fun registerStatusListener() {
        BusinessManager.registerStatusListener(this) { dockBean ->
            when (dockBean.type) {
                DOCK_TYPE_PORTABLE -> {
                    // TODO 便携式待完善
                    dockBean.deviceList.forEach { deviceBean ->
                        if (deviceBean.isExist) {
                            when (deviceBean.type) {
                                DEVICE_TYPE_KEY -> {
                                    // TODO 读工作票
                                }
                                DEVICE_TYPE_LOCK -> {

                                }
                            }
                        }
                    }
                }
            }
        }
    }
}