|
@@ -68,6 +68,7 @@ import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
|
|
import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
|
|
import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
|
|
import org.greenrobot.eventbus.EventBus
|
|
import org.greenrobot.eventbus.EventBus
|
|
import org.greenrobot.eventbus.Subscribe
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
|
+import org.greenrobot.eventbus.ThreadMode
|
|
import java.util.Objects
|
|
import java.util.Objects
|
|
import java.util.concurrent.TimeUnit
|
|
import java.util.concurrent.TimeUnit
|
|
|
|
|
|
@@ -115,7 +116,8 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
private var confirmType: Boolean = false
|
|
private var confirmType: Boolean = false
|
|
private var eggConfirm: AppCompatTextView? = null
|
|
private var eggConfirm: AppCompatTextView? = null
|
|
private var potCloverInterval: Interval? = null
|
|
private var potCloverInterval: Interval? = null
|
|
- private var workMode :WorkMode? = null
|
|
|
|
|
|
+ private var workMode: WorkMode? = null
|
|
|
|
+ private var sdkDevMode: String = ""
|
|
private val backRequestDialog by lazy {
|
|
private val backRequestDialog by lazy {
|
|
CancelConfirmDialog()
|
|
CancelConfirmDialog()
|
|
}
|
|
}
|
|
@@ -138,7 +140,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
eggConfirm?.setOnClickListener {
|
|
eggConfirm?.setOnClickListener {
|
|
var size = view.getSizeCheckType()
|
|
var size = view.getSizeCheckType()
|
|
var hardness = view.getHardnessCheckType()
|
|
var hardness = view.getHardnessCheckType()
|
|
- setEggTime(size,hardness)
|
|
|
|
|
|
+ setEggTime(size, hardness)
|
|
popupWindow.dismiss()
|
|
popupWindow.dismiss()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -157,13 +159,16 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
private fun turnDevModeUI() {
|
|
private fun turnDevModeUI() {
|
|
|
|
|
|
if (CofarSDK.devInfo().devMode == DevModes.AIR_FRYER) {
|
|
if (CofarSDK.devInfo().devMode == DevModes.AIR_FRYER) {
|
|
|
|
+ binding.clCookTemp.visibility = View.VISIBLE
|
|
|
|
+ binding.clCookTime.visibility = View.VISIBLE
|
|
|
|
+
|
|
//隐藏点击
|
|
//隐藏点击
|
|
binding.clCookDirection.visibility = View.GONE;
|
|
binding.clCookDirection.visibility = View.GONE;
|
|
binding.clCookSpeed.visibility = View.GONE;
|
|
binding.clCookSpeed.visibility = View.GONE;
|
|
/**
|
|
/**
|
|
* 2023.11.21 空炸部分把喷水功能隐藏
|
|
* 2023.11.21 空炸部分把喷水功能隐藏
|
|
* */
|
|
* */
|
|
- binding.clCookWater.visibility = View.GONE
|
|
|
|
|
|
+ binding.clCookWater.visibility = View.GONE
|
|
// binding.clCookWater.visibility = View.VISIBLE
|
|
// binding.clCookWater.visibility = View.VISIBLE
|
|
binding.ivTurbo.visibility = View.GONE
|
|
binding.ivTurbo.visibility = View.GONE
|
|
|
|
|
|
@@ -173,13 +178,16 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
}
|
|
}
|
|
|
|
|
|
if (CofarSDK.devInfo().devMode == DevModes.SOUP) {
|
|
if (CofarSDK.devInfo().devMode == DevModes.SOUP) {
|
|
|
|
+
|
|
//隐藏点击
|
|
//隐藏点击
|
|
|
|
+ binding.clCookTemp.visibility = View.VISIBLE
|
|
|
|
+ binding.clCookTime.visibility = View.VISIBLE
|
|
binding.clCookDirection.visibility = View.VISIBLE;
|
|
binding.clCookDirection.visibility = View.VISIBLE;
|
|
binding.clCookSpeed.visibility = View.VISIBLE;
|
|
binding.clCookSpeed.visibility = View.VISIBLE;
|
|
binding.clCookWater.visibility = View.GONE
|
|
binding.clCookWater.visibility = View.GONE
|
|
// binding.ivTurbo.visibility = View.VISIBLE
|
|
// binding.ivTurbo.visibility = View.VISIBLE
|
|
-
|
|
|
|
binding.clCookWater.visibility = View.GONE
|
|
binding.clCookWater.visibility = View.GONE
|
|
|
|
+ binding.clTextView.visibility = View.GONE
|
|
}
|
|
}
|
|
|
|
|
|
// if (CofarSDK.devInfo().devMode=="AF_AIR_FRYER"){
|
|
// if (CofarSDK.devInfo().devMode=="AF_AIR_FRYER"){
|
|
@@ -225,17 +233,20 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
lastModeType = viewModel.modeType
|
|
lastModeType = viewModel.modeType
|
|
modeType = lastModeType
|
|
modeType = lastModeType
|
|
workMode = ConfigUtils.getMode(modeType)
|
|
workMode = ConfigUtils.getMode(modeType)
|
|
|
|
+ sdkDevMode = CofarSDK.devInfo().devMode
|
|
if (!isNightTheme()) {
|
|
if (!isNightTheme()) {
|
|
if (workMode == null) {
|
|
if (workMode == null) {
|
|
binding.ivBanner.setImageResource(com.develop.common.R.drawable.ic_mode_diy)
|
|
binding.ivBanner.setImageResource(com.develop.common.R.drawable.ic_mode_diy)
|
|
// Glide.with(this).load(com.develop.common.R.drawable.ic_mode_diy)
|
|
// Glide.with(this).load(com.develop.common.R.drawable.ic_mode_diy)
|
|
// .into(binding.ivBanner)
|
|
// .into(binding.ivBanner)
|
|
} else {
|
|
} else {
|
|
- binding.ivBanner.setImageResource(resources.getIdentifier(
|
|
|
|
- workMode?.bg,
|
|
|
|
- "drawable",
|
|
|
|
- this.packageName
|
|
|
|
- ))
|
|
|
|
|
|
+ binding.ivBanner.setImageResource(
|
|
|
|
+ resources.getIdentifier(
|
|
|
|
+ workMode?.bg,
|
|
|
|
+ "drawable",
|
|
|
|
+ this.packageName
|
|
|
|
+ )
|
|
|
|
+ )
|
|
// Glide.with(this).load(
|
|
// Glide.with(this).load(
|
|
// resources.getIdentifier(
|
|
// resources.getIdentifier(
|
|
// workMode?.bg,
|
|
// workMode?.bg,
|
|
@@ -654,12 +665,13 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
|
|
|
|
private var currentBgId = com.develop.common.R.drawable.pot_clover_ele_unlock //0是开锁图,1上锁图
|
|
private var currentBgId = com.develop.common.R.drawable.pot_clover_ele_unlock //0是开锁图,1上锁图
|
|
|
|
|
|
- @Subscribe
|
|
|
|
|
|
+ @Subscribe(threadMode = ThreadMode.MAIN)
|
|
fun onDevStateEvent(event: DevStatusEvent) {
|
|
fun onDevStateEvent(event: DevStatusEvent) {
|
|
if (!initModeData) {
|
|
if (!initModeData) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- Log.d("TAG dddddd","event:"+event.devInfo.toString())
|
|
|
|
|
|
+ Log.d("TAG dddddd", "event:" + event.devInfo.toString())
|
|
|
|
+
|
|
ThreadUtils.runOnMainThread {
|
|
ThreadUtils.runOnMainThread {
|
|
currDevInfo = event.devInfo
|
|
currDevInfo = event.devInfo
|
|
mRunningState = currDevInfo.runningStatus.toInt()
|
|
mRunningState = currDevInfo.runningStatus.toInt()
|
|
@@ -755,6 +767,32 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
updateWeightUI(currDevInfo.weight.toFloat())
|
|
updateWeightUI(currDevInfo.weight.toFloat())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //处理中途换换锅问题
|
|
|
|
+ if (sdkDevMode != event.devInfo.devMode) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Log.e("TAG 换锅","sdkDevMode: "+sdkDevMode + " event.devInfo.devMode :"+event.devInfo.devMode)
|
|
|
|
+ sdkDevMode = event.devInfo.devMode
|
|
|
|
+ initDevMode()
|
|
|
|
+ Log.e("TAG 11111","sdkDevMode: "+sdkDevMode + " event.devInfo.devMode :"+event.devInfo.devMode)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private fun initDevMode() {
|
|
|
|
+ Log.e("TAG initDevMode","sdkDevMode: "+sdkDevMode + " CofarSDK.devInfo().devMode :"+CofarSDK.devInfo().devMode)
|
|
|
|
+ binding.clCookTemp.visibility = View.GONE
|
|
|
|
+ binding.clTextView.visibility = View.GONE
|
|
|
|
+ binding.clCookTime.visibility = View.GONE
|
|
|
|
+ binding.clCookSpeed.visibility = View.GONE
|
|
|
|
+ binding.clCookDirection.visibility = View.GONE
|
|
|
|
+ binding.clCookWater.visibility = View.GONE
|
|
|
|
+ CofarSDK.changeDevModeFocus(sdkDevMode)
|
|
|
|
+ turnDevModeUI();
|
|
|
|
+// 初始化模式数据
|
|
|
|
+ initModeData(lastModeType)
|
|
|
|
+ initData()
|
|
|
|
+ changeCommonStep()
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -882,7 +920,6 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
// targetTime = baseMode.defaultTime.toInt()
|
|
// targetTime = baseMode.defaultTime.toInt()
|
|
// }
|
|
// }
|
|
|
|
|
|
- Log.d("TAG initModeData", "baseMode class :" + baseMode.javaClass.name)
|
|
|
|
|
|
|
|
baseMode.apply {
|
|
baseMode.apply {
|
|
currentTemp = targetTemp.toInt()
|
|
currentTemp = targetTemp.toInt()
|
|
@@ -1161,7 +1198,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
binding.clSetTime.stopAlphaAnim()
|
|
binding.clSetTime.stopAlphaAnim()
|
|
binding.functionLayout.visibility = View.VISIBLE
|
|
binding.functionLayout.visibility = View.VISIBLE
|
|
binding.llWeightView.visibility = View.GONE
|
|
binding.llWeightView.visibility = View.GONE
|
|
- // 2023.12.11客户需要隐藏
|
|
|
|
|
|
+ // 2023.12.11客户需要隐藏
|
|
// if (getSN().startsWith("000")){
|
|
// if (getSN().startsWith("000")){
|
|
// binding.ivPotCover.setVisible()
|
|
// binding.ivPotCover.setVisible()
|
|
// }
|
|
// }
|
|
@@ -1505,9 +1542,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
this.isTempChange = isTempChange
|
|
this.isTempChange = isTempChange
|
|
binding.apply {
|
|
binding.apply {
|
|
|
|
|
|
- if (targetTemp.toInt()>maxTemp){
|
|
|
|
|
|
+ if (targetTemp.toInt() > maxTemp) {
|
|
CofarSDK.cfgHeat(maxTemp.toInt().toShort(), HeatModes.PU_TONG);
|
|
CofarSDK.cfgHeat(maxTemp.toInt().toShort(), HeatModes.PU_TONG);
|
|
- clCookTemp.setConfigValue("--${CofarUtils.parseTemp(maxTemp.toInt().toShort())}°C--")
|
|
|
|
|
|
+ clCookTemp.setConfigValue(
|
|
|
|
+ "--${
|
|
|
|
+ CofarUtils.parseTemp(
|
|
|
|
+ maxTemp.toInt().toShort()
|
|
|
|
+ )
|
|
|
|
+ }°C--"
|
|
|
|
+ )
|
|
tempRingView.updateProgress(CofarUtils.parseTemp(maxTemp.toInt().toShort()).toInt())
|
|
tempRingView.updateProgress(CofarUtils.parseTemp(maxTemp.toInt().toShort()).toInt())
|
|
tempRingText.text = ("${CofarUtils.parseTemp(maxTemp.toInt().toShort()).toInt()}°C")
|
|
tempRingText.text = ("${CofarUtils.parseTemp(maxTemp.toInt().toShort()).toInt()}°C")
|
|
|
|
|
|
@@ -1554,7 +1597,10 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
) {
|
|
) {
|
|
|
|
|
|
|
|
|
|
- Log.d("TAG updateTimeUI","minTime:$minTime maxTime:$maxTime remainTime:$remainTime targetTime:$targetTime isTimeChange:$isTimeChange focusUpdate$focusUpdate type :$type")
|
|
|
|
|
|
+ Log.d(
|
|
|
|
+ "TAG updateTimeUI",
|
|
|
|
+ "minTime:$minTime maxTime:$maxTime remainTime:$remainTime targetTime:$targetTime isTimeChange:$isTimeChange focusUpdate$focusUpdate type :$type"
|
|
|
|
+ )
|
|
|
|
|
|
this.isTimeChange = isTimeChange
|
|
this.isTimeChange = isTimeChange
|
|
this.maxTime = maxTime.toLong()
|
|
this.maxTime = maxTime.toLong()
|
|
@@ -2124,15 +2170,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
1 -> {//小
|
|
1 -> {//小
|
|
when (hardness) {
|
|
when (hardness) {
|
|
1 -> {//软
|
|
1 -> {//软
|
|
- time = 8*60
|
|
|
|
|
|
+ time = 8 * 60
|
|
}
|
|
}
|
|
|
|
|
|
2 -> {//中
|
|
2 -> {//中
|
|
- time = 9*60
|
|
|
|
|
|
+ time = 9 * 60
|
|
}
|
|
}
|
|
|
|
|
|
3 -> {//硬
|
|
3 -> {//硬
|
|
- time = 15*60
|
|
|
|
|
|
+ time = 15 * 60
|
|
}
|
|
}
|
|
|
|
|
|
else -> {
|
|
else -> {
|
|
@@ -2146,16 +2192,16 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
2 -> {//中
|
|
2 -> {//中
|
|
when (hardness) {
|
|
when (hardness) {
|
|
1 -> {//软
|
|
1 -> {//软
|
|
- time = 10*60
|
|
|
|
|
|
+ time = 10 * 60
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
2 -> {//中
|
|
2 -> {//中
|
|
- time = 12*60
|
|
|
|
|
|
+ time = 12 * 60
|
|
}
|
|
}
|
|
|
|
|
|
3 -> {//硬
|
|
3 -> {//硬
|
|
- time = 18*60
|
|
|
|
|
|
+ time = 18 * 60
|
|
}
|
|
}
|
|
|
|
|
|
else -> {
|
|
else -> {
|
|
@@ -2168,15 +2214,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
3 -> {//大
|
|
3 -> {//大
|
|
when (hardness) {
|
|
when (hardness) {
|
|
1 -> {//软
|
|
1 -> {//软
|
|
- time = 11*60
|
|
|
|
|
|
+ time = 11 * 60
|
|
}
|
|
}
|
|
|
|
|
|
2 -> {//中
|
|
2 -> {//中
|
|
- time = 13*60
|
|
|
|
|
|
+ time = 13 * 60
|
|
}
|
|
}
|
|
|
|
|
|
3 -> {//硬
|
|
3 -> {//硬
|
|
- time = 18*60
|
|
|
|
|
|
+ time = 18 * 60
|
|
}
|
|
}
|
|
|
|
|
|
else -> {
|
|
else -> {
|
|
@@ -2191,7 +2237,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
time = 0
|
|
time = 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (time ==0){
|
|
|
|
|
|
+ if (time == 0) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
//确认
|
|
//确认
|
|
@@ -2201,13 +2247,14 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
|
|
CofarSDK.cfgTime(time)
|
|
CofarSDK.cfgTime(time)
|
|
CofarSDK.confirm()
|
|
CofarSDK.confirm()
|
|
}
|
|
}
|
|
- private fun visibilityEgg(visibility :Int){
|
|
|
|
|
|
+
|
|
|
|
+ private fun visibilityEgg(visibility: Int) {
|
|
//2023.12.11 000A客户,鸡蛋程序还未完整,需隐藏
|
|
//2023.12.11 000A客户,鸡蛋程序还未完整,需隐藏
|
|
if ("COOK_EGGS" == viewModel.modeType) {
|
|
if ("COOK_EGGS" == viewModel.modeType) {
|
|
binding.ivEggs.visibility = visibility
|
|
binding.ivEggs.visibility = visibility
|
|
//由于鸡蛋SDK默认时间只有20秒,需要自己另行设置
|
|
//由于鸡蛋SDK默认时间只有20秒,需要自己另行设置
|
|
- CofarSDK.devInfo().mode.maxTime = 20*60
|
|
|
|
- }else{
|
|
|
|
|
|
+ CofarSDK.devInfo().mode.maxTime = 20 * 60
|
|
|
|
+ } else {
|
|
binding.ivEggs.visibility = View.GONE
|
|
binding.ivEggs.visibility = View.GONE
|
|
}
|
|
}
|
|
}
|
|
}
|