|
@@ -18,6 +18,7 @@ import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_KEY
|
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_LOCK
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_LOCK
|
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_PORTABLE
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_PORTABLE
|
|
|
import com.grkj.iscs.presentation.PresentationActivity
|
|
import com.grkj.iscs.presentation.PresentationActivity
|
|
|
|
|
+import com.grkj.iscs.util.Executor
|
|
|
import com.grkj.iscs.util.FileUtil
|
|
import com.grkj.iscs.util.FileUtil
|
|
|
import com.grkj.iscs.util.ToastUtils
|
|
import com.grkj.iscs.util.ToastUtils
|
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
@@ -42,7 +43,11 @@ class PresentationLoginActivity : BaseActivity<ActivityPresentationLoginBinding>
|
|
|
val cardList: List<CardInfoBean> =
|
|
val cardList: List<CardInfoBean> =
|
|
|
Gson().fromJson(str, object : TypeToken<List<CardInfoBean>>() {}.type)
|
|
Gson().fromJson(str, object : TypeToken<List<CardInfoBean>>() {}.type)
|
|
|
|
|
|
|
|
|
|
+ handleLoading(true, "正在初始化设备...")
|
|
|
BusinessManager.connectDock(1, true)
|
|
BusinessManager.connectDock(1, true)
|
|
|
|
|
+ Executor.delayOnMain(2000) {
|
|
|
|
|
+ handleLoading(false)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
ModBusController.registerStatusListener(this) { res ->
|
|
ModBusController.registerStatusListener(this) { res ->
|
|
|
(res as List<ByteArray>).forEach { bytes ->
|
|
(res as List<ByteArray>).forEach { bytes ->
|
|
@@ -73,5 +78,10 @@ class PresentationLoginActivity : BaseActivity<ActivityPresentationLoginBinding>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ override fun onDestroy() {
|
|
|
|
|
+ super.onDestroy()
|
|
|
|
|
+ ModBusController.unregisterListener(this)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
data class CardInfoBean(val rfid: String, val mac: String)
|
|
data class CardInfoBean(val rfid: String, val mac: String)
|
|
|
}
|
|
}
|