zhuguifei
2026-01-14 09c54e2bfa51aa9800f224fda7ad3754b353bfed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<?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="@color/white">
                        
                        <View
                            android:layout_width="4dp"
                            android:layout_height="16dp"
                            android:background="@color/base_color"
                            android:layout_marginEnd="8dp"/>
                            
                        <TextView
                            android:id="@+id/tv_monitor_title"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="监控详情"
                            android:textSize="16sp"
                            android:textStyle="bold"
                            android:textColor="#333333"
                            android:clickable="true"
                            android:focusable="true"
                             />
                        
                        <TextView
                            android:id="@+id/tv_monitor_update_time"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text=""
                            android:textSize="12sp"
                            android:textColor="#999999"/>
                    </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="@color/white">
                    
                    <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">
 
                    <!-- Grid Layout for Parameters -->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:layout_marginBottom="16dp">
 
                        <!-- Row 1: Labels -->
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_marginBottom="8dp">
 
                            <!-- Layer Label -->
                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1"
                                android:orientation="horizontal"
                                android:gravity="center">
                                <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="4dp"/>
                            </LinearLayout>
 
                            <!-- Station Label -->
                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1"
                                android:orientation="horizontal"
                                android:gravity="center">
                                <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="4dp"/>
                            </LinearLayout>
 
                            <!-- Baud Label -->
                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.5"
                                android:orientation="horizontal"
                                android:gravity="center">
                                <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="4dp"/>
                            </LinearLayout>
                        </LinearLayout>
 
                        <!-- Row 2: Values -->
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:gravity="center_vertical">
 
                            <!-- Layer Value -->
                             <TextView
                                android:id="@+id/et_layer"
                                android:layout_width="0dp"
                                android:layout_height="48dp"
                                android:layout_weight="1"
                                android:background="@android:color/transparent"
                                android:gravity="center"
                                android:text="待读取"
                                android:textSize="16sp"
                                android:textStyle="bold"
                                android:textColor="#999999"
                                android:layout_marginEnd="4dp"
                                />
 
                            <!-- Station Value -->
                            <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:gravity="center"
                                android:hint="站号"
                                android:textColorHint="#CCCCCC"
                                android:textSize="14sp"
                                android:inputType="number"
                                android:layout_marginStart="4dp"
                                android:layout_marginEnd="4dp"/>
 
                            <!-- Baud Value -->
                            <FrameLayout
                                android:layout_width="0dp"
                                android:layout_height="48dp"
                                android:layout_weight="1.5"
                                android:background="@drawable/bg_input_field"
                                android:layout_marginStart="4dp">
                                
                                <Spinner
                                    android:id="@+id/spinner_baud"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:background="@null"
                                    android:paddingEnd="32dp"
                                    />
 
                                <ImageView
                                    android:layout_width="24dp"
                                    android:layout_height="24dp"
                                    android:src="@drawable/ic_arrow_drop_down"
                                    android:layout_gravity="center_vertical|end"
                                    android:layout_marginEnd="8dp"
                                    android:importantForAccessibility="no"/>
                            </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"
                            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:id="@+id/cv_log"
            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>