文档 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #===以下设置都只是设置值,但是会触发回调,需要调用CofarSDK.start() 或者 CofarSDK.confirm()才会生效===#
  2. CofarSDK.cfgHeat(progress.toShort(), HeatModes.PU_TONG)//设置温度
  3. CofarSDK.cfgMotorGear(progress.toByte());//设置转速
  4. CofarSDK.cfgTime((second + (minute + hours * 60) * 60).toShort())//设置时间
  5. CofarSDK.cfgMotorDirection(MotorDirections.REVERSE)//设置方向REVERSE左,FORWARD 右
  6. //状态设置
  7. CofarSDK.start() 启动 先CofarSDK.cancel() 再CofarSDK.start()
  8. CofarSDK.cancel() 取消 取消上一次的配置
  9. CofarSDK.confirm() 确认 确认当前配置生效
  10. CofarSDK.resume() 恢复
  11. CofarSDK.pause() 暂停
  12. CofarSDK.stop() 停止
  13. //设置模式 type对应ModesType的枚举
  14. val baseMode = CofarSDK.devMode(type)
  15. CofarSDK.changeMode(baseMode)
  16. 1、如果当前的模式是称重
  17. CofarSDK.startWeight() 开始称重
  18. CofarSDK.stoptWeight() 停止称重
  19. CofarSDK.clearWeight() 清0
  20. 2、如果是turbo模式,则监听onTouch事件,Down的时候,每500毫秒调用一次start(),不调用不会生效
  21. 参考
  22. private fun startTurbo() {
  23. turboTimer = Timer()
  24. turboTimer?.schedule(object : TimerTask() {
  25. override fun run() {
  26. CofarSDK.start()
  27. Log.d("ddddddd","-----")
  28. }
  29. }, 0,500)
  30. }
  31. 运行参数说明(DevInfo)
  32. //状态
  33. private int status = DevStatus.STOP;
  34. //电机方向
  35. private byte motorDirection;
  36. //电机方向缓存
  37. private byte motorDirectionBuffer = -1;
  38. //电机档位
  39. private byte motorGear;
  40. //电机档位缓存
  41. private byte motorGearBuffer = -1;
  42. //是否AUTO档
  43. private byte autoGear;
  44. //加热模式
  45. private byte heatMode;
  46. //当前温度
  47. private short temp;
  48. //设置目标温度
  49. private short targetTemp;
  50. //目标温度缓存
  51. private short targetTempBuffer = -1;
  52. //剩下时长
  53. private short remainTime;
  54. //设定时长
  55. private short targetTime;
  56. //目标时长缓存
  57. private short targetTimeBuffer = -1;
  58. //锅状态
  59. private byte potStatus;
  60. //锅盖状态
  61. private byte potCloverStatus;
  62. //故障代码
  63. private byte errCode;
  64. //置零
  65. private byte resetZero;
  66. //当前运行状态
  67. private byte runningStatus;
  68. //锅盖电磁阀状态
  69. private byte potCloverEleStatus;
  70. //当前模式
  71. @Builder.Default
  72. private BaseDevMode mode = new AdaptedCooking();
  73. //称重状态
  74. private boolean weightStatus = false;
  75. //称重数据
  76. private short weight;
  77. //标定状态
  78. private byte weightAlignStatus;
  79. //标定负载点
  80. private byte weightPol;
  81. //厂商
  82. private short manufacturer;
  83. //硬件版本
  84. private short haradware;
  85. //软件版本
  86. private short software;
  87. //通讯协议版本
  88. private byte protocol;
  89. //设备种类
  90. private byte devType;
  91. #模式参数说明(BaseDevMode)
  92. private boolean diyCountDown = false ;
  93. //倒计时
  94. private boolean countDown = true;
  95. //时间是否可调
  96. private boolean timeChange = true;
  97. //最小时间
  98. private int minTime = 0;
  99. //默认时间
  100. private int defaultTime = 0;
  101. //最大时间
  102. private int maxTime = Integer.MAX_VALUE;
  103. //默认加热模式
  104. private byte defaultHeatMode = HeatModes.PU_TONG;
  105. //温度是否可调
  106. private boolean tempChange = true;
  107. //默认温度
  108. private int defaultTemp = 0;
  109. //最小可调温度
  110. private int minTemp = 0;
  111. //最大可调温度
  112. private int maxTemp = 100;
  113. //电机档位是否可调
  114. private boolean motorGearChange = true;
  115. //最小可调电机档位
  116. private int minMotorGear = 0;
  117. //最大可调电机档位
  118. private int maxMotorGear = 15;
  119. //默认电机档位
  120. private int defaultMotorGear = 1;
  121. //电机档位是否可调
  122. private boolean motorDirectionChange = true;
  123. //默认电机方向
  124. private int motorDirection = 0;