Compare commits

..
206 Commits
Author SHA1 Message Date
sc 5aee8ae1b8 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-08 23:20:43 +08:00
sc dfa9a53ab1 修改数据库 2025-10-08 23:20:42 +08:00
sc 781155370f Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-08 23:12:09 +08:00
sc dd7bf1b4d1 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-08 23:12:07 +08:00
sc b3fe0f2dd1 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-08 22:48:36 +08:00
sc 42d728b2ca 810,811,812指令逻辑修改 2025-10-08 22:48:34 +08:00
sc 37723963ce Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-06 21:50:13 +08:00
sc bcca150aea 防火墙设置 2025-10-06 21:50:12 +08:00
sc 2abd80567a Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-06 21:36:36 +08:00
sc 104bec5de6 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-06 21:36:35 +08:00
sc 9e391cd291 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-06 21:35:43 +08:00
sc 3b936a37cb 添加资源,822指令错误修复 2025-10-06 21:35:42 +08:00
sc 9c00cb8176 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-06 00:38:34 +08:00
sc 41990092c4 添加822指令,最近可用工艺 2025-10-06 00:38:31 +08:00
sc a1ec2f84a6 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-05 00:23:20 +08:00
sc 7c31cab283 运行资源 2025-10-05 00:23:08 +08:00
sc 7edfcec844 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-02 22:25:38 +08:00
sc 339d4cfde5 数据库 2025-10-02 22:25:36 +08:00
sc 26a7faebe7 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-02 22:25:24 +08:00
sc 2b93e8141e Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-02 22:25:23 +08:00
sc b64e35a100 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-02 20:56:06 +08:00
sc 62cd3c6e33 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-02 20:56:04 +08:00
sc bb334e76cf Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-01 16:50:48 +08:00
sc 650f89b7cb 明细传输错误修正 2025-10-01 16:50:47 +08:00
sc 9e5e1415a9 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-10-01 15:42:07 +08:00
sc 55ee496d51 812指令修正错误 2025-10-01 15:42:06 +08:00
sc f3b17df9c2 Merge branch 'master' of http://192.168.0.12:13000/sc/DyeingComputer 2025-09-30 20:53:50 +08:00
sc 003037f94a Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-30 20:53:48 +08:00
sc b7b4729805 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-29 01:06:03 +08:00
sc e5ce1bd9ca 数据库 2025-09-29 01:05:45 +08:00
sc eb6ea78c50 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-29 00:57:10 +08:00
sc ec4aa3a9a2 修改缓冲区 2025-09-29 00:57:06 +08:00
sc a1d566b2e0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-27 23:35:18 +08:00
sc 355d942c6e 添加859指令 2025-09-27 23:35:07 +08:00
sc 2cfd88d7a1 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-24 21:45:08 +08:00
sc 7bd4fca576 SC821修改指令 2025-09-24 21:45:05 +08:00
sc 508b07acc5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-24 11:01:33 +08:00
sc 7d1c20b414 错误修正 2025-09-24 11:01:26 +08:00
sc f3e377cc2b Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-21 23:55:29 +08:00
sc b53c596d0d Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-21 23:55:27 +08:00
sc 05c1185c2d Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-21 23:44:30 +08:00
sc 0c24c679ce Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-21 23:44:18 +08:00
sc e5a7d89219 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-21 00:36:55 +08:00
sc ec8bd91c8b 添加资源 2025-09-21 00:36:52 +08:00
sc 370936c484 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-19 01:21:58 +08:00
sc 70a9133f5e 曲线图逻辑错误修改,模拟题添加信息 2025-09-19 01:21:50 +08:00
sc 66d40d94aa Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-18 00:53:12 +08:00
sc 79625bf08c 模拟图 2025-09-18 00:53:08 +08:00
sc 24e7dff82f Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-18 00:04:19 +08:00
sc 3e3a04cb36 模拟图页面 2025-09-18 00:03:47 +08:00
sc c7ccd8277c Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-17 00:36:30 +08:00
sc 9df14365ef 数据库 2025-09-17 00:36:26 +08:00
sc a4cf2ffd00 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-17 00:34:30 +08:00
sc c4b3cbb469 添加资源,设备模拟页面 2025-09-17 00:34:22 +08:00
sc 34af5b755e Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-16 01:08:47 +08:00
sc f0597387d5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-16 01:08:41 +08:00
sc 8bcdc19eb9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-16 01:06:07 +08:00
sc 026a3f4f2b 添加资源,模拟图 2025-09-16 01:06:02 +08:00
sc f2d5e795b0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-15 01:09:54 +08:00
sc 9205894999 添加资源 2025-09-15 01:09:45 +08:00
sc 105155b737 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-14 00:50:20 +08:00
sc d9e5f4e2dc 添加资源 2025-09-14 00:50:15 +08:00
sc 53b28c8319 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-07 12:27:13 +08:00
sc 6c6fa42544 通讯循环逻辑修改 2025-09-07 12:27:07 +08:00
sc c768489b69 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-07 11:06:49 +08:00
sc 65a738d238 io修改限制 2025-09-07 11:06:43 +08:00
sc eff04b74cd Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-07 01:20:32 +08:00
sc da1d79f073 812指令错误修正Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-07 01:20:25 +08:00
sc 4206dda9aa Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-06 22:22:05 +08:00
sc 0af96ea30b Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-06 22:22:00 +08:00
sc 8cb58fc6fa Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-06 22:05:02 +08:00
sc 8db7de1d3c 添加关机退出按钮 2025-09-06 22:05:00 +08:00
sc f08fde6dad Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-05 23:01:23 +08:00
sc df21f7f4cf 修改错误,添加硬件监控 2025-09-05 23:01:19 +08:00
sc 6b26763320 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-05 16:43:19 +08:00
sc 683c7b03f3 内置触摸键盘,参数设置系统设置添加打开触摸键盘功能 2025-09-05 16:42:48 +08:00
sc 6a1d6c5cf8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-04 23:20:18 +08:00
sc f7e051baec 步骤设置页面数字输入键盘完善 2025-09-04 23:20:13 +08:00
sc 5da57efb29 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-04 22:27:56 +08:00
sc 37192378b0 添加数字键盘与字母键盘。数字键盘包含输入限制功能。步骤设置页面使用数字键盘。 2025-09-04 22:27:50 +08:00
sc 06b948dd92 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-04 17:54:18 +08:00
sc aaee65200a 任务检查逻辑数据错误修正 2025-09-04 17:54:16 +08:00
sc af6b3c0796 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-04 00:39:22 +08:00
sc c4f98eda2a 添加字母键盘与数字键盘 2025-09-04 00:39:18 +08:00
sc eae0bbeed3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 22:30:52 +08:00
sc bec56c1206 添加813指令 2025-09-03 22:30:47 +08:00
sc f6f3bd5607 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 21:18:57 +08:00
sc 7d259c5b51 数据库 2025-09-03 21:18:46 +08:00
sc 6119bfe857 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 21:17:25 +08:00
sc 6ddb1f0a86 添加默认速度逻辑 2025-09-03 21:17:21 +08:00
sc e4deb1e52c Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 20:50:02 +08:00
sc 56bb9e0fd7 膝盖信息点位,添加运行信息 2025-09-03 20:49:58 +08:00
sc ba1fe7ef95 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 20:21:06 +08:00
sc a689ff0ad0 添加参数信息传入 2025-09-03 20:20:57 +08:00
sc 8a9cb1b05e Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-03 19:53:07 +08:00
sc 53eb3be876 部分io点修改,添加图片资源,添加注料功能逻辑 2025-09-03 19:53:03 +08:00
sc e570ba713a Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-02 21:04:46 +08:00
sc 27a9b87387 主泵停止时复位温控 2025-09-02 21:04:38 +08:00
sc d2d1f1a741 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-02 21:02:05 +08:00
sc 5750ff7ce1 通讯修改,温控增加主泵检查 2025-09-02 21:01:58 +08:00
sc 2d83da7916 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-01 01:06:10 +08:00
sc 227f2c9967 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-09-01 01:06:01 +08:00
sc 59706005cd Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-31 01:30:14 +08:00
sc b3e33b2f27 增加模拟演示数据 2025-08-31 01:30:03 +08:00
sc 6af357c0d0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-30 21:52:04 +08:00
sc 469d76f9b0 锁功能生效,操作锁 2025-08-30 21:52:00 +08:00
sc 0402261175 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-28 18:30:49 +08:00
sc ad64084638 数据库连接修改 2025-08-28 18:30:42 +08:00
sc e6dc7814cc Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-28 18:00:10 +08:00
sc 58f457c305 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-28 18:00:03 +08:00
sc dd47f96d71 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-28 01:22:29 +08:00
sc 77288bdf85 中控操作逻辑修复 2025-08-28 01:21:49 +08:00
sc 1806a35687 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-27 01:24:13 +08:00
sc 5b203da464 语言,呼叫检查状态 2025-08-27 01:24:06 +08:00
sc e8a7e0e548 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-26 21:09:24 +08:00
sc 6ab8ebb4d9 等待输送功能 2025-08-26 21:08:15 +08:00
sc f422844cec Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-26 01:46:58 +08:00
sc 96468a68c7 输送相关指令 2025-08-26 01:46:56 +08:00
sc cc392fdbfe Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-25 00:23:39 +08:00
sc fb1b024944 数据读写逻辑修改 2025-08-25 00:23:34 +08:00
sc 495d2d1690 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-24 01:04:11 +08:00
sc f4109ecfe1 呼叫功能通讯 2025-08-24 01:04:06 +08:00
sc c35cb1e2fa Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-23 01:17:48 +08:00
sc 0cc877284a Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-23 01:17:45 +08:00
sc 16b727fba7 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-22 23:22:24 +08:00
sc e7eada1ff4 中控呼叫功能 2025-08-22 23:22:16 +08:00
sc 1a5c0aa5d9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-22 01:13:33 +08:00
sc e1e1b3bb33 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-22 01:13:31 +08:00
sc bf014c35a2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-22 00:49:42 +08:00
sc 7d88a1887c 编辑页面子功能错误修复,呼叫功能添加 2025-08-22 00:49:37 +08:00
sc 6644c8d334 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-21 00:15:04 +08:00
sc abe15b19f4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-21 00:15:01 +08:00
sc bd24477e94 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 22:51:46 +08:00
sc 094a3553ad Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 22:51:44 +08:00
sc 549d66fb07 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 01:41:06 +08:00
sc ae749384b1 添加指令859获取设备日志 2025-08-20 01:41:05 +08:00
sc 4256650361 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 01:15:08 +08:00
sc d55324eb42 修改指令特征字符 2025-08-20 01:15:07 +08:00
sc 9959e015db Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 01:06:58 +08:00
sc 05ff7c8431 添加指令记录 2025-08-20 01:06:56 +08:00
sc d2ceaca223 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 00:47:50 +08:00
sc 3da807005d IOdata 2025-08-20 00:47:49 +08:00
sc b01b076748 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-20 00:38:30 +08:00
sc bbaeeb4575 修改iodata 2025-08-20 00:38:28 +08:00
sc d570d5131b Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 23:38:40 +08:00
sc c8c93ae046 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 23:38:37 +08:00
sc 735575d96c Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 23:28:34 +08:00
sc 1069a43cf4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 23:28:32 +08:00
sc b6b67b9961 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 00:05:12 +08:00
sc ae2ddc1691 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-19 00:02:02 +08:00
sc 0401dea0df Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-17 23:38:46 +08:00
sc 8b11146d06 添加资源 2025-08-17 23:38:45 +08:00
sc 6f835ea088 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-17 20:58:08 +08:00
sc 0f44866e27 副功能步骤 2025-08-17 20:58:06 +08:00
sc f718cf152f Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-17 20:16:51 +08:00
sc 5f9cefb7e2 更新库 2025-08-17 20:16:46 +08:00
sc 68414d1bd8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-17 19:52:03 +08:00
sc 28d6556b51 卸载ScottPlot库 2025-08-17 19:52:01 +08:00
sc cf876c27f4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 23:52:39 +08:00
sc f363b81a16 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 23:52:37 +08:00
sc b947648a2b Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 23:45:57 +08:00
sc d21d54da88 步骤表问题修改 2025-08-16 23:45:55 +08:00
sc a0aa5c43c0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 23:02:25 +08:00
sc 5798d8ba00 图表问题修改 2025-08-16 23:02:22 +08:00
sc 09a6ed632e Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 16:45:27 +08:00
sc a946dc8b47 修改数据库 2025-08-16 16:45:23 +08:00
sc 4d6e4f0707 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 16:42:21 +08:00
sc 4a23ae3f2b 数据库 2025-08-16 16:42:19 +08:00
sc 64bc52c166 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 16:41:42 +08:00
sc 7666f88e12 部分触摸界面修改,新建功能错误修改,信息按钮逻辑错误修改 2025-08-16 16:41:40 +08:00
sc 0109e44891 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-16 16:06:12 +08:00
sc 0b9b01c772 添加触摸限制弹性效果 2025-08-16 16:06:10 +08:00
sc c069291ae8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-11 23:39:19 +08:00
sc 4a11bf8b53 数据库修改 2025-08-11 23:39:17 +08:00
sc f861cdb4f8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-11 23:38:24 +08:00
sc 00f6d637ac 程序组步骤页面逻辑修改 2025-08-11 23:38:20 +08:00
sc e51e8bb73f Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-11 23:08:47 +08:00
sc dfcbd0e5ec 子功能页面完成 2025-08-11 23:08:43 +08:00
sc a9288ffad5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-10 00:45:13 +08:00
sc 2ed1f7887b 子功能保存事件 2025-08-10 00:45:09 +08:00
sc 837f0f3cb0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-09 23:15:55 +08:00
sc 3f6ce1389b 修改步骤页面返回逻辑 2025-08-09 23:15:52 +08:00
sc 22a0382f0f Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-09 21:51:43 +08:00
sc 8758185ab1 添加资源,步骤页面更改增加子功能 2025-08-09 21:51:39 +08:00
sc 3f09edd3c7 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-08 17:33:51 +08:00
sc 27f62a03da 步骤编辑页面修改 2025-08-08 17:33:48 +08:00
sc 7401240e4d Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-08 16:56:32 +08:00
sc fb26c91e9b 修改无功能图片逻辑 2025-08-08 16:56:26 +08:00
sc 88646c2c29 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-08 16:53:11 +08:00
sc d6420a29c7 添加错误图标 2025-08-08 16:53:08 +08:00
sc 84b80e0780 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-08 16:49:37 +08:00
sc ad765afbbd 添加图片资源,修改插入逻辑错误,修改主功能循环跳转逻辑错误 2025-08-08 16:49:32 +08:00
sc 65bbc7c572 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-07 00:41:29 +08:00
sc fa836593f5 步骤编辑修改 2025-08-07 00:41:22 +08:00
sc 4cc396c43b Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-06 23:46:42 +08:00
sc 50485955cd 添加子功能逻辑 2025-08-06 23:46:36 +08:00
sc 517b165a45 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-04 01:05:22 +08:00
sc f5bc14171e step表格功能添加 2025-08-04 01:05:16 +08:00
sc 561ef7e336 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-03 23:57:11 +08:00
sc b6ce460d18 修改操作页面开始添加从逻辑 2025-08-03 23:57:04 +08:00
sc 117b7147f1 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-01 16:20:10 +08:00
sc 9d0b291ea0 添加主缸加压与减压逻辑 2025-08-01 16:20:07 +08:00
sc 5b5c7434e5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-01 15:50:22 +08:00
sc bf39e85925 报警消音相关逻辑 2025-08-01 15:50:16 +08:00
sc 1d0c0dbb23 Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer 2025-08-01 15:09:51 +08:00
sc e1a567d1f7 添加取样页面及相关资源 2025-08-01 15:09:47 +08:00
131 changed files with 9237 additions and 1063 deletions

No files matched your search

+247
View File
@@ -0,0 +1,247 @@
# 如果要从更高级别的目录继承 .editorconfig 设置,请删除以下行
root = true
# c# 文件
[*.cs]
#### Core EditorConfig 选项 ####
# 缩进和间距
indent_size = 4
indent_style = space
tab_width = 4
# 新行首选项
end_of_line = crlf
insert_final_newline = false
#### .NET 代码操作 ####
# 类型成员
dotnet_hide_advanced_members = false
dotnet_member_insertion_location = with_other_members_of_the_same_kind
dotnet_property_generation_behavior = prefer_throwing_properties
# 符号搜索
dotnet_search_reference_assemblies = true
#### .NET 编码约定 ####
# 组织 Using
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. 和 Me. 首选项
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# 语言关键字与 bcl 类型首选项
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# 括号首选项
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# 修饰符首选项
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# 表达式级首选项
dotnet_prefer_system_hash_code = true
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# 字段首选项
dotnet_style_readonly_field = true
# 参数首选项
dotnet_code_quality_unused_parameters = all
# 禁止显示首选项
dotnet_remove_unnecessary_suppression_exclusions = none
# 新行首选项
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### c# 编码约定 ####
# var 首选项
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied 成员
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
# 模式匹配首选项
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
# Null 检查首选项
csharp_style_conditional_delegate_call = true
# 修饰符首选项
csharp_prefer_static_anonymous_function = true
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true
# 代码块首选项
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = true
csharp_prefer_system_threading_lock = true
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_primary_constructors = true
csharp_style_prefer_simple_property_accessors = true
csharp_style_prefer_top_level_statements = true
# 表达式级首选项
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_implicitly_typed_lambda_expression = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_unbound_generic_type_in_nameof = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
# "using" 指令首选项
csharp_using_directive_placement = outside_namespace
# 新行首选项
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# 格式规则 ####
# 新行首选项
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# 缩进首选项
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# 空格键首选项
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# 包装首选项
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### 命名样式 ####
# 命名规则
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# 符号规范
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# 命名样式
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
+5 -1
View File
@@ -4,6 +4,10 @@
xmlns:local="clr-namespace:DyeingComputer" xmlns:local="clr-namespace:DyeingComputer"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <Application.Resources>
<!-- 全局禁用弹性效果,保留触摸滚动 -->
<Style TargetType="ScrollViewer">
<!-- 关键:仅添加事件处理 -->
<EventSetter Event="ManipulationBoundaryFeedback" Handler="ScrollViewer_ManipulationBoundaryFeedback"/>
</Style>
</Application.Resources> </Application.Resources>
</Application> </Application>
+7
View File
@@ -15,6 +15,8 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace DyeingComputer namespace DyeingComputer
{ {
@@ -69,6 +71,11 @@ namespace DyeingComputer
LiveCharts.Configure(config => config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('药'))); LiveCharts.Configure(config => config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('药')));
LiveCharts.Configure(config => config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('缸'))); LiveCharts.Configure(config => config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('缸')));
} }
private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
{
// 禁用弹性效果的核心代码
e.Handled = true;
}
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini"); private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini");
+85
View File
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;
namespace DyeingComputer.ConvertMoels
{
internal class StatenToImageConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
switch (value)
{
case "001":
return new BitmapImage(new Uri("/Lmage/ID001.png", UriKind.Relative));//功能模块001温度控制
case "007":
return new BitmapImage(new Uri("/Lmage/ID007.png", UriKind.Relative));//液位入水
case "008":
return new BitmapImage(new Uri("/Lmage/ID008.png", UriKind.Relative));//流量入水
case "013":
return new BitmapImage(new Uri("/Lmage/ID013.png", UriKind.Relative));//批次水位水洗
case "015":
return new BitmapImage(new Uri("/Lmage/ID015.png", UriKind.Relative));//溢流水洗
case "017":
return new BitmapImage(new Uri("/Lmage/ID017.png", UriKind.Relative));//降温水洗
case "020":
return new BitmapImage(new Uri("/Lmage/ID020.png", UriKind.Relative));//排水
case "022":
return new BitmapImage(new Uri("/Lmage/ID022.png", UriKind.Relative));//动力排水
case "031":
return new BitmapImage(new Uri("/Lmage/ID031.png", UriKind.Relative));//运转时间
case "035":
return new BitmapImage(new Uri("/Lmage/ID035.png", UriKind.Relative));//准备入布
case "036":
return new BitmapImage(new Uri("/Lmage/ID036.png", UriKind.Relative));//准备出布
case "039":
return new BitmapImage(new Uri("/Lmage/ID039.png", UriKind.Relative));//呼叫人工
case "040":
return new BitmapImage(new Uri("/Lmage/ID040.png", UriKind.Relative));//取样
case "041":
return new BitmapImage(new Uri("/Lmage/ID041.png", UriKind.Relative));//结束
case "049":
return new BitmapImage(new Uri("/Lmage/ID049.png", UriKind.Relative));//等待
case "050":
return new BitmapImage(new Uri("/Lmage/ID050.png", UriKind.Relative));//主缸加压
case "051":
return new BitmapImage(new Uri("/Lmage/ID051.png", UriKind.Relative));//主缸减压
case "054":
return new BitmapImage(new Uri("/Lmage/ID054.png", UriKind.Relative));//主泵/风机速度
case "055":
return new BitmapImage(new Uri("/Lmage/ID055.png", UriKind.Relative));//主泵启动
case "056":
return new BitmapImage(new Uri("/Lmage/ID056.png", UriKind.Relative));//
case "064":
return new BitmapImage(new Uri("/Lmage/ID064.png", UriKind.Relative));//
case "065":
return new BitmapImage(new Uri("/Lmage/ID065.png", UriKind.Relative));//
case "066":
return new BitmapImage(new Uri("/Lmage/ID066.png", UriKind.Relative));//
case "067":
return new BitmapImage(new Uri("/Lmage/ID067.png", UriKind.Relative));//
case "090":
return new BitmapImage(new Uri("/Lmage/ID090.png", UriKind.Relative));//
case "091":
return new BitmapImage(new Uri("/Lmage/ID091.png", UriKind.Relative));//
case "093":
return new BitmapImage(new Uri("/Lmage/ID093.png", UriKind.Relative));//
case "094":
return new BitmapImage(new Uri("/Lmage/ID094.png", UriKind.Relative));//
default:
return new BitmapImage(new Uri("", UriKind.Relative));
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
Binary file not shown.
BIN
View File
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
[SYS]
COM=COM7
Language=zh-CN
Protocols=SUNLIGHT_R
BIN
View File
Binary file not shown.
Binary file not shown.
+97 -5
View File
@@ -80,6 +80,11 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
@@ -111,6 +116,7 @@
<Compile Include="ConvertMoels\GramsSQLConvert.cs" /> <Compile Include="ConvertMoels\GramsSQLConvert.cs" />
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" /> <Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
<Compile Include="ConvertMoels\RowToIndexConverter.cs" /> <Compile Include="ConvertMoels\RowToIndexConverter.cs" />
<Compile Include="ConvertMoels\StatenToImageConvert.cs" />
<Compile Include="ConvertMoels\StatenConvert.cs" /> <Compile Include="ConvertMoels\StatenConvert.cs" />
<Compile Include="Properties\Resources.en-US.Designer.cs"> <Compile Include="Properties\Resources.en-US.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@@ -136,6 +142,7 @@
<Compile Include="UserClass\HardwareSN.cs" /> <Compile Include="UserClass\HardwareSN.cs" />
<Compile Include="UserClass\IniFile.cs" /> <Compile Include="UserClass\IniFile.cs" />
<Compile Include="UserClass\Json.cs" /> <Compile Include="UserClass\Json.cs" />
<Compile Include="UserClass\LiquidDosingSystem.cs" />
<Compile Include="UserClass\LogDataRead.cs" /> <Compile Include="UserClass\LogDataRead.cs" />
<Compile Include="UserClass\ERRinf.cs" /> <Compile Include="UserClass\ERRinf.cs" />
<Compile Include="UserClass\LogGing.cs" /> <Compile Include="UserClass\LogGing.cs" />
@@ -197,6 +204,18 @@
<Compile Include="Windows\InputBox.xaml.cs"> <Compile Include="Windows\InputBox.xaml.cs">
<DependentUpon>InputBox.xaml</DependentUpon> <DependentUpon>InputBox.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Windows\Sampling.xaml.cs">
<DependentUpon>Sampling.xaml</DependentUpon>
</Compile>
<Compile Include="KEY\TouchKeyboardNumeral.xaml.cs">
<DependentUpon>TouchKeyboardNumeral.xaml</DependentUpon>
</Compile>
<Compile Include="KEY\TouchKeyboard.xaml.cs">
<DependentUpon>TouchKeyboard.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\UserInf.xaml.cs">
<DependentUpon>UserInf.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\UserCall.xaml.cs"> <Compile Include="Windows\UserCall.xaml.cs">
<DependentUpon>UserCall.xaml</DependentUpon> <DependentUpon>UserCall.xaml</DependentUpon>
</Compile> </Compile>
@@ -274,6 +293,22 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Windows\Sampling.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="KEY\TouchKeyboardNumeral.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="KEY\TouchKeyboard.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\UserInf.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\UserCall.xaml"> <Page Include="Windows\UserCall.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -319,8 +354,11 @@
<LastGenOutput>Resources.zh-TW.Designer.cs</LastGenOutput> <LastGenOutput>Resources.zh-TW.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<Resource Include="Fonts\FontAwesome.otf" /> <Resource Include="Fonts\FontAwesome.otf" />
<None Include=".editorconfig" />
<None Include="app.manifest" />
<None Include="DATA\800COMPUTER.db" /> <None Include="DATA\800COMPUTER.db" />
<None Include="DATA\Chart.db" /> <None Include="DATA\Chart.db" />
<None Include="DATA\LOG.db" />
<None Include="Fonts\font-awesome-4.7.0.zip" /> <None Include="Fonts\font-awesome-4.7.0.zip" />
<None Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.eot" /> <None Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.eot" />
<Resource Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.ttf" /> <Resource Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.ttf" />
@@ -355,6 +393,7 @@
<None Include="Fonts\font-awesome-4.7.0\scss\_screen-reader.scss" /> <None Include="Fonts\font-awesome-4.7.0\scss\_screen-reader.scss" />
<None Include="Fonts\font-awesome-4.7.0\scss\_stacked.scss" /> <None Include="Fonts\font-awesome-4.7.0\scss\_stacked.scss" />
<None Include="Fonts\font-awesome-4.7.0\scss\_variables.scss" /> <None Include="Fonts\font-awesome-4.7.0\scss\_variables.scss" />
<None Include="Properties\.editorconfig" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -364,6 +403,7 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="DLL\" />
<Folder Include="Model\" /> <Folder Include="Model\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -371,10 +411,10 @@
<Version>2.0.7</Version> <Version>2.0.7</Version>
</PackageReference> </PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm"> <PackageReference Include="CommunityToolkit.Mvvm">
<Version>8.3.2</Version> <Version>8.4.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF"> <PackageReference Include="LiveChartsCore.SkiaSharpView.WPF">
<Version>2.0.0-rc3.3</Version> <Version>2.0.0-rc5.4</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces"> <PackageReference Include="Microsoft.Bcl.AsyncInterfaces">
<Version>8.0.0</Version> <Version>8.0.0</Version>
@@ -385,9 +425,6 @@
<PackageReference Include="NModbus.Serial"> <PackageReference Include="NModbus.Serial">
<Version>3.0.81</Version> <Version>3.0.81</Version>
</PackageReference> </PackageReference>
<PackageReference Include="ScottPlot.WPF">
<Version>5.0.39</Version>
</PackageReference>
<PackageReference Include="System.Buffers"> <PackageReference Include="System.Buffers">
<Version>4.6.1</Version> <Version>4.6.1</Version>
</PackageReference> </PackageReference>
@@ -420,6 +457,61 @@
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" /> <Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" />
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" /> <Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" />
<Content Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.svg" /> <Content Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.svg" />
<Resource Include="Lmage\00001-1.png" />
<Resource Include="Lmage\00002-1.png" />
<Resource Include="Lmage\00001.png" />
<Resource Include="Lmage\19002.png" />
<Resource Include="Lmage\19001.png" />
<Resource Include="Lmage\19000.png" />
<Resource Include="Lmage\10009-0.png" />
<Resource Include="Lmage\10009-1.png" />
<Resource Include="Lmage\12500-1.png" />
<Resource Include="Lmage\12000-1.png" />
<Resource Include="Lmage\12000.png" />
<Resource Include="Lmage\10002-1.png" />
<Resource Include="Lmage\10002-2.png" />
<Resource Include="Lmage\10002-3.png" />
<Resource Include="Lmage\10002-4.png" />
<Resource Include="Lmage\10002-5.png" />
<Resource Include="Lmage\10002-6.png" />
<Resource Include="Lmage\11000.png" />
<Resource Include="Lmage\15000.png" />
<Resource Include="Lmage\IconParkExtendY.png" />
<Resource Include="Lmage\IconParkExtendR.png" />
<Resource Include="Lmage\MdiPh.png" />
<Resource Include="Lmage\IconParkExtend.png" />
<Resource Include="Lmage\IconParkInfo.png" />
<Resource Include="Lmage\ID051.png" />
<Resource Include="Lmage\ID050.png" />
<Resource Include="Lmage\ADD.jpg" />
<Resource Include="Lmage\ERR.png" />
<Resource Include="Lmage\ID093.png" />
<Resource Include="Lmage\ID094.png" />
<Resource Include="Lmage\ID090.png" />
<Resource Include="Lmage\ID091.png" />
<Resource Include="Lmage\ID066.png" />
<Resource Include="Lmage\ID067.png" />
<Resource Include="Lmage\ID022.png" />
<Resource Include="Lmage\ID017.png" />
<Resource Include="Lmage\ID013.png" />
<Resource Include="Lmage\ID015.png" />
<Resource Include="Lmage\ID020.png" />
<Resource Include="Lmage\ID007.png" />
<Resource Include="Lmage\ID008.png" />
<Resource Include="Lmage\ID049.png" />
<Resource Include="Lmage\ID031.png" />
<Resource Include="Lmage\ID035.png" />
<Resource Include="Lmage\ID036.png" />
<Resource Include="Lmage\ID040.png" />
<Resource Include="Lmage\ID041.png" />
<Resource Include="Lmage\ID055.png" />
<Resource Include="Lmage\ID056.png" />
<Resource Include="Lmage\ID054.png" />
<Resource Include="Lmage\ID064.png" />
<Resource Include="Lmage\ID065.png" />
<Resource Include="Lmage\ID039.png" />
<Resource Include="Lmage\ID001.png" />
<Resource Include="Lmage\StreamlineUltimateColorColorPaletteSample1.png" />
<Resource Include="Lmage\FxemojiBellcancellation.png" /> <Resource Include="Lmage\FxemojiBellcancellation.png" />
<Resource Include="Lmage\FxemojiRingingbell.png" /> <Resource Include="Lmage\FxemojiRingingbell.png" />
<Resource Include="Lmage\IconParkMessages.png" /> <Resource Include="Lmage\IconParkMessages.png" />
+132
View File
@@ -0,0 +1,132 @@
<Window x:Class="DyeingComputer.KEY.TouchKeyboard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DyeingComputer.Windows"
mc:Ignorable="d" WindowStyle="None" ResizeMode="NoResize" Topmost="True"
WindowStartupLocation="CenterScreen"
Title="TouchKeyboard" Height="500" Width="750">
<Window.Resources>
<Style x:Key="KeyButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FFF0F0F0"/>
<Setter Property="BorderBrush" Value="#FFCCCCCC"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="2"/>
<Setter Property="MinWidth" Value="60"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FFDDDDDD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SpecialKeyButtonStyle" BasedOn="{StaticResource KeyButtonStyle}" TargetType="Button">
<Setter Property="Background" Value="#FFE0E0E0"/>
<Setter Property="FontSize" Value="16"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 预览区域 -->
<TextBox x:Name="PreviewTextBox" Grid.Row="0" Height="60" Margin="10"
FontSize="24" VerticalContentAlignment="Center" IsReadOnly="False"/>
<!-- 键盘主体区域 -->
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 数字行 -->
<StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
<Button Content="1" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="2" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="3" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="4" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="5" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="6" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="7" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="8" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="9" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="0" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="DEL" Style="{StaticResource SpecialKeyButtonStyle}" Click="Backspace_Click" Width="60"/>
</StackPanel>
<!-- 第一行字母 -->
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
<Button Content="Q" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="W" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="E" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="R" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="T" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="Y" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="U" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="I" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="O" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="P" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
</StackPanel>
<!-- 第二行字母 -->
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
<Button Content="A" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="S" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="D" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="F" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="G" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="H" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="J" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="K" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="L" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="/" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="HIDE" Style="{StaticResource SpecialKeyButtonStyle}" Click="Hide_Click" Width="60"/>
</StackPanel>
<!-- 第三行字母 -->
<StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Center">
<Button x:Name="ShiftButton" Content="⇧" Style="{StaticResource SpecialKeyButtonStyle}" Click="Shift_Click" Width="60"/>
<Button Content="Z" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="X" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="C" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="V" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="B" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="N" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="M" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="." Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="ENTER" Style="{StaticResource SpecialKeyButtonStyle}" Click="Enter_Click" Width="120"/>
</StackPanel>
</Grid>
<!-- 状态栏 -->
<StatusBar Grid.Row="2">
<StatusBarItem>
<TextBlock x:Name="StatusTextBlock" Text="就绪"/>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>
+116
View File
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using static DyeingComputer.KEY.TouchKeyboardNumeral;
namespace DyeingComputer.KEY
{
/// <summary>
/// TouchKeyboard.xaml 的交互逻辑
/// </summary>
public partial class TouchKeyboard : Window
{
private bool isShiftActive = false;
public string KeyValue;
public event EventHandler<KeyPressedEventArgs> KeyPressed;
public TouchKeyboard()
{
InitializeComponent();
}
private void KeyButton_Click(object sender, RoutedEventArgs e)
{
Button button = sender as Button;
if (button != null)
{
string key = button.Content.ToString();
if (key.Length == 1 && char.IsLetter(key[0]))
{
key = isShiftActive ? key.ToUpper() : key.ToLower();
}
PreviewTextBox.Text += key;
// 输入后关闭Shift状态
if (isShiftActive)
{
isShiftActive = false;
UpdateButtonAppearance();
}
}
}
private void Shift_Click(object sender, RoutedEventArgs e)
{
isShiftActive = !isShiftActive;
UpdateButtonAppearance();
}
private void Backspace_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrEmpty(PreviewTextBox.Text))
{
PreviewTextBox.Text = PreviewTextBox.Text.Substring(0, PreviewTextBox.Text.Length - 1);
}
}
private void Enter_Click(object sender, RoutedEventArgs e)
{
// 触发回车事件
KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Enter, PreviewTextBox.Text));
this.Close();
// PreviewTextBox.Text += Environment.NewLine;
}
private void Hide_Click(object sender, RoutedEventArgs e)
{
KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Hide, ""));
this.Close();
}
private void UpdateButtonAppearance()
{
// 更新Shift按钮的外观以反映当前状态
if (isShiftActive)
{
ShiftButton.Background = new SolidColorBrush(Colors.LightBlue);
}
else
{
ShiftButton.Background = new SolidColorBrush(Color.FromRgb(224, 224, 224));
}
}
public class KeyPressedEventArgs : EventArgs
{
public KeyType KeyType { get; }
public string KeyValue { get; }
public KeyPressedEventArgs(KeyType keyType, string keyValue)
{
KeyType = keyType;
KeyValue = keyValue;
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// 初始化为默认模式
// SetKeyboardMode(KeyboardMode.Default);
PreviewTextBox.Text = null;
}
}
}
+100
View File
@@ -0,0 +1,100 @@
<Window x:Class="DyeingComputer.KEY.TouchKeyboardNumeral"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DyeingComputer.Windows"
mc:Ignorable="d"
WindowStyle="None"
ResizeMode="NoResize"
Topmost="True"
WindowStartupLocation="CenterScreen"
Title="TouchKeyboardNumeral"
Loaded="Window_Loaded"
Height="500" Width="550">
<Window.Resources>
<Style x:Key="KeyButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FFF0F0F0"/>
<Setter Property="BorderBrush" Value="#FFCCCCCC"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="2"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FFDDDDDD"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#FFBBBBBB"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SpecialKeyButtonStyle" BasedOn="{StaticResource KeyButtonStyle}" TargetType="Button">
<Setter Property="Background" Value="#FFE0E0E0"/>
<Setter Property="FontSize" Value="16"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 预览区域 -->
<TextBox x:Name="PreviewTextBox" Grid.Row="0" Height="60" Margin="10"
FontSize="24" VerticalContentAlignment="Center" IsReadOnly="False"/>
<!-- 键盘主体区域 -->
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 数字行 -->
<StackPanel x:Name="FirstRow" Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
<Button Content="7" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="8" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="9" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="0" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="DEL" Style="{StaticResource SpecialKeyButtonStyle}" Click="Backspace_Click" Width="60"/>
</StackPanel>
<!-- 数字行 -->
<StackPanel x:Name="SecondRow" Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
<Button Content="4" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="5" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="6" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="." Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="HIDE" Style="{StaticResource SpecialKeyButtonStyle}" Click="Hide_Click" Width="60"/>
</StackPanel>
<!-- 数字行 -->
<StackPanel x:Name="ThirdRow" Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
<Button Content="1" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="2" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="3" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
<Button Content="ENTER" Style="{StaticResource SpecialKeyButtonStyle}" Click="Enter_Click" Width="200"/>
</StackPanel>
</Grid>
</Grid>
</Window>
+215
View File
@@ -0,0 +1,215 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace DyeingComputer.KEY
{
/// <summary>
/// TouchKeyboard.xaml 的交互逻辑
/// </summary>
public partial class TouchKeyboardNumeral : Window
{
private bool mode = false;
public string KeyValue;
public event EventHandler<KeyPressedEventArgs> KeyPressed;
private KeyboardMode currentMode = KeyboardMode.Default;
private int minValue = 0;
private int maxValue = 9;
private TextBox targetTextBox;
// 定义键盘模式枚举
public enum KeyboardMode
{
Default, // 默认模式,所有键可用
NumericOnly, // 只允许数字
DecimalOnly, // 允许数字和小数点
LimitedRange // 限制数字范围
}
public TouchKeyboardNumeral()
{
InitializeComponent();
}
public void SetKeyboardMode(KeyboardMode mode, TextBox target = null, int min = 0, int max = 9)
{
currentMode = mode;
targetTextBox = target;
minValue = min;
maxValue = max;
UpdateKeyboardLayout();
}
private void UpdateKeyboardLayout()
{
switch (currentMode)
{
case KeyboardMode.NumericOnly:
// 只允许数字,禁用小数点
SetButtonEnabled(".", false);
break;
case KeyboardMode.DecimalOnly:
// 允许数字和小数点
SetButtonEnabled(".", true);
break;
case KeyboardMode.LimitedRange:
// 根据范围启用/禁用数字键
for (int i = 0; i <= 9; i++)
{
SetButtonEnabled(i.ToString(), i >= minValue && i <= maxValue);
}
mode = true;
break;
case KeyboardMode.Default:
default:
// 启用所有键
foreach (var element in FirstRow.Children)
{
if (element is Button button && char.IsDigit(button.Content.ToString()[0]))
button.IsEnabled = true;
}
foreach (var element in SecondRow.Children)
{
if (element is Button button && (char.IsDigit(button.Content.ToString()[0]) || button.Content.ToString() == "."))
button.IsEnabled = true;
}
foreach (var element in ThirdRow.Children)
{
if (element is Button button && char.IsDigit(button.Content.ToString()[0]))
button.IsEnabled = true;
}
break;
}
}
// 设置按钮启用状态
private void SetButtonEnabled(string content, bool enabled)
{
// 在第一行查找
foreach (var element in FirstRow.Children)
{
if (element is Button button && button.Content.ToString() == content)
{
button.IsEnabled = enabled;
return;
}
}
// 在第二行查找
foreach (var element in SecondRow.Children)
{
if (element is Button button && button.Content.ToString() == content)
{
button.IsEnabled = enabled;
return;
}
}
// 在第三行查找
foreach (var element in ThirdRow.Children)
{
if (element is Button button && button.Content.ToString() == content)
{
button.IsEnabled = enabled;
return;
}
}
}
// 数字键点击事件
private void KeyButton_Click(object sender, RoutedEventArgs e)
{
if (mode && PreviewTextBox.Text.Length > 0) return;
Button button = sender as Button;
if (button != null && button.IsEnabled)
{
string keyValue = button.Content.ToString();
PreviewTextBox.Text += keyValue;
// 触发按键事件
// KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Character, keyValue));
}
}
// 退格键点击事件
private void Backspace_Click(object sender, RoutedEventArgs e)
{
if (PreviewTextBox.Text.Length > 0)
{
PreviewTextBox.Text = PreviewTextBox.Text.Substring(0, PreviewTextBox.Text.Length - 1);
// 触发退格事件
// KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Backspace, ""));
}
}
// 回车键点击事件
private void Enter_Click(object sender, RoutedEventArgs e)
{
// 触发回车事件
KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Enter, PreviewTextBox.Text));
// 隐藏键盘
this.Hide();
}
// 隐藏键点击事件
private void Hide_Click(object sender, RoutedEventArgs e)
{
KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Hide, ""));
// 隐藏键盘
this.Hide();
}
public class KeyPressedEventArgs : EventArgs
{
public KeyType KeyType { get; }
public string KeyValue { get; }
public KeyPressedEventArgs(KeyType keyType, string keyValue)
{
KeyType = keyType;
KeyValue = keyValue;
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// 初始化为默认模式
// SetKeyboardMode(KeyboardMode.Default);
PreviewTextBox.Text = null;
mode = false;
}
}
// 按键类型枚举
public enum KeyType
{
Character,
Backspace,
Enter,
Hide
}
// 按键事件参数
public class KeyPressedEventArgs : EventArgs
{
public KeyType KeyType { get; }
public string KeyValue { get; }
public KeyPressedEventArgs(KeyType keyType, string keyValue)
{
KeyType = keyType;
KeyValue = keyValue;
}
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 96 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 604 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+35 -6
View File
@@ -8,7 +8,7 @@
xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel" xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel"
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
Title="SUNLIGHT 838 b0.0.1 (2024/08/10)" Title="SUNLIGHT838"
Height="720" Width="1280" Height="720" Width="1280"
WindowState ="Maximized" WindowState ="Maximized"
WindowStyle="None"> WindowStyle="None">
@@ -181,14 +181,43 @@
</Style> </Style>
</Image.Style> </Image.Style>
</Image> </Image>
<Image Height="40" VerticalAlignment="Center" Width="40" Visibility="{Binding EX_bool}">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/Lmage/IconParkExtend.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding EX_str}" Value="309">
<Setter Property="Source" Value="/Lmage/IconParkExtendR.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding EX_str}" Value="308">
<Setter Property="Source" Value="/Lmage/IconParkExtendY.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/link.png"
Visibility="{Binding Link_bool}"/>
<Image Height="40" Width="40" Source="/Lmage/IconParkLock.png" <Image Height="40" Width="40" Source="/Lmage/IconParkLock.png"
Visibility="{Binding Lock_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown" Visibility="{Binding Lock_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown"
MouseLeftButtonUp="Image_MouseLeftButtonUp" VerticalAlignment="Center"/> MouseLeftButtonUp="Image_MouseLeftButtonUp" VerticalAlignment="Center"/>
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/link.png" <Image Height="40" Width="40" VerticalAlignment="Center" FlowDirection="LeftToRight"
Visibility="{Binding Link_bool}"/> MouseLeftButtonDown="Image_MouseLeftButtonDown_1"
<Image Height="40" VerticalAlignment="Center" Width="40" Source="/Lmage/IconParkAutoFocus.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_1">
Visibility="{Binding AUTO_bool}" MouseLeftButtonDown="Image_MouseLeftButtonDown_1" <Image.Style>
MouseLeftButtonUp="Image_MouseLeftButtonUp_1"/> <Style TargetType="Image">
<Setter Property="Source" Value="/Lmage/IconParkAutoFocus.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding AUTO_bool}" Value="false">
<Setter Property="Source" Value="/Lmage/IconParkAutoFocus.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding AUTO_bool}" Value="true">
<Setter Property="Source" Value="/Lmage/Hand.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>
+14 -6
View File
@@ -1,9 +1,11 @@
using DyeingComputer.UserClass; using DyeingComputer.UserClass;
using DyeingComputer.ViewModel;
using DyeingComputer.View; using DyeingComputer.View;
using DyeingComputer.ViewModel;
using DyeingComputer.Windows;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@@ -34,8 +36,9 @@ namespace DyeingComputer
MainWindowViewModel.ViewID = 1; MainWindowViewModel.ViewID = 1;
} }
private SQLiteHelper SQLiteHelpers = null; //定义数据库 public static SQLiteHelper SQLiteChartAdress = null; //定义数据库
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
/// <summary> /// <summary>
@@ -47,6 +50,9 @@ namespace DyeingComputer
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Open(); //打开数据库
SQLiteChartAdress = new SQLiteHelper(ChartAdress); //数据库连接路径
SQLiteChartAdress.Open(); //打开数据库
bool result_System = SQLiteHelpers.TableExists("System"); //检查表格是否存在(存在返回true) bool result_System = SQLiteHelpers.TableExists("System"); //检查表格是否存在(存在返回true)
bool result_IOName = SQLiteHelpers.TableExists("IOName"); bool result_IOName = SQLiteHelpers.TableExists("IOName");
bool result_ProgramName = SQLiteHelpers.TableExists("ProgramName"); bool result_ProgramName = SQLiteHelpers.TableExists("ProgramName");
@@ -68,13 +74,13 @@ namespace DyeingComputer
if (!result_WorkorderSteps) LogGing.LogGingDATA("Master_WorkorderSteps_Table_Loss"); if (!result_WorkorderSteps) LogGing.LogGingDATA("Master_WorkorderSteps_Table_Loss");
if (!result_System || !result_IOName || !result_ProgramName || !result_ProgramSteps || !result_RUN || !result_Dyelot || !result_Parameters || !result_WorkOrder || !result_WorkorderSteps) if (!result_System || !result_IOName || !result_ProgramName || !result_ProgramSteps || !result_RUN || !result_Dyelot || !result_Parameters || !result_WorkOrder || !result_WorkorderSteps)
{ {
SQLiteHelpers.Close(); // SQLiteHelpers.Close();
MessageBox.Show(Properties.Resources.SysDatLoss); MessageBox.Show(Properties.Resources.SysDatLoss);
return true; return true;
} }
else else
{ {
SQLiteHelpers.Close(); // SQLiteHelpers.Close();
return false; return false;
} }
@@ -197,7 +203,9 @@ namespace DyeingComputer
{ {
((Image)sender).RenderTransform = Transform.Identity; ((Image)sender).RenderTransform = Transform.Identity;
MainWindowViewModel.UserInfoStart = 901; MainWindowViewModel.UserInfoStart = 901;
MainWindowViewModel.UserInfo = Properties.Resources.Manual; if (MainWindowViewModel._AUTO_bool)
{ MainWindowViewModel.UserInfo = Properties.Resources.Auto; }
else { MainWindowViewModel.UserInfo = Properties.Resources.Manual; }
}//手动 }//手动
} }
} }
+247
View File
@@ -0,0 +1,247 @@
# 如果要从更高级别的目录继承 .editorconfig 设置,请删除以下行
root = true
# c# 文件
[*.cs]
#### Core EditorConfig 选项 ####
# 缩进和间距
indent_size = 4
indent_style = space
tab_width = 4
# 新行首选项
end_of_line = crlf
insert_final_newline = false
#### .NET 代码操作 ####
# 类型成员
dotnet_hide_advanced_members = false
dotnet_member_insertion_location = with_other_members_of_the_same_kind
dotnet_property_generation_behavior = prefer_throwing_properties
# 符号搜索
dotnet_search_reference_assemblies = true
#### .NET 编码约定 ####
# 组织 Using
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. 和 Me. 首选项
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# 语言关键字与 bcl 类型首选项
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# 括号首选项
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# 修饰符首选项
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# 表达式级首选项
dotnet_prefer_system_hash_code = true
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# 字段首选项
dotnet_style_readonly_field = true
# 参数首选项
dotnet_code_quality_unused_parameters = all
# 禁止显示首选项
dotnet_remove_unnecessary_suppression_exclusions = none
# 新行首选项
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### c# 编码约定 ####
# var 首选项
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied 成员
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
# 模式匹配首选项
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
# Null 检查首选项
csharp_style_conditional_delegate_call = true
# 修饰符首选项
csharp_prefer_static_anonymous_function = true
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true
# 代码块首选项
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = true
csharp_prefer_system_threading_lock = true
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_primary_constructors = true
csharp_style_prefer_simple_property_accessors = true
csharp_style_prefer_top_level_statements = true
# 表达式级首选项
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_implicitly_typed_lambda_expression = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_unbound_generic_type_in_nameof = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
# "using" 指令首选项
csharp_using_directive_placement = outside_namespace
# 新行首选项
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# 格式规则 ####
# 新行首选项
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# 缩进首选项
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# 空格键首选项
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# 包装首选项
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### 命名样式 ####
# 命名规则
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# 符号规范
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# 命名样式
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
+1 -1
View File
@@ -12,7 +12,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DyeingComputer")] [assembly: AssemblyProduct("DyeingComputer")]
[assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
+54
View File
@@ -78,6 +78,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Add 的本地化字符串。
/// </summary>
public static string ADD {
get {
return ResourceManager.GetString("ADD", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 AddTheMedicine 的本地化字符串。 /// 查找类似 AddTheMedicine 的本地化字符串。
/// </summary> /// </summary>
@@ -636,6 +645,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Inspect 的本地化字符串。
/// </summary>
public static string Inspect {
get {
return ResourceManager.GetString("Inspect", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Invalid features 的本地化字符串。 /// 查找类似 Invalid features 的本地化字符串。
/// </summary> /// </summary>
@@ -681,6 +699,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Locked state 的本地化字符串。
/// </summary>
public static string LockedState {
get {
return ResourceManager.GetString("LockedState", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Low-water level 的本地化字符串。 /// 查找类似 Low-water level 的本地化字符串。
/// </summary> /// </summary>
@@ -879,6 +906,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 please continue after the restriction is lifted 的本地化字符串。
/// </summary>
public static string PCATRIL {
get {
return ResourceManager.GetString("PCATRIL", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 PHControl 的本地化字符串。 /// 查找类似 PHControl 的本地化字符串。
/// </summary> /// </summary>
@@ -1266,6 +1302,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Subroutine 的本地化字符串。
/// </summary>
public static string Subroutine {
get {
return ResourceManager.GetString("Subroutine", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 swing 的本地化字符串。 /// 查找类似 swing 的本地化字符串。
/// </summary> /// </summary>
@@ -1311,6 +1356,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 The current operation is restricted 的本地化字符串。
/// </summary>
public static string TCOIR {
get {
return ResourceManager.GetString("TCOIR", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Process 的本地化字符串。 /// 查找类似 Process 的本地化字符串。
/// </summary> /// </summary>
+18
View File
@@ -582,4 +582,22 @@
<data name="Muffling" xml:space="preserve"> <data name="Muffling" xml:space="preserve">
<value>Muffling</value> <value>Muffling</value>
</data> </data>
<data name="ADD" xml:space="preserve">
<value>Add</value>
</data>
<data name="Subroutine" xml:space="preserve">
<value>Subroutine</value>
</data>
<data name="Inspect" xml:space="preserve">
<value>Waiting For Check</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>Locked state</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>The current operation is restricted</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>please continue after the restriction is lifted</value>
</data>
</root> </root>
+18
View File
@@ -582,4 +582,22 @@
<data name="Muffling" xml:space="preserve"> <data name="Muffling" xml:space="preserve">
<value>Muffling</value> <value>Muffling</value>
</data> </data>
<data name="ADD" xml:space="preserve">
<value>Add</value>
</data>
<data name="Subroutine" xml:space="preserve">
<value>Subroutine</value>
</data>
<data name="Inspect" xml:space="preserve">
<value>Inspect</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>Locked state</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>The current operation is restricted</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>please continue after the restriction is lifted</value>
</data>
</root> </root>
+20 -2
View File
@@ -286,10 +286,10 @@
<value>加注</value> <value>加注</value>
</data> </data>
<data name="CallDistribution" xml:space="preserve"> <data name="CallDistribution" xml:space="preserve">
<value>呼叫输送</value> <value>呼叫輸送</value>
</data> </data>
<data name="CallPreparation" xml:space="preserve"> <data name="CallPreparation" xml:space="preserve">
<value>呼叫准备</value> <value>等待輸送</value>
</data> </data>
<data name="CallWorkers" xml:space="preserve"> <data name="CallWorkers" xml:space="preserve">
<value>呼叫操作员</value> <value>呼叫操作员</value>
@@ -582,4 +582,22 @@
<data name="Muffling" xml:space="preserve"> <data name="Muffling" xml:space="preserve">
<value>静音</value> <value>静音</value>
</data> </data>
<data name="ADD" xml:space="preserve">
<value>加色</value>
</data>
<data name="Subroutine" xml:space="preserve">
<value>副功能</value>
</data>
<data name="Inspect" xml:space="preserve">
<value>等待检查</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>锁定状态</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>当前操作已限制</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>请解除限制后继续</value>
</data>
</root> </root>
+21 -3
View File
@@ -208,7 +208,7 @@
<value>計量</value> <value>計量</value>
</data> </data>
<data name="LineUp" xml:space="preserve"> <data name="LineUp" xml:space="preserve">
<value>轉入</value> <value>排隊</value>
</data> </data>
<data name="Notimplementation" xml:space="preserve"> <data name="Notimplementation" xml:space="preserve">
<value>未執行</value> <value>未執行</value>
@@ -289,7 +289,7 @@
<value>呼叫輸送</value> <value>呼叫輸送</value>
</data> </data>
<data name="CallPreparation" xml:space="preserve"> <data name="CallPreparation" xml:space="preserve">
<value>呼叫準備</value> <value>等待輸送</value>
</data> </data>
<data name="CallWorkers" xml:space="preserve"> <data name="CallWorkers" xml:space="preserve">
<value>呼叫操作員</value> <value>呼叫操作員</value>
@@ -580,6 +580,24 @@
<value>總量</value> <value>總量</value>
</data> </data>
<data name="Muffling" xml:space="preserve"> <data name="Muffling" xml:space="preserve">
<value /> <value>靜音</value>
</data>
<data name="ADD" xml:space="preserve">
<value>加色</value>
</data>
<data name="Subroutine" xml:space="preserve">
<value>副功能</value>
</data>
<data name="Inspect" xml:space="preserve">
<value>等待檢查</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>锁定状态</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>目前操作已限制</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>請解除限制後繼續</value>
</data> </data>
</root> </root>
+12 -6
View File
@@ -1,8 +1,5 @@
using DyeingComputer.View; using DyeingComputer.View;
using DyeingComputer.ViewModel; using DyeingComputer.ViewModel;
using OpenTK.Audio.OpenAL;
using ScottPlot.Colormaps;
using ScottPlot.TickGenerators.TimeUnits;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@@ -76,7 +73,7 @@ namespace DyeingComputer.UserClass
API_LOG.Add("NAME", WorkOrder); API_LOG.Add("NAME", WorkOrder);
API_LOG.Add("ERRID", ERRID); API_LOG.Add("ERRID", ERRID);
API_LOG.Add("MESSAGE", MESSAGE); API_LOG.Add("MESSAGE", MESSAGE);
API_LOG.Add("TIME", Time); API_LOG.Add("TIME", MainWindowViewModel.SYSTime);
LOGDB("ERRLog", API_LOG);//行插入 LOGDB("ERRLog", API_LOG);//行插入
API_LOG.Clear(); API_LOG.Clear();
} }
@@ -97,16 +94,25 @@ namespace DyeingComputer.UserClass
if(DBQueue.Count==0) QueueT=false; if(DBQueue.Count==0) QueueT=false;
} }
public static void LOGDB()//从队列写入数据库 public static void LOGnew()
{ {
SQLiteHelpers = new SQLiteHelper(LOGAddress); //数据库连接路径 SQLiteHelpers = new SQLiteHelper(LOGAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Open(); //打开数据库
}//
public static DataTable LOGSELECT(string select)
{
var dat = SQLiteHelpers.ExecuteDataSet(select, null);
DataTable dt = dat.Tables[0];
return dt;
}
public static void LOGDB()//从队列写入数据库
{
while (DBQueue.Count > 0)//信息发送队列 while (DBQueue.Count > 0)//信息发送队列
{ {
QueueString t = DBQueue.Dequeue(); QueueString t = DBQueue.Dequeue();
SQLiteHelpers.InsertData(t.ID, t.DAT);//行插入 SQLiteHelpers.InsertData(t.ID, t.DAT);//行插入
} }
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
QueueT = false; QueueT = false;
} }
} }
+346 -130
View File
@@ -1,31 +1,31 @@
using DyeingComputer.UserClass; using DyeingComputer.UserClass;
using DyeingComputer.View;
using DyeingComputer.ViewModel;
using Newtonsoft.Json;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Sockets; using System.Net.Sockets;
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Diagnostics;
using TouchSocket.Core;
using TouchSocket.Sockets;
using DyeingComputer.ViewModel;
using System.Runtime.InteropServices;
using ScottPlot.Colormaps;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Newtonsoft.Json;
using static DyeingComputer.UserClass.SqliteHelper;
using DyeingComputer.View;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using TouchSocket.Core;
using TouchSocket.Sockets;
using static DyeingComputer.UserClass.SqliteHelper;
using static System.Net.WebRequestMethods; using static System.Net.WebRequestMethods;
using System.Collections; using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace DyeingComputer.UserClass namespace DyeingComputer.UserClass
{/// <summary> {/// <summary>
@@ -70,10 +70,11 @@ namespace DyeingComputer.UserClass
public static string[] Prohibit = new string[10] { "S01", "S02", "S03", "S05", "S06", "S07", "SL1", "SL2", "SL3", ""};//禁止操作的指令 public static string[] Prohibit = new string[10] { "S01", "S02", "S03", "S05", "S06", "S07", "SL1", "SL2", "SL3", ""};//禁止操作的指令
public static SQLiteHelper SQLiteHelpers = null; //定义数据库 // public static SQLiteHelper SQLiteHelpers = null; //定义数据库
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 // public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static async Task Main() public static async Task Main()
{ {
NetFwManger.AllowPort(7789, "TCP");//开放7790端口
NetFwManger.AllowPort(7790,"TCP");//开放7790端口 NetFwManger.AllowPort(7790,"TCP");//开放7790端口
TcpService service = new TcpService(); TcpService service = new TcpService();
service.Connecting = (client, e) => { return EasyTask.CompletedTask; };//有客户端正在连接 service.Connecting = (client, e) => { return EasyTask.CompletedTask; };//有客户端正在连接
@@ -110,29 +111,23 @@ namespace DyeingComputer.UserClass
Dictionary<string, object> WorkOrder_dat; Dictionary<string, object> WorkOrder_dat;
WorkOrder_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT); WorkOrder_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
//WorkOrder_dat.GetValue("WorkOrder"); //WorkOrder_dat.GetValue("WorkOrder");
bool dat_w = SQLDATA.WorkOrder(
WorkOrder_dat.GetValue("WorkOrder").ToString(), object i = MainWindow.SQLiteHelpers.ExecuteScalar("select * from WorkOrder where WorkOrder = " + WorkOrder_dat.GetValue("WorkOrder").ToString(), null);
WorkOrder_dat.GetValue("ProgramName").ToString(), Dictionary<string, object> Step_new = new Dictionary<string, object>();//缓存函数
WorkOrder_dat.GetValue("StartTime").ToString(), Step_new.Add("WorkOrder", WorkOrder_dat.GetValue("WorkOrder").ToString());
WorkOrder_dat.GetValue("EndTime").ToString(), Step_new.Add("ReDye", WorkOrder_dat.GetValue("ReDye").ToString());
WorkOrder_dat.GetValue("Time").ToString(), if (i != null)
WorkOrder_dat.GetValue("Remark").ToString(),
WorkOrder_dat.GetValue("lock").ToString(),
WorkOrder_dat.GetValue("State").ToString(),
WorkOrder_dat.GetValue("ProgramID").ToString(),
WorkOrder_dat.GetValue("color").ToString(),
WorkOrder_dat.GetValue("Dyelot").ToString());
if (!dat_w)
{ {
client.SendAsync("SC910" + "[" + MainWindowViewModel.S01 + "]" + client.SendAsync("SC910" + "[" + MainWindowViewModel.S01 + "]" + Step_new.ToJsonString());
WorkOrder_dat.GetValue("WorkOrder").ToString());
} }
else else
{ {
client.SendAsync("SC810" + "[" + MainWindowViewModel.S01 + "]" + client.SendAsync("SC810" + "[" + MainWindowViewModel.S01 + "]" + Step_new.ToJsonString());
WorkOrder_dat.GetValue("WorkOrder").ToString()); MainWindowViewModel.TX++; MainWindowViewModel.TX++;
} }
MainWindow.SQLiteHelpers.InsertData("WorkOrder", WorkOrder_dat);
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令 APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
} }
catch (Exception ex) catch (Exception ex)
@@ -151,15 +146,16 @@ namespace DyeingComputer.UserClass
DataTable WorkOrder_dat; DataTable WorkOrder_dat;
WorkOrder_dat = SerializeConvert.JsonDeserializeFromString<DataTable>(SYSDAT); WorkOrder_dat = SerializeConvert.JsonDeserializeFromString<DataTable>(SYSDAT);
bool dat_w = SQLDATA.WorkOderStep(WorkOrder_dat); bool dat_w = SQLDATA.WorkOderStep(WorkOrder_dat);
Dictionary<string, object> Step_new = new Dictionary<string, object>();//缓存函数
Step_new.Add("WorkOrder", WorkOrder_dat.Select().First().Field<object>("WorkOrder"));
Step_new.Add("ReDye", WorkOrder_dat.Select().First().Field<object>("ReDye"));
if (!dat_w) if (!dat_w)
{ {
client.SendAsync("SC911" + "[" + MainWindowViewModel.S01 + "]" + client.SendAsync("SC911" + "[" + MainWindowViewModel.S01 + "]" + Step_new.ToJsonString());
WorkOrder_dat.Select().First().Field<object>("WorkOrder"));
} }
else else
{ {
client.SendAsync("SC811" + "[" + MainWindowViewModel.S01 + "]" + client.SendAsync("SC811" + "[" + MainWindowViewModel.S01 + "]" + Step_new.ToJsonString());
WorkOrder_dat.Select().First().Field<object>("WorkOrder"));
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
} }
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令 APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
@@ -171,6 +167,31 @@ namespace DyeingComputer.UserClass
} }
else { client.SendAsync("SC999"); } else { client.SendAsync("SC999"); }
}//WorkOrderstep表信息检查写入 }//WorkOrderstep表信息检查写入
else if (SYSAPI == "SC812")
{
if (SYSKEY == MainWindowViewModel.SYSKEY)
{
try
{
Dictionary<string, object> WorkOrder_dat;
WorkOrder_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
MainWindow.SQLiteHelpers.InsertData("WorkorderSet", WorkOrder_dat);//行插入
Dictionary<string, object> Step_new = new Dictionary<string, object>();//缓存函数
Step_new.Add("WorkOrder", WorkOrder_dat.GetValue("WorkOrder").ToString());
Step_new.Add("ReDye", WorkOrder_dat.GetValue("ReDye").ToString());
client.SendAsync("SC812" + "[" + MainWindowViewModel.S01 + "]" + Step_new.ToJsonString());
MainWindowViewModel.TX++;
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
catch (Exception ex)
{
client.SendAsync("SC992" + "[" + MainWindowViewModel.S01 + "]" + ex);
}
}
else { client.SendAsync("SC999"); }
}//WorkOrderset表信息检查写入
else if (SYSAPI == "SC813") else if (SYSAPI == "SC813")
{ {
if (SYSKEY == MainWindowViewModel.SYSKEY) if (SYSKEY == MainWindowViewModel.SYSKEY)
@@ -194,7 +215,7 @@ namespace DyeingComputer.UserClass
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令 APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
} }
catch (Exception ex) { client.SendAsync("SC991" + "[" + MainWindowViewModel.S01 + "]" + ex); } catch (Exception ex) { client.SendAsync("SC993" + "[" + MainWindowViewModel.S01 + "]" + ex); }
} }
else { client.SendAsync("SC999"); } else { client.SendAsync("SC999"); }
}//写入领料单 }//写入领料单
@@ -229,45 +250,102 @@ namespace DyeingComputer.UserClass
dat_821 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT); dat_821 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
if (dat_821.GetValue("INSTRUCTION").ToString() == "START") if (dat_821.GetValue("INSTRUCTION").ToString() == "START")
{ {
SQLDATA.TechnologicalProcess_START(dat_821.GetValue("ProgramID").ToString()); MainWindowViewModel.Dyelot_dat = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from Dyelot where ReDye=0 AND WorkOrder = '" +
dat_821.GetValue("WorkOrder").ToString() + "'", null).Tables[0];
var DT_Set = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from WorkOrderSet where WorkOrder = '" +
dat_821.GetValue("WorkOrder").ToString() + "'", null).Tables[0].Rows[0];
MainWindowViewModel.Updata_dtm("1020", DT_Set.Field<int>("PumpSpeed"));
MainWindowViewModel.Updata_dtm("1030", DT_Set.Field<int>("Swing"));
MainWindowViewModel.Updata_dtm("1021", DT_Set.Field<int>("Blower"));
MainWindowViewModel.Updata_dtm("1025", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1026", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1027", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1028", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1029", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1035", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1036", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1037", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1038", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1039", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1040", DT_Set.Field<int>("ClothWheel"));
MainWindowViewModel.Updata_dtm("1041", DT_Set.Field<int>("ClothWheel"));
DataTable WorkorderSteps = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from WorkorderSteps where ReDye=0 AND WorkOrder='" + dat_821.GetValue("WorkOrder").ToString() + "'", null).Tables[0]; //读取表写入缓存
DataTable Workorder = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from Workorder where ReDye=0 AND WorkOrder='" + dat_821.GetValue("WorkOrder").ToString() + "'", null).Tables[0]; //读取表写入缓存
MainWindowViewModel.ProgramName = Workorder.Rows[0].Field<string>("ProgramName");
MainWindowViewModel.WorkNumder = Workorder.Rows[0].Field<string>("WorkOrder");
MainWindow.SQLiteHelpers.Delete("RUN", null, null); //删除run信息
for (int i = 0; i < WorkorderSteps.Rows.Count; i++)
{
DataRow dr = WorkorderSteps.Rows[i];//行转
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dr));//行插入
}
Dictionary<string, object> updata_temp = new Dictionary<string, object>();//缓存函数
updata_temp.Add("State", 205);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + dat_821.GetValue("WorkOrder").ToString() + "'", null);
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("RUN", 1);
MainWindow.SQLiteHelpers.Update("RUN", updata_temp, "Step=1", null);
//SQLiteHelpers.Close(); //关闭连接
/*触发启动*/
string Numder = WorkorderSteps.Select("Step = 1").First().Field<string>("StepID");//
double P1 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter1");
double P2 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter2");
double P3 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter3");
double P4 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter4");
double P5 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter5");
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(1);//插入步骤号
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
Convert.ToDouble(P4), Convert.ToDouble(P5));
MainWindowViewModel.WORK_RUN = 2;
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "START", "STEP = " +
MainWindowViewModel.RUN_STEPID + ";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
client.SendAsync("SC821" + SYSKEY + SYSDAT); client.SendAsync("SC821" + SYSKEY + SYSDAT);
} }
else if (dat_821.GetValue("INSTRUCTION").ToString() == "STOP") else if (dat_821.GetValue("INSTRUCTION").ToString() == "STOP")
{ {
MainWindowViewModel.WORK_RUN = 0;//停止 MainWindowViewModel.WORK_RUN = 0;//停止
MainWindowViewModel.DIDETime = 0; MainWindowViewModel.DIDETime = 0;
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "STOP", MainWindowViewModel.WorkNumder.ToString());
client.SendAsync("SC821" + SYSKEY + SYSDAT); client.SendAsync("SC821" + SYSKEY + SYSDAT);
} }//停止
else if (dat_821.GetValue("INSTRUCTION").ToString() == "PAUSE") else if (dat_821.GetValue("INSTRUCTION").ToString() == "PAUSE")
{ {
MainWindowViewModel.WORK_RUN = 1;//暂停 MainWindowViewModel.WORK_RUN = 1;//暂停
MainWindowViewModel.errTabler.Clear();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "PAUSE", MainWindowViewModel.WorkNumder.ToString());
client.SendAsync("SC821" + SYSKEY + SYSDAT); client.SendAsync("SC821" + SYSKEY + SYSDAT);
} }//暂停
else if (dat_821.GetValue("INSTRUCTION").ToString() == "CONTINUE") else if (dat_821.GetValue("INSTRUCTION").ToString() == "CONTINUE")
{ {
MainWindowViewModel.WORK_RUN = 2;// MainWindowViewModel.errTabler.Clear();
// MainWindowViewModel.WORK_RUN = 2;//PAUSE
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "CONTINUE", MainWindowViewModel.WorkNumder.ToString());
client.SendAsync("SC821" + SYSKEY + SYSDAT); client.SendAsync("SC821" + SYSKEY + SYSDAT);
}//运行 }//运行
else if (dat_821.GetValue("INSTRUCTION").ToString() == "JUMP") else if (dat_821.GetValue("INSTRUCTION").ToString() == "JUMP")
{ {
MainWindowViewModel.RUN_DATATABLE = MainWindowViewModel.dt_TP;//缓存表 MainWindowViewModel.RUN_STEPID = Convert.ToInt16(dat_821.GetValue("ID"));//步骤号
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(dat_821.GetValue("ID").ToString());//插入步骤号
MainWindowViewModel.STEP_START(dat_821.GetValue("Numder").ToString(), Convert.ToDouble(dat_821.GetValue("P1")), MainWindowViewModel.STEP_START(dat_821.GetValue("Numder").ToString(), Convert.ToDouble(dat_821.GetValue("P1")),
Convert.ToDouble(dat_821.GetValue("P2")), Convert.ToDouble(dat_821.GetValue("P3")), Convert.ToDouble(dat_821.GetValue("P2")), Convert.ToDouble(dat_821.GetValue("P3")),
Convert.ToDouble(dat_821.GetValue("P4")), Convert.ToDouble(dat_821.GetValue("P5"))); Convert.ToDouble(dat_821.GetValue("P4")), Convert.ToDouble(dat_821.GetValue("P5")));
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "JUMP", "STEP = " +
MainWindowViewModel.RUN_STEPID + ";"+dat_821.GetValue("Numder").ToString()+";P1="+
Convert.ToDouble(dat_821.GetValue("P1")) + ";P2=" + Convert.ToDouble(dat_821.GetValue("P2")) + ";P3=" +
Convert.ToDouble(dat_821.GetValue("P3")) + ";P4=" + Convert.ToDouble(dat_821.GetValue("P4")) + ";P5=" +
Convert.ToDouble(dat_821.GetValue("P5")));
}//跳步 }//跳步
else if (dat_821.GetValue("INSTRUCTION").ToString() == "INSERT") else if (dat_821.GetValue("INSTRUCTION").ToString() == "INSERT")
{ {
int d = Convert.ToInt16(dat_821.GetValue("ID")); int d = Convert.ToInt16(dat_821.GetValue("ID"));
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 //SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 //SQLiteHelpers.Open(); //打开数据库
/**插入行**/ /**插入行**/
string ProgramID = SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString(); string ProgramID = MainWindow.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
string ProgramNAME = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString(); string ProgramNAME = MainWindow.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
// TechnologicalProcessView.SQLiteHelpers.Close(); // TechnologicalProcessView.SQLiteHelpers.Close();
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据 DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
dr["ProgramID"] = ProgramID; dr["ProgramID"] = ProgramID;
@@ -286,7 +364,27 @@ namespace DyeingComputer.UserClass
drtt["Parameter3"] = dat_821.GetValue("Parameter3").ToString(); drtt["Parameter3"] = dat_821.GetValue("Parameter3").ToString();
drtt["Parameter4"] = dat_821.GetValue("Parameter4").ToString(); drtt["Parameter4"] = dat_821.GetValue("Parameter4").ToString();
drtt["Parameter5"] = dat_821.GetValue("Parameter5").ToString(); drtt["Parameter5"] = dat_821.GetValue("Parameter5").ToString();
drtt["Parameter1_S1"] = dat_821.GetValue("Parameter1_S1").ToString();
drtt["Parameter2_S1"] = dat_821.GetValue("Parameter2_S1").ToString();
drtt["Parameter3_S1"] = dat_821.GetValue("Parameter3_S1").ToString();
drtt["Parameter4_S1"] = dat_821.GetValue("Parameter4_S1").ToString();
drtt["Parameter5_S1"] = dat_821.GetValue("Parameter5_S1").ToString();
drtt["Parameter1_S2"] = dat_821.GetValue("Parameter1_S2").ToString();
drtt["Parameter2_S2"] = dat_821.GetValue("Parameter2_S2").ToString();
drtt["Parameter3_S2"] = dat_821.GetValue("Parameter3_S2").ToString();
drtt["Parameter4_S2"] = dat_821.GetValue("Parameter4_S2").ToString();
drtt["Parameter5_S2"] = dat_821.GetValue("Parameter5_S2").ToString();
drtt["Parameter1_S3"] = dat_821.GetValue("Parameter1_S3").ToString();
drtt["Parameter2_S3"] = dat_821.GetValue("Parameter2_S3").ToString();
drtt["Parameter3_S3"] = dat_821.GetValue("Parameter3_S3").ToString();
drtt["Parameter4_S3"] = dat_821.GetValue("Parameter4_S3").ToString();
drtt["Parameter5_S3"] = dat_821.GetValue("Parameter5_S3").ToString();
drtt["StepName_S1"] = dat_821.GetValue("StepName_S1").ToString();
drtt["StepName_S2"] = dat_821.GetValue("StepName_S2").ToString();
drtt["StepName_S3"] = dat_821.GetValue("StepName_S3").ToString();
drtt["StepID_S1"] = dat_821.GetValue("StepID_S1").ToString();
drtt["StepID_S2"] = dat_821.GetValue("StepID_S2").ToString();
drtt["StepID_S3"] = dat_821.GetValue("StepID_S3").ToString();
drtt["RUN"] = "0"; drtt["RUN"] = "0";
drtt["DYELOT"] = MainWindowViewModel.WorkNumder; drtt["DYELOT"] = MainWindowViewModel.WorkNumder;
drtt.EndEdit(); drtt.EndEdit();
@@ -298,24 +396,18 @@ namespace DyeingComputer.UserClass
/**存入信息**/ /**存入信息**/
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("RUN", null, null); MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++) for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{ {
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换 DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow(); dt.BeginEdit(); //添加订单号
drT.ItemArray = dt.ItemArray; dt["DYELOT"] = MainWindowViewModel.WorkNumder;
data_t.Rows.InsertAt(drT, 0); dt.EndEdit();
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入 MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
} }
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "INSERT", drtt.ToJsonString());
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString()); client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
}//插入 }//插入
@@ -333,32 +425,47 @@ namespace DyeingComputer.UserClass
dr["Parameter3"] = dat_821.GetValue("Parameter3").ToString(); dr["Parameter3"] = dat_821.GetValue("Parameter3").ToString();
dr["Parameter4"] = dat_821.GetValue("Parameter4").ToString(); dr["Parameter4"] = dat_821.GetValue("Parameter4").ToString();
dr["Parameter5"] = dat_821.GetValue("Parameter5").ToString(); dr["Parameter5"] = dat_821.GetValue("Parameter5").ToString();
dr["Parameter1_S1"] = dat_821.GetValue("Parameter1_S1").ToString();
dr["Parameter2_S1"] = dat_821.GetValue("Parameter2_S1").ToString();
dr["Parameter3_S1"] = dat_821.GetValue("Parameter3_S1").ToString();
dr["Parameter4_S1"] = dat_821.GetValue("Parameter4_S1").ToString();
dr["Parameter5_S1"] = dat_821.GetValue("Parameter5_S1").ToString();
dr["Parameter1_S2"] = dat_821.GetValue("Parameter1_S2").ToString();
dr["Parameter2_S2"] = dat_821.GetValue("Parameter2_S2").ToString();
dr["Parameter3_S2"] = dat_821.GetValue("Parameter3_S2").ToString();
dr["Parameter4_S2"] = dat_821.GetValue("Parameter4_S2").ToString();
dr["Parameter5_S2"] = dat_821.GetValue("Parameter5_S2").ToString();
dr["Parameter1_S3"] = dat_821.GetValue("Parameter1_S3").ToString();
dr["Parameter2_S3"] = dat_821.GetValue("Parameter2_S3").ToString();
dr["Parameter3_S3"] = dat_821.GetValue("Parameter3_S3").ToString();
dr["Parameter4_S3"] = dat_821.GetValue("Parameter4_S3").ToString();
dr["Parameter5_S3"] = dat_821.GetValue("Parameter5_S3").ToString();
dr["StepName_S1"] = dat_821.GetValue("StepName_S1").ToString();
dr["StepName_S2"] = dat_821.GetValue("StepName_S2").ToString();
dr["StepName_S3"] = dat_821.GetValue("StepName_S3").ToString();
dr["StepID_S1"] = dat_821.GetValue("StepID_S1").ToString();
dr["StepID_S2"] = dat_821.GetValue("StepID_S2").ToString();
dr["StepID_S3"] = dat_821.GetValue("StepID_S3").ToString();
dr.EndEdit(); dr.EndEdit();
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面 var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
// _TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView; // _TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
_TechnologicalProcessView.GridSTEP.SelectedIndex = -1; _TechnologicalProcessView.GridSTEP.SelectedIndex = -1;
/**存入信息**/ /**存入信息**/
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 //SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 //SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("RUN", null, null); MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone(); DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++) for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{ {
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换 DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow(); dt.BeginEdit(); //添加订单号
drT.ItemArray = dt.ItemArray; dt["DYELOT"] = MainWindowViewModel.WorkNumder;
data_t.Rows.InsertAt(drT, 0); dt.EndEdit();
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
}
SQLiteHelpers.Close(); //关闭连接
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
} //SQLiteHelpers.Close(); //关闭连接
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "EDIT", dr.ToJsonString());
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString()); client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
}//编辑 }//编辑
@@ -368,26 +475,21 @@ namespace DyeingComputer.UserClass
MainWindowViewModel.dt_TP.Rows.RemoveAt(d - 1); MainWindowViewModel.dt_TP.Rows.RemoveAt(d - 1);
TechnologicalProcessView.Dat(); TechnologicalProcessView.Dat();
/**存入信息**/ /**存入信息**/
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 //SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 //SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("RUN", null, null); MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone(); DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++) for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{ {
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换 DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow(); dt.BeginEdit(); //添加订单号
drT.ItemArray = dt.ItemArray; dt["DYELOT"] = MainWindowViewModel.WorkNumder;
data_t.Rows.InsertAt(drT, 0); dt.EndEdit();
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入 MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
} }
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "CentralControl", "DELETE","ID="+ dat_821.GetValue("ID").ToString());
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString()); client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
}//删除 }//删除
@@ -401,32 +503,74 @@ namespace DyeingComputer.UserClass
} }
else { client.SendAsync("SC999"); } else { client.SendAsync("SC999"); }
}//启停跳步指令 }//启停跳步指令
else if (SYSAPI == "SC822")
{
if (SYSKEY == MainWindowViewModel.SYSKEY)
{
try
{
DataTable Workorder = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from Workorder where ReDye=0 AND State='101'AND StartTime >'"+
DateTime.Now.AddHours(-1).ToString("yyyy/MM/dd HH:mm:ss") +"'", null).Tables[0]; //读取表写入缓存
client.SendAsync("SC822" + "[" + MainWindowViewModel.S01 + "]" + Workorder.ToJsonString());
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
catch (Exception ex) { client.SendAsync("SC922" + "[" + MainWindowViewModel.S01 + "]" + ex); }
}
else { client.SendAsync("SC999"); }
}//最近可用工艺
else if (SYSAPI == "SC827")
{
if (SYSKEY == MainWindowViewModel.SYSKEY)
{
try
{
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
string sql_script = "select * from Dyelot where State = '201' AND WorkOrder = '" +
MainWindowViewModel.WorkNumder + "'";
DataTable dt = MainWindow.SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //转换
//SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC827" + "[" + MainWindowViewModel.S01 + "]" + dt.ToJsonString());
MainWindowViewModel.TX++;
}
catch (Exception ex) { client.SendAsync("SC927" + "[" + MainWindowViewModel.S01 + "]" + ex); }
}
else { client.SendAsync("SC999"); }
}//呼叫领料单
else if (SYSAPI == "SC828") else if (SYSAPI == "SC828")
{ {
if (SYSKEY == MainWindowViewModel.SYSKEY) if (SYSKEY == MainWindowViewModel.SYSKEY)
{ {
try try
{ {
DataTable Dyelot_dat; Dictionary<string, object> Dyelot_dat;
Dyelot_dat = SerializeConvert.JsonDeserializeFromString<DataTable>(SYSDAT); Dyelot_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
Dictionary<string, object> Product_data = new Dictionary<string, object>();//缓存函数 Dictionary<string, object> Product_data = new Dictionary<string, object>();//缓存函数
for (int i=0;i<=Dyelot_dat.Rows.Count;i++)
Product_data.Add("State", Dyelot_dat.GetValue("State"));
if (Dyelot_dat.GetValue("State").ToString() == "301")
{ {
DataRow drEmployee = Dyelot_dat.Rows[i]; Product_data.Add("Amount", Dyelot_dat.GetValue("Amount"));
Product_data.Add("State", drEmployee.Field<int>("State")); Product_data.Add("DispenseEndTime", Dyelot_dat.GetValue("DispenseEndTime"));
Product_data.Add("Amount", drEmployee.Field<float>("Amount"));
Product_data.Add("DispenseEndTime", drEmployee.Field<string>("DispenseEndTime"));
SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + drEmployee.Field<string>("Dyelot")
+ "' AND Step ='"+ drEmployee.Field<int>("Step") + "' AND ProductCode='"+
drEmployee.Field<string>("ProductCode") + "'", null);
Product_data.Clear();
} }
SQLiteHelpers.Close(); //关闭连接 MainWindow.SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + Dyelot_dat.GetValue("Dyelot")
+ "' AND Step ='" + Dyelot_dat.GetValue("Step") + "' AND ProductCode='" +
Dyelot_dat.GetValue("ProductCode") + "'", null);
MainWindowViewModel.Dyelot_dat = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from Dyelot where WorkOrder = '" +
MainWindowViewModel.WorkNumder + "'", null).Tables[0];
int dt = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot='" +
Dyelot_dat.GetValue("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
if (dt == 0) MainWindowViewModel.CALL_FR = false;
//SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC828" + SYSKEY + SYSDAT);
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令 APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
@@ -434,7 +578,7 @@ namespace DyeingComputer.UserClass
catch (Exception ex) { client.SendAsync("SC928" + "[" + MainWindowViewModel.S01 + "]" + ex); } catch (Exception ex) { client.SendAsync("SC928" + "[" + MainWindowViewModel.S01 + "]" + ex); }
} }
else { client.SendAsync("SC999"); } else { client.SendAsync("SC999"); }
}//输送信息指令 }//输送状态指令
else if (SYSAPI == "SC829") else if (SYSAPI == "SC829")
{ {
if (SYSKEY == MainWindowViewModel.SYSKEY) if (SYSKEY == MainWindowViewModel.SYSKEY)
@@ -443,7 +587,8 @@ namespace DyeingComputer.UserClass
{ {
Dictionary<string, object> dat_829; Dictionary<string, object> dat_829;
dat_829 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT); dat_829 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
if (dat_829.GetValue("LOCK").ToString() == "True") if (dat_829.GetValue("NAME").ToString() == "LOCK") {
if (dat_829.GetValue("VALUE").ToString() == "True")
{ {
MainWindowViewModel._Lock_bool = true; MainWindowViewModel._Lock_bool = true;
client.SendAsync("SC829" + SYSKEY + SYSDAT); client.SendAsync("SC829" + SYSKEY + SYSDAT);
@@ -453,6 +598,21 @@ namespace DyeingComputer.UserClass
MainWindowViewModel._Lock_bool = false; MainWindowViewModel._Lock_bool = false;
client.SendAsync("SC829" + SYSKEY + SYSDAT); client.SendAsync("SC829" + SYSKEY + SYSDAT);
} }
}
else if (dat_829.GetValue("NAME").ToString() == "AUTO")
{
if (dat_829.GetValue("VALUE").ToString() == "True")
{
MainWindowViewModel._AUTO_bool = true;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
else
{
MainWindowViewModel._AUTO_bool = false;
client.SendAsync("SC829" + SYSKEY + SYSDAT);
}
}
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令 APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
} }
@@ -533,11 +693,11 @@ namespace DyeingComputer.UserClass
{ {
try try
{ {
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 //SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 //SQLiteHelpers.Open(); //打开数据库
string sql_script = "select * from Dyelot where WorkOrder = '" + MainWindowViewModel.WorkNumder + "'"; string sql_script = "select * from Dyelot where WorkOrder = '" + MainWindowViewModel.WorkNumder + "'";
DataTable dt = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //转换 DataTable dt = MainWindow.SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //转换
SQLiteHelpers.Close(); //关闭连接 // SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC833" + "[" + MainWindowViewModel.S01 + "]" + dt.ToJsonString()); client.SendAsync("SC833" + "[" + MainWindowViewModel.S01 + "]" + dt.ToJsonString());
MainWindowViewModel.TX++; MainWindowViewModel.TX++;
@@ -609,6 +769,64 @@ namespace DyeingComputer.UserClass
} }
else { client.SendAsync("SC999"); } else { client.SendAsync("SC999"); }
}//系统设置表 }//系统设置表
else if (SYSAPI == "SC859")
{
if (SYSKEY == MainWindowViewModel.SYSKEY)
{
try
{
// SQLiteHelper SQLiteHelpersLOG = new SQLiteHelper(Environment.CurrentDirectory+"\\DataBase\\LOG.db"); //数据库连接路径
// SQLiteHelpersLOG.Open(); //打开数据库
Dictionary<string, object> dat_859;
dat_859 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
if (dat_859.GetValue("INSTRUCTION").ToString() == "SERVER")
{
var dt_ = APILog.LOGSELECT("select * from SERVER where TIME >'" +
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" +
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'");
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
else if (dat_859.GetValue("INSTRUCTION").ToString() == "OperationLog")
{
var dt_ = APILog.LOGSELECT("select * from OperationLog where TIME >'" +
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" +
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'");
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
else if (dat_859.GetValue("INSTRUCTION").ToString() == "IOLog")
{
var dt_ = APILog.LOGSELECT("select * from IOLog where TIME >'" +
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" +
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'");
dt_.Columns.Remove("type");
dt_.Columns.Remove("Value");
dt_.Columns.Remove("PLC");
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
else if (dat_859.GetValue("INSTRUCTION").ToString() == "ERRLog")
{
var dt_ = APILog.LOGSELECT("select * from ERRLog where TIME >'" +
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" +
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'");
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
}
catch (Exception ex)
{
client.SendAsync("SC959" + "[" + MainWindowViewModel.S01 + "]" + ex.Message);
}
}
else { client.SendAsync("SC999"); }
}//读取设备日志
else if (SYSAPI == "SC861") else if (SYSAPI == "SC861")
{ {
if (SYSKEY == MainWindowViewModel.SYSKEY) if (SYSKEY == MainWindowViewModel.SYSKEY)
@@ -621,11 +839,11 @@ namespace DyeingComputer.UserClass
Dictionary<string, object> datagrid_v = new Dictionary<string, object>();//缓存函数 Dictionary<string, object> datagrid_v = new Dictionary<string, object>();//缓存函数
datagrid_v.Add("Value", dat_861.GetValue("Value")); datagrid_v.Add("Value", dat_861.GetValue("Value"));
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Update("Parameters", datagrid_v, "ParameterID ='" + dat_861.GetValue("ID") + "'", null);//更新 MainWindow.SQLiteHelpers.Update("Parameters", datagrid_v, "ParameterID ='" + dat_861.GetValue("ID") + "'", null);//更新
MainWindowViewModel.dt_ParameterSet = SQLiteHelpers.ExecuteDataSet("select * from Parameters order by ParameterID asc", null).Tables[0]; MainWindowViewModel.dt_ParameterSet = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from Parameters order by ParameterID asc", null).Tables[0];
SQLiteHelpers.Close();//关闭数据库 //SQLiteHelpers.Close();//关闭数据库
client.SendAsync("SC854" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_ParameterSet.ToJsonString());//缓存信息 client.SendAsync("SC854" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_ParameterSet.ToJsonString());//缓存信息
@@ -656,11 +874,11 @@ namespace DyeingComputer.UserClass
Dictionary<string, object> datagrid_v = new Dictionary<string, object>();//缓存函数 Dictionary<string, object> datagrid_v = new Dictionary<string, object>();//缓存函数
datagrid_v.Add("Value", dat_862.GetValue("Value")); datagrid_v.Add("Value", dat_862.GetValue("Value"));
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Update("System", datagrid_v, "ParameterID ='" + dat_862.GetValue("ID") + "'", null);//更新 MainWindow.SQLiteHelpers.Update("System", datagrid_v, "ParameterID ='" + dat_862.GetValue("ID") + "'", null);//更新
MainWindowViewModel.dt_SysSet = SQLiteHelpers.ExecuteDataSet("select * from System order by ParameterID asc", null).Tables[0]; MainWindowViewModel.dt_SysSet = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from System order by ParameterID asc", null).Tables[0];
SQLiteHelpers.Close();//关闭数据库 //SQLiteHelpers.Close();//关闭数据库
client.SendAsync("SC855" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_SysSet.ToJsonString());//缓存信息 client.SendAsync("SC855" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_SysSet.ToJsonString());//缓存信息
@@ -679,16 +897,14 @@ namespace DyeingComputer.UserClass
}; };
await service.SetupAsync(new TouchSocketConfig()//载入配置 await service.SetupAsync(new TouchSocketConfig()//载入配置
.SetMaxBufferSize(1024 * 1024) .SetMaxBufferSize(1024 * 1024 * 100)
.SetMinBufferSize(1024 * 64) .SetMinBufferSize(1024 * 1024)
.SetListenIPHosts(new IPHost[] { new IPHost("tcp://127.0.0.1:7789"), new IPHost(7790) })//同时监听两个地址 .SetListenIPHosts(new IPHost[] { new IPHost(7789), new IPHost(7790) })//同时监听两个地址
.ConfigureContainer(a =>//容器的配置顺序应该在最前面 .ConfigureContainer(a =>//容器的配置顺序应该在最前面
{ {
//a.AddConsoleLogger();//添加一个控制台日志注入(注意:在maui中控制台日志不可用)
}) })
.ConfigurePlugins(a => .ConfigurePlugins(a =>
{ {
//a.Add<DifferentProtocolPlugin>();
}) })
); );
await service.StartAsync();//启动 await service.StartAsync();//启动
+262
View File
@@ -0,0 +1,262 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DyeingComputer.UserClass
{
/// <summary>
/// 加注曲线类型
/// </summary>
public enum DosingCurveType
{
Linear, // 线性曲线
Parabolic, // 抛物线曲线(开始快,后来慢)
Exponential // 指数曲线(开始慢,后来快)
}
/// <summary>
/// 液体加注PID控制器
/// </summary>
public class LiquidDosingController
{
private DateTime _startTime;
private DateTime _lastUpdateTime;
private double _lastLevel;
private bool _isDosingActive;
// PID控制器参数
private double _proportionalGain;
private double _integralGain;
private double _derivativeGain;
private double _integralTerm;
private double _lastError;
/// <summary>
/// 当前比例阀开度 (0-100%)
/// </summary>
public double CurrentValveOpening { get; private set; }
/// <summary>
/// 目标完成时间 (秒)
/// </summary>
public double TargetTime { get; set; }
/// <summary>
/// 加注曲线类型
/// </summary>
public DosingCurveType CurveType { get; set; }
/// <summary>
/// 容器最大容量
/// </summary>
public double MaxCapacity { get; set; }
/// <summary>
/// 当前液位
/// </summary>
public double CurrentLevel { get; private set; }
/// <summary>
/// 已加注体积
/// </summary>
public double DosedVolume { get; private set; }
/// <summary>
/// 液体加注事件
/// </summary>
public event Action<double> OnDosingUpdate;
/// <summary>
/// 初始化液体加注控制器
/// </summary>
/// <param name="targetTime">目标加注时间(秒)</param>
/// <param name="maxCapacity">容器最大容量</param>
/// <param name="curveType">加注曲线类型</param>
/// <param name="kP">比例增益</param>
/// <param name="kI">积分增益</param>
/// <param name="kD">微分增益</param>
public LiquidDosingController(double targetTime, double maxCapacity,
DosingCurveType curveType = DosingCurveType.Linear,
double kP = 1.0, double kI = 0.1, double kD = 0.01)
{
TargetTime = targetTime;
MaxCapacity = maxCapacity;
CurveType = curveType;
_proportionalGain = kP;
_integralGain = kI;
_derivativeGain = kD;
_isDosingActive = false;
CurrentValveOpening = 0;
}
/// <summary>
/// 开始加注过程
/// </summary>
/// <param name="initialLevel">初始液位</param>
public void StartDosing(double initialLevel)
{
if (_isDosingActive) return;
_lastLevel = initialLevel;
CurrentLevel = initialLevel;
DosedVolume = 0;
_integralTerm = 0;
_lastError = 0;
CurrentValveOpening = 0;
_startTime = DateTime.Now;
_lastUpdateTime = _startTime;
_isDosingActive = true;
OnDosingUpdate?.Invoke(CurrentValveOpening);
}
/// <summary>
/// 停止加注过程
/// </summary>
public void StopDosing()
{
_isDosingActive = false;
CurrentValveOpening = 0;
OnDosingUpdate?.Invoke(0);
}
/// <summary>
/// 更新当前液位并计算新的阀门开度
/// </summary>
/// <param name="currentLevel">当前液位</param>
/// <returns>新的阀门开度</returns>
public double UpdateLevel(double currentLevel)
{
if (!_isDosingActive) return 0;
// 获取当前时间
DateTime currentTime = DateTime.Now;
// 计算时间间隔
double timeInterval = (currentTime - _lastUpdateTime).TotalSeconds;
// 如果时间间隔太小,避免计算过于频繁
if (timeInterval < 0.1) return CurrentValveOpening;
// 更新液位
CurrentLevel = currentLevel;
// 计算这段时间内的液体减少量
double volumeDosedInInterval = _lastLevel - currentLevel;
DosedVolume += volumeDosedInInterval;
_lastLevel = currentLevel;
// 计算已用时间和剩余时间
double elapsedTime = (currentTime - _startTime).TotalSeconds;
double remainingTime = TargetTime - elapsedTime;
// 如果已超过目标时间,完全关闭阀门
if (remainingTime <= 0)
{
StopDosing();
return 0;
}
// 计算期望的加注速率(基于所选曲线类型)
double desiredDosingRate = CalculateDesiredDosingRate(elapsedTime, remainingTime);
// 计算实际加注速率(升/秒)
double actualDosingRate = volumeDosedInInterval / timeInterval;
// 计算误差(期望速率与实际速率之差)
double error = desiredDosingRate - actualDosingRate;
// PID计算
double proportionalTerm = _proportionalGain * error;
_integralTerm += _integralGain * error * timeInterval;
// 积分项抗饱和
_integralTerm = Math.Max(Math.Min(_integralTerm, 100), 0);
double derivativeTerm = _derivativeGain * (error - _lastError) / timeInterval;
_lastError = error;
// 计算新的阀门开度
double newValveOpening = CurrentValveOpening + proportionalTerm + _integralTerm + derivativeTerm;
// 限制阀门开度在0-100%范围内
newValveOpening = Math.Max(Math.Min(newValveOpening, 100), 0);
CurrentValveOpening = newValveOpening;
// 更新最后更新时间
_lastUpdateTime = currentTime;
// 触发更新事件
OnDosingUpdate?.Invoke(CurrentValveOpening);
// 检查是否已完成加注
if (CurrentLevel <= 0)
{
StopDosing();
}
return CurrentValveOpening;
}
/// <summary>
/// 根据曲线类型计算期望的加注速率
/// </summary>
private double CalculateDesiredDosingRate(double elapsedTime, double remainingTime)
{
double remainingVolume = CurrentLevel;
// 确保不会除零
if (remainingTime <= 0) return 0;
double progress = elapsedTime / TargetTime;
switch (CurveType)
{
case DosingCurveType.Linear:
// 线性:恒定速率
return remainingVolume / remainingTime;
case DosingCurveType.Parabolic:
// 抛物线:开始快,后来慢
// 使用二次函数减少速率
double parabolicFactor = 1.0 - Math.Pow(progress, 2);
return (remainingVolume / remainingTime) * parabolicFactor;
case DosingCurveType.Exponential:
// 指数:开始慢,后来快
// 使用指数函数增加速率
double exponentialFactor = Math.Exp(progress) / Math.Exp(1);
return (remainingVolume / remainingTime) * exponentialFactor;
default:
return remainingVolume / remainingTime;
}
}
/// <summary>
/// 设置PID参数
/// </summary>
public void SetPIDParameters(double kP, double kI, double kD)
{
_proportionalGain = kP;
_integralGain = kI;
_derivativeGain = kD;
// 重置积分项和误差
_integralTerm = 0;
_lastError = 0;
}
/// <summary>
/// 检查加注是否正在进行中
/// </summary>
public bool IsDosingActive => _isDosingActive;
}
}
+6 -6
View File
@@ -10,8 +10,8 @@ namespace DyeingComputer.UserClass
{ {
public class LogGing public class LogGing
{ {
private static SQLiteHelper SQLiteHelpers = null; //定义数据库 // private static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 // private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static bool sqld=false; public static bool sqld=false;
public static void LogGingDATA(string dat) public static void LogGingDATA(string dat)
{ {
@@ -52,7 +52,7 @@ namespace DyeingComputer.UserClass
if (!sqld) if (!sqld)
{ {
sqld = true; sqld = true;
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 //SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
string Log_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string Log_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Dictionary<string, object> logsql = new Dictionary<string, object>(); Dictionary<string, object> logsql = new Dictionary<string, object>();
// 添加元素 // 添加元素
@@ -60,9 +60,9 @@ namespace DyeingComputer.UserClass
logsql.Add("API", api); logsql.Add("API", api);
logsql.Add("MESSAGE", dat); logsql.Add("MESSAGE", dat);
logsql.Add("TIME", Log_time); logsql.Add("TIME", Log_time);
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.InsertData("SERVER", logsql);//行插入 MainWindow.SQLiteHelpers.InsertData("SERVER", logsql);//行插入
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
sqld = false; sqld = false;
} }
} }
+55 -81
View File
@@ -1,6 +1,5 @@
using DyeingComputer.View; using DyeingComputer.View;
using DyeingComputer.ViewModel; using DyeingComputer.ViewModel;
using ScottPlot.Colormaps;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@@ -15,130 +14,105 @@ namespace DyeingComputer.UserClass
{ {
public class SQLDATA public class SQLDATA
{ {
private static SQLiteHelper SQLiteHelpers = null; //定义数据库 // private static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 // private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
//WorkOrder表检查写入
public static bool WorkOrder(string WorkOrder, string ProgramName, string StartTime, string EndTime, string Time, string Remark,string lock_,string state,string ProgramID, string color,string dyelot)
{
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
object i = SQLiteHelpers.ExecuteScalar("select * from WorkOrder where WorkOrder = "+ WorkOrder,null);
if (i!=null)
{
SQLiteHelpers.Close();
return false;
}
Dictionary<string, object> WorkOrder_new = new Dictionary<string, object>();//缓存函数
WorkOrder_new.Add("WorkOrder", WorkOrder);
WorkOrder_new.Add("ProgramName", ProgramName);
WorkOrder_new.Add("StartTime", StartTime);
WorkOrder_new.Add("EndTime", EndTime);
WorkOrder_new.Add("Time", Time);
WorkOrder_new.Add("Remark", Remark);
WorkOrder_new.Add("lock", Convert.ToInt16(lock_));
WorkOrder_new.Add("state", Convert.ToInt16(state));
WorkOrder_new.Add("ProgramID", ProgramID);
WorkOrder_new.Add("color", color);
WorkOrder_new.Add("Dyelot", dyelot);
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);
SQLiteHelpers.Close();
return true;
}
public static bool WorkOderStep(DataTable WorkOrderStep_) public static bool WorkOderStep(DataTable WorkOrderStep_)
{ {
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
DataTable data_t = WorkOrderStep_.Clone();
int a = WorkOrderStep_.Rows.Count; int a = WorkOrderStep_.Rows.Count;
if (a < 1) if (a < 1)
{ {
SQLiteHelpers.Close(); MainWindow.SQLiteHelpers.Close();
return false; return false;
} }
string Program = WorkOrderStep_.Rows[0][0].ToString(); string Program = WorkOrderStep_.Rows[0][0].ToString();
object n = SQLiteHelpers.ExecuteScalar("select * from WorkorderSteps where Program = " + Program, null); object n = MainWindow.SQLiteHelpers.ExecuteScalar("select * from WorkorderSteps where Program = " + Program, null);
if (n != null)//如id存在着返回错误状态 if (n != null)//如id存在着返回错误状态
{ {
SQLiteHelpers.Close(); //SQLiteHelpers.Close();
return false; return false;
} }
for (int i = 0; i < a; i++) for (int i = 0; i < a; i++)
{ {
data_t.Clear();//清空 MainWindow.SQLiteHelpers.InsertData("WorkorderSteps", MainWindow.SQLiteHelpers.ToDictionary(WorkOrderStep_.Rows[i]));//行插入
DataRow dr = data_t.NewRow();
dr.ItemArray = WorkOrderStep_.Rows[i].ItemArray;
data_t.Rows.InsertAt(dr, 0);
SQLiteHelpers.InsertData("WorkorderSteps", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
} }
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
return true; return true;
} }
public static void TechnologicalProcess_START(string workName) public static void TechnologicalProcess_START(string workName)
{ {
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 // SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 // SQLiteHelpers.Open(); //打开数据库
int r = 0;
string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'"; string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'";
if (TechnologicalProcessView.sql != null) TechnologicalProcessView.sql.Clear(); //清空缓存 // if (TechnologicalProcessView.sql != null) TechnologicalProcessView.sql.Clear(); //清空缓存
TechnologicalProcessView.sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存 MainWindowViewModel.dt_TP = MainWindow.SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //读取表写入缓存
MainWindowViewModel.ProgramName = SQLiteHelpers.ExecuteScalar("select ProgramName from Workorder where ProgramID = '" + workName + "'", null).ToString(); MainWindowViewModel.ProgramName = MainWindow.SQLiteHelpers.ExecuteScalar("select ProgramName from Workorder where ProgramID = '" + workName + "'", null).ToString();
SQLiteHelpers.Delete("RUN", null, null); //删除run信息 MainWindow.SQLiteHelpers.Delete("RUN", null, null); //删除run信息
DataTable data_t = new DataTable(); int a = MainWindowViewModel.dt_TP.Rows.Count;
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
for (int i = 0; i < a; i++) for (int i = 0; i < a; i++)
{ {
data_t.Clear();//清空 MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(MainWindowViewModel.dt_TP.Rows[i]));//行插入
DataRow dt = TechnologicalProcessView.sql.Tables[0].Rows[i];//行转
DataRow dr = data_t.NewRow();
dr.ItemArray = dt.ItemArray;
dr.BeginEdit(); //添加订单号
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
dr.EndEdit();
data_t.Rows.InsertAt(dr, 0); //行转换
r = SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
} }
//数据插入 //数据插入
MainWindowViewModel.WorkNumder = SQLiteHelpers.ExecuteDataSet("select WorkOrder from Workorder where ProgramID = '" + workName + "'", null);; MainWindowViewModel.WorkNumder = MainWindow.SQLiteHelpers.ExecuteDataSet("select WorkOrder from Workorder where ProgramID = '" + workName + "'", null);;
TechnologicalProcessView.workName = workName; TechnologicalProcessView.workName = workName;
MainWindowViewModel.SYS_REDYE = 0; MainWindowViewModel.SYS_REDYE = 0;
MainWindowViewModel.ViewID = 1; MainWindowViewModel.ViewID = 1;
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
} }
public static bool Dyelot(DataTable Dyelot_)//领料单 public static bool Dyelot(DataTable Dyelot_)//领料单
{ {
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 DataTable DyelotTable = new DataTable();
SQLiteHelpers.Open(); //打开数据库 DyelotTable.Columns.Add("WorkOrder", Type.GetType("System.String"));
DataTable data_t = Dyelot_.Clone(); DyelotTable.Columns.Add("Dyelot", Type.GetType("System.String"));
int a = Dyelot_.Rows.Count; DyelotTable.Columns.Add("Redye", Type.GetType("System.Int"));
if (a < 1) DyelotTable.Columns.Add("Step", Type.GetType("System.Int"));
DyelotTable.Columns.Add("Tank", Type.GetType("System.Int"));
DyelotTable.Columns.Add("State", Type.GetType("System.Int"));
DyelotTable.Columns.Add("Machine", Type.GetType("System.String"));
DyelotTable.Columns.Add("ProductCode", Type.GetType("System.String"));
DyelotTable.Columns.Add("ProductName", Type.GetType("System.String"));
DyelotTable.Columns.Add("ProductType", Type.GetType("System.Int"));
DyelotTable.Columns.Add("Grams", Type.GetType("System.Double"));
DyelotTable.Columns.Add("Amount", Type.GetType("System.Double"));
string[] columnsToCopy = { "WorkOrder", "Dyelot", "Redye", "Step", "Tank", "State", "Machine",
"ProductCode", "ProductName", "ProductType", "Grams", "Amount"};
foreach (DataRow sourceRow in Dyelot_.Rows)
{ {
SQLiteHelpers.Close(); DataRow newRow = DyelotTable.NewRow();
return false; foreach (string colName in columnsToCopy)
{
if (Dyelot_.Columns.Contains(colName))
{
newRow[colName] = sourceRow[colName];
} }
string Dyelot = Dyelot_.Rows[0][0].ToString(); }
object n = SQLiteHelpers.ExecuteScalar("select * from Dyelot where Dyelot = " + Dyelot, null); DyelotTable.Rows.Add(newRow);
}
int a = DyelotTable.Rows.Count;
if (a < 1) return false;
string Dyelot = DyelotTable.Rows[0][0].ToString();
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
//SQLiteHelpers.Open(); //打开数据库
object n = MainWindow.SQLiteHelpers.ExecuteScalar("select * from Dyelot where Dyelot = " + Dyelot, null);
if (n != null)//如id存在着返回错误状态 if (n != null)//如id存在着返回错误状态
{ {
SQLiteHelpers.Close(); //SQLiteHelpers.Close();
return false; return false;
} }
for (int i = 0; i < a; i++) for (int i = 0; i < a; i++)
{ {
data_t.Clear();//清空 MainWindow.SQLiteHelpers.InsertData("Dyelot", MainWindow.SQLiteHelpers.ToDictionary(DyelotTable.Rows[i]));//行插入
DataRow dr = data_t.NewRow();
dr.ItemArray = Dyelot_.Rows[i].ItemArray;
data_t.Rows.InsertAt(dr, 0);
SQLiteHelpers.InsertData("Dyelot", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
} }
SQLiteHelpers.Close(); //关闭连接 //SQLiteHelpers.Close(); //关闭连接
return true; return true;
} }
+17
View File
@@ -680,6 +680,23 @@ namespace DyeingComputer.UserClass
return result; return result;
} }
/// <summary>
/// 将DataRow转换为Dictionary&lt;string, object&gt;
/// </summary>
/// <param name="row">DataRow实例</param>
/// <returns>键为列名、值为对应数据的字典</returns>
public Dictionary<string, object> ToDictionary(DataRow row)
{
var dictionary = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
if (row == null) return dictionary;
foreach (DataColumn column in row.Table.Columns)
{
object value = row[column] == DBNull.Value ? null : row[column];
dictionary[column.ColumnName] = value;
}
return dictionary;
}
} }
#endregion #endregion
} }
+1
View File
@@ -11,5 +11,6 @@
<Grid> <Grid>
<lvc:CartesianChart x:Name="OscChart" MinWidth="1280" MinHeight="600" EasingFunction="{x:Null}" <lvc:CartesianChart x:Name="OscChart" MinWidth="1280" MinHeight="600" EasingFunction="{x:Null}"
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}"/> Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}"/>
</Grid> </Grid>
</UserControl> </UserControl>
+7 -7
View File
@@ -1,10 +1,14 @@
using DyeingComputer.ViewModel; using DyeingComputer.UserClass;
using LiveChartsCore.SkiaSharpView; using DyeingComputer.ViewModel;
using LiveChartsCore; using LiveChartsCore;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@@ -17,11 +21,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using static DyeingComputer.UserClass.SqliteHelper; using static DyeingComputer.UserClass.SqliteHelper;
using DyeingComputer.UserClass;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Measure;
using ScottPlot.Plottables;
using System.Runtime.InteropServices;
namespace DyeingComputer.View namespace DyeingComputer.View
{ {
@@ -38,6 +37,7 @@ namespace DyeingComputer.View
private void UserControl_Loaded(object sender, RoutedEventArgs e) private void UserControl_Loaded(object sender, RoutedEventArgs e)
{ {
} }
} }
} }
+42 -3
View File
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:DyeingComputer.View" xmlns:local="clr-namespace:DyeingComputer.View"
xmlns:lang="clr-namespace:DyeingComputer.Properties" xmlns:lang="clr-namespace:DyeingComputer.Properties"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="800"> d:DesignHeight="500" d:DesignWidth="1200">
<Grid> <Grid>
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="comboBoxCOM" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/> <ComboBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="comboBoxCOM" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,50,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Port}" VerticalAlignment="Top" Width="120" FontSize="25"/> <TextBlock HorizontalAlignment="Left" Height="40" Margin="10,50,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Port}" VerticalAlignment="Top" Width="120" FontSize="25"/>
@@ -17,8 +17,47 @@
<TextBlock Name="RX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="5,0,0,0"/> <TextBlock Name="RX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="5,0,0,0"/>
<TextBlock Name="TX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="200,0,0,0"/> <TextBlock Name="TX" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="30" Width="100" Margin="200,0,0,0"/>
<Button Content="{x:Static lang:Resources.Shutdown}" x:Name="Shutdown" FontSize="20" HorizontalAlignment="Right" Height="40" Margin="0,0,10,10" <DataGrid x:Name="_set" AutoGenerateColumns="False" FontSize="15" ColumnHeaderHeight="40" Width="600"
VerticalAlignment="Bottom" Width="200" Background="White" Click="Shutdown_Click"/> HorizontalAlignment="Right" Margin="0,10,10,200" Background="{x:Null}" >
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Height" Value="30" />
<Setter Property="FontSize" Value="25" />
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False"/>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="Key" Binding="{Binding Key}" Width="*"/>
<DataGridTextColumn Header="Type" Binding="{Binding Value}" Width="200"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock Text="SUNLIGHT 838 b0.0.1 (master 2025/03/18)" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="30" Width="600" Margin="0,0,10,160" FontSize="22"/>
<TextBlock x:Name="SocketIP" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="30" Width="600" Margin="0,0,10,130" FontSize="22"/>
<Button Content="{x:Static lang:Resources.Shutdown}" x:Name="Shutdown" FontSize="20" HorizontalAlignment="Right" Height="40" Margin="0,0,20,20"
VerticalAlignment="Bottom" Width="200" Background="White" Click="Shutdown_Click"/>
<Button Content="{x:Static lang:Resources.Quit}" x:Name="Quit" FontSize="20" HorizontalAlignment="Right" Height="40" Margin="0,0,300,20"
VerticalAlignment="Bottom" Width="200" Background="White" Click="Quit_Click"/>
</Grid> </Grid>
</UserControl> </UserControl>
+58 -1
View File
@@ -1,7 +1,10 @@
using DyeingComputer.ViewModel; using DyeingComputer.ViewModel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@@ -22,6 +25,7 @@ namespace DyeingComputer.View
/// </summary> /// </summary>
public partial class EngineerSetView : UserControl public partial class EngineerSetView : UserControl
{ {
int _S=0;
public EngineerSetView() public EngineerSetView()
{ {
InitializeComponent(); InitializeComponent();
@@ -38,10 +42,33 @@ namespace DyeingComputer.View
string[] Language = { "en-US", "zh-CN", "zh -TW" }; string[] Language = { "en-US", "zh-CN", "zh -TW" };
comboBoxLanguage.ItemsSource = Language; comboBoxLanguage.ItemsSource = Language;
comboBoxLanguage.Text = Configini.IniReadvalue("SYS", "Language"); comboBoxLanguage.Text = Configini.IniReadvalue("SYS", "Language");
SocketIP.Text = "SocketIP:"+ GetLocalIPAddress()+"[7789][7799]";
} }
//调用配置文件 //调用配置文件
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini"); private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini");
public static string GetLocalIPAddress()
{
// 获取主机名和所有 IP 地址
var hostEntry = Dns.GetHostEntry(Dns.GetHostName());
// 优先尝试获取非内部、非虚拟网卡的 IPv4 地址(如以太网、Wi-Fi)
var ipAddress = hostEntry.AddressList
.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork
&& !IPAddress.IsLoopback(ip)
&& ip.ToString().StartsWith("192.168")); // 示例:优先 192.168 网段
// 如果没找到优先的,则选择第一个非环回的 IPv4 地址
if (ipAddress == null)
{
ipAddress = hostEntry.AddressList
.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork
&& !IPAddress.IsLoopback(ip));
}
// 如果还是没找到,返回环回地址或抛出异常
return ipAddress?.ToString() ?? "127.0.0.1";
}
private void comboBoxCOM_SelectionChanged(object sender, SelectionChangedEventArgs e) private void comboBoxCOM_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
Configini.IniWritevalue("SYS", "COM", comboBoxCOM.SelectedValue.ToString()); Configini.IniWritevalue("SYS", "COM", comboBoxCOM.SelectedValue.ToString());
@@ -69,6 +96,29 @@ namespace DyeingComputer.View
{ {
RX.Text = MainWindowViewModel.RX.ToString(); RX.Text = MainWindowViewModel.RX.ToString();
TX.Text = MainWindowViewModel.TX.ToString(); TX.Text = MainWindowViewModel.TX.ToString();
_S++;
if (_S > 60)
{
_S = 0;
var displayData = MainWindowViewModel.Hardware.Select(kvp => new AdvancedDictionaryEntry
{
Key = kvp.Key,
Value = kvp.Value
}).ToList();
_set.ItemsSource = displayData;
}
}
private void Quit_Click(object sender, RoutedEventArgs e)
{
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.Quit, "800", MessageBoxButton.YesNo);
if (messageBoxResult == MessageBoxResult.No) return;
if (messageBoxResult == MessageBoxResult.Yes)
{
// Application.Current.Shutdown();
System.Environment.Exit(0);//退出
}
} }
private void Shutdown_Click(object sender, RoutedEventArgs e) private void Shutdown_Click(object sender, RoutedEventArgs e)
@@ -78,8 +128,15 @@ namespace DyeingComputer.View
if (messageBoxResult == MessageBoxResult.Yes) if (messageBoxResult == MessageBoxResult.Yes)
{ {
// Application.Current.Shutdown(); // Application.Current.Shutdown();
System.Environment.Exit(0);//退出 //System.Environment.Exit(0);//退出
Process.Start("shutdown", "/s /t 10");
} }
} }
public class AdvancedDictionaryEntry
{
public string Key { get; set; }
public object Value { get; set; }
}
} }
} }
File diff suppressed because it is too large. Load diff
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff. Show more