|
|
@ -273,11 +273,11 @@ object ParseHelper {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@OptIn(DelicateCoroutinesApi::class)
|
|
|
|
@OptIn(DelicateCoroutinesApi::class)
|
|
|
|
private fun updateGasTypeDb(type: GasTypeEnum, sensorIndex: Int, status: Int) {
|
|
|
|
private fun updateGasTypeDb(type: GasTypeEnum, sensorIndex: Int, status: Int) {
|
|
|
|
|
|
|
|
GasCache.setStatus(type.desc, getShowStatus(CommonApplication.getContext(), status))
|
|
|
|
if (statusChange(type.desc, status)) {
|
|
|
|
if (statusChange(type.desc, status)) {
|
|
|
|
GlobalScope.launch(Dispatchers.Unconfined) {
|
|
|
|
GlobalScope.launch(Dispatchers.Unconfined) {
|
|
|
|
val typeDao = DBUtils.gasTypeDao()
|
|
|
|
val typeDao = DBUtils.gasTypeDao()
|
|
|
|
val gasType = typeDao.getByName(type.desc)
|
|
|
|
val gasType = typeDao.getByName(type.desc)
|
|
|
|
GasCache.setStatus(type.desc, getShowStatus(CommonApplication.getContext(), status))
|
|
|
|
|
|
|
|
gasType?.type = type.desc
|
|
|
|
gasType?.type = type.desc
|
|
|
|
gasType?.status = status
|
|
|
|
gasType?.status = status
|
|
|
|
gasType?.sensorIndex = sensorIndex
|
|
|
|
gasType?.sensorIndex = sensorIndex
|
|
|
|