feat(scale): 实现调料槽位配置持久化及主从设备数据同步

- 新增 SeasoningSlotEntity / SeasoningSlotDao,独立存储格子调料配置
- AppDatabase 升级至版本 8,添加 MIGRATION_7_8
- ScaleEvent 新增 TYPE_SEASONING_CONFIG 和 SlotConfig,用于主从同步
- SeasoningConfigFragment 选择调料后写 Room 并通过 wsClient 推送给子设备
- ScaleWebSocketClient 新增 sendToAllSlaves / sendToDevice / onDeviceConnected
- ScaleWebSocketServer 扩展 onMessage 支持接收主设备下发的配置事件
- ScaleServiceManager 暴露 sendSeasoningConfig / onSeasoningConfig;子设备连接时自动推送全量配置
- MasterScaleActivity 启动时从 Room 加载 slotNameMap,注入 ScaleData.name 展示调料名
- SlaveActivity 新增 slotNameMap 防止重量回调覆盖调料名;监听 onSeasoningConfig 写 Room 并刷新 adapter
- Adapter 新增 tvAddress 和 showAddress 参数,仅 MasterScaleActivity 显示秤地址行;tvName 空值统一显示"-"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 15:27:28 +08:00
co-authored by Claude Sonnet 4.6
parent a81e914b63
commit b16d7d19cd
13 changed files with 390 additions and 40 deletions
@@ -1,5 +1,5 @@
<?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"
@@ -8,6 +8,15 @@
android:padding="4dp"
android:background="@drawable/shape_scale_cell">
<TextView
android:id="@+id/tvAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/home_sub_title"
android:visibility="gone" />
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"