123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- #===以下设置都只是设置值,但是会触发回调,需要调用CofarSDK.start() 或者 CofarSDK.confirm()才会生效===#
- CofarSDK.cfgHeat(progress.toShort(), HeatModes.PU_TONG)//设置温度
- CofarSDK.cfgMotorGear(progress.toByte());//设置转速
- CofarSDK.cfgTime((second + (minute + hours * 60) * 60).toShort())//设置时间
- CofarSDK.cfgMotorDirection(MotorDirections.REVERSE)//设置方向REVERSE左,FORWARD 右
- //状态设置
- CofarSDK.start() 启动 先CofarSDK.cancel() 再CofarSDK.start()
- CofarSDK.cancel() 取消 取消上一次的配置
- CofarSDK.confirm() 确认 确认当前配置生效
- CofarSDK.resume() 恢复
- CofarSDK.pause() 暂停
- CofarSDK.stop() 停止
- //设置模式 type对应ModesType的枚举
- val baseMode = CofarSDK.devMode(type)
- CofarSDK.changeMode(baseMode)
- 1、如果当前的模式是称重
- CofarSDK.startWeight() 开始称重
- CofarSDK.stoptWeight() 停止称重
- CofarSDK.clearWeight() 清0
- 2、如果是turbo模式,则监听onTouch事件,Down的时候,每500毫秒调用一次start(),不调用不会生效
- 参考
- private fun startTurbo() {
- turboTimer = Timer()
- turboTimer?.schedule(object : TimerTask() {
- override fun run() {
- CofarSDK.start()
- Log.d("ddddddd","-----")
- }
- }, 0,500)
- }
- 运行参数说明(DevInfo)
- //状态
- private int status = DevStatus.STOP;
- //电机方向
- private byte motorDirection;
- //电机方向缓存
- private byte motorDirectionBuffer = -1;
- //电机档位
- private byte motorGear;
- //电机档位缓存
- private byte motorGearBuffer = -1;
- //是否AUTO档
- private byte autoGear;
- //加热模式
- private byte heatMode;
- //当前温度
- private short temp;
- //设置目标温度
- private short targetTemp;
- //目标温度缓存
- private short targetTempBuffer = -1;
- //剩下时长
- private short remainTime;
- //设定时长
- private short targetTime;
- //目标时长缓存
- private short targetTimeBuffer = -1;
- //锅状态
- private byte potStatus;
- //锅盖状态
- private byte potCloverStatus;
- //故障代码
- private byte errCode;
- //置零
- private byte resetZero;
- //当前运行状态
- private byte runningStatus;
- //锅盖电磁阀状态
- private byte potCloverEleStatus;
- //当前模式
- @Builder.Default
- private BaseDevMode mode = new AdaptedCooking();
- //称重状态
- private boolean weightStatus = false;
- //称重数据
- private short weight;
- //标定状态
- private byte weightAlignStatus;
- //标定负载点
- private byte weightPol;
- //厂商
- private short manufacturer;
- //硬件版本
- private short haradware;
- //软件版本
- private short software;
- //通讯协议版本
- private byte protocol;
- //设备种类
- private byte devType;
- #模式参数说明(BaseDevMode)
- private boolean diyCountDown = false ;
- //倒计时
- private boolean countDown = true;
- //时间是否可调
- private boolean timeChange = true;
- //最小时间
- private int minTime = 0;
- //默认时间
- private int defaultTime = 0;
- //最大时间
- private int maxTime = Integer.MAX_VALUE;
- //默认加热模式
- private byte defaultHeatMode = HeatModes.PU_TONG;
- //温度是否可调
- private boolean tempChange = true;
- //默认温度
- private int defaultTemp = 0;
- //最小可调温度
- private int minTemp = 0;
- //最大可调温度
- private int maxTemp = 100;
- //电机档位是否可调
- private boolean motorGearChange = true;
- //最小可调电机档位
- private int minMotorGear = 0;
- //最大可调电机档位
- private int maxMotorGear = 15;
- //默认电机档位
- private int defaultMotorGear = 1;
- //电机档位是否可调
- private boolean motorDirectionChange = true;
- //默认电机方向
- private int motorDirection = 0;
|