feat: 大屏改为纯流式自适应布局,新增KPI带与产线动态拓扑地图

This commit is contained in:
SunYF
2026-10-28 10:10:17 +08:00
parent 1f10c3091e
commit 4d3c4e2c3a
131 changed files with 18118 additions and 1728 deletions
+11
View File
@@ -37,6 +37,10 @@ type Client interface {
ReadBits(ctx context.Context) ([]bool, error)
// ReadMW 读取 16 位寄存器(MW)当前值(大端)。用于监控页读 MW800~MW886。
ReadMW(ctx context.Context, addr int) (int, error)
// ReadMWBlock 批量读取连续 MW 寄存器(大端),返回 [start..start+count-1] 每地址的 16 位值。
// 真实 S7 一次 AGReadMB 读 count*2 字节;看板快照用它一次取 MW800..MW887(44 个路由寄存器),
// 避免 44 次 ReadMW = 88 次 TCP 往返阻塞 PLC 连接。
ReadMWBlock(ctx context.Context, start, count int) ([]int, error)
// WriteMW 向 16 位寄存器(MW)写入值(大端)。用于手动下发路径指令、在途指令清零。
WriteMW(ctx context.Context, addr, value int) error
}
@@ -93,6 +97,13 @@ func (m *Manager) ReadMW(ctx context.Context, addr int) (int, error) {
return v, err
}
// ReadMWBlock 批量读连续 MW 寄存器(带恢复检测)。
func (m *Manager) ReadMWBlock(ctx context.Context, start, count int) ([]int, error) {
v, err := m.client.ReadMWBlock(ctx, start, count)
m.track(err)
return v, err
}
// WriteMW 写 16 位寄存器(带恢复检测)。
func (m *Manager) WriteMW(ctx context.Context, addr, value int) error {
err := m.client.WriteMW(ctx, addr, value)