瀏覽代碼

033 温度转速处理

zhangshenjie 3 天之前
父節點
當前提交
f67410180f

+ 7 - 6
BusinessSetting/src/main/java/com/develop/setting/ui/SettingMainActivity.kt

@@ -99,7 +99,7 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
 //        }
 
         /**
-         * 需要隐藏登录 032D 032E 011A 030A 010F 033
+         * 需要隐藏登录 032D 032E 011A 030A 010F 033  010I 010H
          * 需要隐藏涂鸦 010D 010F 032D 033 011A 036I 058A 058B
          * 需要隐藏亮度 010D
          *
@@ -108,11 +108,11 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
          * */
 
         dataList.clear()
-        dataList = if (sn.startsWith("010D")||sn.startsWith("010I")||sn.startsWith("010H")) {
+        dataList = if (sn.startsWith("010D")) {
             DataFactory.genSetting010DModesList(resources)
         } else if (sn.startsWith("032D")  || sn.startsWith("010F") || sn.startsWith("033")) {
             DataFactory.genSetting032DModesList(resources)
-        } else if (sn.startsWith("011")) {
+        } else if (sn.startsWith("011")||sn.startsWith("010I")||sn.startsWith("010H")) {
             DataFactory.genSetting011AModesList(resources)
         } else if (sn.startsWith("030A")||sn.startsWith("032E")) {
             DataFactory.genSetting030AModesList(resources)
@@ -486,7 +486,7 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
     @SuppressLint("NotifyDataSetChanged")
     fun tuyaEvent() {
         /**
-         * 需要隐藏登录 032D 032E 011A 030A 010F 033
+         * 需要隐藏登录 032D 032E 011A 030A 010F 033  010I 010H
          * 需要隐藏涂鸦 010D 010F 032D 033 011A 036I 058A 058B
          * 需要隐藏亮度 010D
          *
@@ -495,11 +495,12 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
          * */
 
 
-        dataList = if (sn.startsWith("010D")||sn.startsWith("010I")||sn.startsWith("010H")) {
+
+        dataList = if (sn.startsWith("010D")) {
             DataFactory.genSetting010DModesList(resources)
         } else if (sn.startsWith("032D") || sn.startsWith("010F") || sn.startsWith("033")) {
             DataFactory.genSetting032DModesList(resources)
-        } else if (sn.startsWith("011")) {
+        } else if (sn.startsWith("011")||sn.startsWith("010I")||sn.startsWith("010H")) {
             DataFactory.genSetting011AModesList(resources)
         } else if (sn.startsWith("030A")||sn.startsWith("032E")) {
             DataFactory.genSetting030AModesList(resources)

+ 16 - 17
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -807,23 +807,22 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
             }
 
 
-//            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type) {
-//                Log.e("TAG sad","MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP")
-//                if (sn.startsWith("033G") || sn.startsWith("033H")) {
-//                    CofarSDK.cfgMotorGear(3)
-//                    currDevInfo.mode.apply {
-//                        updateMotorGearUI(
-//                            minMotorGear.toFloat(),
-//                            maxMotorGear.toFloat(),
-//                            3,
-//                            isMotorGearChange,
-//                            true
-//                        )
-//
-//
-//                    }
-//                }
-//            }
+            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type) {
+                if (sn.startsWith("033G") || sn.startsWith("033H")) {
+                    CofarSDK.cfgMotorGear(3)
+                    currDevInfo.mode.apply {
+                        updateMotorGearUI(
+                            minMotorGear.toFloat(),
+                            maxMotorGear.toFloat(),
+                            3,
+                            isMotorGearChange,
+                            true
+                        )
+
+
+                    }
+                }
+            }
 
 
             if (CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type) {

+ 24 - 25
app/build.gradle

@@ -20,7 +20,7 @@ ext {
     versionCode = Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
 //    brandCode="000B"
-    brandCode = "010I"
+    brandCode = "033G"
 //    model = "5037"
     model = "1039"
 
@@ -896,15 +896,14 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-//            manifestPlaceholders = [channelName: "brand010I"]
-//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-//            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
-//            buildConfigField("String", "model", "\"1039\"")
-//            buildConfigField("String", "brandCode", "\"010I\"")
-//            //appCode 1.01 指向bug修复,2.01指向功能变更
-//            buildConfigField("String", "appCode", "\"1.01\"")
-//            buildConfigField("String", "time", "\"${getCurrentTime()}\"")
-
+            manifestPlaceholders = [channelName: "brand010I"]
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
+            buildConfigField("String", "model", "\"1039\"")
+            buildConfigField("String", "brandCode", "\"010I\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
+            buildConfigField("String", "time", "\"${getCurrentTime()}\"")
 
 
 //            buildConfigField("String", "UpdatePlatform", "\"normal\"")
@@ -941,13 +940,13 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-//                        manifestPlaceholders = [channelName: "brand033GTuya"]
-//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-//            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
-//            buildConfigField("String", "model", "\"1039\"")
-//            buildConfigField("String", "brandCode", "\"033G\"")
-//            //appCode 1.01 指向bug修复,2.01指向功能变更
-//            buildConfigField("String", "appCode", "\"1.01\"")
+            manifestPlaceholders = [channelName: "brand033GTuya"]
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
+            buildConfigField("String", "model", "\"1039\"")
+            buildConfigField("String", "brandCode", "\"033G\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
 //            buildConfigField("String", "appCode", "\"2.01\"")
 
 
@@ -1018,14 +1017,14 @@ android {
 //
 
 
-            manifestPlaceholders = [channelName: "brand058A"]
-            resValue("string", "app_theme", "@style/Splash062ATheme")
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            buildConfigField("String", "model", "\"1039\"")
-            buildConfigField("String", "brandCode", "\"058A\"")
-            //appCode 1.01 指向bug修复,2.01指向功能变更
-            buildConfigField("String", "appCode", "\"1.01\"")
-            buildConfigField("String", "time", "\"${getCurrentTime()}\"")
+//            manifestPlaceholders = [channelName: "brand058A"]
+//            resValue("string", "app_theme", "@style/Splash062ATheme")
+//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            buildConfigField("String", "model", "\"1039\"")
+//            buildConfigField("String", "brandCode", "\"058A\"")
+//            //appCode 1.01 指向bug修复,2.01指向功能变更
+//            buildConfigField("String", "appCode", "\"1.01\"")
+//            buildConfigField("String", "time", "\"${getCurrentTime()}\"")
 
 
 //            manifestPlaceholders = [channelName: "brand053A"]

+ 12 - 72
app/src/main/java/com/develop/foodcooking/FoodCookingApp.kt

@@ -18,6 +18,7 @@ import com.blankj.utilcode.util.ResourceUtils
 import com.blankj.utilcode.util.Utils
 import com.develop.base.app.BaseApp
 import com.develop.base.ext.getBrandNum
+import com.develop.base.ext.getDeviceNum
 import com.develop.base.ext.getOtaFileMd5
 import com.develop.base.ext.getSN
 import com.develop.base.ext.getUpdateRecipeTime
@@ -52,6 +53,7 @@ import com.drake.net.convert.NetConverter
 import com.drake.net.interceptor.RequestInterceptor
 import com.drake.net.interfaces.NetErrorHandler
 import com.drake.net.time.Interval
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.BaseConfig
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevPromptEvent
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
@@ -156,83 +158,21 @@ class FoodCookingApp : BaseApp() {
             }
             AppVersionUtil.endRecord("ThemeSkinService")
 
-        CofarSDK.init(getBrandNum())
+
         SerialPortUtils.init()
         CofarSDK.register(this)
         //MainActvity 加了这个代码,在这注释
 //        CofarSDK.stopNative()
 
-        //食谱解压
-//        Thread {
-//            var isUpdateFile = StringUtils.doesUpdateTxtFileExist()
-//            //之前根据zip包的md5 更新,现在做一个文本获取进行更新, 先判断是否存在,存在再处理,不存在就走之前的方法
-//            Log.d("TAG update", "isUpdateFile  文件: $isUpdateFile")
-//            if (isUpdateFile) {
-//                Log.d("TAG update", "isUpdateFile  文件存在 ")
-//                var fileUpdate = StringUtils.getUpdateTime()
-//                var roomUpdate = getUpdateRecipeTime()
-//
-//                Log.d("TAG update", "fileUpdate :   $fileUpdate")
-//                Log.d("TAG update", "roomUpdate :   $roomUpdate")
-//
-//
-//                FoodDataProvider.setUpdateTime(fileUpdate)
-//                //当本地时间为空,或者file的文件时间比本地时间大的时候,证明食谱包更新了
-//                if (roomUpdate == "" || fileUpdate.toLong() > roomUpdate.toLong()) {
-//                    Log.d("TAG update", "isUpdateFile1111111--------  文件存在 ")
-//
-//                    //删除room数据库
-//                    deleteRoomDb()
-//                    //删除sd卡的东西
-//                    FoodDataProvider.deleteAll()
-//                    FoodDataProvider.prepareData(this)
-//                } else {
-//                    FoodDataProvider.prepareData(this)
-//                }
-//
-//
-//
-//            } else {
-//                val md5 = getOtaFileMd5()
-//                val sn = getSN()
-//                Log.d("TAG md5", "time :" + System.currentTimeMillis())
-//                //大概50秒才获取到
-////            val zipMd2 = StringUtils.getFileMD5("system/media/cofa_cooking.zip")
-//                Log.d("TAG md5", "md5 :$md5")
-//                var zipMd5 = ""
-//                if (md5.isNotEmpty()) {
-//                    zipMd5 = FileUtils.getFileMD5ToString("system/media/cofa_cooking.zip")
-//                }
-//                Log.d("TAG md5", "time2222 :" + System.currentTimeMillis())
-//                Log.d("TAG md5", "string :$zipMd5")
-//                //处理ota食谱更新问题
-//                if (sn.startsWith("010") && (md5.isEmpty() || md5 != zipMd5)) {
-//                    /**
-//                     *  如果MD5的值不存在,重新解压
-//                     *  如果MD5的值不一样的,就代表食谱包已经重新更新
-//                     *  需要先删除sd卡目录下的cofa文件,再重新解压
-//                     * */
-//                    deleteRoomDb()
-//
-//                    //删除sd卡的东西
-//                    FoodDataProvider.deleteAll()
-//
-//
-//                    FoodDataProvider.prepareData(this)
-//                } else {
-//                    FoodDataProvider.prepareData(this)
-//                }
-//                //010 每一次都把md5的值set进去
-//                if (sn.startsWith("010")) {
-//                    //优化启动程序
-//                    if (zipMd5.isEmpty()) {
-//                        zipMd5 = FileUtils.getFileMD5ToString("system/media/cofa_cooking.zip")
-//                    }
-//                    setOtaFileMd5(zipMd5)
-//                }
-//            }
-//        }.start()
-
+       var sn = getSN()
+        if (sn.startsWith("033G")||sn.startsWith("033H")){
+            //DIY模式、自动程序模式和食谱模式温度与档速 设置有温度的时候,速度最大3
+            //033需求需要再传型号过去判断
+            BaseConfig.TEMP_OF_LIMIT_MOTOR = 0
+            CofarSDK.initDevice(getBrandNum(),getDeviceNum())
+        }else{
+            CofarSDK.init(getBrandNum())
+        }
 
 //        val powerManager = getSystemService(POWER_SERVICE) as PowerManager
 //        val wakeLock: PowerManager.WakeLock =

+ 3 - 2
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -250,6 +250,7 @@ fun getSN(): String {
 //    return  "017A20060020123010190001"
 //        return  "017A10390020123010190001"
 //    return "010D10390020123010190001"
+//        return "010I10390020123010190001"
 //        return "010D10390020123010190001"
 //    return "000A10390020123010190009"
 //        return "032E21060020123010190001"
@@ -258,7 +259,7 @@ fun getSN(): String {
 //         return  "030A10390020123010190002"
 //        return  "033F20020020123010190001"
 //        return  "033I20020020123010190001"
-//        return "033G20020020123010190001"
+        return "033G20020020123010190001"
 //        return  "014A19050020123010190002"
 //        return "029C21010020123010190002"
 //        return "029C21010030424071900612"
@@ -272,7 +273,7 @@ fun getSN(): String {
 //        return  "063B10390020123010190001"
 //        return  "063B20030020123010190015"
 //        return "063B21050020123010190001"
-        return "058A10390020123010190001"
+//        return "058A10390020123010190001"
 //        return  "049B10390020123010190001"
 //        return "000A50370020123010190017"
 //        return  "053A10390020123010190088"

二進制
libThirdPart/libs/cofar-cooking-device-sdk-0.0.1-SNAPSHOT.jar