<?xml version="1.0" encoding="utf-8"?>
|
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
android:background="#F5F6FA"
|
android:fillViewport="true">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
android:padding="16dp">
|
|
<!-- Card 1: Grid Status -->
|
<androidx.cardview.widget.CardView
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:cardCornerRadius="12dp"
|
app:cardElevation="2dp"
|
app:cardBackgroundColor="@color/white"
|
android:layout_marginBottom="24dp">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical">
|
|
<!-- Card Header -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:padding="16dp"
|
android:background="#FAFAFA">
|
|
<View
|
android:layout_width="4dp"
|
android:layout_height="16dp"
|
android:background="@color/base_color"
|
android:layout_marginEnd="8dp"/>
|
|
<TextView
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
android:text="监控详情"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
android:textColor="#333333" />
|
|
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
|
android:id="@+id/btn_read_data"
|
android:layout_width="wrap_content"
|
android:layout_height="32dp"
|
android:text="读取数据"
|
android:textColor="@color/white"
|
android:textSize="12sp"
|
android:paddingStart="12dp"
|
android:paddingEnd="12dp"
|
app:qmui_backgroundColor="@color/base_color"
|
app:qmui_radius="4dp"/>
|
</LinearLayout>
|
|
<View
|
android:layout_width="match_parent"
|
android:layout_height="1dp"
|
android:background="#EEEEEE"/>
|
|
<!-- Card Content -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
android:padding="16dp">
|
|
<HorizontalScrollView
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:scrollbars="none">
|
|
<androidx.recyclerview.widget.RecyclerView
|
android:id="@+id/rv_grid"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content" />
|
</HorizontalScrollView>
|
|
<View
|
android:layout_width="match_parent"
|
android:layout_height="1dp"
|
android:background="#EEEEEE"
|
android:layout_marginTop="16dp"
|
android:layout_marginBottom="12dp"/>
|
|
<!-- Legend -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:paddingStart="4dp">
|
|
<View
|
android:layout_width="12dp"
|
android:layout_height="12dp"
|
android:background="@drawable/bg_box_full"
|
android:layout_marginEnd="6dp"/>
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="有玻璃"
|
android:textSize="12sp"
|
android:textColor="#666666"
|
android:layout_marginEnd="16dp"/>
|
|
<View
|
android:layout_width="12dp"
|
android:layout_height="12dp"
|
android:background="@drawable/bg_box_empty"
|
android:layout_marginEnd="6dp"/>
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="无玻璃"
|
android:textSize="12sp"
|
android:textColor="#666666"
|
android:layout_marginEnd="16dp"/>
|
|
<View
|
android:layout_width="12dp"
|
android:layout_height="12dp"
|
android:background="@drawable/bg_box_offline"
|
android:layout_marginEnd="6dp"/>
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="离线"
|
android:textSize="12sp"
|
android:textColor="#666666"/>
|
</LinearLayout>
|
</LinearLayout>
|
</LinearLayout>
|
</androidx.cardview.widget.CardView>
|
|
<!-- Card 2: Controls -->
|
<androidx.cardview.widget.CardView
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:cardCornerRadius="12dp"
|
app:cardElevation="2dp"
|
app:cardBackgroundColor="@color/white">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical">
|
|
<!-- Card Header -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:padding="16dp"
|
android:background="#FAFAFA">
|
|
<View
|
android:layout_width="4dp"
|
android:layout_height="16dp"
|
android:background="@color/base_color"
|
android:layout_marginEnd="8dp"/>
|
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="参数"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
android:textColor="#333333" />
|
</LinearLayout>
|
|
<View
|
android:layout_width="match_parent"
|
android:layout_height="1dp"
|
android:background="#EEEEEE"/>
|
|
<!-- Card Content -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
android:padding="16dp">
|
|
<!-- Layer Input -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
android:layout_marginBottom="16dp">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:layout_marginBottom="8dp">
|
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="层数"
|
android:textSize="14sp"
|
android:textColor="#666666"/>
|
|
<TextView
|
android:id="@+id/tv_layer_status"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:textSize="10sp"
|
android:layout_marginStart="8dp"/>
|
</LinearLayout>
|
|
<EditText
|
android:id="@+id/et_layer"
|
android:layout_width="match_parent"
|
android:layout_height="48dp"
|
android:background="@drawable/bg_input_field"
|
android:paddingStart="16dp"
|
android:paddingEnd="16dp"
|
android:hint="层数 (1-30)"
|
android:textColorHint="#CCCCCC"
|
android:textSize="14sp"
|
android:focusable="false"
|
android:focusableInTouchMode="false"
|
android:inputType="none"/>
|
</LinearLayout>
|
|
<!-- Station Input -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
android:layout_marginBottom="16dp">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:layout_marginBottom="8dp">
|
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="站号"
|
android:textSize="14sp"
|
android:textColor="#666666"/>
|
|
<TextView
|
android:id="@+id/tv_station_status"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:textSize="10sp"
|
android:layout_marginStart="8dp"/>
|
</LinearLayout>
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal">
|
|
<EditText
|
android:id="@+id/et_station"
|
android:layout_width="0dp"
|
android:layout_height="48dp"
|
android:layout_weight="1"
|
android:background="@drawable/bg_input_field"
|
android:paddingStart="16dp"
|
android:paddingEnd="16dp"
|
android:hint="请输入站号 (1-64)"
|
android:textColorHint="#CCCCCC"
|
android:textSize="14sp"
|
android:inputType="number"/>
|
|
</LinearLayout>
|
</LinearLayout>
|
|
<!-- Baud Rate -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:layout_marginBottom="8dp">
|
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="波特率"
|
android:textSize="14sp"
|
android:textColor="#666666"/>
|
|
<TextView
|
android:id="@+id/tv_baud_status"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:textSize="10sp"
|
android:layout_marginStart="8dp"/>
|
</LinearLayout>
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal">
|
|
<FrameLayout
|
android:layout_width="0dp"
|
android:layout_height="48dp"
|
android:layout_weight="1"
|
android:background="@drawable/bg_input_field">
|
|
<Spinner
|
android:id="@+id/spinner_baud"
|
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
android:background="@null"
|
android:paddingStart="8dp"/>
|
</FrameLayout>
|
</LinearLayout>
|
</LinearLayout>
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:layout_marginTop="24dp">
|
|
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
|
android:id="@+id/btn_read_param"
|
android:layout_width="0dp"
|
android:layout_height="48dp"
|
android:layout_weight="1"
|
android:layout_marginEnd="8dp"
|
android:text="读取参数"
|
android:textColor="@color/white"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
app:qmui_backgroundColor="@color/base_color"
|
app:qmui_radius="8dp"/>
|
|
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
|
android:id="@+id/btn_write_all"
|
android:layout_width="0dp"
|
android:layout_height="48dp"
|
android:layout_weight="1"
|
android:layout_marginStart="8dp"
|
android:text="写入参数"
|
android:textColor="@color/white"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
app:qmui_backgroundColor="@color/base_color_s"
|
app:qmui_radius="8dp"/>
|
</LinearLayout>
|
|
</LinearLayout>
|
</LinearLayout>
|
</androidx.cardview.widget.CardView>
|
|
<TextView
|
android:id="@+id/tv_status"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:text="当前状态:等待操作..."
|
android:gravity="center"
|
android:textSize="12sp"
|
android:textColor="#999999"
|
android:layout_marginTop="16dp"/>
|
|
<!-- Log Display -->
|
<androidx.cardview.widget.CardView
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:cardCornerRadius="12dp"
|
app:cardElevation="2dp"
|
app:cardBackgroundColor="@color/white"
|
android:layout_marginTop="16dp"
|
android:layout_marginBottom="24dp">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical">
|
|
<!-- Card Header -->
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:gravity="center_vertical"
|
android:padding="16dp"
|
android:background="#FAFAFA">
|
|
<View
|
android:layout_width="4dp"
|
android:layout_height="16dp"
|
android:background="@color/base_color"
|
android:layout_marginEnd="8dp"/>
|
|
<TextView
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
android:text="日志"
|
android:textSize="16sp"
|
android:textStyle="bold"
|
android:textColor="#333333" />
|
|
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
|
android:id="@+id/btn_clear_log"
|
android:layout_width="wrap_content"
|
android:layout_height="32dp"
|
android:text="清空"
|
android:textColor="@color/white"
|
android:textSize="12sp"
|
android:paddingStart="12dp"
|
android:paddingEnd="12dp"
|
app:qmui_backgroundColor="#FF5252"
|
app:qmui_radius="4dp"/>
|
</LinearLayout>
|
|
<View
|
android:layout_width="match_parent"
|
android:layout_height="1dp"
|
android:background="#EEEEEE"/>
|
|
<ScrollView
|
android:id="@+id/sv_log"
|
android:layout_width="match_parent"
|
android:layout_height="200dp"
|
android:padding="12dp"
|
android:scrollbars="vertical"
|
android:background="#FAFAFA">
|
|
<TextView
|
android:id="@+id/tv_log"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:text="日志记录:\n"
|
android:textSize="12sp"
|
android:fontFamily="monospace"
|
android:textColor="#333333"
|
android:lineSpacingExtra="4dp"/>
|
</ScrollView>
|
</LinearLayout>
|
</androidx.cardview.widget.CardView>
|
|
</LinearLayout>
|
|
</androidx.core.widget.NestedScrollView>
|