完善智能称重终端界面与电子秤接入

This commit is contained in:
FinleyHsu
2026-08-06 10:48:47 +08:00
parent 839edd1e4a
commit 3b856f0c11
8 changed files with 967 additions and 181 deletions
+17
View File
@@ -6,6 +6,23 @@ const UNIT_FACTORS: Record<WeightUnit, number> = {
lb: 2.20462262,
};
/**
* RS-485 Modbus RTU 默认配置。
* 留空或传 "{}" 时使用此配置。
* 针对 Firefly AIO-3399C 工业终端的 /dev/ttysWK0 (RS485 端口)。
*/
export const DEFAULT_MODBUS_CONFIG = {
portPath: "/dev/ttysWK0",
baudRate: 9600,
slaveId: 1,
functionCode: 4,
registerAddress: 0,
registerCount: 2,
dataType: "float32",
byteOrder: "ABCD",
pollIntervalMs: 125,
};
/**
* 将内部统一保存的千克值转换为界面单位,并固定显示两位小数。
*/