|
|
@ -71,7 +71,7 @@ class SensorCalibrationActivity : NoOptionsActivity() {
|
|
|
|
mBinding.tvSave.text = getString(R.string.calibration_zero_txt)
|
|
|
|
mBinding.tvSave.text = getString(R.string.calibration_zero_txt)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
mBinding.layoutInput.visibility = View.VISIBLE
|
|
|
|
mBinding.layoutInput.visibility = View.VISIBLE
|
|
|
|
val localValue = MMKVUtils.getInt("${gasName}_Calibration")
|
|
|
|
val localValue = MMKVUtils.getFloat("${gasName}_Calibration")
|
|
|
|
if (localValue >= 0) {
|
|
|
|
if (localValue >= 0) {
|
|
|
|
mBinding.etName.setText(localValue.toString())
|
|
|
|
mBinding.etName.setText(localValue.toString())
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -111,9 +111,10 @@ class SensorCalibrationActivity : NoOptionsActivity() {
|
|
|
|
return@setOnClickListener
|
|
|
|
return@setOnClickListener
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sensorIndex != -1) {
|
|
|
|
if (sensorIndex != -1) {
|
|
|
|
val toInt = text.toInt()
|
|
|
|
val toFloat = text.toFloat()
|
|
|
|
MMKVUtils.put("${gasName}_Calibration", toInt)
|
|
|
|
MMKVUtils.put("${gasName}_Calibration", toFloat)
|
|
|
|
GasPortUtils.calibrationSensor(sensorIndex, toInt)
|
|
|
|
// 输入的可能存在小数,*100,底层处理会自动处理
|
|
|
|
|
|
|
|
GasPortUtils.calibrationSensor(sensorIndex, (toFloat * 100).toInt())
|
|
|
|
mHandler.postDelayed(outTimeRunnable, 3000)
|
|
|
|
mHandler.postDelayed(outTimeRunnable, 3000)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|