desc:传感器标定
parent
485690b450
commit
f756a4863b
@ -0,0 +1,26 @@
|
||||
package com.yinuo.safetywatcher.watcher.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.yinuo.safetywatcher.databinding.ActivitySensorCalibrationBinding
|
||||
import com.yinuo.safetywatcher.watcher.port.GasPortUtils
|
||||
|
||||
class SensorCalibrationActivity : AppCompatActivity() {
|
||||
private val mBinding by lazy {
|
||||
ActivitySensorCalibrationBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(mBinding.root)
|
||||
val sensorIndex = intent.getIntExtra("index", -1)
|
||||
mBinding.tvSave.setOnClickListener {
|
||||
mBinding.etName.text.toString().let {
|
||||
if (sensorIndex != -1) {
|
||||
val toInt = it.toInt()
|
||||
GasPortUtils.calibrationSensor(sensorIndex, toInt)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/_121dp"
|
||||
android:paddingTop="@dimen/_61dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_name"
|
||||
android:layout_width="@dimen/_600dp"
|
||||
android:layout_height="@dimen/_100dp"
|
||||
android:textSize="@dimen/_30dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/white"
|
||||
android:hint="@string/calibration_value"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:paddingStart="@dimen/_30dp"
|
||||
android:focusable="true"
|
||||
android:nextFocusDown="@id/et_name"
|
||||
android:background="@drawable/cloud_sync_btn_bg"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_save"
|
||||
android:layout_width="@dimen/_600dp"
|
||||
android:layout_height="@dimen/_80dp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="@dimen/_23dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/calibration_txt"
|
||||
android:focusable="true"
|
||||
android:textSize="@dimen/_30dp"
|
||||
android:background="@drawable/save_btn_bg"/>
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue