Commit Graph

134 Commits

Author SHA1 Message Date
wanglei
34f329c532 Test vision asset scopes, camera identity and batch reverse-order undo 2026-12-05 22:35:48 +08:00
wanglei
860602b480 Review, apply and undo scoped vision asset and step renames 2026-12-05 22:33:24 +08:00
wanglei
2e03f3b617 Resolve camera and scoped vision image references in workflow scripts 2026-12-05 22:31:22 +08:00
wanglei
30e669fccb Verify three device renames and exact reverse-order undo in one WPF session 2026-12-05 22:26:30 +08:00
wanglei
fc49db64a8 Apply and undo reviewed device names and workflow edits in the live editor 2026-12-05 22:25:25 +08:00
wanglei
dc5463b3bb Resolve cylinder, robot and connection name references across workflows 2026-12-05 22:22:37 +08:00
wanglei
5712d069ce Run DI and DQ acceptance together with reverse-order WPF undo 2026-12-05 22:20:49 +08:00
wanglei
f0d69cd932 Rename DI and DQ channels with typed workflow and cylinder references 2026-12-05 22:19:50 +08:00
wanglei
c2e88950a6 Verify axis rename and byte-for-byte undo on the live WPF sample 2026-12-05 22:14:01 +08:00
wanglei
cfb25928cb Apply and undo reviewed axis, point and workflow changes across recipes 2026-12-05 22:13:44 +08:00
wanglei
d275631836 Resolve hardware axis name references across recipe scripts 2026-12-05 22:03:21 +08:00
wanglei
f3590d2ee7 Exercise vision function rename and byte-for-byte undo on the portable sample 2026-12-05 21:58:10 +08:00
wanglei
2b66063b4d Apply and undo reviewed vision function renames in MCP and WPF 2026-12-05 21:57:31 +08:00
wanglei
1efee842d7 Resolve recipe-scoped vision function references in workflow scripts 2026-12-05 21:55:34 +08:00
wanglei
c8e14cb5af Return standalone configuration objects through the editor pipe 2026-12-05 21:54:29 +08:00
wanglei
534dee0427 Exercise point rename and undo on the portable WPF sample 2026-12-05 21:50:37 +08:00
wanglei
c4f406e975 Review, apply and undo point names with their scoped matrix and script references 2026-12-05 21:49:35 +08:00
wanglei
779932f7a2 Resolve axis and robot point references in recipe scripts 2026-12-05 21:46:39 +08:00
wanglei
c81cd7851e Exercise live workflow rename, confirmation and exact undo on a sample caller 2026-12-05 21:44:31 +08:00
wanglei
ea414f488e Apply and undo reviewed workflow renames through MCP and WPF 2026-12-05 21:43:50 +08:00
wanglei
2d4805a777 Plan recipe-scoped workflow renames from bound script references 2026-12-05 21:40:34 +08:00
wanglei
3bd6a7872e Guard batch commits and verify live editor rename and undo 2026-12-05 21:38:38 +08:00
wanglei
058ba4fcae Apply variable renames and guarded inverse drafts across project files 2026-12-05 21:34:17 +08:00
wanglei
49fe9d599a Plan recipe variable renames from bound C# references 2026-12-05 21:32:39 +08:00
wanglei
f4dee92233 Track live script edits and verify cancel and save with real WPF dialogs 2026-12-05 21:30:05 +08:00
wanglei
559eb230a6 Apply reviewed workflow source only after explicit WPF approval 2026-12-05 21:26:51 +08:00
wanglei
addac5ba77 Preview workflow diffs and compile C# without loading user code 2026-12-05 21:25:07 +08:00
wanglei
444953d81a Preview and apply scoped MCP edits with editor approval and conflict checks 2026-12-05 21:20:55 +08:00
wanglei
46dc6282fc Locate recipe-scoped variable and workflow references with Roslyn 2026-12-05 21:15:24 +08:00
wanglei
6db8425851 Expose portable project inspection through a local MCP server 2026-12-05 21:14:19 +08:00
wanglei
b972271a14 Persist portable PLCSharp project directories and configuration 2026-12-05 21:12:52 +08:00
wanglei
12b51e0ca2 Carry pending Modbus RTU replies across client replacement 2026-12-05 20:41:09 +08:00
wanglei
d83d1750d1 Preserve outstanding RTU replies across serial port reopen 2026-12-05 20:38:01 +08:00
wanglei
114fd5d3e4 Isolate silent Modbus RTU stations on a shared bus 2026-12-05 20:35:37 +08:00
wanglei
8d3114efa1 隔离 Modbus RTU 超时请求的迟到应答 2026-12-05 20:28:47 +08:00
wanglei
4a96aa38e2 拒绝 CRC 正确但与请求不匹配的 Modbus RTU 应答 2026-12-05 20:20:04 +08:00
wanglei
38401bb901 拒绝与当前请求不匹配的 Modbus TCP 应答 2026-12-05 20:19:01 +08:00
wanglei
3de85630c6 按实际接收帧校验 Modbus RTU 写入和异常应答 2026-12-05 20:16:10 +08:00
wanglei
e49e90329b 修正 Modbus TCP 请求头多计一个字节的长度 2026-12-05 20:15:11 +08:00
wanglei
26d5212e55 矩阵点沿用起始点的安全高度和运动倍率 2026-12-05 20:14:19 +08:00
wanglei
eaabfd10cd 按坐标系正常结束状态确认本次插补完成 2026-12-05 20:12:18 +08:00
wanglei
599883e247 气缸反馈失效时清除旧点位和到位状态 2026-12-05 20:06:25 +08:00
wanglei
4951c97a3e 按配置的物理端口回读数字输入和输出 2026-12-05 20:05:15 +08:00
wanglei
1e52339a8c 按目标轴下发停轴、使能和参数保存命令 2026-12-05 20:04:30 +08:00
wanglei
634e11c325 分别刷新和显示气缸 A/B 位输出状态 2026-12-05 20:02:07 +08:00
wanglei
c55bff6c32 验证脚本入口后再标记编译成功 2026-12-05 20:01:44 +08:00
wanglei
5c022bfd26 切换配方前等待旧工作流退出 2026-12-05 20:01:10 +08:00
3ebbd31103 gitign 2026-11-28 15:15:36 +08:00
24325d2535 补齐文件编码:把编辑过程中被丢掉的 UTF-8 BOM 和 LF 行尾归一回仓库约定
本仓库的 .cs 都是 UTF-8 with BOM + CRLF。前面几个提交里,编辑工具把 App.xaml.cs、LoginModel.cs、VisionFunction.cs 首行的 BOM 掉了(表现为每个提交都多出一行无关的 -using/+using diff);新建的 TaskTool.cs、WorkerGuard.cs 及三个测试文件则是无 BOM 的 LF。

这里统一补回 BOM、行尾归一为 CRLF。改动只是编码,逐文件 diff 都只有首行一处,无代码变化。
2026-11-17 23:30:49 +08:00
ec0c476c79 修复数据库无迁移能力:用模型对比补表补列,替掉字符串 Split 建表 hack
原做法:构造时 EnsureCreated() + 对每个 DbSet 反射名字试跑 SELECT,抛异常就把 GenerateCreateScript() 按 CREATE TABLE 名字 做 Split、取最后一段拼回去执行。问题:
- 只处理「缺表」,完全不处理「模型加了字段」。给实体新增一个属性后,老库的表里没有该列,EF 的 SELECT 直接 no such column —— 整个模块打不开,只能删库重来;
- Split 取 Last() 会挑错片段(同名字符串在别的表定义/索引里出现时),拼出来的 SQL 可能混进别的表的片段;索引语句被丢掉;
- 表名直接拼进 SQL;用「试跑 SELECT 看是否抛异常」判断存在性,等于靠异常做流程控制。

改法(SchemaMaintenance):
- 期望结构取自 EF 模型本身(GetEntityTypes/GetTableName/GetColumnName/GetColumnType),不再反射 DbSet 属性名;
- 实际结构读 sqlite_master 与 PRAGMA table_info,不再用异常做流程控制;
- 缺表:按 GenerateCreateScript() 自身的依赖顺序,只执行属于该表的 CREATE TABLE / CREATE INDEX 语句(引用关系天然正确);
- 缺列:ALTER TABLE ADD COLUMN,按 CLR 类型给已有行补默认值(数值/枚举 0、字符串空串、Guid 全零、时间 0001-01-01),非空列带 NOT NULL DEFAULT,可空列填 NULL;
- 不自动补的三类:主键列(ALTER 加不了)、影子/判别列(填错值比缺列更危险,宁缺勿错)、计算列;
- 标识符统一加引号并剥掉内嵌双引号。

另外把库路径从相对 CWD 的 ./Config/Datas.db 改成可注入:新增 DatasContext(databasePath),默认路径改为「可执行文件同级 Config/Datas.db」,并且若老安装把库放在启动目录下则继续沿用(升级后不会看不到原数据);同时自动建目录。这样库不再是「谁启动就落在谁的当前目录」。

新增 5 个测试:建库落盘可重读(这条同时兜住上一个提交里「注册/改密/删除不 Save」那类不落盘缺陷的回归)、缺表自动补建、缺列自动 ALTER 并按默认值填充、重复打开幂等不会重复加列、指定路径不会写到默认库。测试 59/59 通过,构建 0 error。
2026-11-17 23:30:38 +08:00