package com.quyunshuo.module.home.fragment.vm

import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.google.gson.Gson
import com.hboxs.serialport.plc.thread.ThreadHomeParam
import com.quyunshuo.androidbaseframemvvm.base.mvvm.vm.BaseViewModel
import com.quyunshuo.androidbaseframemvvm.base.utils.SpUtils
import com.quyunshuo.androidbaseframemvvm.common.util.UiUtil
import com.quyunshuo.module.home.R
import com.quyunshuo.module.home.fragment.repo.HomeFragmentRepo
import com.quyunshuo.module.home.fragment.repo.ProdutionProcessFragmentRepo
import com.quyunshuo.module.home.fragment.repo.SleepFragmentRepo
import com.quyunshuo.module.home.model.UserPassword
import com.quyunshuo.module.home.model.livedata.LiveDataBean
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.launch
import javax.inject.Inject

/**
 * HomeFragment 的 VM 层
 *
 * @author Qu Yunshuo
 * @since 2021/8/5 11:11 下午
 */
@HiltViewModel
class ProdutionProcessFragmentVM @Inject constructor(private val mRepo: ProdutionProcessFragmentRepo) :
    BaseViewModel() {
    val threadHomeParam: ThreadHomeParam = ThreadHomeParam()
    fun stopM231() {
        threadHomeParam.stopSetM231()
    }
    fun startSendm231(selectPro: Int,number:Int) {
        threadHomeParam.startSetM231(selectPro,number)
    }
}