diff --git a/CHANGELOGS/V1.2.6.md b/CHANGELOGS/V1.2.6.md new file mode 100644 index 0000000..486598b --- /dev/null +++ b/CHANGELOGS/V1.2.6.md @@ -0,0 +1,44 @@ +# V1.2.6 更新日志 + +- **更新日期**: 2026年08月24日 +- **版本号**: 1.2.6 + +## 新增功能 + +### 1. OLE.ini 增加模拟增益倍数配置 +- **新增“模拟增益倍数”参数**:在 `OLE.ini` 第二行增加固定值 `0.001`。 +- **调整配置文件结构**:原 `OLE.ini` 第二行参数顺延至第三行,原有参数值继续保留。 +- **保持曝光参数位置不变**:第一行仍用于设备曝光参数,上位机读取和修改曝光参数的逻辑不变。 + +## 技术细节 + +### OLE.ini 文件格式 +```ini +曝光参数 +0.001 +原第二行参数 +``` + +- 上位机写入 `OLE.ini` 时,第二行始终写入 `0.001`。 +- 已有三行文件写入时保留第三行原值。 +- 旧版两行文件写入时,原第二行自动迁移到第三行,避免参数丢失。 +- 配置文件仍通过 ADB 写入设备的 `/data/`;当前界面同时写入 `/system/etc/` 以持久化配置。 + +## 影响范围 +- 设备端 `OLE.ini` 配置文件结构 +- 曝光参数读取与设置流程 +- 设备端模拟增益倍数配置 +- 项目版本元数据与发布文档 + +## 依赖更新 +- 无依赖包更新 + +## 注意事项 +1. `OLE.ini` 第二行是固定的模拟增益倍数 `0.001`,不应由用户修改。 +2. 第一行曝光参数仍限制在 `0.000001 ~ 0.999999` 范围内。 +3. 对旧版两行 `OLE.ini` 的迁移在下一次设置曝光参数时执行;仅读取不会改写文件。 +4. 第三行参数的具体含义由设备端定义,上位机仅负责保留和回写。 + +--- + +**完整更新内容请查看项目 Git 提交记录** diff --git a/package-lock.json b/package-lock.json index d0052d4..6981f66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "FlexometerSetup", - "version": "1.2.5", + "version": "1.2.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "FlexometerSetup", - "version": "1.2.5", + "version": "1.2.6", "hasInstallScript": true, "dependencies": { "@ant-design/icons": "^5.6.1", diff --git a/package.json b/package.json index 4716c28..c03d415 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "FlexometerSetup", - "version": "1.2.5", + "version": "1.2.6", "description": "An Electron application with React", "main": "./out/main/index.js", "author": "cles", diff --git a/src/main/lib/adbClient.js b/src/main/lib/adbClient.js index 2263aed..ee31e3b 100644 --- a/src/main/lib/adbClient.js +++ b/src/main/lib/adbClient.js @@ -128,13 +128,14 @@ async function readLocalOLE() { async function writeFirstOLE(line1) { const file = path.join(adbDir, 'OLE.ini') - let second = '1.000000' + let third = '1.000000' try { const text = await fsp.readFile(file, 'utf8') const lines = text.split(/\r?\n/).filter(Boolean) - if (lines.length >= 2) second = lines[1] + if (lines.length >= 3) third = lines[2] + else if (lines.length >= 2) third = lines[1] } catch {} - const content = `${line1}\n${second}\n` + const content = `${line1}\n0.001\n${third}\n` await fsp.writeFile(file, content, 'utf8') return file }