设备预警信息详情 温度完成
parent
a1accf7cb6
commit
0225103849
@ -0,0 +1,100 @@
|
||||
package com.rehome.zhdcoa.ui.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
|
||||
import com.rehome.zhdcoa.bean.DeviceAlarmListResultBean
|
||||
import com.rehome.zhdcoa.databinding.ActivityDeviceAlarmInfoDetailBinding
|
||||
import com.rehome.zhdcoa.utils.GsonUtils
|
||||
|
||||
class DeviceAlarmInfoDetailActivity : BaseActivityOaToolbarViewBinding<ActivityDeviceAlarmInfoDetailBinding>() {
|
||||
override fun getViewBinding() = ActivityDeviceAlarmInfoDetailBinding.inflate(layoutInflater)
|
||||
|
||||
override fun getToolbar() = binding.toolbarView.toolbar
|
||||
|
||||
override fun initView() {
|
||||
initToolbar("设备预警信息详情", "",{
|
||||
|
||||
})
|
||||
//binding.tvPaiHao.setTextColor(Color.parseColor("#0099ff"))
|
||||
binding.itemZt.tvBjz.setTextColor(Color.parseColor("#0099ff"))
|
||||
binding.itemZt.vHead.visibility= View.VISIBLE
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n", "DefaultLocale")
|
||||
override fun initData() {
|
||||
val item:String = intent.getStringExtra("item").toString()
|
||||
showLog(item)
|
||||
val itemDeviceWarning:DeviceAlarmListResultBean.DeviceWarning? = GsonUtils.GsonToBean(item,DeviceAlarmListResultBean.DeviceWarning::class.java)
|
||||
if(itemDeviceWarning==null){
|
||||
showLog("null")
|
||||
}else{
|
||||
showLog(itemDeviceWarning.warningTime)
|
||||
binding.itemZt.tvBjz.text=itemDeviceWarning.statusStr //状态
|
||||
binding.itemLx.tvBjz.text=itemDeviceWarning.typeStr //类型
|
||||
binding.itemYjsj.tvBjz.text=itemDeviceWarning.warningTime //预警时间
|
||||
binding.itemSb.tvBjz.text=itemDeviceWarning.deviceName //设备
|
||||
binding.itemQx.tvBjz.text=itemDeviceWarning.description //详情
|
||||
|
||||
binding.itemZt.tvStatus.text="状态" //状态
|
||||
binding.itemLx.tvStatus.text="类型" //类型
|
||||
binding.itemYjsj.tvStatus.text="预警时间" //预警时间
|
||||
binding.itemSb.tvStatus.text="设备" //设备
|
||||
binding.itemQx.tvStatus.text="详情" //详情
|
||||
binding.itemWd.tvStatus.text="温度" //温度
|
||||
binding.itemWdbjz.tvStatus.text="温度报警值" //详情
|
||||
|
||||
//binding.itemWd.tvBjz.text=itemDeviceWarning.temperature //温度
|
||||
//binding.itemWdbjz.tvBjz.text=itemDeviceWarning.description //温度报警值
|
||||
val paramsStr:String = itemDeviceWarning.params
|
||||
val dataStr:String = itemDeviceWarning.data
|
||||
val data:DeviceAlarmListResultBean.DeviceData? = GsonUtils.GsonToBean(dataStr,DeviceAlarmListResultBean.DeviceData::class.java)
|
||||
val params:DeviceAlarmListResultBean.DeviceParams? = GsonUtils.GsonToBean(paramsStr,DeviceAlarmListResultBean.DeviceParams::class.java)
|
||||
if(data!=null){
|
||||
binding.itemWd.tvBjz.text= String.format("%.0f", data.temperature) + "℃" //温度
|
||||
}
|
||||
if("温度预警"==itemDeviceWarning.description){
|
||||
binding.itemWd.tvBjz.setTextColor(Color.parseColor("#e9260f"))
|
||||
if(data!=null&¶ms!=null){
|
||||
if(params.tptAlarmMaxValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.tptAlarmMaxValue) + "℃" //温度
|
||||
}else{
|
||||
if(params.tptAlarmMinValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.tptAlarmMinValue) + "℃" //温度
|
||||
}else{
|
||||
if(params.spdAlarmMaxValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.spdAlarmMaxValue) + "℃" //温度
|
||||
}else{
|
||||
if(params.spdAlarmMinValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.spdAlarmMinValue) + "℃" //温度
|
||||
}else{
|
||||
if(params.dpmAlarmMaxValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.dpmAlarmMaxValue) + "℃" //温度
|
||||
}else{
|
||||
if(params.dpmAlarmMinValue!=null){
|
||||
binding.itemWdbjz.tvBjz.text= String.format("%.0f", params.dpmAlarmMinValue) + "℃" //温度
|
||||
}else{
|
||||
binding.itemWdbjz.tvBjz.text=""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.itemWdbjz.llAll.visibility= View.VISIBLE
|
||||
}else{
|
||||
if("振动预警"==itemDeviceWarning.description){
|
||||
binding.itemWdbjz.llAll.visibility= View.GONE
|
||||
}
|
||||
if("振动异常"==itemDeviceWarning.description){
|
||||
binding.itemWdbjz.llAll.visibility= View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* {"createTime":"2025-12-31 20:59:55","data":"{\"id\":3211802,\"mqttIp\":\"172.16.5.226\",\"deviceCode\":\"003c0003\",\"deviceTime\":1767185984839,\"pkNum\":21252,\"status\":2,\"voltage\":3.4907227,\"temperature\":89,\"xAcceleration\":0,\"yAcceleration\":0,\"zAcceleration\":0,\"xSpeed\":0,\"ySpeed\":0,\"zSpeed\":0,\"xDisplacement\":0,\"yDisplacement\":0,\"zDisplacement\":0,\"xDcComponent\":0,\"yDcComponent\":0,\"zDcComponent\":0,\"xFrequency\":0,\"yFrequency\":0,\"zFrequency\":0,\"xFreq\":0,\"yFreq\":0,\"zFreq\":0}","description":"温度预警","deviceCode":"003c0003","deviceName":"1#锅炉6F东侧04吹灰器","id":80730,"params":"{\"tptAlarmMaxValue\":70,\"tptAlarmMinValue\":70}","specialtyStr":"锅炉","statusStr":"报警","typeStr":"测振测温设备","warningTime":"2025-12-31 20:59:45"}
|
||||
*/
|
||||
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#000000"
|
||||
tools:context=".ui.activity.DeviceAlarmInfoDetailActivity">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbarView"
|
||||
layout="@layout/layout_base" />
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/item_head"
|
||||
layout="@layout/item_device_alarm_info_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_temperature"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/item_zt"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_lx"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:text="类型"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_yjsj"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_sb"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_qx"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_wd"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_wdbjz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_zhendong"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/item_xwy"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_ywy"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_zwy"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_xsd"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_ysd"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_zsd"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_zd_wdbjz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_wybjz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<include
|
||||
android:id="@+id/item_wygzz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_sdbjz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/item_sdgzz"
|
||||
layout="@layout/item_device_alarm_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10px"
|
||||
android:layout_marginEnd="10px"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ll_all"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minHeight="92px"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_head"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:background="#524658"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="90px">
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#524658" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_status"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1.4"
|
||||
android:paddingStart="10dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#0aefcc"
|
||||
android:text="状态" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#524658" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bjz"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="start|center_vertical"
|
||||
android:layout_marginLeft="10px"
|
||||
android:layout_weight="2.5"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#ffffff"
|
||||
android:text="报警" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#524658" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#524658" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,76 @@
|
||||
<?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="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minHeight="92px"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/head"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:background="#524658"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="90px">
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#524658" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_status"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_weight="2.2"
|
||||
android:gravity="start"
|
||||
android:textSize="28sp"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:text="预警信息" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:background="#524658" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_djrw"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="10px"
|
||||
android:layout_weight="1.7"
|
||||
android:textSize="18sp"
|
||||
|
||||
android:text="" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:background="#524658" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:background="#524658" />
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue