Repository navigation
[0.8.6] - 2026-11-25
新增
- Modbus 点位级字节序布局:设备点位新增「字节序布局」配置(
device_address.byte_order),留空 = 跟随设备protocol_json。可选集合按值宽度:16 位ABCD/BADC,32 位ABCD/CDAB/BADC/DCBA,64 位ABCDEFGH/CDABGHEF/BADCFEHG/HGFEDCBA/GHEFCDAB/DCBAHGFE,字符串仅ABCD/BADC。切换数据类型会清空失效布局;保存与 Excel 导入按宽度校验。采集、控制下发与点位扫描共用同一布局,布局参与配置校验和,改完热加载生效。导入模板新增第七列「字节序布局」,旧六列文件仍可导入。 - 欧姆龙 FINS 点位级字节序布局:四种 FINS 协议(UDP/TCP/Serial/HostLinkTCP)同样支持点位级
ByteOrderLayout,覆盖 16/32/64 位数值与 BCD/LBCD/Date;空串沿用设备级byteOrder/wordOrder,读写共用同一份布局。FINS 的字符串、bool 与 8 位类型(以及任何位地址)没有点位级布局,保存时拒绝、前端不显示。后端新增协议白名单:只有 Modbus 与 FINS 接受非空布局,其余协议保存/导入时明确报错,不再「能存但被驱动静默忽略」;导入模板的布局下拉也随设备协议收敛。 - 属性绑定点位支持两级分页选择:新增
GET /thingModel/pageThingModelPointDevices(仅返回有点位的设备,带pointCount,按名称/编码搜索)与GET /thingModel/pageThingModelPointOptions(按设备分页的点位候选,按地址名/说明搜索),镜像到/agentApi。属性弹窗改用「先设备、后点位」的选择器,全量listThingModelPointOptions保留兼容。 - 物模型复制:新增
POST /thingModel/copyThingModel,按 ID 复制一条新模型,只带基础信息(标识/名称/分类/版本/描述/状态),不复制属性;标识与名称自动追加-copy后缀并查重(-copy2…),返回{id, code, name},镜像到/agentApi。控制台模型详情头新增复制按钮,复制后直接选中副本。
Added
- Point-level byte order layout for Modbus points: points gain a byte-order layout setting (
device_address.byte_order); empty follows the device'sprotocol_json. Available layouts depend on value width:ABCD/BADCfor 16-bit,ABCD/CDAB/BADC/DCBAfor 32-bit,ABCDEFGH/CDABGHEF/BADCFEHG/HGFEDCBA/GHEFCDAB/DCBAHGFEfor 64-bit, andABCD/BADCfor strings. Switching the data type clears a layout that no longer applies; saving and Excel import validate against the width. Collection, control writes and point scan share the same layout, which is part of the config checksum, so changes apply via hot reload. The import template gains a seventh "byte order layout" column; old six-column files still import. - Point-level byte order layout for Omron FINS: all four FINS protocols (UDP/TCP/Serial/HostLinkTCP) support
ByteOrderLayoutfor 16/32/64-bit numeric types plus BCD/LBCD/Date; an empty string follows the device-levelbyteOrder/wordOrder, and reads and writes share the layout. FINS strings, bool, 8-bit types and any bit address have no point-level layout: they are rejected on save and hidden in the dialog. The backend now enforces a protocol allowlist: only Modbus and FINS accept a non-empty layout, and other protocols return a clear error on save/import instead of storing a value the driver silently ignores. The import template's layout dropdown follows the device protocol as well. - Two-level paged point picker for property binding: adds
GET /thingModel/pageThingModelPointDevices(only devices that have points, withpointCount, searchable by name/code) andGET /thingModel/pageThingModelPointOptions(a device's points paged, searchable by address name/label), mirrored to/agentApi. The property dialog now picks a device first and then a point; the fulllistThingModelPointOptionsstays for compatibility. - Thing-model duplication:
POST /thingModel/copyThingModelcopies a model by ID with only its basics (code / name / category / version / description / status) and no properties; the code and name get a-copysuffix with collision avoidance (-copy2…), and the response returns{id, code, name}. Mirrored to/agentApi; the console's model detail header gains a duplicate action that selects the copy.
变更
- 物模型标识支持改名:编辑物模型时可修改模型标识,全表仍保持唯一(撞名报
41001,格式非法报41007)。设备绑定按模型id关联,改名不断绑;但开放接口、导入导出与订阅映射里按旧标识配置的引用需同步更新——开放接口按 code 定位模型,拿旧标识再 upsert 会落成新模型。编辑弹窗在标识被改动时把提示切到警示色。 - 物模型属性标识符支持改名:编辑属性时可修改标识符,模型内仍保持唯一(撞名报
41003,格式非法报41008)。点位绑定按property_id关联,改名不断绑;但映射、脚本与推送里按旧标识符命中的引用需同步更新。采集侧把属性标识符纳入配置校验和,改名后自动热加载,记录中的propertyCode随新值更新;错误码41009保留但不再下发。 - 物模型属性列表展示绑定点位:属性与点位已改为 1 对 1,「点位数」恒为 0/1、没有信息量,该列改为「绑定点位」,直接展示
设备名称.点位名称(点击仍打开点位明细抽屉),未绑定显示「未绑定」。属性分页与全量接口的响应新增pointDeviceName/pointName;存量多绑数据显示首个点位并以+N提示剩余条数。 - 依赖 SDK v0.6.0 与官方驱动 v0.6.1(新增 FINS 点位级布局):线协议
APIVersion由 4 进位到 5,全部插件必须与主二进制成对重编;旧插件在新网关、新插件在旧网关上均会在握手期被拒绝。 - 物模型属性数据类型改为纯说明:属性的
kind不再作为点位绑定的兼容性前提(不再报41016),绑定点位时不校验类型;管理页面(属性列表、新增/编辑弹窗、点位选择器)不再展示数据类型,新建、编辑、Excel 导入与开放接口均允许留空(未指定)。被点位绑定后仍禁止修改accessMode(41018),但kind随时可改。采集与推送本就不依赖属性类型,运行时行为不变。 - 属性与点位改为严格 1 对 1:一个属性最多绑定一个点位(
addressIds上限 1,超出报新错误码41022),从点位侧绑定同样受约束;存量多绑属性照常读取,保存时收敛为选中的那一条。 - 控制台表单改版:设备对象页改为主从工作台——左侧设备列表、右侧直接管理该设备的点位,原点位页与设备页共用同一面板;设备、物模型、属性、推送通道的新增/编辑弹窗统一为分区卡片,推送通道先选类型再填参数。
- 物模型改为主从工作台:物模型页左侧为模型列表、右侧直接维护选中模型的属性,选中项同步到 URL(
?modelId=),窄屏切换为「列表 / 详情」二选一;模型标识可一键复制。原独立属性页保留为旧深链与属性控制下发的返回落点,主体复用同一属性面板。
Changed
- Thing-model codes can be renamed: the model dialog now allows editing the model code while keeping it unique across all models (
41001on collision,41007when malformed). Device bindings are keyed by the modelid, so renaming does not unbind; however, external references configured with the old code (open API, import/export, subscription mappings) must be updated — the open API locates models by code, so a later upsert with the old code creates a new model. The dialog switches its code hint to the warning color once the value is changed. - Thing-model property identifiers can be renamed: the property dialog now allows editing the identifier while keeping it unique within the model (
41003on collision,41008when malformed). Point bindings are keyed byproperty_id, so renaming does not unbind; mappings, scripts and pushes that match the old identifier must be updated. The collector includes property identifiers in its config checksum, so a rename hot-reloads and new records carry the newpropertyCode; error code41009is kept but no longer emitted. - Property list shows the bound point: properties and points are now 1:1, so a point count of 0/1 carries no information. The column becomes "Bound Point" and shows
deviceName.pointNamedirectly (clicking still opens the point detail drawer), with "Not bound" when empty. The paged and full property responses gainpointDeviceName/pointName; legacy multi-bound rows show the first point plus+Nremaining. - Depends on SDK v0.6.0 and official drivers v0.6.1 (adding the FINS point-level layout): the wire
APIVersionmoves from 4 to 5, so all plugins must be rebuilt together with the main binary; old plugins are rejected at handshake by a new gateway, and vice versa. - Thing-model property data type is now descriptive only: a property's
kindis no longer a binding compatibility prerequisite (the41016check is gone), so point type is not validated on binding; the admin UI (property list, create/edit dialog and point picker) no longer shows it, and create, edit, Excel import and the open API all accept an empty value (unspecified). A point-bound property still locksaccessMode(41018), whilekindcan change at any time. Collection and pushing never depended on the property type, so runtime behavior is unchanged. - Property-to-point binding is strictly 1:1: a property binds at most one point (
addressIdscapped at 1, exceeding returns the new41022), and binding from the point side enforces the same rule; legacy multi-bound rows still load and converge to the selected point on save. - Console form redesign: the device page becomes a master-detail workbench — a device list on the left and that device's points managed on the right, sharing one panel with the original point page; the device, thing-model, property and push-channel create/edit dialogs share sectioned cards, and a push channel picks its type before its parameters.
- Thing models become a master-detail workspace: the thing-model page shows a model list on the left and manages the selected model's properties on the right, with the selection reflected in the URL (
?modelId=); narrow screens switch between list and detail, and the model code is copied with one click. The standalone property page stays as the landing for legacy deep links and the property-control back link, reusing the same property panel.
Full Changelog: v0.8.5...v0.8.6