commit b1ff3223e96589c7b0e1b07d4c1e6de8df7e55c7 Author: kite_lucs <334054969@qq.com> Date: Thu Sep 10 15:19:23 2026 +0800 hlp:640x480-小屏vx4齿轮泵代码提交 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d92257 --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# 基本 Qt 项目 .gitignore — 忽略中间文件和构建产物 + +# 构建目录(你的工作区包含这些目录) +arm_build/ +arm_debug_build/ +x86_build/ +build*/ +*/build/ + +# Qt Creator / qmake +*.pro.user +*.pro.user.* +.qmake.stash + +# Make / ninja / qmake 生成文件 +Makefile +Makefile.* +cmake_install.cmake +CMakeCache.txt + +# 对象文件和库 +*.o +*.obj +*.lo +*.la +*.al +*.a +*.so +*.dylib +*.dll +*.lib +*.exe + +# moc / uic / rcc 生成的源和头 +moc_* +*moc.cpp +ui_*.h +ui_*.hpp +qrc_*.cpp +qrc_*.h +*.moc + +# 临时/备份/日志 +*.log +*.tmp +*.swp +*~ +*.orig + +# IDE / 编辑器 +.idea/ +.vscode/ +*.user + +# macOS / Windows +.DS_Store +Thumbs.db + +# 覆盖率 / 测试输出 +coverage/ +*.gcda +*.gcno + +# QML/Qt 缓存(可选) +qmlcache/ + +# 其他可能的二进制产物 +dist/ +bin/ +。 +.svn/ +.cproject +.project + +printImage.* +printImageScene.bmp +printSceneView.png +dbg.txt + +oldProject/ \ No newline at end of file diff --git a/0/image/digitalWidth1.bmp b/0/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/0/image/digitalWidth1.bmp differ diff --git a/0/image/digitalWidth175.bmp b/0/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/0/image/digitalWidth175.bmp differ diff --git a/0/image/digitalWidth2.bmp b/0/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/0/image/digitalWidth2.bmp differ diff --git a/0/image/digitalWidth275.bmp b/0/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/0/image/digitalWidth275.bmp differ diff --git a/0/image/digitalWidth3.bmp b/0/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/0/image/digitalWidth3.bmp differ diff --git a/0/image/digitalWidth375.bmp b/0/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/0/image/digitalWidth375.bmp differ diff --git a/0/image/digitalWidth4.bmp b/0/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/0/image/digitalWidth4.bmp differ diff --git a/0/image/digitalWidth475.bmp b/0/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/0/image/digitalWidth475.bmp differ diff --git a/0/image/digitalWidth5.bmp b/0/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/0/image/digitalWidth5.bmp differ diff --git a/0/image/digitalWidth575.bmp b/0/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/0/image/digitalWidth575.bmp differ diff --git a/0/image/digitalWidth6.bmp b/0/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/0/image/digitalWidth6.bmp differ diff --git a/0/image/digitalWidth675.bmp b/0/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/0/image/digitalWidth675.bmp differ diff --git a/0/image/digitalWidth7.bmp b/0/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/0/image/digitalWidth7.bmp differ diff --git a/0/image/digitalWidth775.bmp b/0/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/0/image/digitalWidth775.bmp differ diff --git a/0/image/digitalWidth8.bmp b/0/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/0/image/digitalWidth8.bmp differ diff --git a/0/image/digitalWidth875.bmp b/0/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/0/image/digitalWidth875.bmp differ diff --git a/0varRam.png b/0varRam.png new file mode 100644 index 0000000..7c0d67e Binary files /dev/null and b/0varRam.png differ diff --git a/1/image/digitalWidth1.bmp b/1/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/1/image/digitalWidth1.bmp differ diff --git a/1/image/digitalWidth175.bmp b/1/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/1/image/digitalWidth175.bmp differ diff --git a/1/image/digitalWidth2.bmp b/1/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/1/image/digitalWidth2.bmp differ diff --git a/1/image/digitalWidth275.bmp b/1/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/1/image/digitalWidth275.bmp differ diff --git a/1/image/digitalWidth3.bmp b/1/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/1/image/digitalWidth3.bmp differ diff --git a/1/image/digitalWidth375.bmp b/1/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/1/image/digitalWidth375.bmp differ diff --git a/1/image/digitalWidth4.bmp b/1/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/1/image/digitalWidth4.bmp differ diff --git a/1/image/digitalWidth475.bmp b/1/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/1/image/digitalWidth475.bmp differ diff --git a/1/image/digitalWidth5.bmp b/1/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/1/image/digitalWidth5.bmp differ diff --git a/1/image/digitalWidth575.bmp b/1/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/1/image/digitalWidth575.bmp differ diff --git a/1/image/digitalWidth6.bmp b/1/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/1/image/digitalWidth6.bmp differ diff --git a/1/image/digitalWidth675.bmp b/1/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/1/image/digitalWidth675.bmp differ diff --git a/1/image/digitalWidth7.bmp b/1/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/1/image/digitalWidth7.bmp differ diff --git a/1/image/digitalWidth775.bmp b/1/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/1/image/digitalWidth775.bmp differ diff --git a/1/image/digitalWidth8.bmp b/1/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/1/image/digitalWidth8.bmp differ diff --git a/1/image/digitalWidth875.bmp b/1/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/1/image/digitalWidth875.bmp differ diff --git a/10/image/QRV21.bmp b/10/image/QRV21.bmp new file mode 100644 index 0000000..b576bf6 Binary files /dev/null and b/10/image/QRV21.bmp differ diff --git a/10/image/QRV25.bmp b/10/image/QRV25.bmp new file mode 100644 index 0000000..505f4a6 Binary files /dev/null and b/10/image/QRV25.bmp differ diff --git a/10/image/QRV25X21.bmp b/10/image/QRV25X21.bmp new file mode 100644 index 0000000..54da2a7 Binary files /dev/null and b/10/image/QRV25X21.bmp differ diff --git a/10/image/QRV29.bmp b/10/image/QRV29.bmp new file mode 100644 index 0000000..2c9295a Binary files /dev/null and b/10/image/QRV29.bmp differ diff --git a/10/image/QRV33.bmp b/10/image/QRV33.bmp new file mode 100644 index 0000000..ecf6ded Binary files /dev/null and b/10/image/QRV33.bmp differ diff --git a/10/image/QRV37.bmp b/10/image/QRV37.bmp new file mode 100644 index 0000000..8082eb3 Binary files /dev/null and b/10/image/QRV37.bmp differ diff --git a/100/EXPIRYXX.xcf b/100/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/100/EXPIRYXX.xcf differ diff --git a/100/digitalWidth4.bmp b/100/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/100/digitalWidth4.bmp differ diff --git a/100/expiryDate8.bmp b/100/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/100/expiryDate8.bmp differ diff --git a/100/image/digitalWidth1.bmp b/100/image/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/100/image/digitalWidth1.bmp differ diff --git a/100/image/digitalWidth175.bmp b/100/image/digitalWidth175.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/100/image/digitalWidth175.bmp differ diff --git a/100/image/digitalWidth8 (____).bmp b/100/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/100/image/digitalWidth8 (____).bmp differ diff --git a/100/image/digitalWidth8.bmp b/100/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/100/image/digitalWidth8.bmp differ diff --git a/100/image/digitalWidth8.xcf b/100/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/100/image/digitalWidth8.xcf differ diff --git a/100/image/digitalWidth88.bmp b/100/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/100/image/digitalWidth88.bmp differ diff --git a/100/image/expiryDate8.bmp b/100/image/expiryDate8.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/100/image/expiryDate8.bmp differ diff --git a/100/image/expiryDate875.bmp b/100/image/expiryDate875.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/100/image/expiryDate875.bmp differ diff --git a/100/image/expiryDate875_backup.bmp b/100/image/expiryDate875_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/100/image/expiryDate875_backup.bmp differ diff --git a/100/image/expiryDate8_backup.bmp b/100/image/expiryDate8_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/100/image/expiryDate8_backup.bmp differ diff --git a/101/EXPIRYXX.xcf b/101/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/101/EXPIRYXX.xcf differ diff --git a/101/digitalWidth1.bmp b/101/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/101/digitalWidth1.bmp differ diff --git a/101/digitalWidth4.bmp b/101/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/101/digitalWidth4.bmp differ diff --git a/101/expiryDate8.bmp b/101/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/101/expiryDate8.bmp differ diff --git a/101/image/curDate1.bmp b/101/image/curDate1.bmp new file mode 100644 index 0000000..bc9c77f Binary files /dev/null and b/101/image/curDate1.bmp differ diff --git a/101/image/curDate8.bmp b/101/image/curDate8.bmp new file mode 100644 index 0000000..8094d0e Binary files /dev/null and b/101/image/curDate8.bmp differ diff --git a/101/image/curDate875.bmp b/101/image/curDate875.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/101/image/curDate875.bmp differ diff --git a/101/image/curDate8_backup.bmp b/101/image/curDate8_backup.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/101/image/curDate8_backup.bmp differ diff --git a/101/image/digitalWidth1.bmp b/101/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/101/image/digitalWidth1.bmp differ diff --git a/101/image/digitalWidth8 (____).bmp b/101/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/101/image/digitalWidth8 (____).bmp differ diff --git a/101/image/digitalWidth8.bmp b/101/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/101/image/digitalWidth8.bmp differ diff --git a/101/image/digitalWidth8.xcf b/101/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/101/image/digitalWidth8.xcf differ diff --git a/101/image/digitalWidth88.bmp b/101/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/101/image/digitalWidth88.bmp differ diff --git a/101/image/expiryDate8.bmp b/101/image/expiryDate8.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/101/image/expiryDate8.bmp differ diff --git a/101/image/expiryDate875.bmp b/101/image/expiryDate875.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/101/image/expiryDate875.bmp differ diff --git a/11/image/BARV105.bmp b/11/image/BARV105.bmp new file mode 100644 index 0000000..63ec41b Binary files /dev/null and b/11/image/BARV105.bmp differ diff --git a/11/image/BARV107.bmp b/11/image/BARV107.bmp new file mode 100644 index 0000000..f0d6e4b Binary files /dev/null and b/11/image/BARV107.bmp differ diff --git a/11/image/BARV109.bmp b/11/image/BARV109.bmp new file mode 100644 index 0000000..f8323c2 Binary files /dev/null and b/11/image/BARV109.bmp differ diff --git a/11/image/BARV112.bmp b/11/image/BARV112.bmp new file mode 100644 index 0000000..35ffc37 Binary files /dev/null and b/11/image/BARV112.bmp differ diff --git a/11/image/BARV116.bmp b/11/image/BARV116.bmp new file mode 100644 index 0000000..2fd9a1d Binary files /dev/null and b/11/image/BARV116.bmp differ diff --git a/11/image/BARV12.bmp b/11/image/BARV12.bmp new file mode 100644 index 0000000..57a3151 Binary files /dev/null and b/11/image/BARV12.bmp differ diff --git a/11/image/BARV124.bmp b/11/image/BARV124.bmp new file mode 100644 index 0000000..f8f72d8 Binary files /dev/null and b/11/image/BARV124.bmp differ diff --git a/11/image/BARV16.bmp b/11/image/BARV16.bmp new file mode 100644 index 0000000..fd14bee Binary files /dev/null and b/11/image/BARV16.bmp differ diff --git a/11/image/BARV205.bmp b/11/image/BARV205.bmp new file mode 100644 index 0000000..a893e0e Binary files /dev/null and b/11/image/BARV205.bmp differ diff --git a/11/image/BARV207.bmp b/11/image/BARV207.bmp new file mode 100644 index 0000000..1feb715 Binary files /dev/null and b/11/image/BARV207.bmp differ diff --git a/11/image/BARV209.bmp b/11/image/BARV209.bmp new file mode 100644 index 0000000..60df46e Binary files /dev/null and b/11/image/BARV209.bmp differ diff --git a/11/image/BARV212.bmp b/11/image/BARV212.bmp new file mode 100644 index 0000000..a49ff4f Binary files /dev/null and b/11/image/BARV212.bmp differ diff --git a/11/image/BARV216.bmp b/11/image/BARV216.bmp new file mode 100644 index 0000000..031eda9 Binary files /dev/null and b/11/image/BARV216.bmp differ diff --git a/11/image/BARV224.bmp b/11/image/BARV224.bmp new file mode 100644 index 0000000..5003d90 Binary files /dev/null and b/11/image/BARV224.bmp differ diff --git a/11/image/BARV24.bmp b/11/image/BARV24.bmp new file mode 100644 index 0000000..021860a Binary files /dev/null and b/11/image/BARV24.bmp differ diff --git a/11/image/BARV5.bmp b/11/image/BARV5.bmp new file mode 100644 index 0000000..a8b28b5 Binary files /dev/null and b/11/image/BARV5.bmp differ diff --git a/11/image/BARV7.bmp b/11/image/BARV7.bmp new file mode 100644 index 0000000..f7c37d8 Binary files /dev/null and b/11/image/BARV7.bmp differ diff --git a/11/image/BARV9.bmp b/11/image/BARV9.bmp new file mode 100644 index 0000000..1f50e6c Binary files /dev/null and b/11/image/BARV9.bmp differ diff --git a/12/image/digitalWidth1.bmp b/12/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/12/image/digitalWidth1.bmp differ diff --git a/12/image/digitalWidth10.bmp b/12/image/digitalWidth10.bmp new file mode 100644 index 0000000..36f4532 Binary files /dev/null and b/12/image/digitalWidth10.bmp differ diff --git a/12/image/digitalWidth1075.bmp b/12/image/digitalWidth1075.bmp new file mode 100644 index 0000000..36f4532 Binary files /dev/null and b/12/image/digitalWidth1075.bmp differ diff --git a/12/image/digitalWidth11.bmp b/12/image/digitalWidth11.bmp new file mode 100644 index 0000000..171d070 Binary files /dev/null and b/12/image/digitalWidth11.bmp differ diff --git a/12/image/digitalWidth1175.bmp b/12/image/digitalWidth1175.bmp new file mode 100644 index 0000000..171d070 Binary files /dev/null and b/12/image/digitalWidth1175.bmp differ diff --git a/12/image/digitalWidth12.bmp b/12/image/digitalWidth12.bmp new file mode 100644 index 0000000..0c5a440 Binary files /dev/null and b/12/image/digitalWidth12.bmp differ diff --git a/12/image/digitalWidth1275.bmp b/12/image/digitalWidth1275.bmp new file mode 100644 index 0000000..0c5a440 Binary files /dev/null and b/12/image/digitalWidth1275.bmp differ diff --git a/12/image/digitalWidth13.bmp b/12/image/digitalWidth13.bmp new file mode 100644 index 0000000..0fa65a5 Binary files /dev/null and b/12/image/digitalWidth13.bmp differ diff --git a/12/image/digitalWidth1375.bmp b/12/image/digitalWidth1375.bmp new file mode 100644 index 0000000..0fa65a5 Binary files /dev/null and b/12/image/digitalWidth1375.bmp differ diff --git a/12/image/digitalWidth14.bmp b/12/image/digitalWidth14.bmp new file mode 100644 index 0000000..939c6c4 Binary files /dev/null and b/12/image/digitalWidth14.bmp differ diff --git a/12/image/digitalWidth1475.bmp b/12/image/digitalWidth1475.bmp new file mode 100644 index 0000000..939c6c4 Binary files /dev/null and b/12/image/digitalWidth1475.bmp differ diff --git a/12/image/digitalWidth15.bmp b/12/image/digitalWidth15.bmp new file mode 100644 index 0000000..b6beec9 Binary files /dev/null and b/12/image/digitalWidth15.bmp differ diff --git a/12/image/digitalWidth1575.bmp b/12/image/digitalWidth1575.bmp new file mode 100644 index 0000000..b6beec9 Binary files /dev/null and b/12/image/digitalWidth1575.bmp differ diff --git a/12/image/digitalWidth16.bmp b/12/image/digitalWidth16.bmp new file mode 100644 index 0000000..2a30f73 Binary files /dev/null and b/12/image/digitalWidth16.bmp differ diff --git a/12/image/digitalWidth1675.bmp b/12/image/digitalWidth1675.bmp new file mode 100644 index 0000000..2a30f73 Binary files /dev/null and b/12/image/digitalWidth1675.bmp differ diff --git a/12/image/digitalWidth175.bmp b/12/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/12/image/digitalWidth175.bmp differ diff --git a/12/image/digitalWidth2.bmp b/12/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/12/image/digitalWidth2.bmp differ diff --git a/12/image/digitalWidth275.bmp b/12/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/12/image/digitalWidth275.bmp differ diff --git a/12/image/digitalWidth3.bmp b/12/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/12/image/digitalWidth3.bmp differ diff --git a/12/image/digitalWidth375.bmp b/12/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/12/image/digitalWidth375.bmp differ diff --git a/12/image/digitalWidth4.bmp b/12/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/12/image/digitalWidth4.bmp differ diff --git a/12/image/digitalWidth475.bmp b/12/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/12/image/digitalWidth475.bmp differ diff --git a/12/image/digitalWidth5.bmp b/12/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/12/image/digitalWidth5.bmp differ diff --git a/12/image/digitalWidth575.bmp b/12/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/12/image/digitalWidth575.bmp differ diff --git a/12/image/digitalWidth6.bmp b/12/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/12/image/digitalWidth6.bmp differ diff --git a/12/image/digitalWidth675.bmp b/12/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/12/image/digitalWidth675.bmp differ diff --git a/12/image/digitalWidth7.bmp b/12/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/12/image/digitalWidth7.bmp differ diff --git a/12/image/digitalWidth775.bmp b/12/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/12/image/digitalWidth775.bmp differ diff --git a/12/image/digitalWidth8.bmp b/12/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/12/image/digitalWidth8.bmp differ diff --git a/12/image/digitalWidth875.bmp b/12/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/12/image/digitalWidth875.bmp differ diff --git a/12/image/digitalWidth9.bmp b/12/image/digitalWidth9.bmp new file mode 100644 index 0000000..da84387 Binary files /dev/null and b/12/image/digitalWidth9.bmp differ diff --git a/12/image/digitalWidth975.bmp b/12/image/digitalWidth975.bmp new file mode 100644 index 0000000..da84387 Binary files /dev/null and b/12/image/digitalWidth975.bmp differ diff --git a/13/image/digitalWidth1.bmp b/13/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/13/image/digitalWidth1.bmp differ diff --git a/13/image/digitalWidth175.bmp b/13/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/13/image/digitalWidth175.bmp differ diff --git a/13/image/digitalWidth2.bmp b/13/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/13/image/digitalWidth2.bmp differ diff --git a/13/image/digitalWidth275.bmp b/13/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/13/image/digitalWidth275.bmp differ diff --git a/13/image/digitalWidth3.bmp b/13/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/13/image/digitalWidth3.bmp differ diff --git a/13/image/digitalWidth375.bmp b/13/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/13/image/digitalWidth375.bmp differ diff --git a/13/image/digitalWidth4.bmp b/13/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/13/image/digitalWidth4.bmp differ diff --git a/13/image/digitalWidth475.bmp b/13/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/13/image/digitalWidth475.bmp differ diff --git a/13/image/digitalWidth5.bmp b/13/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/13/image/digitalWidth5.bmp differ diff --git a/13/image/digitalWidth575.bmp b/13/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/13/image/digitalWidth575.bmp differ diff --git a/13/image/digitalWidth6.bmp b/13/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/13/image/digitalWidth6.bmp differ diff --git a/13/image/digitalWidth675.bmp b/13/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/13/image/digitalWidth675.bmp differ diff --git a/13/image/digitalWidth7.bmp b/13/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/13/image/digitalWidth7.bmp differ diff --git a/13/image/digitalWidth775.bmp b/13/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/13/image/digitalWidth775.bmp differ diff --git a/13/image/digitalWidth8.bmp b/13/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/13/image/digitalWidth8.bmp differ diff --git a/13/image/digitalWidth875.bmp b/13/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/13/image/digitalWidth875.bmp differ diff --git a/2/image/digitalWidth1.bmp b/2/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/2/image/digitalWidth1.bmp differ diff --git a/2/image/digitalWidth175.bmp b/2/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/2/image/digitalWidth175.bmp differ diff --git a/2/image/digitalWidth2.bmp b/2/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/2/image/digitalWidth2.bmp differ diff --git a/2/image/digitalWidth275.bmp b/2/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/2/image/digitalWidth275.bmp differ diff --git a/2/image/digitalWidth3.bmp b/2/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/2/image/digitalWidth3.bmp differ diff --git a/2/image/digitalWidth375.bmp b/2/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/2/image/digitalWidth375.bmp differ diff --git a/2/image/digitalWidth4.bmp b/2/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/2/image/digitalWidth4.bmp differ diff --git a/2/image/digitalWidth475.bmp b/2/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/2/image/digitalWidth475.bmp differ diff --git a/2/image/digitalWidth5.bmp b/2/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/2/image/digitalWidth5.bmp differ diff --git a/2/image/digitalWidth575.bmp b/2/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/2/image/digitalWidth575.bmp differ diff --git a/2/image/digitalWidth6.bmp b/2/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/2/image/digitalWidth6.bmp differ diff --git a/2/image/digitalWidth675.bmp b/2/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/2/image/digitalWidth675.bmp differ diff --git a/2/image/digitalWidth7.bmp b/2/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/2/image/digitalWidth7.bmp differ diff --git a/2/image/digitalWidth775.bmp b/2/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/2/image/digitalWidth775.bmp differ diff --git a/2/image/digitalWidth8.bmp b/2/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/2/image/digitalWidth8.bmp differ diff --git a/2/image/digitalWidth875.bmp b/2/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/2/image/digitalWidth875.bmp differ diff --git a/20/image/digitalWidth1.bmp b/20/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/20/image/digitalWidth1.bmp differ diff --git a/20/image/digitalWidth175.bmp b/20/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/20/image/digitalWidth175.bmp differ diff --git a/20/image/digitalWidth2.bmp b/20/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/20/image/digitalWidth2.bmp differ diff --git a/20/image/digitalWidth275.bmp b/20/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/20/image/digitalWidth275.bmp differ diff --git a/20/image/digitalWidth3.bmp b/20/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/20/image/digitalWidth3.bmp differ diff --git a/20/image/digitalWidth375.bmp b/20/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/20/image/digitalWidth375.bmp differ diff --git a/20/image/digitalWidth4.bmp b/20/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/20/image/digitalWidth4.bmp differ diff --git a/20/image/digitalWidth475.bmp b/20/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/20/image/digitalWidth475.bmp differ diff --git a/20/image/digitalWidth5.bmp b/20/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/20/image/digitalWidth5.bmp differ diff --git a/20/image/digitalWidth575.bmp b/20/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/20/image/digitalWidth575.bmp differ diff --git a/20/image/digitalWidth6.bmp b/20/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/20/image/digitalWidth6.bmp differ diff --git a/20/image/digitalWidth675.bmp b/20/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/20/image/digitalWidth675.bmp differ diff --git a/20/image/digitalWidth7.bmp b/20/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/20/image/digitalWidth7.bmp differ diff --git a/20/image/digitalWidth775.bmp b/20/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/20/image/digitalWidth775.bmp differ diff --git a/20/image/digitalWidth8.bmp b/20/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/20/image/digitalWidth8.bmp differ diff --git a/20/image/digitalWidth875.bmp b/20/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/20/image/digitalWidth875.bmp differ diff --git a/21/image/digitalWidth1.bmp b/21/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/21/image/digitalWidth1.bmp differ diff --git a/21/image/digitalWidth175.bmp b/21/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/21/image/digitalWidth175.bmp differ diff --git a/21/image/digitalWidth2.bmp b/21/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/21/image/digitalWidth2.bmp differ diff --git a/21/image/digitalWidth275.bmp b/21/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/21/image/digitalWidth275.bmp differ diff --git a/21/image/digitalWidth3.bmp b/21/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/21/image/digitalWidth3.bmp differ diff --git a/21/image/digitalWidth375.bmp b/21/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/21/image/digitalWidth375.bmp differ diff --git a/21/image/digitalWidth4.bmp b/21/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/21/image/digitalWidth4.bmp differ diff --git a/21/image/digitalWidth475.bmp b/21/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/21/image/digitalWidth475.bmp differ diff --git a/21/image/digitalWidth5.bmp b/21/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/21/image/digitalWidth5.bmp differ diff --git a/21/image/digitalWidth575.bmp b/21/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/21/image/digitalWidth575.bmp differ diff --git a/21/image/digitalWidth6.bmp b/21/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/21/image/digitalWidth6.bmp differ diff --git a/21/image/digitalWidth675.bmp b/21/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/21/image/digitalWidth675.bmp differ diff --git a/21/image/digitalWidth7.bmp b/21/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/21/image/digitalWidth7.bmp differ diff --git a/21/image/digitalWidth775.bmp b/21/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/21/image/digitalWidth775.bmp differ diff --git a/21/image/digitalWidth8.bmp b/21/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/21/image/digitalWidth8.bmp differ diff --git a/21/image/digitalWidth875.bmp b/21/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/21/image/digitalWidth875.bmp differ diff --git a/22/image/digitalWidth1.bmp b/22/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/22/image/digitalWidth1.bmp differ diff --git a/22/image/digitalWidth175.bmp b/22/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/22/image/digitalWidth175.bmp differ diff --git a/22/image/digitalWidth2.bmp b/22/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/22/image/digitalWidth2.bmp differ diff --git a/22/image/digitalWidth275.bmp b/22/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/22/image/digitalWidth275.bmp differ diff --git a/22/image/digitalWidth3.bmp b/22/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/22/image/digitalWidth3.bmp differ diff --git a/22/image/digitalWidth375.bmp b/22/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/22/image/digitalWidth375.bmp differ diff --git a/22/image/digitalWidth4.bmp b/22/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/22/image/digitalWidth4.bmp differ diff --git a/22/image/digitalWidth475.bmp b/22/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/22/image/digitalWidth475.bmp differ diff --git a/22/image/digitalWidth5.bmp b/22/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/22/image/digitalWidth5.bmp differ diff --git a/22/image/digitalWidth575.bmp b/22/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/22/image/digitalWidth575.bmp differ diff --git a/22/image/digitalWidth6.bmp b/22/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/22/image/digitalWidth6.bmp differ diff --git a/22/image/digitalWidth675.bmp b/22/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/22/image/digitalWidth675.bmp differ diff --git a/22/image/digitalWidth7.bmp b/22/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/22/image/digitalWidth7.bmp differ diff --git a/22/image/digitalWidth775.bmp b/22/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/22/image/digitalWidth775.bmp differ diff --git a/22/image/digitalWidth8.bmp b/22/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/22/image/digitalWidth8.bmp differ diff --git a/22/image/digitalWidth875.bmp b/22/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/22/image/digitalWidth875.bmp differ diff --git a/23/image/digitalWidth1.bmp b/23/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/23/image/digitalWidth1.bmp differ diff --git a/23/image/digitalWidth175.bmp b/23/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/23/image/digitalWidth175.bmp differ diff --git a/23/image/digitalWidth2.bmp b/23/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/23/image/digitalWidth2.bmp differ diff --git a/23/image/digitalWidth275.bmp b/23/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/23/image/digitalWidth275.bmp differ diff --git a/23/image/digitalWidth3.bmp b/23/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/23/image/digitalWidth3.bmp differ diff --git a/23/image/digitalWidth375.bmp b/23/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/23/image/digitalWidth375.bmp differ diff --git a/23/image/digitalWidth4.bmp b/23/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/23/image/digitalWidth4.bmp differ diff --git a/23/image/digitalWidth475.bmp b/23/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/23/image/digitalWidth475.bmp differ diff --git a/23/image/digitalWidth5.bmp b/23/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/23/image/digitalWidth5.bmp differ diff --git a/23/image/digitalWidth575.bmp b/23/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/23/image/digitalWidth575.bmp differ diff --git a/23/image/digitalWidth6.bmp b/23/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/23/image/digitalWidth6.bmp differ diff --git a/23/image/digitalWidth675.bmp b/23/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/23/image/digitalWidth675.bmp differ diff --git a/23/image/digitalWidth7.bmp b/23/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/23/image/digitalWidth7.bmp differ diff --git a/23/image/digitalWidth775.bmp b/23/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/23/image/digitalWidth775.bmp differ diff --git a/23/image/digitalWidth8.bmp b/23/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/23/image/digitalWidth8.bmp differ diff --git a/23/image/digitalWidth875.bmp b/23/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/23/image/digitalWidth875.bmp differ diff --git a/24/image/digitalWidth1.bmp b/24/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/24/image/digitalWidth1.bmp differ diff --git a/24/image/digitalWidth175.bmp b/24/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/24/image/digitalWidth175.bmp differ diff --git a/24/image/digitalWidth2.bmp b/24/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/24/image/digitalWidth2.bmp differ diff --git a/24/image/digitalWidth275.bmp b/24/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/24/image/digitalWidth275.bmp differ diff --git a/24/image/digitalWidth3.bmp b/24/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/24/image/digitalWidth3.bmp differ diff --git a/24/image/digitalWidth375.bmp b/24/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/24/image/digitalWidth375.bmp differ diff --git a/24/image/digitalWidth4.bmp b/24/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/24/image/digitalWidth4.bmp differ diff --git a/24/image/digitalWidth475.bmp b/24/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/24/image/digitalWidth475.bmp differ diff --git a/24/image/digitalWidth5.bmp b/24/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/24/image/digitalWidth5.bmp differ diff --git a/24/image/digitalWidth575.bmp b/24/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/24/image/digitalWidth575.bmp differ diff --git a/24/image/digitalWidth6.bmp b/24/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/24/image/digitalWidth6.bmp differ diff --git a/24/image/digitalWidth675.bmp b/24/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/24/image/digitalWidth675.bmp differ diff --git a/24/image/digitalWidth7.bmp b/24/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/24/image/digitalWidth7.bmp differ diff --git a/24/image/digitalWidth775.bmp b/24/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/24/image/digitalWidth775.bmp differ diff --git a/24/image/digitalWidth8.bmp b/24/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/24/image/digitalWidth8.bmp differ diff --git a/24/image/digitalWidth875.bmp b/24/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/24/image/digitalWidth875.bmp differ diff --git a/25/image/digitalWidth1.bmp b/25/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/25/image/digitalWidth1.bmp differ diff --git a/25/image/digitalWidth175.bmp b/25/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/25/image/digitalWidth175.bmp differ diff --git a/25/image/digitalWidth2.bmp b/25/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/25/image/digitalWidth2.bmp differ diff --git a/25/image/digitalWidth275.bmp b/25/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/25/image/digitalWidth275.bmp differ diff --git a/25/image/digitalWidth3.bmp b/25/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/25/image/digitalWidth3.bmp differ diff --git a/25/image/digitalWidth375.bmp b/25/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/25/image/digitalWidth375.bmp differ diff --git a/25/image/digitalWidth4.bmp b/25/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/25/image/digitalWidth4.bmp differ diff --git a/25/image/digitalWidth475.bmp b/25/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/25/image/digitalWidth475.bmp differ diff --git a/25/image/digitalWidth5.bmp b/25/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/25/image/digitalWidth5.bmp differ diff --git a/25/image/digitalWidth575.bmp b/25/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/25/image/digitalWidth575.bmp differ diff --git a/25/image/digitalWidth6.bmp b/25/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/25/image/digitalWidth6.bmp differ diff --git a/25/image/digitalWidth675.bmp b/25/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/25/image/digitalWidth675.bmp differ diff --git a/25/image/digitalWidth7.bmp b/25/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/25/image/digitalWidth7.bmp differ diff --git a/25/image/digitalWidth775.bmp b/25/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/25/image/digitalWidth775.bmp differ diff --git a/25/image/digitalWidth8.bmp b/25/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/25/image/digitalWidth8.bmp differ diff --git a/25/image/digitalWidth875.bmp b/25/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/25/image/digitalWidth875.bmp differ diff --git a/26/image/digitalWidth1.bmp b/26/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/26/image/digitalWidth1.bmp differ diff --git a/26/image/digitalWidth175.bmp b/26/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/26/image/digitalWidth175.bmp differ diff --git a/26/image/digitalWidth2.bmp b/26/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/26/image/digitalWidth2.bmp differ diff --git a/26/image/digitalWidth275.bmp b/26/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/26/image/digitalWidth275.bmp differ diff --git a/26/image/digitalWidth3.bmp b/26/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/26/image/digitalWidth3.bmp differ diff --git a/26/image/digitalWidth375.bmp b/26/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/26/image/digitalWidth375.bmp differ diff --git a/26/image/digitalWidth4.bmp b/26/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/26/image/digitalWidth4.bmp differ diff --git a/26/image/digitalWidth475.bmp b/26/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/26/image/digitalWidth475.bmp differ diff --git a/26/image/digitalWidth5.bmp b/26/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/26/image/digitalWidth5.bmp differ diff --git a/26/image/digitalWidth575.bmp b/26/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/26/image/digitalWidth575.bmp differ diff --git a/26/image/digitalWidth6.bmp b/26/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/26/image/digitalWidth6.bmp differ diff --git a/26/image/digitalWidth675.bmp b/26/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/26/image/digitalWidth675.bmp differ diff --git a/26/image/digitalWidth7.bmp b/26/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/26/image/digitalWidth7.bmp differ diff --git a/26/image/digitalWidth775.bmp b/26/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/26/image/digitalWidth775.bmp differ diff --git a/26/image/digitalWidth8.bmp b/26/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/26/image/digitalWidth8.bmp differ diff --git a/26/image/digitalWidth875.bmp b/26/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/26/image/digitalWidth875.bmp differ diff --git a/27/image (复件)/digitalWidth1.bmp b/27/image (复件)/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/27/image (复件)/digitalWidth1.bmp differ diff --git a/27/image (复件)/digitalWidth175.bmp b/27/image (复件)/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/27/image (复件)/digitalWidth175.bmp differ diff --git a/27/image (复件)/digitalWidth2.bmp b/27/image (复件)/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/27/image (复件)/digitalWidth2.bmp differ diff --git a/27/image (复件)/digitalWidth275.bmp b/27/image (复件)/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/27/image (复件)/digitalWidth275.bmp differ diff --git a/27/image (复件)/digitalWidth3.bmp b/27/image (复件)/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/27/image (复件)/digitalWidth3.bmp differ diff --git a/27/image (复件)/digitalWidth375.bmp b/27/image (复件)/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/27/image (复件)/digitalWidth375.bmp differ diff --git a/27/image (复件)/digitalWidth4.bmp b/27/image (复件)/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/27/image (复件)/digitalWidth4.bmp differ diff --git a/27/image (复件)/digitalWidth475.bmp b/27/image (复件)/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/27/image (复件)/digitalWidth475.bmp differ diff --git a/27/image (复件)/digitalWidth5.bmp b/27/image (复件)/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/27/image (复件)/digitalWidth5.bmp differ diff --git a/27/image (复件)/digitalWidth575.bmp b/27/image (复件)/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/27/image (复件)/digitalWidth575.bmp differ diff --git a/27/image (复件)/digitalWidth6.bmp b/27/image (复件)/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/27/image (复件)/digitalWidth6.bmp differ diff --git a/27/image (复件)/digitalWidth675.bmp b/27/image (复件)/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/27/image (复件)/digitalWidth675.bmp differ diff --git a/27/image (复件)/digitalWidth7.bmp b/27/image (复件)/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/27/image (复件)/digitalWidth7.bmp differ diff --git a/27/image (复件)/digitalWidth775.bmp b/27/image (复件)/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/27/image (复件)/digitalWidth775.bmp differ diff --git a/27/image (复件)/digitalWidth8.bmp b/27/image (复件)/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/27/image (复件)/digitalWidth8.bmp differ diff --git a/27/image (复件)/digitalWidth875.bmp b/27/image (复件)/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/27/image (复件)/digitalWidth875.bmp differ diff --git a/27/image.tar.gz b/27/image.tar.gz new file mode 100644 index 0000000..953eecb Binary files /dev/null and b/27/image.tar.gz differ diff --git a/27/image/digitalWidth1.bmp b/27/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/27/image/digitalWidth1.bmp differ diff --git a/27/image/digitalWidth175.bmp b/27/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/27/image/digitalWidth175.bmp differ diff --git a/27/image/digitalWidth2.bmp b/27/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/27/image/digitalWidth2.bmp differ diff --git a/27/image/digitalWidth275.bmp b/27/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/27/image/digitalWidth275.bmp differ diff --git a/27/image/digitalWidth3.bmp b/27/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/27/image/digitalWidth3.bmp differ diff --git a/27/image/digitalWidth375.bmp b/27/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/27/image/digitalWidth375.bmp differ diff --git a/27/image/digitalWidth4.bmp b/27/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/27/image/digitalWidth4.bmp differ diff --git a/27/image/digitalWidth475.bmp b/27/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/27/image/digitalWidth475.bmp differ diff --git a/27/image/digitalWidth5.bmp b/27/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/27/image/digitalWidth5.bmp differ diff --git a/27/image/digitalWidth575.bmp b/27/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/27/image/digitalWidth575.bmp differ diff --git a/27/image/digitalWidth6.bmp b/27/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/27/image/digitalWidth6.bmp differ diff --git a/27/image/digitalWidth675.bmp b/27/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/27/image/digitalWidth675.bmp differ diff --git a/27/image/digitalWidth7.bmp b/27/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/27/image/digitalWidth7.bmp differ diff --git a/27/image/digitalWidth775.bmp b/27/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/27/image/digitalWidth775.bmp differ diff --git a/27/image/digitalWidth8.bmp b/27/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/27/image/digitalWidth8.bmp differ diff --git a/27/image/digitalWidth875.bmp b/27/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/27/image/digitalWidth875.bmp differ diff --git a/28/image/digitalWidth1.bmp b/28/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/28/image/digitalWidth1.bmp differ diff --git a/28/image/digitalWidth175.bmp b/28/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/28/image/digitalWidth175.bmp differ diff --git a/28/image/digitalWidth2.bmp b/28/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/28/image/digitalWidth2.bmp differ diff --git a/28/image/digitalWidth275.bmp b/28/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/28/image/digitalWidth275.bmp differ diff --git a/28/image/digitalWidth3.bmp b/28/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/28/image/digitalWidth3.bmp differ diff --git a/28/image/digitalWidth375.bmp b/28/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/28/image/digitalWidth375.bmp differ diff --git a/28/image/digitalWidth4.bmp b/28/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/28/image/digitalWidth4.bmp differ diff --git a/28/image/digitalWidth475.bmp b/28/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/28/image/digitalWidth475.bmp differ diff --git a/28/image/digitalWidth5.bmp b/28/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/28/image/digitalWidth5.bmp differ diff --git a/28/image/digitalWidth575.bmp b/28/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/28/image/digitalWidth575.bmp differ diff --git a/28/image/digitalWidth6.bmp b/28/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/28/image/digitalWidth6.bmp differ diff --git a/28/image/digitalWidth675.bmp b/28/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/28/image/digitalWidth675.bmp differ diff --git a/28/image/digitalWidth7.bmp b/28/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/28/image/digitalWidth7.bmp differ diff --git a/28/image/digitalWidth775.bmp b/28/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/28/image/digitalWidth775.bmp differ diff --git a/28/image/digitalWidth8.bmp b/28/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/28/image/digitalWidth8.bmp differ diff --git a/28/image/digitalWidth875.bmp b/28/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/28/image/digitalWidth875.bmp differ diff --git a/3/image/digitalWidth1.bmp b/3/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/3/image/digitalWidth1.bmp differ diff --git a/3/image/digitalWidth175.bmp b/3/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/3/image/digitalWidth175.bmp differ diff --git a/3/image/digitalWidth2.bmp b/3/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/3/image/digitalWidth2.bmp differ diff --git a/3/image/digitalWidth275.bmp b/3/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/3/image/digitalWidth275.bmp differ diff --git a/3/image/digitalWidth3.bmp b/3/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/3/image/digitalWidth3.bmp differ diff --git a/3/image/digitalWidth375.bmp b/3/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/3/image/digitalWidth375.bmp differ diff --git a/3/image/digitalWidth4.bmp b/3/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/3/image/digitalWidth4.bmp differ diff --git a/3/image/digitalWidth475.bmp b/3/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/3/image/digitalWidth475.bmp differ diff --git a/3/image/digitalWidth5.bmp b/3/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/3/image/digitalWidth5.bmp differ diff --git a/3/image/digitalWidth575.bmp b/3/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/3/image/digitalWidth575.bmp differ diff --git a/3/image/digitalWidth6.bmp b/3/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/3/image/digitalWidth6.bmp differ diff --git a/3/image/digitalWidth675.bmp b/3/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/3/image/digitalWidth675.bmp differ diff --git a/3/image/digitalWidth7.bmp b/3/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/3/image/digitalWidth7.bmp differ diff --git a/3/image/digitalWidth775.bmp b/3/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/3/image/digitalWidth775.bmp differ diff --git a/3/image/digitalWidth8.bmp b/3/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/3/image/digitalWidth8.bmp differ diff --git a/3/image/digitalWidth875.bmp b/3/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/3/image/digitalWidth875.bmp differ diff --git a/30/image/digitalWidth1.bmp b/30/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/30/image/digitalWidth1.bmp differ diff --git a/30/image/digitalWidth175.bmp b/30/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/30/image/digitalWidth175.bmp differ diff --git a/30/image/digitalWidth2.bmp b/30/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/30/image/digitalWidth2.bmp differ diff --git a/30/image/digitalWidth275.bmp b/30/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/30/image/digitalWidth275.bmp differ diff --git a/30/image/digitalWidth3.bmp b/30/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/30/image/digitalWidth3.bmp differ diff --git a/30/image/digitalWidth375.bmp b/30/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/30/image/digitalWidth375.bmp differ diff --git a/30/image/digitalWidth4.bmp b/30/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/30/image/digitalWidth4.bmp differ diff --git a/30/image/digitalWidth475.bmp b/30/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/30/image/digitalWidth475.bmp differ diff --git a/30/image/digitalWidth5.bmp b/30/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/30/image/digitalWidth5.bmp differ diff --git a/30/image/digitalWidth575.bmp b/30/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/30/image/digitalWidth575.bmp differ diff --git a/30/image/digitalWidth6.bmp b/30/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/30/image/digitalWidth6.bmp differ diff --git a/30/image/digitalWidth675.bmp b/30/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/30/image/digitalWidth675.bmp differ diff --git a/30/image/digitalWidth7.bmp b/30/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/30/image/digitalWidth7.bmp differ diff --git a/30/image/digitalWidth775.bmp b/30/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/30/image/digitalWidth775.bmp differ diff --git a/30/image/digitalWidth8.bmp b/30/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/30/image/digitalWidth8.bmp differ diff --git a/30/image/digitalWidth875.bmp b/30/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/30/image/digitalWidth875.bmp differ diff --git a/31/image/digitalWidth1.bmp b/31/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/31/image/digitalWidth1.bmp differ diff --git a/31/image/digitalWidth175.bmp b/31/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/31/image/digitalWidth175.bmp differ diff --git a/31/image/digitalWidth2.bmp b/31/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/31/image/digitalWidth2.bmp differ diff --git a/31/image/digitalWidth275.bmp b/31/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/31/image/digitalWidth275.bmp differ diff --git a/31/image/digitalWidth3.bmp b/31/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/31/image/digitalWidth3.bmp differ diff --git a/31/image/digitalWidth375.bmp b/31/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/31/image/digitalWidth375.bmp differ diff --git a/31/image/digitalWidth4.bmp b/31/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/31/image/digitalWidth4.bmp differ diff --git a/31/image/digitalWidth475.bmp b/31/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/31/image/digitalWidth475.bmp differ diff --git a/31/image/digitalWidth5.bmp b/31/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/31/image/digitalWidth5.bmp differ diff --git a/31/image/digitalWidth575.bmp b/31/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/31/image/digitalWidth575.bmp differ diff --git a/31/image/digitalWidth6.bmp b/31/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/31/image/digitalWidth6.bmp differ diff --git a/31/image/digitalWidth675.bmp b/31/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/31/image/digitalWidth675.bmp differ diff --git a/31/image/digitalWidth7.bmp b/31/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/31/image/digitalWidth7.bmp differ diff --git a/31/image/digitalWidth775.bmp b/31/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/31/image/digitalWidth775.bmp differ diff --git a/31/image/digitalWidth8.bmp b/31/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/31/image/digitalWidth8.bmp differ diff --git a/31/image/digitalWidth875.bmp b/31/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/31/image/digitalWidth875.bmp differ diff --git a/32/image/digitalWidth1.bmp b/32/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/32/image/digitalWidth1.bmp differ diff --git a/32/image/digitalWidth175.bmp b/32/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/32/image/digitalWidth175.bmp differ diff --git a/32/image/digitalWidth2.bmp b/32/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/32/image/digitalWidth2.bmp differ diff --git a/32/image/digitalWidth275.bmp b/32/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/32/image/digitalWidth275.bmp differ diff --git a/32/image/digitalWidth3.bmp b/32/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/32/image/digitalWidth3.bmp differ diff --git a/32/image/digitalWidth375.bmp b/32/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/32/image/digitalWidth375.bmp differ diff --git a/32/image/digitalWidth4.bmp b/32/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/32/image/digitalWidth4.bmp differ diff --git a/32/image/digitalWidth475.bmp b/32/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/32/image/digitalWidth475.bmp differ diff --git a/32/image/digitalWidth5.bmp b/32/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/32/image/digitalWidth5.bmp differ diff --git a/32/image/digitalWidth575.bmp b/32/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/32/image/digitalWidth575.bmp differ diff --git a/32/image/digitalWidth6.bmp b/32/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/32/image/digitalWidth6.bmp differ diff --git a/32/image/digitalWidth675.bmp b/32/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/32/image/digitalWidth675.bmp differ diff --git a/32/image/digitalWidth7.bmp b/32/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/32/image/digitalWidth7.bmp differ diff --git a/32/image/digitalWidth775.bmp b/32/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/32/image/digitalWidth775.bmp differ diff --git a/32/image/digitalWidth8.bmp b/32/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/32/image/digitalWidth8.bmp differ diff --git a/32/image/digitalWidth875.bmp b/32/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/32/image/digitalWidth875.bmp differ diff --git a/33/image/digitalWidth1.bmp b/33/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/33/image/digitalWidth1.bmp differ diff --git a/33/image/digitalWidth175.bmp b/33/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/33/image/digitalWidth175.bmp differ diff --git a/33/image/digitalWidth2.bmp b/33/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/33/image/digitalWidth2.bmp differ diff --git a/33/image/digitalWidth275.bmp b/33/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/33/image/digitalWidth275.bmp differ diff --git a/33/image/digitalWidth3.bmp b/33/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/33/image/digitalWidth3.bmp differ diff --git a/33/image/digitalWidth375.bmp b/33/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/33/image/digitalWidth375.bmp differ diff --git a/33/image/digitalWidth4.bmp b/33/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/33/image/digitalWidth4.bmp differ diff --git a/33/image/digitalWidth475.bmp b/33/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/33/image/digitalWidth475.bmp differ diff --git a/33/image/digitalWidth5.bmp b/33/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/33/image/digitalWidth5.bmp differ diff --git a/33/image/digitalWidth575.bmp b/33/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/33/image/digitalWidth575.bmp differ diff --git a/33/image/digitalWidth6.bmp b/33/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/33/image/digitalWidth6.bmp differ diff --git a/33/image/digitalWidth675.bmp b/33/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/33/image/digitalWidth675.bmp differ diff --git a/33/image/digitalWidth7.bmp b/33/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/33/image/digitalWidth7.bmp differ diff --git a/33/image/digitalWidth775.bmp b/33/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/33/image/digitalWidth775.bmp differ diff --git a/33/image/digitalWidth8.bmp b/33/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/33/image/digitalWidth8.bmp differ diff --git a/33/image/digitalWidth875.bmp b/33/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/33/image/digitalWidth875.bmp differ diff --git a/34/image/digitalWidth1.bmp b/34/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/34/image/digitalWidth1.bmp differ diff --git a/34/image/digitalWidth175.bmp b/34/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/34/image/digitalWidth175.bmp differ diff --git a/34/image/digitalWidth2.bmp b/34/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/34/image/digitalWidth2.bmp differ diff --git a/34/image/digitalWidth275.bmp b/34/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/34/image/digitalWidth275.bmp differ diff --git a/34/image/digitalWidth3.bmp b/34/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/34/image/digitalWidth3.bmp differ diff --git a/34/image/digitalWidth375.bmp b/34/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/34/image/digitalWidth375.bmp differ diff --git a/34/image/digitalWidth4.bmp b/34/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/34/image/digitalWidth4.bmp differ diff --git a/34/image/digitalWidth475.bmp b/34/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/34/image/digitalWidth475.bmp differ diff --git a/34/image/digitalWidth5.bmp b/34/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/34/image/digitalWidth5.bmp differ diff --git a/34/image/digitalWidth575.bmp b/34/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/34/image/digitalWidth575.bmp differ diff --git a/34/image/digitalWidth6.bmp b/34/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/34/image/digitalWidth6.bmp differ diff --git a/34/image/digitalWidth675.bmp b/34/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/34/image/digitalWidth675.bmp differ diff --git a/34/image/digitalWidth7.bmp b/34/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/34/image/digitalWidth7.bmp differ diff --git a/34/image/digitalWidth775.bmp b/34/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/34/image/digitalWidth775.bmp differ diff --git a/34/image/digitalWidth8.bmp b/34/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/34/image/digitalWidth8.bmp differ diff --git a/34/image/digitalWidth875.bmp b/34/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/34/image/digitalWidth875.bmp differ diff --git a/35/image/digitalWidth1.bmp b/35/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/35/image/digitalWidth1.bmp differ diff --git a/35/image/digitalWidth175.bmp b/35/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/35/image/digitalWidth175.bmp differ diff --git a/35/image/digitalWidth2.bmp b/35/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/35/image/digitalWidth2.bmp differ diff --git a/35/image/digitalWidth275.bmp b/35/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/35/image/digitalWidth275.bmp differ diff --git a/35/image/digitalWidth3.bmp b/35/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/35/image/digitalWidth3.bmp differ diff --git a/35/image/digitalWidth375.bmp b/35/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/35/image/digitalWidth375.bmp differ diff --git a/35/image/digitalWidth4.bmp b/35/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/35/image/digitalWidth4.bmp differ diff --git a/35/image/digitalWidth475.bmp b/35/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/35/image/digitalWidth475.bmp differ diff --git a/35/image/digitalWidth5.bmp b/35/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/35/image/digitalWidth5.bmp differ diff --git a/35/image/digitalWidth575.bmp b/35/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/35/image/digitalWidth575.bmp differ diff --git a/35/image/digitalWidth6.bmp b/35/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/35/image/digitalWidth6.bmp differ diff --git a/35/image/digitalWidth675.bmp b/35/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/35/image/digitalWidth675.bmp differ diff --git a/35/image/digitalWidth7.bmp b/35/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/35/image/digitalWidth7.bmp differ diff --git a/35/image/digitalWidth775.bmp b/35/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/35/image/digitalWidth775.bmp differ diff --git a/35/image/digitalWidth8.bmp b/35/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/35/image/digitalWidth8.bmp differ diff --git a/35/image/digitalWidth875.bmp b/35/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/35/image/digitalWidth875.bmp differ diff --git a/36/image/digitalWidth1.bmp b/36/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/36/image/digitalWidth1.bmp differ diff --git a/36/image/digitalWidth175.bmp b/36/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/36/image/digitalWidth175.bmp differ diff --git a/36/image/digitalWidth2.bmp b/36/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/36/image/digitalWidth2.bmp differ diff --git a/36/image/digitalWidth275.bmp b/36/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/36/image/digitalWidth275.bmp differ diff --git a/36/image/digitalWidth3.bmp b/36/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/36/image/digitalWidth3.bmp differ diff --git a/36/image/digitalWidth375.bmp b/36/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/36/image/digitalWidth375.bmp differ diff --git a/36/image/digitalWidth4.bmp b/36/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/36/image/digitalWidth4.bmp differ diff --git a/36/image/digitalWidth475.bmp b/36/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/36/image/digitalWidth475.bmp differ diff --git a/36/image/digitalWidth5.bmp b/36/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/36/image/digitalWidth5.bmp differ diff --git a/36/image/digitalWidth575.bmp b/36/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/36/image/digitalWidth575.bmp differ diff --git a/36/image/digitalWidth6.bmp b/36/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/36/image/digitalWidth6.bmp differ diff --git a/36/image/digitalWidth675.bmp b/36/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/36/image/digitalWidth675.bmp differ diff --git a/36/image/digitalWidth7.bmp b/36/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/36/image/digitalWidth7.bmp differ diff --git a/36/image/digitalWidth775.bmp b/36/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/36/image/digitalWidth775.bmp differ diff --git a/36/image/digitalWidth8.bmp b/36/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/36/image/digitalWidth8.bmp differ diff --git a/36/image/digitalWidth875.bmp b/36/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/36/image/digitalWidth875.bmp differ diff --git a/37/image/digitalWidth1.bmp b/37/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/37/image/digitalWidth1.bmp differ diff --git a/37/image/digitalWidth175.bmp b/37/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/37/image/digitalWidth175.bmp differ diff --git a/37/image/digitalWidth2.bmp b/37/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/37/image/digitalWidth2.bmp differ diff --git a/37/image/digitalWidth275.bmp b/37/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/37/image/digitalWidth275.bmp differ diff --git a/37/image/digitalWidth3.bmp b/37/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/37/image/digitalWidth3.bmp differ diff --git a/37/image/digitalWidth375.bmp b/37/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/37/image/digitalWidth375.bmp differ diff --git a/37/image/digitalWidth4.bmp b/37/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/37/image/digitalWidth4.bmp differ diff --git a/37/image/digitalWidth475.bmp b/37/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/37/image/digitalWidth475.bmp differ diff --git a/37/image/digitalWidth5.bmp b/37/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/37/image/digitalWidth5.bmp differ diff --git a/37/image/digitalWidth575.bmp b/37/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/37/image/digitalWidth575.bmp differ diff --git a/37/image/digitalWidth6.bmp b/37/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/37/image/digitalWidth6.bmp differ diff --git a/37/image/digitalWidth675.bmp b/37/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/37/image/digitalWidth675.bmp differ diff --git a/37/image/digitalWidth7.bmp b/37/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/37/image/digitalWidth7.bmp differ diff --git a/37/image/digitalWidth775.bmp b/37/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/37/image/digitalWidth775.bmp differ diff --git a/37/image/digitalWidth8.bmp b/37/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/37/image/digitalWidth8.bmp differ diff --git a/37/image/digitalWidth875.bmp b/37/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/37/image/digitalWidth875.bmp differ diff --git a/38/image/digitalWidth1.bmp b/38/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/38/image/digitalWidth1.bmp differ diff --git a/38/image/digitalWidth175.bmp b/38/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/38/image/digitalWidth175.bmp differ diff --git a/38/image/digitalWidth2.bmp b/38/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/38/image/digitalWidth2.bmp differ diff --git a/38/image/digitalWidth275.bmp b/38/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/38/image/digitalWidth275.bmp differ diff --git a/38/image/digitalWidth3.bmp b/38/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/38/image/digitalWidth3.bmp differ diff --git a/38/image/digitalWidth375.bmp b/38/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/38/image/digitalWidth375.bmp differ diff --git a/38/image/digitalWidth4.bmp b/38/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/38/image/digitalWidth4.bmp differ diff --git a/38/image/digitalWidth475.bmp b/38/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/38/image/digitalWidth475.bmp differ diff --git a/38/image/digitalWidth5.bmp b/38/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/38/image/digitalWidth5.bmp differ diff --git a/38/image/digitalWidth575.bmp b/38/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/38/image/digitalWidth575.bmp differ diff --git a/38/image/digitalWidth6.bmp b/38/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/38/image/digitalWidth6.bmp differ diff --git a/38/image/digitalWidth675.bmp b/38/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/38/image/digitalWidth675.bmp differ diff --git a/38/image/digitalWidth7.bmp b/38/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/38/image/digitalWidth7.bmp differ diff --git a/38/image/digitalWidth775.bmp b/38/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/38/image/digitalWidth775.bmp differ diff --git a/38/image/digitalWidth8.bmp b/38/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/38/image/digitalWidth8.bmp differ diff --git a/38/image/digitalWidth875.bmp b/38/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/38/image/digitalWidth875.bmp differ diff --git a/4/image/digitalWidth1.bmp b/4/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/4/image/digitalWidth1.bmp differ diff --git a/4/image/digitalWidth175.bmp b/4/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/4/image/digitalWidth175.bmp differ diff --git a/4/image/digitalWidth2.bmp b/4/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/4/image/digitalWidth2.bmp differ diff --git a/4/image/digitalWidth275.bmp b/4/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/4/image/digitalWidth275.bmp differ diff --git a/4/image/digitalWidth3.bmp b/4/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/4/image/digitalWidth3.bmp differ diff --git a/4/image/digitalWidth375.bmp b/4/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/4/image/digitalWidth375.bmp differ diff --git a/4/image/digitalWidth4.bmp b/4/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/4/image/digitalWidth4.bmp differ diff --git a/4/image/digitalWidth475.bmp b/4/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/4/image/digitalWidth475.bmp differ diff --git a/4/image/digitalWidth5.bmp b/4/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/4/image/digitalWidth5.bmp differ diff --git a/4/image/digitalWidth575.bmp b/4/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/4/image/digitalWidth575.bmp differ diff --git a/4/image/digitalWidth6.bmp b/4/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/4/image/digitalWidth6.bmp differ diff --git a/4/image/digitalWidth675.bmp b/4/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/4/image/digitalWidth675.bmp differ diff --git a/4/image/digitalWidth7.bmp b/4/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/4/image/digitalWidth7.bmp differ diff --git a/4/image/digitalWidth775.bmp b/4/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/4/image/digitalWidth775.bmp differ diff --git a/4/image/digitalWidth8.bmp b/4/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/4/image/digitalWidth8.bmp differ diff --git a/4/image/digitalWidth875.bmp b/4/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/4/image/digitalWidth875.bmp differ diff --git a/40/image/digitalWidth1.bmp b/40/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/40/image/digitalWidth1.bmp differ diff --git a/40/image/digitalWidth175.bmp b/40/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/40/image/digitalWidth175.bmp differ diff --git a/40/image/digitalWidth2.bmp b/40/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/40/image/digitalWidth2.bmp differ diff --git a/40/image/digitalWidth275.bmp b/40/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/40/image/digitalWidth275.bmp differ diff --git a/40/image/digitalWidth3.bmp b/40/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/40/image/digitalWidth3.bmp differ diff --git a/40/image/digitalWidth375.bmp b/40/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/40/image/digitalWidth375.bmp differ diff --git a/40/image/digitalWidth4.bmp b/40/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/40/image/digitalWidth4.bmp differ diff --git a/40/image/digitalWidth475.bmp b/40/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/40/image/digitalWidth475.bmp differ diff --git a/40/image/digitalWidth5.bmp b/40/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/40/image/digitalWidth5.bmp differ diff --git a/40/image/digitalWidth575.bmp b/40/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/40/image/digitalWidth575.bmp differ diff --git a/40/image/digitalWidth6.bmp b/40/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/40/image/digitalWidth6.bmp differ diff --git a/40/image/digitalWidth675.bmp b/40/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/40/image/digitalWidth675.bmp differ diff --git a/40/image/digitalWidth7.bmp b/40/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/40/image/digitalWidth7.bmp differ diff --git a/40/image/digitalWidth775.bmp b/40/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/40/image/digitalWidth775.bmp differ diff --git a/40/image/digitalWidth8.bmp b/40/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/40/image/digitalWidth8.bmp differ diff --git a/40/image/digitalWidth875.bmp b/40/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/40/image/digitalWidth875.bmp differ diff --git a/41/image/digitalWidth1.bmp b/41/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/41/image/digitalWidth1.bmp differ diff --git a/41/image/digitalWidth175.bmp b/41/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/41/image/digitalWidth175.bmp differ diff --git a/41/image/digitalWidth2.bmp b/41/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/41/image/digitalWidth2.bmp differ diff --git a/41/image/digitalWidth275.bmp b/41/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/41/image/digitalWidth275.bmp differ diff --git a/41/image/digitalWidth3.bmp b/41/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/41/image/digitalWidth3.bmp differ diff --git a/41/image/digitalWidth375.bmp b/41/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/41/image/digitalWidth375.bmp differ diff --git a/41/image/digitalWidth4.bmp b/41/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/41/image/digitalWidth4.bmp differ diff --git a/41/image/digitalWidth475.bmp b/41/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/41/image/digitalWidth475.bmp differ diff --git a/41/image/digitalWidth5.bmp b/41/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/41/image/digitalWidth5.bmp differ diff --git a/41/image/digitalWidth575.bmp b/41/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/41/image/digitalWidth575.bmp differ diff --git a/41/image/digitalWidth6.bmp b/41/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/41/image/digitalWidth6.bmp differ diff --git a/41/image/digitalWidth675.bmp b/41/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/41/image/digitalWidth675.bmp differ diff --git a/41/image/digitalWidth7.bmp b/41/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/41/image/digitalWidth7.bmp differ diff --git a/41/image/digitalWidth775.bmp b/41/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/41/image/digitalWidth775.bmp differ diff --git a/41/image/digitalWidth8.bmp b/41/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/41/image/digitalWidth8.bmp differ diff --git a/41/image/digitalWidth875.bmp b/41/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/41/image/digitalWidth875.bmp differ diff --git a/42/image/digitalWidth1.bmp b/42/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/42/image/digitalWidth1.bmp differ diff --git a/42/image/digitalWidth175.bmp b/42/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/42/image/digitalWidth175.bmp differ diff --git a/42/image/digitalWidth2.bmp b/42/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/42/image/digitalWidth2.bmp differ diff --git a/42/image/digitalWidth275.bmp b/42/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/42/image/digitalWidth275.bmp differ diff --git a/42/image/digitalWidth3.bmp b/42/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/42/image/digitalWidth3.bmp differ diff --git a/42/image/digitalWidth375.bmp b/42/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/42/image/digitalWidth375.bmp differ diff --git a/42/image/digitalWidth4.bmp b/42/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/42/image/digitalWidth4.bmp differ diff --git a/42/image/digitalWidth475.bmp b/42/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/42/image/digitalWidth475.bmp differ diff --git a/42/image/digitalWidth5.bmp b/42/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/42/image/digitalWidth5.bmp differ diff --git a/42/image/digitalWidth575.bmp b/42/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/42/image/digitalWidth575.bmp differ diff --git a/42/image/digitalWidth6.bmp b/42/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/42/image/digitalWidth6.bmp differ diff --git a/42/image/digitalWidth675.bmp b/42/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/42/image/digitalWidth675.bmp differ diff --git a/42/image/digitalWidth7.bmp b/42/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/42/image/digitalWidth7.bmp differ diff --git a/42/image/digitalWidth775.bmp b/42/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/42/image/digitalWidth775.bmp differ diff --git a/42/image/digitalWidth8.bmp b/42/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/42/image/digitalWidth8.bmp differ diff --git a/42/image/digitalWidth875.bmp b/42/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/42/image/digitalWidth875.bmp differ diff --git a/43/image/digitalWidth1.bmp b/43/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/43/image/digitalWidth1.bmp differ diff --git a/43/image/digitalWidth175.bmp b/43/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/43/image/digitalWidth175.bmp differ diff --git a/43/image/digitalWidth2.bmp b/43/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/43/image/digitalWidth2.bmp differ diff --git a/43/image/digitalWidth275.bmp b/43/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/43/image/digitalWidth275.bmp differ diff --git a/43/image/digitalWidth3.bmp b/43/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/43/image/digitalWidth3.bmp differ diff --git a/43/image/digitalWidth375.bmp b/43/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/43/image/digitalWidth375.bmp differ diff --git a/43/image/digitalWidth4.bmp b/43/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/43/image/digitalWidth4.bmp differ diff --git a/43/image/digitalWidth475.bmp b/43/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/43/image/digitalWidth475.bmp differ diff --git a/43/image/digitalWidth5.bmp b/43/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/43/image/digitalWidth5.bmp differ diff --git a/43/image/digitalWidth575.bmp b/43/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/43/image/digitalWidth575.bmp differ diff --git a/43/image/digitalWidth6.bmp b/43/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/43/image/digitalWidth6.bmp differ diff --git a/43/image/digitalWidth675.bmp b/43/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/43/image/digitalWidth675.bmp differ diff --git a/43/image/digitalWidth7.bmp b/43/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/43/image/digitalWidth7.bmp differ diff --git a/43/image/digitalWidth775.bmp b/43/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/43/image/digitalWidth775.bmp differ diff --git a/43/image/digitalWidth8.bmp b/43/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/43/image/digitalWidth8.bmp differ diff --git a/43/image/digitalWidth875.bmp b/43/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/43/image/digitalWidth875.bmp differ diff --git a/44/image/digitalWidth1.bmp b/44/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/44/image/digitalWidth1.bmp differ diff --git a/44/image/digitalWidth175.bmp b/44/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/44/image/digitalWidth175.bmp differ diff --git a/44/image/digitalWidth2.bmp b/44/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/44/image/digitalWidth2.bmp differ diff --git a/44/image/digitalWidth275.bmp b/44/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/44/image/digitalWidth275.bmp differ diff --git a/44/image/digitalWidth3.bmp b/44/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/44/image/digitalWidth3.bmp differ diff --git a/44/image/digitalWidth375.bmp b/44/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/44/image/digitalWidth375.bmp differ diff --git a/44/image/digitalWidth4.bmp b/44/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/44/image/digitalWidth4.bmp differ diff --git a/44/image/digitalWidth475.bmp b/44/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/44/image/digitalWidth475.bmp differ diff --git a/44/image/digitalWidth5.bmp b/44/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/44/image/digitalWidth5.bmp differ diff --git a/44/image/digitalWidth575.bmp b/44/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/44/image/digitalWidth575.bmp differ diff --git a/44/image/digitalWidth6.bmp b/44/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/44/image/digitalWidth6.bmp differ diff --git a/44/image/digitalWidth675.bmp b/44/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/44/image/digitalWidth675.bmp differ diff --git a/44/image/digitalWidth7.bmp b/44/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/44/image/digitalWidth7.bmp differ diff --git a/44/image/digitalWidth775.bmp b/44/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/44/image/digitalWidth775.bmp differ diff --git a/44/image/digitalWidth8.bmp b/44/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/44/image/digitalWidth8.bmp differ diff --git a/44/image/digitalWidth875.bmp b/44/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/44/image/digitalWidth875.bmp differ diff --git a/45/image/digitalWidth1.bmp b/45/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/45/image/digitalWidth1.bmp differ diff --git a/45/image/digitalWidth175.bmp b/45/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/45/image/digitalWidth175.bmp differ diff --git a/45/image/digitalWidth2.bmp b/45/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/45/image/digitalWidth2.bmp differ diff --git a/45/image/digitalWidth275.bmp b/45/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/45/image/digitalWidth275.bmp differ diff --git a/45/image/digitalWidth3.bmp b/45/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/45/image/digitalWidth3.bmp differ diff --git a/45/image/digitalWidth375.bmp b/45/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/45/image/digitalWidth375.bmp differ diff --git a/45/image/digitalWidth4.bmp b/45/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/45/image/digitalWidth4.bmp differ diff --git a/45/image/digitalWidth475.bmp b/45/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/45/image/digitalWidth475.bmp differ diff --git a/45/image/digitalWidth5.bmp b/45/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/45/image/digitalWidth5.bmp differ diff --git a/45/image/digitalWidth575.bmp b/45/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/45/image/digitalWidth575.bmp differ diff --git a/45/image/digitalWidth6.bmp b/45/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/45/image/digitalWidth6.bmp differ diff --git a/45/image/digitalWidth675.bmp b/45/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/45/image/digitalWidth675.bmp differ diff --git a/45/image/digitalWidth7.bmp b/45/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/45/image/digitalWidth7.bmp differ diff --git a/45/image/digitalWidth775.bmp b/45/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/45/image/digitalWidth775.bmp differ diff --git a/45/image/digitalWidth8.bmp b/45/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/45/image/digitalWidth8.bmp differ diff --git a/45/image/digitalWidth875.bmp b/45/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/45/image/digitalWidth875.bmp differ diff --git a/46/image/digitalWidth1.bmp b/46/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/46/image/digitalWidth1.bmp differ diff --git a/46/image/digitalWidth175.bmp b/46/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/46/image/digitalWidth175.bmp differ diff --git a/46/image/digitalWidth2.bmp b/46/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/46/image/digitalWidth2.bmp differ diff --git a/46/image/digitalWidth275.bmp b/46/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/46/image/digitalWidth275.bmp differ diff --git a/46/image/digitalWidth3.bmp b/46/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/46/image/digitalWidth3.bmp differ diff --git a/46/image/digitalWidth375.bmp b/46/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/46/image/digitalWidth375.bmp differ diff --git a/46/image/digitalWidth4.bmp b/46/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/46/image/digitalWidth4.bmp differ diff --git a/46/image/digitalWidth475.bmp b/46/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/46/image/digitalWidth475.bmp differ diff --git a/46/image/digitalWidth5.bmp b/46/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/46/image/digitalWidth5.bmp differ diff --git a/46/image/digitalWidth575.bmp b/46/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/46/image/digitalWidth575.bmp differ diff --git a/46/image/digitalWidth6.bmp b/46/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/46/image/digitalWidth6.bmp differ diff --git a/46/image/digitalWidth675.bmp b/46/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/46/image/digitalWidth675.bmp differ diff --git a/46/image/digitalWidth7.bmp b/46/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/46/image/digitalWidth7.bmp differ diff --git a/46/image/digitalWidth775.bmp b/46/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/46/image/digitalWidth775.bmp differ diff --git a/46/image/digitalWidth8.bmp b/46/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/46/image/digitalWidth8.bmp differ diff --git a/46/image/digitalWidth875.bmp b/46/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/46/image/digitalWidth875.bmp differ diff --git a/47/image (复件)/digitalWidth1.bmp b/47/image (复件)/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/47/image (复件)/digitalWidth1.bmp differ diff --git a/47/image (复件)/digitalWidth175.bmp b/47/image (复件)/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/47/image (复件)/digitalWidth175.bmp differ diff --git a/47/image (复件)/digitalWidth2.bmp b/47/image (复件)/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/47/image (复件)/digitalWidth2.bmp differ diff --git a/47/image (复件)/digitalWidth275.bmp b/47/image (复件)/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/47/image (复件)/digitalWidth275.bmp differ diff --git a/47/image (复件)/digitalWidth3.bmp b/47/image (复件)/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/47/image (复件)/digitalWidth3.bmp differ diff --git a/47/image (复件)/digitalWidth375.bmp b/47/image (复件)/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/47/image (复件)/digitalWidth375.bmp differ diff --git a/47/image (复件)/digitalWidth4.bmp b/47/image (复件)/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/47/image (复件)/digitalWidth4.bmp differ diff --git a/47/image (复件)/digitalWidth475.bmp b/47/image (复件)/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/47/image (复件)/digitalWidth475.bmp differ diff --git a/47/image (复件)/digitalWidth5.bmp b/47/image (复件)/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/47/image (复件)/digitalWidth5.bmp differ diff --git a/47/image (复件)/digitalWidth575.bmp b/47/image (复件)/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/47/image (复件)/digitalWidth575.bmp differ diff --git a/47/image (复件)/digitalWidth6.bmp b/47/image (复件)/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/47/image (复件)/digitalWidth6.bmp differ diff --git a/47/image (复件)/digitalWidth675.bmp b/47/image (复件)/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/47/image (复件)/digitalWidth675.bmp differ diff --git a/47/image (复件)/digitalWidth7.bmp b/47/image (复件)/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/47/image (复件)/digitalWidth7.bmp differ diff --git a/47/image (复件)/digitalWidth775.bmp b/47/image (复件)/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/47/image (复件)/digitalWidth775.bmp differ diff --git a/47/image (复件)/digitalWidth8.bmp b/47/image (复件)/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/47/image (复件)/digitalWidth8.bmp differ diff --git a/47/image (复件)/digitalWidth875.bmp b/47/image (复件)/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/47/image (复件)/digitalWidth875.bmp differ diff --git a/47/image.tar.gz b/47/image.tar.gz new file mode 100644 index 0000000..953eecb Binary files /dev/null and b/47/image.tar.gz differ diff --git a/47/image/digitalWidth1.bmp b/47/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/47/image/digitalWidth1.bmp differ diff --git a/47/image/digitalWidth175.bmp b/47/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/47/image/digitalWidth175.bmp differ diff --git a/47/image/digitalWidth2.bmp b/47/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/47/image/digitalWidth2.bmp differ diff --git a/47/image/digitalWidth275.bmp b/47/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/47/image/digitalWidth275.bmp differ diff --git a/47/image/digitalWidth3.bmp b/47/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/47/image/digitalWidth3.bmp differ diff --git a/47/image/digitalWidth375.bmp b/47/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/47/image/digitalWidth375.bmp differ diff --git a/47/image/digitalWidth4.bmp b/47/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/47/image/digitalWidth4.bmp differ diff --git a/47/image/digitalWidth475.bmp b/47/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/47/image/digitalWidth475.bmp differ diff --git a/47/image/digitalWidth5.bmp b/47/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/47/image/digitalWidth5.bmp differ diff --git a/47/image/digitalWidth575.bmp b/47/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/47/image/digitalWidth575.bmp differ diff --git a/47/image/digitalWidth6.bmp b/47/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/47/image/digitalWidth6.bmp differ diff --git a/47/image/digitalWidth675.bmp b/47/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/47/image/digitalWidth675.bmp differ diff --git a/47/image/digitalWidth7.bmp b/47/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/47/image/digitalWidth7.bmp differ diff --git a/47/image/digitalWidth775.bmp b/47/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/47/image/digitalWidth775.bmp differ diff --git a/47/image/digitalWidth8.bmp b/47/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/47/image/digitalWidth8.bmp differ diff --git a/47/image/digitalWidth875.bmp b/47/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/47/image/digitalWidth875.bmp differ diff --git a/48/image/digitalWidth1.bmp b/48/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/48/image/digitalWidth1.bmp differ diff --git a/48/image/digitalWidth175.bmp b/48/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/48/image/digitalWidth175.bmp differ diff --git a/48/image/digitalWidth2.bmp b/48/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/48/image/digitalWidth2.bmp differ diff --git a/48/image/digitalWidth275.bmp b/48/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/48/image/digitalWidth275.bmp differ diff --git a/48/image/digitalWidth3.bmp b/48/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/48/image/digitalWidth3.bmp differ diff --git a/48/image/digitalWidth375.bmp b/48/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/48/image/digitalWidth375.bmp differ diff --git a/48/image/digitalWidth4.bmp b/48/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/48/image/digitalWidth4.bmp differ diff --git a/48/image/digitalWidth475.bmp b/48/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/48/image/digitalWidth475.bmp differ diff --git a/48/image/digitalWidth5.bmp b/48/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/48/image/digitalWidth5.bmp differ diff --git a/48/image/digitalWidth575.bmp b/48/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/48/image/digitalWidth575.bmp differ diff --git a/48/image/digitalWidth6.bmp b/48/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/48/image/digitalWidth6.bmp differ diff --git a/48/image/digitalWidth675.bmp b/48/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/48/image/digitalWidth675.bmp differ diff --git a/48/image/digitalWidth7.bmp b/48/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/48/image/digitalWidth7.bmp differ diff --git a/48/image/digitalWidth775.bmp b/48/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/48/image/digitalWidth775.bmp differ diff --git a/48/image/digitalWidth8.bmp b/48/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/48/image/digitalWidth8.bmp differ diff --git a/48/image/digitalWidth875.bmp b/48/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/48/image/digitalWidth875.bmp differ diff --git a/5/image/digitalWidth1.bmp b/5/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/5/image/digitalWidth1.bmp differ diff --git a/5/image/digitalWidth175.bmp b/5/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/5/image/digitalWidth175.bmp differ diff --git a/5/image/digitalWidth2.bmp b/5/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/5/image/digitalWidth2.bmp differ diff --git a/5/image/digitalWidth275.bmp b/5/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/5/image/digitalWidth275.bmp differ diff --git a/5/image/digitalWidth3.bmp b/5/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/5/image/digitalWidth3.bmp differ diff --git a/5/image/digitalWidth375.bmp b/5/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/5/image/digitalWidth375.bmp differ diff --git a/5/image/digitalWidth4.bmp b/5/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/5/image/digitalWidth4.bmp differ diff --git a/5/image/digitalWidth475.bmp b/5/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/5/image/digitalWidth475.bmp differ diff --git a/5/image/digitalWidth5.bmp b/5/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/5/image/digitalWidth5.bmp differ diff --git a/5/image/digitalWidth575.bmp b/5/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/5/image/digitalWidth575.bmp differ diff --git a/5/image/digitalWidth6.bmp b/5/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/5/image/digitalWidth6.bmp differ diff --git a/5/image/digitalWidth675.bmp b/5/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/5/image/digitalWidth675.bmp differ diff --git a/5/image/digitalWidth7.bmp b/5/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/5/image/digitalWidth7.bmp differ diff --git a/5/image/digitalWidth775.bmp b/5/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/5/image/digitalWidth775.bmp differ diff --git a/5/image/digitalWidth8.bmp b/5/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/5/image/digitalWidth8.bmp differ diff --git a/5/image/digitalWidth875.bmp b/5/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/5/image/digitalWidth875.bmp differ diff --git a/50/image/digitalWidth1.bmp b/50/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/50/image/digitalWidth1.bmp differ diff --git a/50/image/digitalWidth175.bmp b/50/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/50/image/digitalWidth175.bmp differ diff --git a/50/image/digitalWidth2.bmp b/50/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/50/image/digitalWidth2.bmp differ diff --git a/50/image/digitalWidth275.bmp b/50/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/50/image/digitalWidth275.bmp differ diff --git a/50/image/digitalWidth3.bmp b/50/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/50/image/digitalWidth3.bmp differ diff --git a/50/image/digitalWidth375.bmp b/50/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/50/image/digitalWidth375.bmp differ diff --git a/50/image/digitalWidth4.bmp b/50/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/50/image/digitalWidth4.bmp differ diff --git a/50/image/digitalWidth475.bmp b/50/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/50/image/digitalWidth475.bmp differ diff --git a/50/image/digitalWidth5.bmp b/50/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/50/image/digitalWidth5.bmp differ diff --git a/50/image/digitalWidth575.bmp b/50/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/50/image/digitalWidth575.bmp differ diff --git a/50/image/digitalWidth6.bmp b/50/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/50/image/digitalWidth6.bmp differ diff --git a/50/image/digitalWidth675.bmp b/50/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/50/image/digitalWidth675.bmp differ diff --git a/50/image/digitalWidth7.bmp b/50/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/50/image/digitalWidth7.bmp differ diff --git a/50/image/digitalWidth775.bmp b/50/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/50/image/digitalWidth775.bmp differ diff --git a/50/image/digitalWidth8.bmp b/50/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/50/image/digitalWidth8.bmp differ diff --git a/50/image/digitalWidth875.bmp b/50/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/50/image/digitalWidth875.bmp differ diff --git a/51/image/digitalWidth1.bmp b/51/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/51/image/digitalWidth1.bmp differ diff --git a/51/image/digitalWidth175.bmp b/51/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/51/image/digitalWidth175.bmp differ diff --git a/51/image/digitalWidth2.bmp b/51/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/51/image/digitalWidth2.bmp differ diff --git a/51/image/digitalWidth275.bmp b/51/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/51/image/digitalWidth275.bmp differ diff --git a/51/image/digitalWidth3.bmp b/51/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/51/image/digitalWidth3.bmp differ diff --git a/51/image/digitalWidth375.bmp b/51/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/51/image/digitalWidth375.bmp differ diff --git a/51/image/digitalWidth4.bmp b/51/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/51/image/digitalWidth4.bmp differ diff --git a/51/image/digitalWidth475.bmp b/51/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/51/image/digitalWidth475.bmp differ diff --git a/51/image/digitalWidth5.bmp b/51/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/51/image/digitalWidth5.bmp differ diff --git a/51/image/digitalWidth575.bmp b/51/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/51/image/digitalWidth575.bmp differ diff --git a/51/image/digitalWidth6.bmp b/51/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/51/image/digitalWidth6.bmp differ diff --git a/51/image/digitalWidth675.bmp b/51/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/51/image/digitalWidth675.bmp differ diff --git a/51/image/digitalWidth7.bmp b/51/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/51/image/digitalWidth7.bmp differ diff --git a/51/image/digitalWidth775.bmp b/51/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/51/image/digitalWidth775.bmp differ diff --git a/51/image/digitalWidth8.bmp b/51/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/51/image/digitalWidth8.bmp differ diff --git a/51/image/digitalWidth875.bmp b/51/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/51/image/digitalWidth875.bmp differ diff --git a/52/image/digitalWidth1.bmp b/52/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/52/image/digitalWidth1.bmp differ diff --git a/52/image/digitalWidth175.bmp b/52/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/52/image/digitalWidth175.bmp differ diff --git a/52/image/digitalWidth2.bmp b/52/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/52/image/digitalWidth2.bmp differ diff --git a/52/image/digitalWidth275.bmp b/52/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/52/image/digitalWidth275.bmp differ diff --git a/52/image/digitalWidth3.bmp b/52/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/52/image/digitalWidth3.bmp differ diff --git a/52/image/digitalWidth375.bmp b/52/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/52/image/digitalWidth375.bmp differ diff --git a/52/image/digitalWidth4.bmp b/52/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/52/image/digitalWidth4.bmp differ diff --git a/52/image/digitalWidth475.bmp b/52/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/52/image/digitalWidth475.bmp differ diff --git a/52/image/digitalWidth5.bmp b/52/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/52/image/digitalWidth5.bmp differ diff --git a/52/image/digitalWidth575.bmp b/52/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/52/image/digitalWidth575.bmp differ diff --git a/52/image/digitalWidth6.bmp b/52/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/52/image/digitalWidth6.bmp differ diff --git a/52/image/digitalWidth675.bmp b/52/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/52/image/digitalWidth675.bmp differ diff --git a/52/image/digitalWidth7.bmp b/52/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/52/image/digitalWidth7.bmp differ diff --git a/52/image/digitalWidth775.bmp b/52/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/52/image/digitalWidth775.bmp differ diff --git a/52/image/digitalWidth8.bmp b/52/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/52/image/digitalWidth8.bmp differ diff --git a/52/image/digitalWidth875.bmp b/52/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/52/image/digitalWidth875.bmp differ diff --git a/53/image/digitalWidth1.bmp b/53/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/53/image/digitalWidth1.bmp differ diff --git a/53/image/digitalWidth175.bmp b/53/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/53/image/digitalWidth175.bmp differ diff --git a/53/image/digitalWidth2.bmp b/53/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/53/image/digitalWidth2.bmp differ diff --git a/53/image/digitalWidth275.bmp b/53/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/53/image/digitalWidth275.bmp differ diff --git a/53/image/digitalWidth3.bmp b/53/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/53/image/digitalWidth3.bmp differ diff --git a/53/image/digitalWidth375.bmp b/53/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/53/image/digitalWidth375.bmp differ diff --git a/53/image/digitalWidth4.bmp b/53/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/53/image/digitalWidth4.bmp differ diff --git a/53/image/digitalWidth475.bmp b/53/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/53/image/digitalWidth475.bmp differ diff --git a/53/image/digitalWidth5.bmp b/53/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/53/image/digitalWidth5.bmp differ diff --git a/53/image/digitalWidth575.bmp b/53/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/53/image/digitalWidth575.bmp differ diff --git a/53/image/digitalWidth6.bmp b/53/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/53/image/digitalWidth6.bmp differ diff --git a/53/image/digitalWidth675.bmp b/53/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/53/image/digitalWidth675.bmp differ diff --git a/53/image/digitalWidth7.bmp b/53/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/53/image/digitalWidth7.bmp differ diff --git a/53/image/digitalWidth775.bmp b/53/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/53/image/digitalWidth775.bmp differ diff --git a/53/image/digitalWidth8.bmp b/53/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/53/image/digitalWidth8.bmp differ diff --git a/53/image/digitalWidth875.bmp b/53/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/53/image/digitalWidth875.bmp differ diff --git a/54/image/digitalWidth1.bmp b/54/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/54/image/digitalWidth1.bmp differ diff --git a/54/image/digitalWidth175.bmp b/54/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/54/image/digitalWidth175.bmp differ diff --git a/54/image/digitalWidth2.bmp b/54/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/54/image/digitalWidth2.bmp differ diff --git a/54/image/digitalWidth275.bmp b/54/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/54/image/digitalWidth275.bmp differ diff --git a/54/image/digitalWidth3.bmp b/54/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/54/image/digitalWidth3.bmp differ diff --git a/54/image/digitalWidth375.bmp b/54/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/54/image/digitalWidth375.bmp differ diff --git a/54/image/digitalWidth4.bmp b/54/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/54/image/digitalWidth4.bmp differ diff --git a/54/image/digitalWidth475.bmp b/54/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/54/image/digitalWidth475.bmp differ diff --git a/54/image/digitalWidth5.bmp b/54/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/54/image/digitalWidth5.bmp differ diff --git a/54/image/digitalWidth575.bmp b/54/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/54/image/digitalWidth575.bmp differ diff --git a/54/image/digitalWidth6.bmp b/54/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/54/image/digitalWidth6.bmp differ diff --git a/54/image/digitalWidth675.bmp b/54/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/54/image/digitalWidth675.bmp differ diff --git a/54/image/digitalWidth7.bmp b/54/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/54/image/digitalWidth7.bmp differ diff --git a/54/image/digitalWidth775.bmp b/54/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/54/image/digitalWidth775.bmp differ diff --git a/54/image/digitalWidth8.bmp b/54/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/54/image/digitalWidth8.bmp differ diff --git a/54/image/digitalWidth875.bmp b/54/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/54/image/digitalWidth875.bmp differ diff --git a/55/image/digitalWidth1.bmp b/55/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/55/image/digitalWidth1.bmp differ diff --git a/55/image/digitalWidth175.bmp b/55/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/55/image/digitalWidth175.bmp differ diff --git a/55/image/digitalWidth2.bmp b/55/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/55/image/digitalWidth2.bmp differ diff --git a/55/image/digitalWidth275.bmp b/55/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/55/image/digitalWidth275.bmp differ diff --git a/55/image/digitalWidth3.bmp b/55/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/55/image/digitalWidth3.bmp differ diff --git a/55/image/digitalWidth375.bmp b/55/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/55/image/digitalWidth375.bmp differ diff --git a/55/image/digitalWidth4.bmp b/55/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/55/image/digitalWidth4.bmp differ diff --git a/55/image/digitalWidth475.bmp b/55/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/55/image/digitalWidth475.bmp differ diff --git a/55/image/digitalWidth5.bmp b/55/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/55/image/digitalWidth5.bmp differ diff --git a/55/image/digitalWidth575.bmp b/55/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/55/image/digitalWidth575.bmp differ diff --git a/55/image/digitalWidth6.bmp b/55/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/55/image/digitalWidth6.bmp differ diff --git a/55/image/digitalWidth675.bmp b/55/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/55/image/digitalWidth675.bmp differ diff --git a/55/image/digitalWidth7.bmp b/55/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/55/image/digitalWidth7.bmp differ diff --git a/55/image/digitalWidth775.bmp b/55/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/55/image/digitalWidth775.bmp differ diff --git a/55/image/digitalWidth8.bmp b/55/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/55/image/digitalWidth8.bmp differ diff --git a/55/image/digitalWidth875.bmp b/55/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/55/image/digitalWidth875.bmp differ diff --git a/56/image/digitalWidth1.bmp b/56/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/56/image/digitalWidth1.bmp differ diff --git a/56/image/digitalWidth175.bmp b/56/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/56/image/digitalWidth175.bmp differ diff --git a/56/image/digitalWidth2.bmp b/56/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/56/image/digitalWidth2.bmp differ diff --git a/56/image/digitalWidth275.bmp b/56/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/56/image/digitalWidth275.bmp differ diff --git a/56/image/digitalWidth3.bmp b/56/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/56/image/digitalWidth3.bmp differ diff --git a/56/image/digitalWidth375.bmp b/56/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/56/image/digitalWidth375.bmp differ diff --git a/56/image/digitalWidth4.bmp b/56/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/56/image/digitalWidth4.bmp differ diff --git a/56/image/digitalWidth475.bmp b/56/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/56/image/digitalWidth475.bmp differ diff --git a/56/image/digitalWidth5.bmp b/56/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/56/image/digitalWidth5.bmp differ diff --git a/56/image/digitalWidth575.bmp b/56/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/56/image/digitalWidth575.bmp differ diff --git a/56/image/digitalWidth6.bmp b/56/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/56/image/digitalWidth6.bmp differ diff --git a/56/image/digitalWidth675.bmp b/56/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/56/image/digitalWidth675.bmp differ diff --git a/56/image/digitalWidth7.bmp b/56/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/56/image/digitalWidth7.bmp differ diff --git a/56/image/digitalWidth775.bmp b/56/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/56/image/digitalWidth775.bmp differ diff --git a/56/image/digitalWidth8.bmp b/56/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/56/image/digitalWidth8.bmp differ diff --git a/56/image/digitalWidth875.bmp b/56/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/56/image/digitalWidth875.bmp differ diff --git a/57/image (复件)/digitalWidth1.bmp b/57/image (复件)/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/57/image (复件)/digitalWidth1.bmp differ diff --git a/57/image (复件)/digitalWidth175.bmp b/57/image (复件)/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/57/image (复件)/digitalWidth175.bmp differ diff --git a/57/image (复件)/digitalWidth2.bmp b/57/image (复件)/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/57/image (复件)/digitalWidth2.bmp differ diff --git a/57/image (复件)/digitalWidth275.bmp b/57/image (复件)/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/57/image (复件)/digitalWidth275.bmp differ diff --git a/57/image (复件)/digitalWidth3.bmp b/57/image (复件)/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/57/image (复件)/digitalWidth3.bmp differ diff --git a/57/image (复件)/digitalWidth375.bmp b/57/image (复件)/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/57/image (复件)/digitalWidth375.bmp differ diff --git a/57/image (复件)/digitalWidth4.bmp b/57/image (复件)/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/57/image (复件)/digitalWidth4.bmp differ diff --git a/57/image (复件)/digitalWidth475.bmp b/57/image (复件)/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/57/image (复件)/digitalWidth475.bmp differ diff --git a/57/image (复件)/digitalWidth5.bmp b/57/image (复件)/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/57/image (复件)/digitalWidth5.bmp differ diff --git a/57/image (复件)/digitalWidth575.bmp b/57/image (复件)/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/57/image (复件)/digitalWidth575.bmp differ diff --git a/57/image (复件)/digitalWidth6.bmp b/57/image (复件)/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/57/image (复件)/digitalWidth6.bmp differ diff --git a/57/image (复件)/digitalWidth675.bmp b/57/image (复件)/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/57/image (复件)/digitalWidth675.bmp differ diff --git a/57/image (复件)/digitalWidth7.bmp b/57/image (复件)/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/57/image (复件)/digitalWidth7.bmp differ diff --git a/57/image (复件)/digitalWidth775.bmp b/57/image (复件)/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/57/image (复件)/digitalWidth775.bmp differ diff --git a/57/image (复件)/digitalWidth8.bmp b/57/image (复件)/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/57/image (复件)/digitalWidth8.bmp differ diff --git a/57/image (复件)/digitalWidth875.bmp b/57/image (复件)/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/57/image (复件)/digitalWidth875.bmp differ diff --git a/57/image.tar.gz b/57/image.tar.gz new file mode 100644 index 0000000..953eecb Binary files /dev/null and b/57/image.tar.gz differ diff --git a/57/image/digitalWidth1.bmp b/57/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/57/image/digitalWidth1.bmp differ diff --git a/57/image/digitalWidth175.bmp b/57/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/57/image/digitalWidth175.bmp differ diff --git a/57/image/digitalWidth2.bmp b/57/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/57/image/digitalWidth2.bmp differ diff --git a/57/image/digitalWidth275.bmp b/57/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/57/image/digitalWidth275.bmp differ diff --git a/57/image/digitalWidth3.bmp b/57/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/57/image/digitalWidth3.bmp differ diff --git a/57/image/digitalWidth375.bmp b/57/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/57/image/digitalWidth375.bmp differ diff --git a/57/image/digitalWidth4.bmp b/57/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/57/image/digitalWidth4.bmp differ diff --git a/57/image/digitalWidth475.bmp b/57/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/57/image/digitalWidth475.bmp differ diff --git a/57/image/digitalWidth5.bmp b/57/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/57/image/digitalWidth5.bmp differ diff --git a/57/image/digitalWidth575.bmp b/57/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/57/image/digitalWidth575.bmp differ diff --git a/57/image/digitalWidth6.bmp b/57/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/57/image/digitalWidth6.bmp differ diff --git a/57/image/digitalWidth675.bmp b/57/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/57/image/digitalWidth675.bmp differ diff --git a/57/image/digitalWidth7.bmp b/57/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/57/image/digitalWidth7.bmp differ diff --git a/57/image/digitalWidth775.bmp b/57/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/57/image/digitalWidth775.bmp differ diff --git a/57/image/digitalWidth8.bmp b/57/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/57/image/digitalWidth8.bmp differ diff --git a/57/image/digitalWidth875.bmp b/57/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/57/image/digitalWidth875.bmp differ diff --git a/58/image/digitalWidth1.bmp b/58/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/58/image/digitalWidth1.bmp differ diff --git a/58/image/digitalWidth175.bmp b/58/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/58/image/digitalWidth175.bmp differ diff --git a/58/image/digitalWidth2.bmp b/58/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/58/image/digitalWidth2.bmp differ diff --git a/58/image/digitalWidth275.bmp b/58/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/58/image/digitalWidth275.bmp differ diff --git a/58/image/digitalWidth3.bmp b/58/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/58/image/digitalWidth3.bmp differ diff --git a/58/image/digitalWidth375.bmp b/58/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/58/image/digitalWidth375.bmp differ diff --git a/58/image/digitalWidth4.bmp b/58/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/58/image/digitalWidth4.bmp differ diff --git a/58/image/digitalWidth475.bmp b/58/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/58/image/digitalWidth475.bmp differ diff --git a/58/image/digitalWidth5.bmp b/58/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/58/image/digitalWidth5.bmp differ diff --git a/58/image/digitalWidth575.bmp b/58/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/58/image/digitalWidth575.bmp differ diff --git a/58/image/digitalWidth6.bmp b/58/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/58/image/digitalWidth6.bmp differ diff --git a/58/image/digitalWidth675.bmp b/58/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/58/image/digitalWidth675.bmp differ diff --git a/58/image/digitalWidth7.bmp b/58/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/58/image/digitalWidth7.bmp differ diff --git a/58/image/digitalWidth775.bmp b/58/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/58/image/digitalWidth775.bmp differ diff --git a/58/image/digitalWidth8.bmp b/58/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/58/image/digitalWidth8.bmp differ diff --git a/58/image/digitalWidth875.bmp b/58/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/58/image/digitalWidth875.bmp differ diff --git a/6/image/digitalWidth1.bmp b/6/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/6/image/digitalWidth1.bmp differ diff --git a/6/image/digitalWidth175.bmp b/6/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/6/image/digitalWidth175.bmp differ diff --git a/6/image/digitalWidth2.bmp b/6/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/6/image/digitalWidth2.bmp differ diff --git a/6/image/digitalWidth275.bmp b/6/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/6/image/digitalWidth275.bmp differ diff --git a/6/image/digitalWidth3.bmp b/6/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/6/image/digitalWidth3.bmp differ diff --git a/6/image/digitalWidth375.bmp b/6/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/6/image/digitalWidth375.bmp differ diff --git a/6/image/digitalWidth4.bmp b/6/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/6/image/digitalWidth4.bmp differ diff --git a/6/image/digitalWidth475.bmp b/6/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/6/image/digitalWidth475.bmp differ diff --git a/6/image/digitalWidth5.bmp b/6/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/6/image/digitalWidth5.bmp differ diff --git a/6/image/digitalWidth575.bmp b/6/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/6/image/digitalWidth575.bmp differ diff --git a/6/image/digitalWidth6.bmp b/6/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/6/image/digitalWidth6.bmp differ diff --git a/6/image/digitalWidth675.bmp b/6/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/6/image/digitalWidth675.bmp differ diff --git a/6/image/digitalWidth7.bmp b/6/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/6/image/digitalWidth7.bmp differ diff --git a/6/image/digitalWidth775.bmp b/6/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/6/image/digitalWidth775.bmp differ diff --git a/6/image/digitalWidth8.bmp b/6/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/6/image/digitalWidth8.bmp differ diff --git a/6/image/digitalWidth875.bmp b/6/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/6/image/digitalWidth875.bmp differ diff --git a/66/image/digitalWidth1.bmp b/66/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/66/image/digitalWidth1.bmp differ diff --git a/66/image/digitalWidth175.bmp b/66/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/66/image/digitalWidth175.bmp differ diff --git a/66/image/digitalWidth2.bmp b/66/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/66/image/digitalWidth2.bmp differ diff --git a/66/image/digitalWidth275.bmp b/66/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/66/image/digitalWidth275.bmp differ diff --git a/66/image/digitalWidth3.bmp b/66/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/66/image/digitalWidth3.bmp differ diff --git a/66/image/digitalWidth375.bmp b/66/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/66/image/digitalWidth375.bmp differ diff --git a/66/image/digitalWidth4.bmp b/66/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/66/image/digitalWidth4.bmp differ diff --git a/66/image/digitalWidth475.bmp b/66/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/66/image/digitalWidth475.bmp differ diff --git a/66/image/digitalWidth5.bmp b/66/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/66/image/digitalWidth5.bmp differ diff --git a/66/image/digitalWidth575.bmp b/66/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/66/image/digitalWidth575.bmp differ diff --git a/66/image/digitalWidth6.bmp b/66/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/66/image/digitalWidth6.bmp differ diff --git a/66/image/digitalWidth675.bmp b/66/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/66/image/digitalWidth675.bmp differ diff --git a/66/image/digitalWidth7.bmp b/66/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/66/image/digitalWidth7.bmp differ diff --git a/66/image/digitalWidth775.bmp b/66/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/66/image/digitalWidth775.bmp differ diff --git a/66/image/digitalWidth8.bmp b/66/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/66/image/digitalWidth8.bmp differ diff --git a/66/image/digitalWidth875.bmp b/66/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/66/image/digitalWidth875.bmp differ diff --git a/7/image (复件)/digitalWidth1.bmp b/7/image (复件)/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/7/image (复件)/digitalWidth1.bmp differ diff --git a/7/image (复件)/digitalWidth175.bmp b/7/image (复件)/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/7/image (复件)/digitalWidth175.bmp differ diff --git a/7/image (复件)/digitalWidth2.bmp b/7/image (复件)/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/7/image (复件)/digitalWidth2.bmp differ diff --git a/7/image (复件)/digitalWidth275.bmp b/7/image (复件)/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/7/image (复件)/digitalWidth275.bmp differ diff --git a/7/image (复件)/digitalWidth3.bmp b/7/image (复件)/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/7/image (复件)/digitalWidth3.bmp differ diff --git a/7/image (复件)/digitalWidth375.bmp b/7/image (复件)/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/7/image (复件)/digitalWidth375.bmp differ diff --git a/7/image (复件)/digitalWidth4.bmp b/7/image (复件)/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/7/image (复件)/digitalWidth4.bmp differ diff --git a/7/image (复件)/digitalWidth475.bmp b/7/image (复件)/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/7/image (复件)/digitalWidth475.bmp differ diff --git a/7/image (复件)/digitalWidth5.bmp b/7/image (复件)/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/7/image (复件)/digitalWidth5.bmp differ diff --git a/7/image (复件)/digitalWidth575.bmp b/7/image (复件)/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/7/image (复件)/digitalWidth575.bmp differ diff --git a/7/image (复件)/digitalWidth6.bmp b/7/image (复件)/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/7/image (复件)/digitalWidth6.bmp differ diff --git a/7/image (复件)/digitalWidth675.bmp b/7/image (复件)/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/7/image (复件)/digitalWidth675.bmp differ diff --git a/7/image (复件)/digitalWidth7.bmp b/7/image (复件)/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/7/image (复件)/digitalWidth7.bmp differ diff --git a/7/image (复件)/digitalWidth775.bmp b/7/image (复件)/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/7/image (复件)/digitalWidth775.bmp differ diff --git a/7/image (复件)/digitalWidth8.bmp b/7/image (复件)/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/7/image (复件)/digitalWidth8.bmp differ diff --git a/7/image (复件)/digitalWidth875.bmp b/7/image (复件)/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/7/image (复件)/digitalWidth875.bmp differ diff --git a/7/image.tar.gz b/7/image.tar.gz new file mode 100644 index 0000000..953eecb Binary files /dev/null and b/7/image.tar.gz differ diff --git a/7/image/digitalWidth1.bmp b/7/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/7/image/digitalWidth1.bmp differ diff --git a/7/image/digitalWidth175.bmp b/7/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/7/image/digitalWidth175.bmp differ diff --git a/7/image/digitalWidth2.bmp b/7/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/7/image/digitalWidth2.bmp differ diff --git a/7/image/digitalWidth275.bmp b/7/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/7/image/digitalWidth275.bmp differ diff --git a/7/image/digitalWidth3.bmp b/7/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/7/image/digitalWidth3.bmp differ diff --git a/7/image/digitalWidth375.bmp b/7/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/7/image/digitalWidth375.bmp differ diff --git a/7/image/digitalWidth4.bmp b/7/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/7/image/digitalWidth4.bmp differ diff --git a/7/image/digitalWidth475.bmp b/7/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/7/image/digitalWidth475.bmp differ diff --git a/7/image/digitalWidth5.bmp b/7/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/7/image/digitalWidth5.bmp differ diff --git a/7/image/digitalWidth575.bmp b/7/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/7/image/digitalWidth575.bmp differ diff --git a/7/image/digitalWidth6.bmp b/7/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/7/image/digitalWidth6.bmp differ diff --git a/7/image/digitalWidth675.bmp b/7/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/7/image/digitalWidth675.bmp differ diff --git a/7/image/digitalWidth7.bmp b/7/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/7/image/digitalWidth7.bmp differ diff --git a/7/image/digitalWidth775.bmp b/7/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/7/image/digitalWidth775.bmp differ diff --git a/7/image/digitalWidth8.bmp b/7/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/7/image/digitalWidth8.bmp differ diff --git a/7/image/digitalWidth875.bmp b/7/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/7/image/digitalWidth875.bmp differ diff --git a/8/image/digitalWidth1.bmp b/8/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/8/image/digitalWidth1.bmp differ diff --git a/8/image/digitalWidth175.bmp b/8/image/digitalWidth175.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/8/image/digitalWidth175.bmp differ diff --git a/8/image/digitalWidth2.bmp b/8/image/digitalWidth2.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/8/image/digitalWidth2.bmp differ diff --git a/8/image/digitalWidth275.bmp b/8/image/digitalWidth275.bmp new file mode 100644 index 0000000..2989e5c Binary files /dev/null and b/8/image/digitalWidth275.bmp differ diff --git a/8/image/digitalWidth3.bmp b/8/image/digitalWidth3.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/8/image/digitalWidth3.bmp differ diff --git a/8/image/digitalWidth375.bmp b/8/image/digitalWidth375.bmp new file mode 100644 index 0000000..b50df2f Binary files /dev/null and b/8/image/digitalWidth375.bmp differ diff --git a/8/image/digitalWidth4.bmp b/8/image/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/8/image/digitalWidth4.bmp differ diff --git a/8/image/digitalWidth475.bmp b/8/image/digitalWidth475.bmp new file mode 100644 index 0000000..43be7b9 Binary files /dev/null and b/8/image/digitalWidth475.bmp differ diff --git a/8/image/digitalWidth5.bmp b/8/image/digitalWidth5.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/8/image/digitalWidth5.bmp differ diff --git a/8/image/digitalWidth575.bmp b/8/image/digitalWidth575.bmp new file mode 100644 index 0000000..f2560c9 Binary files /dev/null and b/8/image/digitalWidth575.bmp differ diff --git a/8/image/digitalWidth6.bmp b/8/image/digitalWidth6.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/8/image/digitalWidth6.bmp differ diff --git a/8/image/digitalWidth675.bmp b/8/image/digitalWidth675.bmp new file mode 100644 index 0000000..65f3a03 Binary files /dev/null and b/8/image/digitalWidth675.bmp differ diff --git a/8/image/digitalWidth7.bmp b/8/image/digitalWidth7.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/8/image/digitalWidth7.bmp differ diff --git a/8/image/digitalWidth775.bmp b/8/image/digitalWidth775.bmp new file mode 100644 index 0000000..5f16e78 Binary files /dev/null and b/8/image/digitalWidth775.bmp differ diff --git a/8/image/digitalWidth8.bmp b/8/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/8/image/digitalWidth8.bmp differ diff --git a/8/image/digitalWidth875.bmp b/8/image/digitalWidth875.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/8/image/digitalWidth875.bmp differ diff --git a/80/EXPIRYXX.xcf b/80/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/80/EXPIRYXX.xcf differ diff --git a/80/digitalWidth4.bmp b/80/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/80/digitalWidth4.bmp differ diff --git a/80/expiryDate8.bmp b/80/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/80/expiryDate8.bmp differ diff --git a/80/image/digitalWidth1.bmp b/80/image/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/80/image/digitalWidth1.bmp differ diff --git a/80/image/digitalWidth175.bmp b/80/image/digitalWidth175.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/80/image/digitalWidth175.bmp differ diff --git a/80/image/digitalWidth8 (____).bmp b/80/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/80/image/digitalWidth8 (____).bmp differ diff --git a/80/image/digitalWidth8.bmp b/80/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/80/image/digitalWidth8.bmp differ diff --git a/80/image/digitalWidth8.xcf b/80/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/80/image/digitalWidth8.xcf differ diff --git a/80/image/digitalWidth88.bmp b/80/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/80/image/digitalWidth88.bmp differ diff --git a/80/image/expiryDate8.bmp b/80/image/expiryDate8.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/80/image/expiryDate8.bmp differ diff --git a/80/image/expiryDate875.bmp b/80/image/expiryDate875.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/80/image/expiryDate875.bmp differ diff --git a/80/image/expiryDate875_backup.bmp b/80/image/expiryDate875_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/80/image/expiryDate875_backup.bmp differ diff --git a/80/image/expiryDate8_backup.bmp b/80/image/expiryDate8_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/80/image/expiryDate8_backup.bmp differ diff --git a/81/EXPIRYXX.xcf b/81/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/81/EXPIRYXX.xcf differ diff --git a/81/digitalWidth1.bmp b/81/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/81/digitalWidth1.bmp differ diff --git a/81/digitalWidth4.bmp b/81/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/81/digitalWidth4.bmp differ diff --git a/81/expiryDate8.bmp b/81/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/81/expiryDate8.bmp differ diff --git a/81/image/curDate1.bmp b/81/image/curDate1.bmp new file mode 100644 index 0000000..bc9c77f Binary files /dev/null and b/81/image/curDate1.bmp differ diff --git a/81/image/curDate8.bmp b/81/image/curDate8.bmp new file mode 100644 index 0000000..8094d0e Binary files /dev/null and b/81/image/curDate8.bmp differ diff --git a/81/image/curDate875.bmp b/81/image/curDate875.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/81/image/curDate875.bmp differ diff --git a/81/image/curDate8_backup.bmp b/81/image/curDate8_backup.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/81/image/curDate8_backup.bmp differ diff --git a/81/image/digitalWidth1.bmp b/81/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/81/image/digitalWidth1.bmp differ diff --git a/81/image/digitalWidth8 (____).bmp b/81/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/81/image/digitalWidth8 (____).bmp differ diff --git a/81/image/digitalWidth8.bmp b/81/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/81/image/digitalWidth8.bmp differ diff --git a/81/image/digitalWidth8.xcf b/81/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/81/image/digitalWidth8.xcf differ diff --git a/81/image/digitalWidth88.bmp b/81/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/81/image/digitalWidth88.bmp differ diff --git a/81/image/expiryDate8.bmp b/81/image/expiryDate8.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/81/image/expiryDate8.bmp differ diff --git a/81/image/expiryDate875.bmp b/81/image/expiryDate875.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/81/image/expiryDate875.bmp differ diff --git a/82/digitalWidth1.bmp b/82/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/82/digitalWidth1.bmp differ diff --git a/82/digitalWidth4.bmp b/82/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/82/digitalWidth4.bmp differ diff --git a/82/expiryDate8.bmp b/82/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/82/expiryDate8.bmp differ diff --git a/82/image/class1.bmp b/82/image/class1.bmp new file mode 100644 index 0000000..39926a5 Binary files /dev/null and b/82/image/class1.bmp differ diff --git a/82/image/class91.bmp b/82/image/class91.bmp new file mode 100644 index 0000000..007cc6e Binary files /dev/null and b/82/image/class91.bmp differ diff --git a/82/image/curDate8.bmp b/82/image/curDate8.bmp new file mode 100644 index 0000000..8094d0e Binary files /dev/null and b/82/image/curDate8.bmp differ diff --git a/82/image/curDate875.bmp b/82/image/curDate875.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/82/image/curDate875.bmp differ diff --git a/82/image/curDate8_backup.bmp b/82/image/curDate8_backup.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/82/image/curDate8_backup.bmp differ diff --git a/82/image/digitalWidth1.bmp b/82/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/82/image/digitalWidth1.bmp differ diff --git a/82/image/digitalWidth8 (____).bmp b/82/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/82/image/digitalWidth8 (____).bmp differ diff --git a/82/image/digitalWidth8.bmp b/82/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/82/image/digitalWidth8.bmp differ diff --git a/82/image/digitalWidth8.xcf b/82/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/82/image/digitalWidth8.xcf differ diff --git a/82/image/digitalWidth88.bmp b/82/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/82/image/digitalWidth88.bmp differ diff --git a/82/image/expiryDate8.bmp b/82/image/expiryDate8.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/82/image/expiryDate8.bmp differ diff --git a/82/image/expiryDate875.bmp b/82/image/expiryDate875.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/82/image/expiryDate875.bmp differ diff --git a/9/image/DMTV10.bmp b/9/image/DMTV10.bmp new file mode 100644 index 0000000..d3fd232 Binary files /dev/null and b/9/image/DMTV10.bmp differ diff --git a/9/image/DMTV12.bmp b/9/image/DMTV12.bmp new file mode 100644 index 0000000..0a32fc7 Binary files /dev/null and b/9/image/DMTV12.bmp differ diff --git a/9/image/DMTV14.bmp b/9/image/DMTV14.bmp new file mode 100644 index 0000000..f7975bb Binary files /dev/null and b/9/image/DMTV14.bmp differ diff --git a/9/image/DMTV16.bmp b/9/image/DMTV16.bmp new file mode 100644 index 0000000..1fdcd7a Binary files /dev/null and b/9/image/DMTV16.bmp differ diff --git a/9/image/DMTV18.bmp b/9/image/DMTV18.bmp new file mode 100644 index 0000000..04025e9 Binary files /dev/null and b/9/image/DMTV18.bmp differ diff --git a/9/image/DMTV20.bmp b/9/image/DMTV20.bmp new file mode 100644 index 0000000..bb9be12 Binary files /dev/null and b/9/image/DMTV20.bmp differ diff --git a/9/image/DMTV22.bmp b/9/image/DMTV22.bmp new file mode 100644 index 0000000..781f48b Binary files /dev/null and b/9/image/DMTV22.bmp differ diff --git a/9/image/DMTV24.bmp b/9/image/DMTV24.bmp new file mode 100644 index 0000000..096f7e7 Binary files /dev/null and b/9/image/DMTV24.bmp differ diff --git a/9/image/DMTV26.bmp b/9/image/DMTV26.bmp new file mode 100644 index 0000000..6b0a428 Binary files /dev/null and b/9/image/DMTV26.bmp differ diff --git a/9/image/DMTV32.bmp b/9/image/DMTV32.bmp new file mode 100644 index 0000000..e4a7b66 Binary files /dev/null and b/9/image/DMTV32.bmp differ diff --git a/90/EXPIRYXX.xcf b/90/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/90/EXPIRYXX.xcf differ diff --git a/90/digitalWidth4.bmp b/90/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/90/digitalWidth4.bmp differ diff --git a/90/expiryDate8.bmp b/90/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/90/expiryDate8.bmp differ diff --git a/90/image/digitalWidth1.bmp b/90/image/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/90/image/digitalWidth1.bmp differ diff --git a/90/image/digitalWidth175.bmp b/90/image/digitalWidth175.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/90/image/digitalWidth175.bmp differ diff --git a/90/image/digitalWidth8 (____).bmp b/90/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/90/image/digitalWidth8 (____).bmp differ diff --git a/90/image/digitalWidth8.bmp b/90/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/90/image/digitalWidth8.bmp differ diff --git a/90/image/digitalWidth8.xcf b/90/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/90/image/digitalWidth8.xcf differ diff --git a/90/image/digitalWidth88.bmp b/90/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/90/image/digitalWidth88.bmp differ diff --git a/90/image/expiryDate8.bmp b/90/image/expiryDate8.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/90/image/expiryDate8.bmp differ diff --git a/90/image/expiryDate875.bmp b/90/image/expiryDate875.bmp new file mode 100644 index 0000000..58e7d4e Binary files /dev/null and b/90/image/expiryDate875.bmp differ diff --git a/90/image/expiryDate875_backup.bmp b/90/image/expiryDate875_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/90/image/expiryDate875_backup.bmp differ diff --git a/90/image/expiryDate8_backup.bmp b/90/image/expiryDate8_backup.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/90/image/expiryDate8_backup.bmp differ diff --git a/91/EXPIRYXX.xcf b/91/EXPIRYXX.xcf new file mode 100644 index 0000000..a1674a6 Binary files /dev/null and b/91/EXPIRYXX.xcf differ diff --git a/91/digitalWidth1.bmp b/91/digitalWidth1.bmp new file mode 100644 index 0000000..9b0bef1 Binary files /dev/null and b/91/digitalWidth1.bmp differ diff --git a/91/digitalWidth4.bmp b/91/digitalWidth4.bmp new file mode 100644 index 0000000..b87ee02 Binary files /dev/null and b/91/digitalWidth4.bmp differ diff --git a/91/expiryDate8.bmp b/91/expiryDate8.bmp new file mode 100644 index 0000000..6072a3f Binary files /dev/null and b/91/expiryDate8.bmp differ diff --git a/91/image/curDate1.bmp b/91/image/curDate1.bmp new file mode 100644 index 0000000..bc9c77f Binary files /dev/null and b/91/image/curDate1.bmp differ diff --git a/91/image/curDate8.bmp b/91/image/curDate8.bmp new file mode 100644 index 0000000..8094d0e Binary files /dev/null and b/91/image/curDate8.bmp differ diff --git a/91/image/curDate875.bmp b/91/image/curDate875.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/91/image/curDate875.bmp differ diff --git a/91/image/curDate8_backup.bmp b/91/image/curDate8_backup.bmp new file mode 100644 index 0000000..21e5a5a Binary files /dev/null and b/91/image/curDate8_backup.bmp differ diff --git a/91/image/digitalWidth1.bmp b/91/image/digitalWidth1.bmp new file mode 100644 index 0000000..4a8b364 Binary files /dev/null and b/91/image/digitalWidth1.bmp differ diff --git a/91/image/digitalWidth8 (____).bmp b/91/image/digitalWidth8 (____).bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/91/image/digitalWidth8 (____).bmp differ diff --git a/91/image/digitalWidth8.bmp b/91/image/digitalWidth8.bmp new file mode 100644 index 0000000..121914b Binary files /dev/null and b/91/image/digitalWidth8.bmp differ diff --git a/91/image/digitalWidth8.xcf b/91/image/digitalWidth8.xcf new file mode 100644 index 0000000..4165c8c Binary files /dev/null and b/91/image/digitalWidth8.xcf differ diff --git a/91/image/digitalWidth88.bmp b/91/image/digitalWidth88.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/91/image/digitalWidth88.bmp differ diff --git a/91/image/expiryDate8.bmp b/91/image/expiryDate8.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/91/image/expiryDate8.bmp differ diff --git a/91/image/expiryDate875.bmp b/91/image/expiryDate875.bmp new file mode 100644 index 0000000..e806c6c Binary files /dev/null and b/91/image/expiryDate875.bmp differ diff --git a/Aes/TAesClass.cpp b/Aes/TAesClass.cpp new file mode 100644 index 0000000..e2133c1 --- /dev/null +++ b/Aes/TAesClass.cpp @@ -0,0 +1,529 @@ +#include "TAesClass.h" +#if 1 +unsigned char AesSbox[16*16]= +{// populate the Sbox matrix + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /*0*/ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + /*1*/ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + /*2*/ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + /*3*/ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + /*4*/ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + /*5*/ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + /*6*/ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + /*7*/ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + /*8*/ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + /*9*/ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + /*a*/ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + /*b*/ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + /*c*/ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + /*d*/ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + /*e*/ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + /*f*/ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 +}; + +unsigned char AesiSbox[16*16]= +{ + // populate the iSbox matrix + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /*0*/ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + /*1*/ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + /*2*/ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + /*3*/ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + /*4*/ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + /*5*/ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + /*6*/ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + /*7*/ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + /*8*/ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + /*9*/ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + /*a*/ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + /*b*/ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + /*c*/ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + /*d*/ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + /*e*/ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + /*f*/ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d +}; +unsigned char AesRcon[11*4]= +{ + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x00 +}; +#endif +Aes::~Aes() +{ + +} +Aes::Aes() +{ + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//构造函数 +Aes::Aes(int keysize,unsigned char* keyBytes) +{ + SetNbNkNr(keysize); //设置密钥块数,轮数 + memcpy(key,keyBytes,keysize); //字符串拷贝函数,把keyBytes的keysize个字符复制到key中 + KeyExpansion(); //密钥扩展,必须提前做的初始化 +} +//////////////////////////////////////////////////////////////////////////////////////////////// +void Aes::SetNbNkNr(int keySize) +{ + Nb=4; + if(keySize==Bits128) + { + Nk=4; //4*4字节,128位密钥,10轮加密 + Nr=10; + } + else if(keySize==Bits192) + { + Nk=6; //6*4字节,192位密钥,12轮加密 + Nr=12; + } + else if(keySize==Bits256) + { + Nk=8; //8*4字节,256位密钥,14轮加密 + Nr=14; + } +} +//////////////////////////////////////////////////////////////////////////////////////////////// +void Aes::KeyExpansion() +{ + + memset(w,0,16*15); + for(int row=0;row 6 && (row % Nk == 4) ) //这个还没有搞清楚 + { + temp = SubWord(temp); + } + + // w[row] = w[row-Nk] xor temp + w[4*row+0] = (byte) ( (int) w[4*(row-Nk)+0] ^ (int)temp[0] ); + w[4*row+1] = (byte) ( (int) w[4*(row-Nk)+1] ^ (int)temp[1] ); + w[4*row+2] = (byte) ( (int) w[4*(row-Nk)+2] ^ (int)temp[2] ); + w[4*row+3] = (byte) ( (int) w[4*(row-Nk)+3] ^ (int)temp[3] ); + } // for loop + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//密钥移位函数 +unsigned char* Aes::RotWord(unsigned char* word) +{ + byte* temp = new byte[4]; + temp[0] = word[1]; + temp[1] = word[2]; + temp[2] = word[3]; + temp[3] = word[0]; + return temp; +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//密钥字代换函数 +unsigned char* Aes::SubWord(unsigned char* word) +{ + byte* temp = new byte[4]; + for(int j=0;j<4;j++) + { + temp[j] = AesSbox[16*(word[j] >> 4)+(word[j] & 0x0f)]; //实际上也可以写成AesSbox[[j]];因为两者相等 + } + return temp; + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//Aes加密函数 +void Aes::Cipher(unsigned char* input, unsigned char* output) +{ + memset(&State[0][0],0,16); + for(int i=0;i<4*Nb;i++) //这里是先写列后写行的,即输入是一列一列的进来的 + { + State[i%4][i/4]=input[i]; //换成先写行后写列也是可以的,只要在输出时也是这样就可以了 + } + AddRoundKey(0); //轮密钥加 + + for (int round = 1; round <= (Nr - 1); round++) // main round loop + { + SubBytes(); //字节代换 + ShiftRows(); //行移位 + MixColumns(); //列混淆 + AddRoundKey(round); //轮密钥加 + } // main round loop + + SubBytes(); //字节代换 + ShiftRows(); //行移位 + AddRoundKey(Nr); //轮密钥加 + + // output = state + for (int i = 0; i < (4 * Nb); i++) + { + output[i] = State[i % 4][ i / 4]; + } + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//Aes解密函数 +void Aes::InvCipher(unsigned char* input,unsigned char* output) +{ + memset(&State[0][0],0,16); + for (int i = 0; i < (4 * Nb); i++) + { + State[i % 4][ i / 4] = input[i]; + } + + AddRoundKey(Nr); + + for (int round = Nr-1; round >= 1; round--) // main round loop + { + InvShiftRows(); + InvSubBytes(); + AddRoundKey(round); + InvMixColumns(); + } // end main round loop for InvCipher + + InvShiftRows(); + InvSubBytes(); + AddRoundKey(0); + + // output = state + for (int i = 0; i < (4 * Nb); i++) + { + output[i] = State[i % 4][ i / 4]; + } +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//轮密钥加 +void Aes::AddRoundKey(int round) +{ + int i,j; //i行 j列 //因为密钥w是一列一列排列的,即 k0 k4 k8 k12 + for(j=0;j<4;j++) // k1 k5 k9 k13 + { // k2 k6 k10k14 + for(i=0;i<4;i++) // k3 k7 k11k15 + { // 所以i行j列的下标是4*((round*4)+j)+i即16*round+4*j+i + State[i][j]=(unsigned char)((int)State[i][j]^(int)w[4*((round*4)+j)+i]); + } + } +} +//////////////////////////////////////////////////////////////////////////////////////////////// +//字节代换函数 +void Aes::SubBytes() //Page 103 +{ + int i,j; + for(j=0;j<4;j++) + { + for(i=0;i<4;i++) + { + State[i][j]=AesSbox[State[i][j]]; + //因为 16*(State[i][j]>>4)+State[i][j]&0x0f=State[i][j] + + + } + } +} + +void Aes::InvSubBytes() +{ + int i,j; + for(j=0;j<4;j++) + { + for(i=0;i<4;i++) + { + State[i][j]=AesiSbox[State[i][j]]; //因为 16*(State[i][j]>>4)+State[i][j]&0x0f=State[i][j] + } + } + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +void Aes::ShiftRows() +{ + unsigned char temp[4*4]; //Page105 + int i,j; + for(j=0;j<4;j++) + { + for(i=0;i<4;i++) + { + temp[4*i+j]=State[i][j]; + } + } + for(i=1;i<4;i++) + { + for(j=0;j<4;j++) + { + if(i==1)State[i][j]=temp[4*i+(j+1)%4]; //第一行左移1位 + else if(i==2)State[i][j]=temp[4*i+(j+2)%4]; //第二行左移2位 + else if(i==3)State[i][j]=temp[4*i+(j+3)%4]; //第三行左移3位 + } + } + +} +void Aes::InvShiftRows() +{ + unsigned char temp[4*4]; + int i,j; + for(j=0;j<4;j++) + { + for(i=0;i<4;i++) + { + temp[4*i+j]=State[i][j]; + } + } + for(i=1;i<4;i++) + { + for(j=0;j<4;j++) + { + //if(i==1)State[i][j]=temp[4*i+(j-1)%4]; 在此犯了一个错误 -1%4=-1 而不是3,所以采用了下面再加一个4的做法 + if(i==1)State[i][j]=temp[4*i+(j+3)%4]; //第一行右移1位 j-1+4=j+3 + else if(i==2)State[i][j]=temp[4*i+(j+2)%4]; //第二行右移2位 j-2+4=j+2 + else if(i==3)State[i][j]=temp[4*i+(j+1)%4]; //第三行右移3位 j-3+4=j+2 + } + } + +} +//////////////////////////////////////////////////////////////////////////////////////////////// +void Aes::MixColumns() +{ + unsigned char temp[4*4]; + int i,j; + for(j=0;j<4;j++) //2 3 1 1 列混淆矩阵 Page107 + { //1 2 3 1 + for(i=0;i<4;i++) //1 1 2 3 + { //3 1 1 2 + temp[4*i+j]=State[i][j]; + } + } + for(j=0;j<4;j++) + { + State[0][j] = (unsigned char) ( (int)gfmultby02(temp[0+j]) ^ (int)gfmultby03(temp[4*1+j]) ^ + (int)gfmultby01(temp[4*2+j]) ^ (int)gfmultby01(temp[4*3+j]) ); + State[1][j] = (unsigned char) ( (int)gfmultby01(temp[0+j]) ^ (int)gfmultby02(temp[4*1+j]) ^ + (int)gfmultby03(temp[4*2+j]) ^ (int)gfmultby01(temp[4*3+j]) ); + State[2][j] = (unsigned char) ( (int)gfmultby01(temp[0+j]) ^ (int)gfmultby01(temp[4*1+j]) ^ + (int)gfmultby02(temp[4*2+j]) ^ (int)gfmultby03(temp[4*3+j]) ); + State[3][j] = (unsigned char) ( (int)gfmultby03(temp[0+j]) ^ (int)gfmultby01(temp[4*1+j]) ^ + (int)gfmultby01(temp[4*2+j]) ^ (int)gfmultby02(temp[4*3+j]) ); + } + +} +void Aes::InvMixColumns() +{ + unsigned char temp[4*4]; + int i,j; + for (i = 0; i < 4; i++) // copy State into temp[] + { + for (j = 0; j < 4; j++) //0e 0b 0d 09 逆变换矩阵 Page108 + { //09 0e 0b 0d + temp[4*i+j] = State[i][j]; //0d 09 0e 0b + } //0b 0d 09 0e + } + + for (j = 0; j < 4; j++) + { + State[0][j] = (unsigned char) ( (int)gfmultby0e(temp[j]) ^ (int)gfmultby0b(temp[4+j]) ^ + (int)gfmultby0d(temp[4*2+j]) ^ (int)gfmultby09(temp[4*3+j]) ); + State[1][j] = (unsigned char) ( (int)gfmultby09(temp[j]) ^ (int)gfmultby0e(temp[4+j]) ^ + (int)gfmultby0b(temp[4*2+j]) ^ (int)gfmultby0d(temp[4*3+j]) ); + State[2][j] = (unsigned char) ( (int)gfmultby0d(temp[j]) ^ (int)gfmultby09(temp[4+j]) ^ + (int)gfmultby0e(temp[4*2+j]) ^ (int)gfmultby0b(temp[4*3+j]) ); + State[3][j] = (unsigned char) ( (int)gfmultby0b(temp[j]) ^ (int)gfmultby0d(temp[4+j]) ^ + (int)gfmultby09(temp[4*2+j]) ^ (int)gfmultby0e(temp[4*3+j]) ); + } +} +//////////////////////////////////////////////////////////////////////////////////////////////// +unsigned char Aes::gfmultby01(unsigned char b) +{ + return b; +} +unsigned char Aes::gfmultby02(unsigned char b) +{ + if (b < 0x80) + return (unsigned char)(int)(b <<1); + else + return (unsigned char)( (int)(b << 1) ^ (int)(0x1b) ); +} + +unsigned char Aes::gfmultby03(unsigned char b) +{ + return (unsigned char) ( (int)gfmultby02(b) ^ (int)b ); +} + +unsigned char Aes::gfmultby09(unsigned char b) +{ + return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ (int)b ); +} + +unsigned char Aes::gfmultby0b(unsigned char b) +{ + return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ + (int)gfmultby02(b) ^ (int)b ); +} + +unsigned char Aes::gfmultby0d(unsigned char b) +{ + return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ + (int)gfmultby02(gfmultby02(b)) ^ (int)(b) ); +} + +unsigned char Aes::gfmultby0e(unsigned char b) +{ + return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ + (int)gfmultby02(gfmultby02(b)) ^(int)gfmultby02(b) ); +} + +TAesClass::TAesClass() +{ + m_lpAes=NULL; + InitializePrivateKey(16,(unsigned char*)"\x49\x76\x48\x6B\x27\x66\x7E\x65\x72\x35\x73\x15\x8C\x3B\x80\x40"); +} + +TAesClass::~TAesClass() +{ + if (m_lpAes!=NULL) + { + delete m_lpAes; + } +} +//------------------------------------------------------------------------------------------------------------ +// 编写人员:wfnhddd +// +// 函数名称:InitializeAes +// +// 函数描述:初始化AES 密钥,密钥用于加密解密 +// +// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 +// +// 返回数值:无 +// +// 最近修改:2009 年 08 月 07 日 +//------------------------------------------------------------------------------------------------------------ + + +VOID TAesClass::InitializePrivateKey(DWORD KeySize,UCHAR *KeyBytes) +{ + if (m_lpAes) + { + delete m_lpAes; + m_lpAes=NULL; + } + m_lpAes=new Aes(KeySize,KeyBytes); + +} + +//------------------------------------------------------------------------------------------------------------ +// 编写人员:wfnhddd +// +// 函数名称:OnAesEncrypt +// +// 函数描述:用AES加密算法加密数据 +// +// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 +// +// 返回数值:加密后的数据大小 ,错误返回值 0 +// +// 最近修改:2009 年 08 月 07 日 +//------------------------------------------------------------------------------------------------------------ + +DWORD TAesClass::OnAesEncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer) +{ + DWORD OutLength=0; + if (m_lpAes==NULL||OutBuffer==NULL) + { + return 0; + } + + UCHAR *lpCurInBuff=(UCHAR *)InBuffer; + UCHAR *lpCurOutBuff=(UCHAR *)OutBuffer; + long blocknum=InLength/16; + long leftnum=InLength%16; + for(long i=0;iCipher(lpCurInBuff,lpCurOutBuff); + lpCurInBuff+=16; + lpCurOutBuff+=16; + OutLength+=16; + } + if(leftnum) //多余出leftnum 字节 则加密时 多出16-leftnum 个字节 + { + UCHAR inbuff[16]; + memset(inbuff,0,16); + memcpy(inbuff,lpCurInBuff,leftnum); + m_lpAes->Cipher(inbuff,lpCurOutBuff); + lpCurOutBuff+=16; + OutLength+=16; + } + //新增16个字节,用以确定增加的字节数 + UCHAR extrabuff[16]; + memset(extrabuff,0,16); + *((LPDWORD)extrabuff)=16+(16-leftnum)%16; //多出16+(16-leftnum)%16个字节 + m_lpAes->Cipher(extrabuff,lpCurOutBuff); + OutLength+=16; + return OutLength; + +} + + +//------------------------------------------------------------------------------------------------------------ +// 编写人员:wfnhddd +// +// 函数名称:OnAesUncrypt +// +// 函数描述:用AES加密算法解密数据 +// +// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 +// +// 返回数值:解密后的数据大小 ,错误返回值 0 +// +// 最近修改:2009 年 08 月 07 日 +//------------------------------------------------------------------------------------------------------------ +DWORD TAesClass::OnAesUncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer) +{ + DWORD OutLength=0; + if (m_lpAes==NULL||OutBuffer==NULL) + { + return 0; + } + UCHAR *lpCurInBuff=(UCHAR *)InBuffer; + UCHAR *lpCurOutBuff=(UCHAR *)OutBuffer; + long blocknum=InLength/16; + long leftnum=InLength%16; + if(leftnum) + { + return 0; + } + for(long i=0;iInvCipher(lpCurInBuff,lpCurOutBuff); + lpCurInBuff+=16; + lpCurOutBuff+=16; + OutLength+=16; + } + + UCHAR *lpExtraInBuff=lpCurOutBuff-16; + DWORD dwExtraBytes=*((LPDWORD)lpExtraInBuff); + return (OutLength-dwExtraBytes); + +} diff --git a/Aes/TAesClass.h b/Aes/TAesClass.h new file mode 100644 index 0000000..8e5ae9a --- /dev/null +++ b/Aes/TAesClass.h @@ -0,0 +1,134 @@ +#ifndef __TAESCLASS_H__ +#define __TAESCLASS_H__ +#include +#include +#include +#include + +typedef unsigned long DWORD; +typedef unsigned char UCHAR,*PUCHAR; +typedef void *PVOID,*LPVOID; +typedef unsigned char byte; +typedef DWORD *PDWORD,*LPDWORD; + +#ifndef VOID +#define VOID void +#endif + +//#pragma once + +//enum KeySize { Bits128, Bits192, Bits256 }; // key size, in bits, for construtor +#define Bits128 16 +#define Bits192 24 +#define Bits256 32 +#if 0 +static unsigned char AesSbox[16*16]= +{// populate the Sbox matrix + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /*0*/ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + /*1*/ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + /*2*/ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + /*3*/ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + /*4*/ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + /*5*/ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + /*6*/ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + /*7*/ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + /*8*/ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + /*9*/ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + /*a*/ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + /*b*/ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + /*c*/ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + /*d*/ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + /*e*/ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + /*f*/ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 +}; + +static unsigned char AesiSbox[16*16]= +{ + // populate the iSbox matrix + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /*0*/ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + /*1*/ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + /*2*/ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + /*3*/ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + /*4*/ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + /*5*/ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + /*6*/ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + /*7*/ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + /*8*/ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + /*9*/ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + /*a*/ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + /*b*/ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + /*c*/ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + /*d*/ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + /*e*/ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + /*f*/ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d +}; +static unsigned char AesRcon[11*4]= +{ + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x00 +}; +#endif +extern unsigned char AesSbox[16*16]; +extern unsigned char AesiSbox[16*16]; +extern unsigned char AesRcon[11*4]; +class Aes // Advanced Encryption Standard +{ +public: + ~Aes(); + Aes(); + Aes(int keySize, unsigned char* keyBytes); + unsigned char State[4][4]; + void Cipher(unsigned char* input, unsigned char* output); // encipher 16-bit input + void InvCipher(unsigned char* input, unsigned char* output); // decipher 16-bit input +private: + int Nb; // block size in 32-bit words. Always 4 for AES. (128 bits). + int Nk; // key size in 32-bit words. 4, 6, 8. (128, 192, 256 bits). + int Nr; // number of rounds. 10, 12, 14. + + unsigned char key[32]; + unsigned char w[16*15]; + + void SetNbNkNr(int keySize); + void AddRoundKey(int round); //轮密钥加 + void SubBytes(); //S盒字节代换 + void InvSubBytes(); //逆S盒字节代换 + void ShiftRows(); //行移位 + void InvShiftRows(); + void MixColumns(); //列混淆 + void InvMixColumns(); + unsigned char gfmultby01(unsigned char b); + unsigned char gfmultby02(unsigned char b); + unsigned char gfmultby03(unsigned char b); + unsigned char gfmultby09(unsigned char b); + unsigned char gfmultby0b(unsigned char b); + unsigned char gfmultby0d(unsigned char b); + unsigned char gfmultby0e(unsigned char b); + void KeyExpansion(); //密钥扩展 + unsigned char* SubWord(unsigned char* word); //密钥S盒字代换 + unsigned char* RotWord(unsigned char* word); //密钥移位 + +}; + +class TAesClass +{ +public: + TAesClass(); + ~TAesClass(); + void InitializePrivateKey(DWORD KeySize,UCHAR *KeyBytes); //AES 密钥初始化 + DWORD OnAesEncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer); //AES 加密数据 + DWORD OnAesUncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer); //AES 解密数据 +private: + Aes * m_lpAes; +}; +#endif diff --git a/BarCode/barcode.h b/BarCode/barcode.h new file mode 100644 index 0000000..6b9bdf4 --- /dev/null +++ b/BarCode/barcode.h @@ -0,0 +1,119 @@ +/* + * barcode.h -- definitions for libbarcode + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _BARCODE_H_ +#define _BARCODE_H_ + +#include + +#define BARCODE_VERSION "0.98" +#define BARCODE_VERSION_INT 9800 + +/* + * The object + */ +struct Barcode_Item { + int flags; /* type of encoding and decoding */ + char *ascii; /* malloced */ + char *partial; /* malloced too */ + char *textinfo; /* information about text positioning */ + char *encoding; /* code name, filled by encoding engine */ + int width, height; /* output units */ + int xoff, yoff; /* output units */ + int margin; /* output units */ + double scalef; /* requested scaling for barcode */ + int error; /* an errno-like value, in case of failure */ +}; + +/* + * The flags field + */ +#define BARCODE_DEFAULT_FLAGS 0x00000000 + +#define BARCODE_ENCODING_MASK 0x000000ff /* 256 possibilites... */ +#define BARCODE_NO_ASCII 0x00000100 /* avoid text in output */ +#define BARCODE_NO_CHECKSUM 0x00000200 /* avoid checksum in output */ + +#define BARCODE_OUTPUT_MASK 0x000ff000 /* 256 output types */ +#define BARCODE_OUT_EPS 0x00001000 +#define BARCODE_OUT_PS 0x00002000 +#define BARCODE_OUT_PCL 0x00004000 /* by Andrea Scopece */ +/* PCL_III 0x00008000 */ +#define BARCODE_OUT_PCL_III 0x0000C000 +#define BARCODE_OUT_NOHEADERS 0x00100000 /* no header nor footer */ + +enum { + BARCODE_ANY = 0, /* choose best-fit */ + BARCODE_EAN, + BARCODE_UPC, /* upc == 12-digit ean */ + BARCODE_ISBN, /* isbn numbers (still EAN13) */ + BARCODE_39, /* code 39 */ + BARCODE_128, /* code 128 (a,b,c: autoselection) */ + BARCODE_128C, /* code 128 (compact form for digits) */ + BARCODE_128B, /* code 128, full printable ascii */ + BARCODE_I25, /* interleaved 2 of 5 (only digits) */ + BARCODE_128RAW, /* Raw code 128 (by Leonid A. Broukhis) */ + BARCODE_CBR, /* Codabar (by Leonid A. Broukhis) */ + BARCODE_MSI, /* MSI (by Leonid A. Broukhis) */ + BARCODE_PLS, /* Plessey (by Leonid A. Broukhis) */ + BARCODE_93 /* code 93 (by Nathan D. Holmes) */ +}; + +#define BARCODE_DEFAULT_MARGIN 10 + +#ifdef __cplusplus +extern "C" { +#endif +/* + * Create and destroy barcode structures + */ +extern struct Barcode_Item *Barcode_Create(char *text); +extern int Barcode_Delete(struct Barcode_Item *bc); + +/* + * Encode and print + */ +extern int Barcode_Encode(struct Barcode_Item *bc, int flags); +extern int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags); + +/* + * Choose the position + */ +extern int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, + int xoff, int yoff, double scalef); + +/* + * Do it all in one step + */ +extern int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags); + + +/* + * Return current version (integer and string) + */ +extern int Barcode_Version(char *versionname); + +#ifdef __cplusplus +} +#endif + +#endif /* _BARCODE_H_ */ diff --git a/BarCode/cmdline.c b/BarCode/cmdline.c new file mode 100644 index 0000000..a69a825 --- /dev/null +++ b/BarCode/cmdline.c @@ -0,0 +1,177 @@ +/* + * cmdline.c -- parse a command line using getopt, environment and defaults + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * Changes: + * Michele Comitini (mcm@glisco.it): better handling of numeric type args. + */ + +#include +#include +#include + +#ifdef NO_GETOPT + /* use replacement */ + #include "compat/getopt.h" +#else + #include +#endif + +#include "cmdline.h" + +/* In case of error, print help string and return error (-1) */ +int commandline_errormsg(FILE *f, struct commandline *args, + char *prgname, char *messagehead) +{ + char *buffer; + char *buffer2; + int len; + struct commandline *ptr; + + if (!messagehead) { + fprintf(f,"%s: Error in cmdline\nPossible options:\n",prgname); + } else { + fprintf(f,"%s: %s",prgname,messagehead); + } + + for (ptr = args; ptr->option; ptr++) { + if (ptr->descrip) { + len = strlen(ptr->descrip); + len += ptr->default_v ? strlen(ptr->default_v) : 6; + len += ptr->env ? strlen(ptr->env) : 6; + buffer2 = malloc(len+3); /* 3 to be safe :) */ + len += 32; + if (buffer2) { + buffer = malloc(len); + if (buffer) { + sprintf(buffer2, ptr->descrip, + ptr->default_v ? ptr->default_v : "(none)", + ptr->env ? ptr->env : "(none)"); + sprintf(buffer, " -%c %s %s", ptr->option, + ptr->type ? "" : " ", buffer2); + fprintf(f, "%s\n",buffer); + free(buffer); + } + free(buffer2); + } + } + } + return -1; +} + +/* + * Associate formats to type. + */ +struct type_fmt { + enum option_type type; + char *fmt; +}; +static struct type_fmt formats[] = { + {CMDLINE_I, "%i%s"}, /* the trailing "%s" is used for error check */ + {CMDLINE_D, "%d%s"}, + {CMDLINE_X, "%x%s"}, + {CMDLINE_O, "%o%s"}, + {CMDLINE_F, "%lf%s"}, + {CMDLINE_P, "%p%s"}, + {0, NULL} /* If we get here, it's CMDLINE_S: no sscanf buf strcpy() */ +}; + + +/* Parse one argument (default or provided) */ +static int commandline_oneopt(struct commandline *ptr, char *value) +{ + struct type_fmt *tptr; + char *trash = value ? strdup(value) : NULL; + + /* convert it, if needed */ + if ((ptr->type != CMDLINE_NONE) && ptr->result) { + for (tptr = formats; tptr->type; tptr++) + if (tptr->type == ptr->type) + break; + if (!tptr->type) /* not found: it is a string */ + *(char **)(ptr->result) = value; + else + if (sscanf(value, tptr->fmt, ptr->result, trash)!=1) { + free(trash); + return -1; + } + } + if (trash) + free(trash); + + if ((ptr->type == CMDLINE_NONE) && ptr->result) /* no type, just count */ + (*(int *)(ptr->result))++; + + /* call the function, if needed */ + if (ptr->fun) { + if (ptr->type) { + if (ptr->result) return ptr->fun(ptr->result); /* converted */ + return ptr->fun(value); /* type, but not converted */ + } + return ptr->fun(NULL); /* no type: just call it */ + } + return 0; +} + +/* The main function */ +int commandline(struct commandline *args, int argc, char **argv, + char *errorhead) +{ + struct commandline *ptr; + char *getopt_desc = (char *)calloc(512, 1); + int desc_offset = 0; + int opt, retval; + char *value; + + /* Build getopt string and process defaults values */ + for (ptr = args; ptr->option; ptr++) { + getopt_desc[desc_offset++] = ptr->option; + if (ptr->type) getopt_desc[desc_offset++] = ':'; + + value = NULL; + if (ptr->env) + value = getenv(ptr->env); + if (!value) + value = ptr->default_v; + if (value && (retval = commandline_oneopt(ptr, value))) { + /* + * if the function returns a specific (not -1) value, it already + * printed its message, so avoid the generic help + */ + if (retval == -1) + commandline_errormsg(stderr, args, argv[0], errorhead); + return retval; + } + } + + /* Run getopt and process material */ + while ((opt = getopt(argc, argv, getopt_desc)) != -1) { + for (ptr = args; ptr->option; ptr++) + if (opt == ptr->option) + break; + if (!ptr->option) /* unknown option */ + return commandline_errormsg(stderr, args, argv[0], errorhead); + if ( (retval = commandline_oneopt(ptr, optarg)) ) { /* wrong arg */ + if (retval == -1) + commandline_errormsg(stderr, args, argv[0], errorhead); + return retval; + } + } + return 0; +} diff --git a/BarCode/cmdline.h b/BarCode/cmdline.h new file mode 100644 index 0000000..6931991 --- /dev/null +++ b/BarCode/cmdline.h @@ -0,0 +1,58 @@ +/* + * cmdline.h -- generic commandline editing (uses getopt, only short) + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* + * The options may have different arguments of different type + */ +enum option_type { + CMDLINE_NONE=0, /* no argument after option */ + CMDLINE_I, /* integer (any base) */ + CMDLINE_D, /* decimal integer */ + CMDLINE_X, /* hex integer */ + CMDLINE_O, /* octal integer */ + CMDLINE_S, /* string */ + CMDLINE_F, /* double float */ + CMDLINE_P, /* pointer */ +}; + + +struct commandline { + int option; /* Single byte: option id */ + int type; /* Type of argument, used in sscanf */ + void *result; /* Store data here, if non null */ + int (*fun)(void *); /* Call if defined: arg is "result" or input string */ + char *env; /* Where to get runtime defaults, may be NULL */ + char *default_v; /* The compile-time default, may be NULL */ + char *descrip; /* For err msg. May have %s's for default and env */ +}; + +/* returns: 0 or -1. "optarg" is global (see getopt) */ +extern int commandline(struct commandline *args, + int argc, char **argv, char *errorhead); + +/* prints an error message based on "args" */ +extern int commandline_errormsg(FILE *f, struct commandline *args, + char *prgname, char *messagehead); + + + + diff --git a/BarCode/codabar.c b/BarCode/codabar.c new file mode 100644 index 0000000..7065b9e --- /dev/null +++ b/BarCode/codabar.c @@ -0,0 +1,182 @@ +/* + * codabar.c -- encoding for Codabar + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789" "-$:/.+ABCD"; + +#define CODE_A 16 +#define CODE_B 17 + +#define NARROW 12 +#define WIDE 14 + +/* Patterns */ +static char *patterns[] = { +"1111133","1111331","1113113","3311111","1131131", +"3111131","1311113","1311311","1331111","3113111", +"1113311","1133111","3111313","3131113","3131311", +"1131313","1133131","1313113","1113133","1113331" }; + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it. + * If the first character is a letter (A to D), the last one must be too; + * no other character should be a letter. + */ +int Barcode_cbr_verify(unsigned char *text) +{ + int i, lower=0, upper=0; + int startpresent = 0; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + char * pos; + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + pos = strchr(alphabet,toupper(text[i])); + if (!pos) + return -1; + if (i == 0 && pos - alphabet >= CODE_A) + startpresent = 1; + else if (pos - alphabet >= CODE_A && + (!startpresent || i != strlen(text) - 1)) + return -1; + } + if (lower && upper) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr,"1%s", /* separator */ patterns[code]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_cbr_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + int i, code, textpos, usesum, checksum = 0, startpresent; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("codabar"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 8 * (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 3) * 8 + 2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * (strlen + check) +term */ + textinfo = malloc(10*(strlen(text) + 1) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + ptr = partial; + textptr = textinfo; + textpos = 0; + usesum = bc->flags & BARCODE_NO_CHECKSUM ? 0 : 1; + /* if no start character specified, A is used as a start character */ + if (!isalpha(text[0])) { + add_one(ptr, CODE_A); + ptr += strlen(ptr); + textpos = WIDE; + checksum = CODE_A; + startpresent = 0; + } else { + startpresent = 1; + } + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + textpos += code < 12 ? NARROW : WIDE; + textptr += strlen(textptr); + ptr += strlen(ptr); + checksum += code; + if (startpresent && usesum && i == strlen(text) - 2) { + /* stuff a check symbol before the stop */ + c = strchr(alphabet, toupper(text[i+1])); + if (!c) /* impossible */ + continue; + code = c - alphabet; + checksum += code; + + /* Complement to a multiple of 16 */ + checksum = (checksum + 15) / 16 * 16 - checksum; + add_one(ptr, checksum); + ptr += strlen(ptr); + } + } + if (!startpresent) { + if (usesum) { + /* if no start character specified, B is used as a stop char */ + checksum += CODE_B; + checksum = (checksum + 15) / 16 * 16 - checksum; + add_one(ptr, checksum); + ptr += strlen(ptr); + } + add_one(ptr, CODE_B); + } + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/BarCode/code128.c b/BarCode/code128.c new file mode 100644 index 0000000..3eed959 --- /dev/null +++ b/BarCode/code128.c @@ -0,0 +1,618 @@ +/* + * code128.c -- encoding for code128 (A, B, C) + * + * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" +//0 b1a2a4 123221 223211 221132 221231 213212 223112 312131 311222 314111 b3c1a1b +static char *codeset[] = { + "212222", "222122", "222221", "121223", "121322", /* 0 - 4 */ + "131222", "122213", "122312", "132212", "221213", + "221312", "231212", "112232", "122132", "122231", /* 10 - 14 */ + "113222", "123122", "123221", "223211", "221132", + "221231", "213212", "223112", "312131", "311222", /* 20 - 24 */ + "321122", "321221", "312212", "322112", "322211", + "212123", "212321", "232121", "111323", "131123", /* 30 - 34 */ + "131321", "112313", "132113", "132311", "211313", + "231113", "231311", "112133", "112331", "132131", /* 40 - 44 */ + "113123", "113321", "133121", "313121", "211331", + "231131", "213113", "213311", "213131", "311123", /* 50 - 54 */ + "311321", "331121", "312113", "312311", "332111", + "314111", "221411", "431111", "111224", "111422", /* 60 - 64 */ + "121124", "121421", "141122", "141221", "112214", + "112412", "122114", "122411", "142112", "142211", /* 70 - 74 */ + "241211", "221114", "413111", "241112", "134111", + "111242", "121142", "121241", "114212", "124112", /* 80 - 84 */ + "124211", "411212", "421112", "421211", "212141", + "214121", "412121", "111143", "111341", "131141", /* 90 - 94 */ + "114113", "114311", "411113", "411311", "113141", + "114131", "311141", "411131", "b1a4a2", "b1a2a4", /* 100 - 104 */ + "b1a2c2", "b3c1a1b" +}; +// "114131", "311141", "411131", "211412", "211214", /* 100 - 104 */ +// "211232", "2331112" +//0 b1a2a4 123221 223211 221132 221231 213212 223112 312131 311222 314111 b3c1a1b +// 211214 2331112 +/* +1,1,4,1,3,1,// CodeB FNC4 CodeB +3,1,1,1,4,1,// FNC4 CodeA CodeA +4,1,1,1,3,1,// FNC1 FNC1 FNC1 +2,1,1,4,1,2,// StartA +2,1,1,2,1,4,// StartB +2,1,1,2,3,2,// StartC +2,3,3,1,1,1,2,// Stop +*/ +#define START_A 103 +#define START_B 104 +#define START_C 105 +#define STOP 106 +#define SHIFT 98 /* only A and B */ +#define CODE_A 101 /* only B and C */ +#define CODE_B 100 /* only A and C */ +#define CODE_C 99 /* only A and B */ +#define FUNC_1 102 /* all of them */ +#define FUNC_2 97 /* only A and B */ +#define FUNC_3 96 /* only A and B */ +/* FUNC_4 is CODE_A when in A and CODE_B when in B */ + +#define SYMBOL_WID 11 /* all of them are 11-bar wide */ + +/* + * code 128-b includes all printable ascii chars + */ + +int Barcode_128b_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + while (*text && *text>=32 && !(*text&0x80)) + text++; + if (*text) + return -1; /* a non-ascii char */ + return 0; /* ok */ +} + +int Barcode_128b_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128-B"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 6* (head + text + check + tail) + final + term. */ + partial = malloc( (strlen(text) + 4) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + /* up to now, it was the same code as other encodings */ + + strcpy(partial, "0"); /* the first space */ + strcat(partial, codeset[START_B]); + checksum += START_B; /* the start char is counted in the checksum */ + textptr = textinfo; + textpos = SYMBOL_WID; + + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = text[i]-32; + strcat(partial, codeset[code]); + checksum += code * (i+1); /* first * 1 + second * 2 + third * 3... */ + sprintf(textptr, "%i:12:%c ", textpos, text[i]); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + return 0; +} + +/* + * code 128-c is only digits, but two per symbol + */ + +int Barcode_128c_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + /* must be an even number of digits */ + if (strlen(text)%2) + return -1; + /* and must be all digits */ + for (; *text; text++) + if (!isdigit(*text)) + return -1; + return 0; +} + +int Barcode_128c_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128-C"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 6* (head + text + check + tail) + final + term. */ + partial = malloc( (strlen(text) + 3) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn.5:fff:c " * strlen +term */ + textinfo = malloc(12*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, "0"); /* the first space */ + strcat(partial, codeset[START_C]); + checksum += START_C; /* the start char is counted in the checksum */ + textptr = textinfo; + textpos = SYMBOL_WID; + + for (i=0; text[i]; i+=2) { + if (!isdigit(text[i]) || !isdigit(text[i+1])) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = (text[i]-'0') * 10 + text[i+1]-'0'; + strcat(partial, codeset[code]); + checksum += code * (i/2+1); /* first * 1 + second * 2 + third * 3... */ + + /* print as "%s", because we have ".5" positions */ + sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, text[i], + textpos + (double)SYMBOL_WID/2, text[i+1]); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} + +/* + * generic (full-featured) code128 implementation: it selects between + * A, B, C according to the data being encoded. F1, F2, F3, F4 are expressed + * using ascii chars 0xc1, 0xc2, 0xc3, 0xc4 (0301, 0302, 0303, 0304). + * Char '\0' is expressed by 0x80 (0200). + */ + +int Barcode_128_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + while (*text && (*text<=0x80 || (*text >= 0xc1 && *text <= 0xc4))) + text++; + if (*text) + return -1; /* unencodable character */ + return 0; /* ok */ +} + + +/* + * These functions are extracted from Barcode_128_encode for clarity. + * It deals with choosing the symbols used to represent the text + * and returns a dynamic array of integers, terminated by -1. + * + * The algorithm used in choosing the codes comes from App 2 of + * "El Codigo Estandar EAN/UCC 128", courtesy of AECOC, Spain. + * Thanks to Dani Pardo for getting permission and giving me a copy + * of the document + */ + +#define NEED_CODE_A(c) ((c)<32 || (c)==0x80) +#define NEED_CODE_B(c) ((c)>=96 && (c)<128) + +static int Barcode_a_or_b(unsigned char *text) +{ + for ( ; *text; text++) { + if (NEED_CODE_A(*text)) + return 'A'; + if (NEED_CODE_B(*text)) + return 'B'; + } + return 0; /* any */ +} + +/* code is either 'A' or 'B', and value must be valid */ +static int Barcode_encode_as(int code, int value) +{ + + /* first check the special chars */ + if (value == 0xC1) return FUNC_1; + if (value == 0xC2) return FUNC_2; + if (value == 0xC3) return FUNC_3; + if (value == 0xC4) { /* F4 */ + if (code == 'A') return CODE_A; + return CODE_B; + } + + /* then check ascii values */ + if (value >= 0x20 && value <= 0x5F) + return value - 0x20; /* both codes */ + if (value == 0x80) return 64; /* code A */ + if (value < 0x20) return value+64; /* code A */ + if (value >= 0x60) return value - 0x20; /* code B */ + /* can't happen */ + return -1; +} + +static int *Barcode_128_make_array(struct Barcode_Item *bc, int *lptr) +{ + int len, *codes; + unsigned char *s; + int i=0, j, code, checksum; + + /* allocate twice the text length + 5, as this is the worst case */ + len = 2 * strlen(bc->ascii) + 5; + codes = malloc(len * sizeof(int)); + s = bc->ascii; + + /* choose the starting code */ + if (s[2]=='\0' && isdigit(s[0]) && isdigit(s[1])) { + code = 'C'; + } else if (isdigit(s[0])&&isdigit(s[1]) && isdigit(s[2])&&isdigit(s[3])) { + code = 'C'; + } else { + code = Barcode_a_or_b(s); + if (!code) code = 'B'; /* default */ + } + codes[i++] = START_A + code - 'A'; + + for (s = bc->ascii; *s; /* increments are in the loop */) { + switch(code) { + + case 'C': + if (s[0] == 0xC1) { /* F1 is valid */ + codes[i++] = FUNC_1; + s++; + } else if (isdigit(s[0]) && isdigit(s[1])) { + /* encode two digits */ + codes[i++] = (s[0]-'0') * 10 + s[1]-'0'; + s += 2; + } else { + /* change code */ + code = Barcode_a_or_b(s); + if (!code) code = 'B'; + codes[i++] = (code == 'A') ? CODE_A : CODE_B; + } + break; + + case 'B': + case 'A': + for (j=0; isdigit(s[j]); j++) + ; + if (j>=4) { /* if there are 4 or more digits, turn to C */ + if (j&1) { + /* odd number: encode one first */ + codes[i++] = *(s++) - ' '; + } + codes[i++] = CODE_C; + code = 'C'; + } else if (code == 'A' && NEED_CODE_B(*s)) { + /* check whether we should use SHIFT or change code */ + j = Barcode_a_or_b(s+1); + if (j == 'B') { + codes[i++] = CODE_B; + code = 'B'; + } else { + codes[i++] = SHIFT; + codes[i++] = Barcode_encode_as('B', *s); + s++; + } + } else if (code == 'B' && NEED_CODE_A(*s)) { + /* check whether we should use SHIFT or change code */ + j = Barcode_a_or_b(s+1); + if (j == 'A') { + codes[i++] = CODE_A; + code = 'A'; + } else { + codes[i++] = SHIFT; + codes[i++] = Barcode_encode_as('A', *s); + s++; + } + } else { + codes[i++] = Barcode_encode_as(code, *s); + s++; + } + break; + } + } + /* add the checksum */ + checksum = codes[0]; + for (j=1; j len) { + fprintf(stderr, "impossible: length is > allocated len\n"); + } + *lptr = i; + return codes; +} + +/* + * Encoding is tricky, in that we cannot print the ascii + * representation in an easy way. Therefore, just skip non-printable + * chars and try to fit the rest somehow. + */ +int Barcode_128_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int *codes; /* dynamic */ + int i, c, len; + double textpos, size, step; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + + codes = Barcode_128_make_array(bc, &len); + if (!codes) return -1; + + /* the partial code is 6*codelen + ini + term (+margin) */ + partial = malloc( 6 * len + 4); + if (!partial) { + bc->error = errno; + free(codes); + return -1; + } + + /* the text information is at most "nnn.n:ff.f:c " * strlen +term */ + textptr = textinfo = malloc(13*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(codes); + return -1; + } + + /* up to now, it was almost the same code as other encodings */ + + strcpy(partial, "0"); /* the first space */ + for (i=0; i 12.0) size = 12.0; + + /* align the text to the left, using its natural size */ + step = (int)(10 * (size/18.0 * SYMBOL_WID) + .5) / 10.0; + textpos = SYMBOL_WID; + + for (i=0; i 0xc0) c = ' '; /* F code */ + sprintf(textptr, "%g:%g:%c ", textpos, size, c); + textptr += strlen(textptr); + textpos += step; + } + + bc->partial = partial; + bc->textinfo = textinfo; + free(codes); + return 0; +} + +/* + * A raw 128 code is given as a sequence of space separated numbers + * from 0 to 105, starting from the start code to be (Leonid) + */ + +int Barcode_128raw_verify(unsigned char *text) +{ + int n; + unsigned val; + + if (!strlen(text)) + return -1; + while (*text) { + if (sscanf(text, "%u%n", &val, &n) < 1) + return -1; + if (val > 105) + return -1; + text += n; + } + return 0; +} + +int Barcode_128raw_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, n, count, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("128raw"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* + * length of partial code is unknown in advance, but it is + * at most 6* (1+text/2 + check + tail) + final + terminator + */ + partial = malloc( (3+ strlen(text)/2) * 6 + 2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn.5:fff:c " * 1+strlen/2 +term */ + textinfo = malloc(12 * (1+strlen(text)/2) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, "0"); /* the first space */ + textptr = textinfo; + textpos = 0; + + for (i=0, count = 0; i < strlen(text); count++) { + if (sscanf(text + i, "%u%n", &code, &n) < 1) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + strcat(partial, codeset[code]); + + /* + * since the start code is part of the "raw" input, it is + * counted in the checksum by itself + */ + if (!count) checksum += code; /* the start code */ + else checksum += code * count; /* first * 1 + second * 2 ... */ + + /* + * print as "%s", because we have ".5" positions + * also, use a size of 9 like codeC above, as each symbol is + * represented by two chars + */ + sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, + code >= 100 ? 'A' : code/10 + '0', + textpos + (double)SYMBOL_WID/2, code%10 + '0'); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + i += n; + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} + diff --git a/BarCode/code39.c b/BarCode/code39.c new file mode 100644 index 0000000..3308c95 --- /dev/null +++ b/BarCode/code39.c @@ -0,0 +1,173 @@ +/* + * code39.c -- encoding for code39 + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "1234567890" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. *" "$/+%"; + +/* the checksum alphabet has a different order */ +static char checkbet[] = + "0123456789" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. $" "/+%"; + +/* The first 40 symbols repeat this bar pattern */ +static char *bars[] = { + "31113","13113","33111","11313","31311", + "13311","11133","31131","13131","11331"}; + +/* The first 4 decades use these space patterns */ +static char *spaces[] = {"1311","1131","1113","3111"}; + +/* the last four symbols are special */ +static char *specialbars[] = { + "11111","11111","11111","11111"}; + +static char *specialspaces[] = { + "3331","3313","3133","1333"}; + +static char *fillers[]= { + "0a3a1c1c1a", + "1a3a1c1c1a" +}; + + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it + */ +int Barcode_39_verify(unsigned char *text) +{ + int i, lower=0, upper=0; + + if (text[0] == '\0') + return -1; + for (i=0; text[i]; i++) { + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + if (!strchr(alphabet,toupper(text[i]))) + return -1; + } + if (lower && upper) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + char *b, *s; + + if (code < 40) { + b = bars[code%10]; + s = spaces[code/10]; + } else { + b = specialbars[code-40]; + s = specialspaces[code-40]; + } + sprintf(ptr,"1%c%c%c%c%c%c%c%c%c", /* separator */ + b[0], s[0], b[1], s[1], b[2], s[2], + b[3], s[3], b[4]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_39_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 39"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 10* (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 3) * 10 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = 22; + + for (i=0; text[i]; i++) { + c = strchr(alphabet, toupper(text[i])); + if (!c) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + c = strchr(checkbet,*c); + if (c) /* the '*' is not there */ + checksum += (c-checkbet); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + + textpos += 16; /* width of each code */ + textptr += strlen(textptr); + ptr += strlen(ptr); + } + /* Add the checksum */ + if ( (bc->flags & BARCODE_NO_CHECKSUM)==0 ) { + code = (strchr(alphabet, checkbet[checksum % 43]) - alphabet); + add_one(ptr, code); + } + strcat(ptr, fillers[1]); /* end */ + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/BarCode/code93.c b/BarCode/code93.c new file mode 100644 index 0000000..73f8cee --- /dev/null +++ b/BarCode/code93.c @@ -0,0 +1,213 @@ +/* + * code39.c -- encoding for code39 + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2001 Nathan D. Holmes / FedEx Services (ndholmes@fedex.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; + +static char *codeset[] = { + "131112", "111213", "111312", "111411", "121113", /* 0 - 4 */ + "121212", "121311", "111114", "131211", "141111", /* 5 - 9 */ + "211113", "211212", "211311", "221112", "221211", /* A - E */ + "231111", "112113", "112212", "112311", "122112", /* F - J */ + "132111", "111123", "111222", "111321", "121122", /* K - O */ + "131121", "212112", "212211", "211122", "211221", /* P - T */ + "221121", "222111", "112122", "112221", "122121", /* U - Y */ + "123111", "121131", "311112", "311211", "321111", /* Z - $ */ + "112131", "113121", "211131", "121221", "312111", /* / - (%) */ + "311121", "122211", "111141" /* (/) - (terminator) */ +}; + + +/* 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111 */ +/* 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222 */ +/* 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 */ +static char shiftset[] = + "%$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%% /// ///// / /%%%%%% %%%%%%++++++++++++++++++++++++++%%%%%"; +static char shiftset2[] = + "UABCDEFGHIJKLMNOPQRSTUVWXYZABCDE ABC FGHIJ L ZFGHIJV KLMNOWABCDEFGHIJLKMNOPQRSTUVWXYZPQRST"; + +#define START_STOP 47 +#define EXTEND_DOLLAR 43 +#define EXTEND_PERCENT 44 +#define EXTEND_SLASH 45 +#define EXTEND_PLUS 46 + +/* + * Check that the text can be encoded. Returns 0 or -1. + * All of ASCII-7 is accepted. + */ +int Barcode_93_verify(unsigned char *text) +{ + int i; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + + /* Test if beyond the range of 7-bit ASCII */ + if ((int)text[i] > 127) + return -1; + } + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_93_encode(struct Barcode_Item *bc) +{ + static unsigned char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *textptr; + int *checksum_str; + int i, code, textpos, checksum_len=0; + int c_checksum = 0; + int k_checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 93"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + + /* the partial code is 6 * (head + 2* text + 2* check + tail) + margin + term. */ + partial = malloc( (strlen(text) *2 + 4) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + checksum_str = (int *)malloc( (strlen(text) + 3) * 2 * sizeof(int)); + if (!checksum_str) { + free(partial); + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(checksum_str); + return -1; + } + + textptr = textinfo; + textpos = 22; + strcpy(partial, "0"); + strcat(partial, codeset[START_STOP]); + + for (i=0; iflags & BARCODE_NO_CHECKSUM)==0 ) + { + for(i=1; i<=checksum_len; i++) + { + c_checksum += i * (int)checksum_str[checksum_len - i]; + k_checksum += (i+1) * (int)checksum_str[checksum_len - i]; + } + + c_checksum = c_checksum % 47; + k_checksum += c_checksum; + k_checksum = k_checksum % 47; + + strcat(partial, codeset[c_checksum]); + strcat(partial, codeset[k_checksum]); + + } + strcat(partial, codeset[START_STOP]); /* end */ + + /* Encodes final 1-unit width bar to turn the start character into a stop char */ + strcat(partial, "1"); + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/BarCode/ean.c b/BarCode/ean.c new file mode 100644 index 0000000..0801a0e --- /dev/null +++ b/BarCode/ean.c @@ -0,0 +1,774 @@ +/* + * ean.c -- encoding for ean, upc and isbn + * + * Copyright (c) 1999 Alessandro Rubini + * Copyright (c) 1999 Prosa Srl. + * Copyright (c) 2001 Boszormenyi Zoltan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +/* + * IMPORTANT NOTE: if you are reading this file to learn how to add a + * new encoding type, this is the wrong place as there are too many + * special cases. Please refer to code39.c instead. If you want to + * learn how UPC, EAN, ISBN work, on the other hand, I did my best to + * commend things and hope you enjoy it. + */ + +/* + * These following static arrays are used to describe the barcode. + * + * The various forms of UPC and EAN are documented as using three + * different alphabets to encode the ten digits. However, each digit + * has exactly one encoding; only, it is sometimes mirrored. Moreover, + * if you represent the width of each symbol (bar/space) instead of + * the sequence of 1's and 0's, you find that even-parity and odd-parity + * encoding are exactly the same. So, here are the digits: */ +static char *digits[] = { + "3211","2221","2122","1411","1132", + "1231","1114","1312","1213","3112"}; + +/* + * What EAN encoding does is adding a leading digit (the 13th digit). + * Such an extra digit is encoded by mirroring three of the six digits that + * appear in the left half of the UPC code. Here how mirroring works: + */ +static char *ean_mirrortab[] = { + "------","--1-11","--11-1","--111-","-1--11", + "-11--1","-111--","-1-1-1","-1-11-","-11-1-" +}; + +/* + * UPC-E (the 6-digit one), instead, encodes the check character as + * a mirroring of the symbols. This is similar, but the encoding for "0" is + * different (EAN uses no mirroring for "0" to be compatible with UPC). + * The same rule is used for UPC-5 (the supplemental digits for ISBN) + */ +static char *upc_mirrortab[] = { + "---111","--1-11","--11-1","--111-","-1--11", + "-11--1","-111--","-1-1-1","-1-11-","-11-1-" +}; + +/* + * UPC-E mirroring for encoding "1" + */ +static char *upc_mirrortab1[] = { + "111---","11-1--","11--1-","11---1","1-11--", + "1--11-","1---11","1-1-1-","1-1--1","1--1-1" +}; + +/* UPC-2 has just two digits to mirror */ +static char *upc_mirrortab2[] = { + "11","1-","-1","--" +}; + +/* + * initial, middle, final guard bars (first symbol is a a space). + * EAN-13 overwrites the first "0" with "9" to make space for the extra digit. + */ +static char *guard[] = {"0a1a","1a1a1","a1a"}; + +/* initial, final guard bars for UPC-E*/ +static char *guardE[] = {"0a1a","1a1a1a"}; + +/* initial and inter-char guard bars for supplementals (first is space) */ +static char *guardS[] = {"9112","11"}; + +/* + * These functions are shortcuts I use in the encoding engine + */ +static int ean_make_checksum(char *text, int mode) +{ + int esum = 0, osum = 0, i; + int even=1; /* last char is even */ + + if (strchr(text, ' ')) + i = strchr(text, ' ') - text; /* end of first part */ + else + i = strlen(text); /* end of all */ + + while (i-- > 0) { + if (even) esum += text[i]-'0'; + else osum += text[i]-'0'; + even = !even; + } + if (!mode) { /* standard upc/ean checksum */ + i = (3*esum + osum) % 10; + return (10-i) % 10; /* complement to 10 */ + } else { /* add-5 checksum */ + i = (3*esum + 9*osum); + return i%10; + } +} + +/* + * Check that the text can be encoded. Returns 0 or -1. + * Accept: + * 13 or 12 digits: EAN-13 w/ or w/o checksum + * or + * 8 or 7 digits: EAN-8 w/ or w/o checksum. + * For both EAN-13 and EAN-8, accept an addon of 2 or 5 digits, + * separated by ' ' + */ +int Barcode_ean_verify(unsigned char *text) +{ + int i, len0, len, addon; + unsigned char tmp[24], *spc; + + len = strlen(text); + spc = strchr(text, ' '); + if (spc) { + len0 = spc - text; + addon = len - len0 - 1; + if (addon != 2 && addon != 5) + return -1; + for (i=len0+1; i= '5' && text[10] <= '9') { + memcpy(&result[1], text+1, 5); + result[6] = text[10]; + } else { + return NULL; + } + result[7] = chksum + '0'; + + return result; +} + +/* + * UPC-A is the same as EAN, but accept + * 12 or 11 digits (UPC-A w/ or w/o checksum) + * or accept UPC-E as: + * 6 digits (w/o number system and checksum): number system '0' assumed, + * 7 digits (either w/o number system or checksum), + * 8 digits (w/ number system and checksum) + * plus the 2 or 5-digit add-on + */ +int Barcode_upc_verify(unsigned char *text) +{ + int i, len0, len, addon; + unsigned char tmp[24], *spc; + + len = strlen(text); + spc = strchr(text, ' '); + if (spc) { + len0 = spc - text; + addon = len - len0 - 1; + if (addon != 2 && addon != 5) + return -1; + for (i=len0+1; iascii) { + bc->error = EINVAL; + return -1; + } + + /* Find out whether the barcode has addon and + * the length of the barcode w/o the addon. + */ + len = strlen(bc->ascii); + spc = strchr(bc->ascii, ' '); + if (spc) { + len0 = spc - bc->ascii; + addon = strlen(spc + 1); + if (addon != 2 && addon != 5) { + bc->error = EINVAL; /* impossible, actually */ + return -1; + } + } else { + len0 = len; + addon = 0; + } + + if (!bc->encoding) { + /* ISBN already wrote what it is; if unknown, find it out */ + + /* + * Do not decide only by barcode length, it may be ambiguous. + * Anyway, either the user specified the barcode type or + * we already found a fitting one. + */ + switch(bc->flags & BARCODE_ENCODING_MASK) { + case BARCODE_EAN: + switch (len0) { + case 7: case 8: + bc->encoding = strdup("EAN-8"); + encoding = EAN8; + break; + case 12: case 13: + bc->encoding = strdup("EAN-13"); + encoding = EAN13; + break; + default: + bc->error = -EINVAL; + return -1; + } + break; + + case BARCODE_UPC: + switch (len0) { + case 6: case 7: case 8: + bc->encoding = strdup("UPC-E"); + encoding = UPCE; + break; + case 11: case 12: + bc->encoding = strdup("UPC-A"); + encoding = UPCA; + break; + default: + bc->error = -EINVAL; + return -1; + } + break; + default: + /* else, it's wrong (impossible, as the text is checked) */ + bc->error = -EINVAL; + return -1; + } + } + + /* better safe than sorry */ + if (bc->partial) free(bc->partial); bc->partial = NULL; + if (bc->textinfo) free(bc->textinfo); bc->textinfo = NULL; + + if (encoding == UPCA) { /* add the leading 0 (not printed) */ + text[0] = '0'; + strcpy(text+1, bc->ascii); + } else if (encoding == UPCE) { + strcpy(text, upc_a_to_e(upc_e_to_a(bc->ascii))); + } else { + strcpy(text, bc->ascii); + } + + /* + * build the checksum and the bars: any encoding is slightly different + */ + if (encoding == UPCA || encoding == EAN13 || encoding == ISBN) { + if (!(encoding == UPCA && len0 == 12) && + !(encoding == EAN13 && len0 == 13)) { + checksum = ean_make_checksum(text, 0); + text[12] = '0' + checksum; /* add it to the text */ + text[13] = '\0'; + } + + strcpy(partial, guard[0]); + if (encoding == EAN13 || encoding == ISBN) { /* The first digit */ + sprintf(tptr,"0:12:%c ",text[0]); + tptr += strlen(tptr); + partial[0] = '9'; /* extra space for the digit */ + } else if (encoding == UPCA) + partial[0] = '9'; /* UPC has one digit before the symbol, too */ + xpos = width_of_partial(partial); + mirror = ean_mirrortab[text[0]-'0']; + + /* left part */ + for (i=1;i<7;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i]-'0']; /* source */ + strcpy(ptr1, ptr2); + if (mirror[i-1] == '1') { + /* mirror this */ + ptr1[0] = ptr2[3]; + ptr1[1] = ptr2[2]; + ptr1[2] = ptr2[1]; + ptr1[3] = ptr2[0]; + } + /* + * Write the ascii digit. UPC has a special case + * for the first digit, which is out of the bars + */ + if (encoding == UPCA && i==1) { + sprintf(tptr, "0:10:%c ", text[i]); + tptr += strlen(tptr); + ptr1[1] += 'a'-'1'; /* bars are long */ + ptr1[3] += 'a'-'1'; + } else { + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + } + /* count the width of the symbol */ + xpos += 7; /* width_of_partial(ptr2) */ + } + + strcat(partial, guard[1]); /* middle */ + xpos += width_of_partial(guard[1]); + + /* right part */ + for (i=7;i<13;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i]-'0']; /* source */ + strcpy(ptr1, ptr2); + /* + * Ascii digit. Once again, UPC has a special + * case for the last digit + */ + if (encoding == UPCA && i==12) { + sprintf(tptr, "%i:10:%c ", xpos+13, text[i]); + tptr += strlen(tptr); + ptr1[0] += 'a'-'1'; /* bars are long */ + ptr1[2] += 'a'-'1'; + } else { + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + } + xpos += 7; /* width_of_partial(ptr2) */ + } + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guard[2]); /* end */ + xpos += width_of_partial(guard[2]); + + } else if (encoding == UPCE) { + checksum = text[7] - '0'; + + strcpy(partial, guardE[0]); + partial[0] = '9'; /* UPC-A has one digit before the symbol, too */ + xpos = width_of_partial(partial); + + /* UPC-E has the number system written before the bars. */ + sprintf(tptr, "0:10:%c ", text[0]); + tptr += strlen(tptr); + + if (text[0] == '0') + mirror = upc_mirrortab[checksum]; + else + mirror = upc_mirrortab1[checksum]; + + for (i=0;i<6;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i+1]-'0']; /* source */ + strcpy(ptr1, ptr2); + if (mirror[i] != '1') { /* negated wrt EAN13 */ + /* mirror this */ + ptr1[0] = ptr2[3]; + ptr1[1] = ptr2[2]; + ptr1[2] = ptr2[1]; + ptr1[3] = ptr2[0]; + } + sprintf(tptr, "%i:12:%c ", xpos, text[i+1]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(ptr2) */ + } + + sprintf(tptr, "%i:10:%c ", xpos+10, text[7]); + tptr += strlen(tptr); + ptr1[0] += 'a'-'1'; /* bars are long */ + ptr1[2] += 'a'-'1'; + + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guardE[1]); /* end */ + + } else { /* EAN-8 almost identical to EAN-13 but no mirroring */ + + if (len0 != 8) { + checksum = ean_make_checksum(text, 0); + text[7] = '0' + checksum; /* add it to the text */ + text[8] = '\0'; + } + + strcpy(partial, guard[0]); + xpos = width_of_partial(partial); + + /* left part */ + for (i=0;i<4;i++) { + strcpy(partial + strlen(partial), digits[text[i]-'0']); + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(digits[text[i]-'0' */ + } + strcat(partial, guard[1]); /* middle */ + xpos += width_of_partial(guard[1]); + + /* right part */ + for (i=4;i<8;i++) { + strcpy(partial + strlen(partial), digits[text[i]-'0']); + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(digits[text[i]-'0' */ + } + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guard[2]); /* end */ + } + + /* + * And that's it. Now, in case some add-on is specified it + * must be encoded too. Look for it. + */ + if ( (ptr1 = spc) ) { + ptr1++; + strcpy(text, ptr1); + if (strlen(ptr1)==5) { + checksum = ean_make_checksum(text, 1 /* special way */); + mirror = upc_mirrortab[checksum]+1; /* only last 5 digits */ + } else { + checksum = atoi(text)%4; + mirror = upc_mirrortab2[checksum]; + } + strcat(textinfo, " +"); strcat(partial, "+"); + tptr = textinfo + strlen(textinfo); + for (i=0; ipartial = strdup(partial); + if (!bc->partial) { + bc->error = errno; + return -1; + } + bc->textinfo = strdup(textinfo); + if (!bc->textinfo) { + bc->error = errno; + free(bc->partial); + bc->partial = NULL; + return -1; + } + if (!bc->width) + bc->width = width_of_partial(partial); + + return 0; /* success */ +} + +int Barcode_upc_encode(struct Barcode_Item *bc) +{ + return Barcode_ean_encode(bc); /* UPC is folded into EAN */ +} + +int Barcode_isbn_encode(struct Barcode_Item *bc) +{ + /* For ISBN we must normalize the string and prefix "978" */ + unsigned char *text = malloc(24); /* 13 + ' ' + 5 plus some slack */ + unsigned char *otext; + int i, j, retval; + + if (!text) { + bc->error = ENOMEM; + return -1; + } + strcpy(text, "978"); j=3; + + otext = bc->ascii; + for (i=0; otext[i]; i++) { + if (isdigit(otext[i])) + text[j++] = otext[i]; + if (j == 12) /* checksum added later */ + break; + } + text[j]='\0'; + if (strchr(otext, ' ')) + strcat(text, strchr(otext, ' ')); + bc->ascii = text; + bc->encoding = strdup("ISBN"); + retval = Barcode_ean_encode(bc); + bc->ascii = otext; /* restore ascii for the ps comments */ + free(text); + return retval; +} + diff --git a/BarCode/i25.c b/BarCode/i25.c new file mode 100644 index 0000000..72bd035 --- /dev/null +++ b/BarCode/i25.c @@ -0,0 +1,164 @@ +/* + * i25.c -- "interleaved 2 of 5" + * + * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +static char *codes[] = { + "11331", "31113", "13113", "33111", "11313", + "31311", "13311", "11133", "31131", "13131" +}; + +static char *guard[] = {"a1a1", "c1a"}; /* begin end */ + +int Barcode_i25_verify(unsigned char *text) +{ + if (!text[0]) + return -1; + while (*text && isdigit(*text)) + text++; + if (*text) + return -1; /* a non-digit char */ + return 0; /* ok */ +} + +int Barcode_i25_encode(struct Barcode_Item *bc) +{ + unsigned char *text; + unsigned char *partial; /* dynamic */ + unsigned char *textinfo; /* dynamic */ + unsigned char *textptr, *p1, *p2, *pd; + int i, len, sum[2], textpos, usesum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("interleaved 2 of 5"); + + text = bc->ascii; + if (!bc->ascii) { + bc->error = EINVAL; + return -1; + } + + if ((bc->flags & BARCODE_NO_CHECKSUM)) usesum = 0; else usesum = 1; + + /* create the real text string, padded to an even number of digits */ + text = malloc(strlen(bc->ascii) + 3); /* leading 0, checksum, term. */ + if (!text) { + bc->error = errno; + return -1; + } + /* add the leading 0 if needed */ + i = strlen(bc->ascii) + usesum; + if (i % 2) { + /* add a leading 0 */ + text[0] = '0'; + strcpy(text+1, bc->ascii); + } else { + strcpy(text, bc->ascii); + } + /* add the trailing checksum if needed, the leading 0 is ignored */ + if (usesum) { + sum[0] = sum[1] = 0; + for (i=0; text[i]; i++) + sum[i%2] += text[i]-'0'; + /* + * The "even" sum must be multiplied by three, and the * + * rightmost digit is defined as "even". The digits' position + * is already correct, whether or not we added a leading zero. + * (e.g., they are in pos. 0..4 or 1..4 of the string) + */ + i = sum[0] * 3 + sum[1]; + strcat(text, "0"); + text[strlen(text)-1] += (10 - (i%10)) % 10; + } + + /* the partial code is 5 * (text + check) + 4(head) + 3(tail) + term. */ + partial = malloc( (strlen(text) + 3) * 5 +2); /* be large... */ + if (!partial) { + bc->error = errno; + free(text); + return -1; + } + + /* the text information is at most "nnn:fff:c " * (strlen+1) +term */ + textinfo = malloc(10*(strlen(text)+1) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(text); + return -1; + } + + + strcpy(partial, "0"); /* the first space */ + strcat(partial, guard[0]); /* start */ + textpos = 4; /* width of initial guard */ + textptr = textinfo; + + len = strlen(text); + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + free(text); + return -1; + } + /* interleave two digits */ + p1 = codes[text[i]-'0']; + p2 = codes[text[i+1]-'0']; + pd = partial + strlen(partial); /* destination */ + while (*p1) { + *(pd++) = *(p1++); + *(pd++) = *(p2++); + } + *pd = '\0'; + /* and print the ascii text (but don't print the checksum, if any */ + if (usesum && strlen(text+i)==2) { + /* print only one digit, discard the checksum */ + sprintf(textptr, "%i:12:%c ", textpos, text[i]); + } else { + sprintf(textptr, "%i:12:%c %i:12:%c ", textpos, text[i], + textpos+9, text[i+1]); + } + textpos += 18; /* width of two codes */ + textptr += strlen(textptr); + } + strcat(partial, guard[1]); + + bc->partial = partial; + bc->textinfo = textinfo; + free(text); + + return 0; +} + diff --git a/BarCode/library.c b/BarCode/library.c new file mode 100644 index 0000000..08df802 --- /dev/null +++ b/BarCode/library.c @@ -0,0 +1,247 @@ +/* + * library.c -- external functions of libbarcode + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H /* sometimes (windows, for instance) it's missing */ +# include +#endif +#include + +#include "barcode.h" +//#include "QFile.h" +//#include "QString.h" + +/* + * This function allocates a barcode structure and strdup()s the + * text string. It returns NULL in case of error + */ +struct Barcode_Item *Barcode_Create(char *text) +{ + struct Barcode_Item *bc; + + bc = malloc(sizeof(*bc)); + if (!bc) return NULL; + + memset(bc, 0, sizeof(*bc)); + bc->ascii = strdup(text); + bc->margin = BARCODE_DEFAULT_MARGIN; /* default margin */ + return bc; +} + + +/* + * Free a barcode structure + */ +int Barcode_Delete(struct Barcode_Item *bc) +{ + if (bc->ascii) + free(bc->ascii); + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + if (bc->encoding) + free(bc->encoding); + free(bc); + return 0; /* always success */ +} + + +/* + * The various supported encodings. This might be extended to support + * dynamic addition of extra encodings + */ +extern int Barcode_ean_verify(unsigned char *text); +extern int Barcode_ean_encode(struct Barcode_Item *bc); +extern int Barcode_upc_verify(unsigned char *text); +extern int Barcode_upc_encode(struct Barcode_Item *bc); +extern int Barcode_isbn_verify(unsigned char *text); +extern int Barcode_isbn_encode(struct Barcode_Item *bc); +extern int Barcode_39_verify(unsigned char *text); +extern int Barcode_39_encode(struct Barcode_Item *bc); +extern int Barcode_128b_verify(unsigned char *text); +extern int Barcode_128b_encode(struct Barcode_Item *bc); +extern int Barcode_128c_verify(unsigned char *text); +extern int Barcode_128c_encode(struct Barcode_Item *bc); +extern int Barcode_128_verify(unsigned char *text); +extern int Barcode_128_encode(struct Barcode_Item *bc); +extern int Barcode_128raw_verify(unsigned char *text); +extern int Barcode_128raw_encode(struct Barcode_Item *bc); +extern int Barcode_i25_verify(unsigned char *text); +extern int Barcode_i25_encode(struct Barcode_Item *bc); +extern int Barcode_cbr_verify(unsigned char *text); +extern int Barcode_cbr_encode(struct Barcode_Item *bc); +extern int Barcode_msi_verify(unsigned char *text); +extern int Barcode_msi_encode(struct Barcode_Item *bc); +extern int Barcode_pls_verify(unsigned char *text); +extern int Barcode_pls_encode(struct Barcode_Item *bc); +extern int Barcode_93_verify(unsigned char *text); +extern int Barcode_93_encode(struct Barcode_Item *bc); + + +struct encoding { + int type; + int (*verify)(unsigned char *text); + int (*encode)(struct Barcode_Item *bc); +}; + +struct encoding encodings[] = { + {BARCODE_EAN, Barcode_ean_verify, Barcode_ean_encode}, + {BARCODE_UPC, Barcode_upc_verify, Barcode_upc_encode}, + {BARCODE_ISBN, Barcode_isbn_verify, Barcode_isbn_encode}, + {BARCODE_128B, Barcode_128b_verify, Barcode_128b_encode}, + {BARCODE_128C, Barcode_128c_verify, Barcode_128c_encode}, + {BARCODE_128RAW, Barcode_128raw_verify, Barcode_128raw_encode}, + {BARCODE_39, Barcode_39_verify, Barcode_39_encode}, + {BARCODE_I25, Barcode_i25_verify, Barcode_i25_encode}, + {BARCODE_128, Barcode_128_verify, Barcode_128_encode}, + {BARCODE_CBR, Barcode_cbr_verify, Barcode_cbr_encode}, + {BARCODE_PLS, Barcode_pls_verify, Barcode_pls_encode}, + {BARCODE_MSI, Barcode_msi_verify, Barcode_msi_encode}, + {BARCODE_93, Barcode_93_verify, Barcode_93_encode}, + {0, NULL, NULL} +}; + +/* + * A function to encode a string into bc->partial, ready for + * postprocessing to the output file. Meaningful bits for "flags" are + * the encoding mask and the no-checksum flag. These bits + * get saved in the data structure. + */ +int Barcode_Encode(struct Barcode_Item *bc, int flags) +{ + int validbits = BARCODE_ENCODING_MASK | BARCODE_NO_CHECKSUM; + struct encoding *cptr; + + /* If any flag is cleared in "flags", inherit it from "bc->flags" */ + if (!(flags & BARCODE_ENCODING_MASK)) + flags |= bc->flags & BARCODE_ENCODING_MASK; + if (!(flags & BARCODE_NO_CHECKSUM)) + flags |= bc->flags & BARCODE_NO_CHECKSUM; + flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); + + if (!(flags & BARCODE_ENCODING_MASK)) { + /* get the first code able to handle the text */ + for (cptr = encodings; cptr->verify; cptr++) + if (cptr->verify((unsigned char *)bc->ascii)==0) + break; + if (!cptr->verify) { + bc->error = EINVAL; /* no code can handle this text */ + return -1; + } + flags |= cptr->type; /* this works */ + bc->flags |= cptr->type; + } + for (cptr = encodings; cptr->verify; cptr++) + if (cptr->type == (flags & BARCODE_ENCODING_MASK)) + break; + if (!cptr->verify) { + bc->error = EINVAL; /* invalid barcode type */ + return -1; + } + if (cptr->verify(bc->ascii) != 0) { + bc->error = EINVAL; + return -1; + } + return cptr->encode(bc); +} + + +/* + * When multiple output formats are supported, there will + * be a jumpt table like the one for the types. Now we don't need it + */ +extern int Barcode_ps_print(struct Barcode_Item *bc, FILE *f); +extern int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f); + +/* + * A function to print a partially decoded string. Meaningful bits for + * "flags" are the output mask etc. These bits get saved in the data + * structure. + */ +int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags) +{ + int validbits = BARCODE_OUTPUT_MASK | BARCODE_NO_ASCII + | BARCODE_OUT_NOHEADERS; + + /* If any flag is clear in "flags", inherit it from "bc->flags" */ + if (!(flags & BARCODE_OUTPUT_MASK)) + flags |= bc->flags & BARCODE_OUTPUT_MASK; + if (!(flags & BARCODE_NO_ASCII)) + flags |= bc->flags & BARCODE_NO_ASCII; + if (!(flags & BARCODE_OUT_NOHEADERS)) + flags |= bc->flags & BARCODE_OUT_NOHEADERS; + flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); + + if (bc->flags & BARCODE_OUT_PCL) + return Barcode_pcl_print(bc, f); + return Barcode_ps_print(bc, f); +} + +/* + * Choose the position + */ +int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, + int xoff, int yoff, double scalef) +{ + bc->width = wid; bc->height = hei; + bc->xoff = xoff; bc->yoff = yoff; + bc->scalef = scalef; + return 0; +} + +/* + * Do it all in one step + */ +int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags) +{ + struct Barcode_Item * bc; + + if (!(bc=Barcode_Create(text))) { + errno = -ENOMEM; + return -1; + } + + if ( Barcode_Position(bc, wid, hei, xoff, yoff, 0.0) < 0 + || Barcode_Encode(bc, flags) < 0 + || Barcode_Print(bc, f, flags) < 0) { + errno = bc->error; + Barcode_Delete(bc); + return -1; + } + Barcode_Delete(bc); + return 0; +} + +/* + * Return the version + */ + +int Barcode_Version(char *vptr) +{ + if (vptr) + strcpy(vptr, BARCODE_VERSION); + return BARCODE_VERSION_INT; +} diff --git a/BarCode/msi.c b/BarCode/msi.c new file mode 100644 index 0000000..77a373b --- /dev/null +++ b/BarCode/msi.c @@ -0,0 +1,155 @@ +/* + * msi.c -- encoding for MSI-Plessey + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* Patterns */ +static char *patterns[] = { "13", "31" }; + +static char *fillers[] = { "031", "131" }; + +static int width = 16 /* each character uses 4 patterns */, + startpos = 6 /* length of the first filler */; + +/* + * Check that the text can be encoded. Returns 0 or -1. + */ +int Barcode_msi_verify(unsigned char *text) +{ + int i; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + if (!isdigit(text[i])) + return -1; + } + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr, "%s%s%s%s", + patterns[(code >> 3) & 1], + patterns[(code >> 2) & 1], + patterns[(code >> 1) & 1], + patterns[code & 1]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_msi_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *ptr, *textptr; + int i, code, textpos, usesum, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("msi"); + + if ((bc->flags & BARCODE_NO_CHECKSUM)) + usesum = 0; + else + usesum = 1; + + text = bc->ascii; + + /* the partial code is head + 8 * (text + check) + tail + margin + term. */ + partial = malloc( 3 + 8 * (strlen(text) + 1) + 3 + 2 ); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = startpos; + + for (i=0; ipartial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/BarCode/pcl.c b/BarCode/pcl.c new file mode 100644 index 0000000..d5ec097 --- /dev/null +++ b/BarCode/pcl.c @@ -0,0 +1,200 @@ +/* + * pcl.c -- printing the "partial" bar encoding in PCL format + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2001 Andrea Scopece (a.scopece@tin.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ + + +/* + * How do the "partial" and "textinfo" strings work? See file "ps.c" + */ + + +int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f) +{ + int i, j, k, barlen; + double f1, f2, fsav=0; + int mode = '-'; /* text below bars */ + double scalef=1, xpos, x0, y0, yr; + unsigned char *ptr; + unsigned char c; + + char font_id[6]; /* default font, should be "scalable" */ + /* 0 Line printer, use on older LJet II, isn't scalable */ + /* 4148 Univers, use on LJet III series, and Lj 4L, 5L */ + /* 16602 Arial, default LJ family 4, 5, 6, Color, Djet */ + + if (!bc->partial || !bc->textinfo) { + bc->error = EINVAL; + return -1; + } + + /* + * Maybe this first part can be made common to several printing back-ends, + * we'll see how that works when other ouput engines are added + */ + + /* First, calculate barlen */ + barlen = bc->partial[0] - '0'; + for (ptr = bc->partial+1; *ptr; ptr++) + if (isdigit(*ptr)) + barlen += (*ptr - '0'); + else if (islower(*ptr)) + barlen += (*ptr - 'a'+1); + + /* The scale factor depends on bar length */ + if (!bc->scalef) { + if (!bc->width) bc->width = barlen; /* default */ + scalef = bc->scalef = (double)bc->width / (double)barlen; + } + + /* The width defaults to "just enough" */ + if (!bc->width) bc->width = barlen * scalef +1; + + /* But it can be too small, in this case enlarge and center the area */ + if (bc->width < barlen * scalef) { + int wid = barlen * scalef + 1; + bc->xoff -= (wid - bc->width)/2 ; + bc->width = wid; + /* Can't extend too far on the left */ + if (bc->xoff < 0) { + bc->width += -bc->xoff; + bc->xoff = 0; + } + } + + /* The height defaults to 80 points (rescaled) */ + if (!bc->height) bc->height = 80 * scalef; + +#if 0 + /* If too small (5 + text), enlarge and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + int hei = i * scalef; + bc->yoff -= (hei-bc->height)/2; + bc->height = hei; + if (bc->yoff < 0) { + bc->height += -bc->yoff; + bc->yoff = 0; + } + } +#else + /* If too small (5 + text), reduce the scale factor and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + double scaleg = ((double)bc->height) / i; + int wid = bc->width * scaleg / scalef; + bc->xoff += (bc->width - wid)/2; + bc->width = wid; + scalef = scaleg; + } +#endif + + /* + * deal with PCL output + */ + + xpos = bc->margin + (bc->partial[0]-'0') * scalef; + for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { + /* special cases: '+' and '-' */ + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; /* don't count it */ i++; continue; + } + + /* j is the width of this bar/space */ + if (isdigit (*ptr)) j = *ptr-'0'; + else j = *ptr-'a'+1; + if (i%2) { /* bar */ + x0 = bc->xoff + xpos; + y0 = bc->yoff + bc->margin; + yr = bc->height; + if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ + if (mode == '-') { + /* text below bars: 10 points or five points */ + yr -= (isdigit(*ptr) ? 10 : 5) * scalef; + } else { /* '+' */ + /* text above bars: 10 or 0 from bottom, and 10 from top */ + y0 += (isdigit(*ptr) ? 10 : 0) * scalef; + yr -= (isdigit(*ptr) ? 20 : 10) * scalef; + } + } + + fprintf(f,"%c&a%.0fH", 27, x0 * 10.0); + fprintf(f,"%c&a%.0fV", 27, y0 * 10.0); + fprintf(f,"%c*c%.0fH", 27, ((j*scalef)-SHRINK_AMOUNT) * 10.0); + fprintf(f,"%c*c%.0fV", 27, yr * 10.0); + fprintf(f,"%c*c0P\n", 27); + } + xpos += j * scalef; + } + + /* the text */ + + mode = '-'; /* reinstantiate default */ + if (!(bc->flags & BARCODE_NO_ASCII)) { + k=0; /* k is the "previous font size" */ + for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { + while (*ptr == ' ') ptr++; + if (!*ptr) break; + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; continue; + } + if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { + fprintf(stderr, "barcode: impossible data: %s\n", ptr); + continue; + } + + /* select a Scalable Font */ + + if (fsav != f2) + { + if ((bc->flags & BARCODE_OUT_PCL_III) == BARCODE_OUT_PCL_III) + { strcpy(font_id, "4148"); /* font Univers */ + } + else + { strcpy(font_id, "16602"); /* font Arial */ + } + + fprintf(f,"%c(8U%c(s1p%5.2fv0s0b%sT", 27, 27, f2 * scalef, font_id); + } + fsav = f2; + + fprintf(f,"%c&a%.0fH", 27, (bc->xoff + f1 * scalef + bc->margin) * 10.0); + fprintf(f,"%c&a%.0fV", 27, + mode != '-' + ? ((double)bc->yoff + bc->margin + 8*scalef) * 10.0 + : ((double)bc->yoff + bc->margin + bc->height ) * 10.0); + + fprintf(f, "%c", c); + } + + } + + return 0; +} diff --git a/BarCode/plessey.c b/BarCode/plessey.c new file mode 100644 index 0000000..ec47100 --- /dev/null +++ b/BarCode/plessey.c @@ -0,0 +1,164 @@ +/* + * plessey.c -- encoding for Plessey + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +static char * patterns[] = { "13", "31" }; + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789" "ABCDEF"; + +/* stop sequence may be 231311313 (barcodemill.com) */ +static char *fillers[] = { "031311331", "331311313" }; + +static int width = 16, startpos = 16; + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it + */ +int Barcode_pls_verify(unsigned char *text) +{ + int i, upper = 0, lower = 0; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + if (!strchr(alphabet,toupper(text[i]))) + return -1; + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + } + if (upper && lower) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr, "%s%s%s%s", + patterns[code & 1], + patterns[(code >> 1) & 1], + patterns[(code >> 2) & 1], + patterns[(code >> 3) & 1] + ); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_pls_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + unsigned char *checkptr; + int i, code, textpos; + static char check[9] = {1,1,1,1,0,1,0,0,1}; + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("plessey"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 8 * (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 4) * 8 + 3); + checkptr = calloc (1, strlen(text) * 4 + 8); + + if (!partial || !checkptr) { + if (partial) free(partial); + if (checkptr) free(checkptr); + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = startpos; + + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + + textpos += width; /* width of each code */ + textptr += strlen(textptr); + ptr += strlen(ptr); + checkptr[4*i] = code & 1; + checkptr[4*i+1] = (code >> 1) & 1; + checkptr[4*i+2] = (code >> 2) & 1; + checkptr[4*i+3] = (code >> 3) & 1; + } + /* The CRC checksum is required */ + for (i=0; i < 4*strlen(text); i++) { + int j; + if (checkptr[i]) + for (j = 0; j < 9; j++) + checkptr[i+j] ^= check[j]; + } + for (i = 0; i < 8; i++) { + sprintf(ptr, patterns[checkptr[strlen(text) * 4 + i]]); + ptr += 2; + } + fprintf(stderr, "CRC: "); + for (i = 0; i < 8; i++) { + fputc('0' + checkptr[strlen(text) * 4 + i], stderr); + } + fputc('\n', stderr); + strcpy(ptr, fillers[1]); + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/BarCode/ps.c b/BarCode/ps.c new file mode 100644 index 0000000..c9d18d6 --- /dev/null +++ b/BarCode/ps.c @@ -0,0 +1,273 @@ +/* + * ps.c -- printing the "partial" bar encoding + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ + + +/* + * How do the "partial" and "textinfo" strings work? + * + * The first char in "partial" tells how much extra space to add to the + * left of the bars. For EAN-13, it is used to leave space to print the + * first digit, other codes may have '0' for no-extra-space-needed. + * + * The next characters are alternating bars and spaces, as multiples + * of the base dimension which is 1 unless the code is + * rescaled. Rescaling is calculated as the ratio from the requested + * width and the calculated width. Digits represent bar/space + * dimensions. Lower-case letters represent those bars that should + * extend lower than the others: 'a' is equivalent to '1', 'b' is '2' and + * so on. + * + * The "textinfo" string is made up of fields "%lf:%lf:%c" separated by + * blank space. The first integer is the x position of the character, + * the second is the font size (before rescaling) and the char item is + * the charcter to be printed. + * + * Both the "partial" and "textinfo" strings may include "-" or "+" as + * special characters (in "textinfo" the char should be a standalone + * word). They state where the text should be printed: below the bars + * ("-", default) or above the bars. This is used, for example, to + * print the add-5 and add-2 codes to the right of UPC or EAN codes + * (the add-5 extension is mostly used in ISBN codes. + */ + + +int Barcode_ps_print(struct Barcode_Item *bc, FILE *f) +{ + int i, j, k, barlen, printable=1; + double f1, f2, fsav=0; + int mode = '-'; /* text below bars */ + double scalef=1, xpos, x0, y0, yr; + unsigned char *ptr; + unsigned char c; + + if (!bc->partial || !bc->textinfo) { + bc->error = EINVAL; + return -1; + } + + + /* + * Maybe this first part can be made common to several printing back-ends, + * we'll see how that works when other ouput engines are added + */ + + /* First, calculate barlen */ + barlen = bc->partial[0] - '0'; + for (ptr = bc->partial+1; *ptr; ptr++) + if (isdigit(*ptr)) + barlen += (*ptr - '0'); + else if (islower(*ptr)) + barlen += (*ptr - 'a'+1); + + /* The scale factor depends on bar length */ + if (!bc->scalef) { + if (!bc->width) bc->width = barlen; /* default */ + scalef = bc->scalef = (double)bc->width / (double)barlen; + } + + /* The width defaults to "just enough" */ + if (!bc->width) bc->width = barlen * scalef +1; + + /* But it can be too small, in this case enlarge and center the area */ + if (bc->width < barlen * scalef) { + int wid = barlen * scalef + 1; + bc->xoff -= (wid - bc->width)/2 ; + bc->width = wid; + /* Can't extend too far on the left */ + if (bc->xoff < 0) { + bc->width += -bc->xoff; + bc->xoff = 0; + } + } + + /* The height defaults to 80 points (rescaled) */ + if (!bc->height) bc->height = 80 * scalef; + +#if 0 + /* If too small (5 + text), enlarge and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + int hei = i * scalef; + bc->yoff -= (hei-bc->height)/2; + bc->height = hei; + if (bc->yoff < 0) { + bc->height += -bc->yoff; + bc->yoff = 0; + } + } +#else + /* If too small (5 + text), reduce the scale factor and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + double scaleg = ((double)bc->height) / i; + int wid = bc->width * scaleg / scalef; + bc->xoff += (bc->width - wid)/2; + bc->width = wid; + scalef = scaleg; + } +#endif + + /* + * Ok, then deal with actual ps (eps) output + */ + + if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { /* spit a header first */ + if (bc->flags & BARCODE_OUT_EPS) + fprintf(f, "%%!PS-Adobe-2.0 EPSF-1.2\n"); + else + fprintf(f, "%%!PS-Adobe-2.0\n"); + fprintf(f, "%%%%Creator: libbarcode\n"); + if (bc->flags & BARCODE_OUT_EPS) { + fprintf(f, "%%%%BoundingBox: %i %i %i %i\n", + bc->xoff, + bc->yoff, + bc->xoff + bc->width + 2* bc->margin, + bc->yoff + bc->height + 2* bc->margin); + } + fprintf(f, "%%%%EndComments\n"); + if (bc->flags & BARCODE_OUT_PS) { + fprintf(f, "%%%%EndProlog\n\n"); + fprintf(f, "%%%%Page: 1 1\n\n"); + } + } + + /* Print some informative comments */ + for (i=0; bc->ascii[i]; i++) + if (bc->ascii[i] < ' ') + printable = 0; + + fprintf(f,"%% Printing barcode for \"%s\", scaled %5.2f", + printable ? bc->ascii : "", scalef); + if (bc->encoding) + fprintf(f,", encoded using \"%s\"",bc->encoding); + fprintf(f, "\n"); + fprintf(f,"%% The space/bar succession is represented " + "by the following widths (space first):\n" + "%% "); + for (i=0; ipartial); i++) { + unsigned char c = bc->partial[i]; + if (isdigit(c)) putc(c, f); + if (islower(c)) putc(c-'a'+'1', f); + if (isupper(c)) putc(c-'A'+'1', f); + } + /* open array for "forall" */ + fprintf(f, "\n[\n%% height xpos ypos width" + " height xpos ypos width\n"); + + xpos = bc->margin + (bc->partial[0]-'0') * scalef; + for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { + /* special cases: '+' and '-' */ + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; /* don't count it */ i++; continue; + } + /* j is the width of this bar/space */ + if (isdigit (*ptr)) j = *ptr-'0'; + else j = *ptr-'a'+1; + if (i%2) { /* bar */ + x0 = bc->xoff + xpos + (j*scalef)/2; + y0 = bc->yoff + bc->margin; + yr = bc->height; + if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ + if (mode == '-') { + /* text below bars: 10 points or five points */ + y0 += (isdigit(*ptr) ? 10 : 5) * scalef; + yr -= (isdigit(*ptr) ? 10 : 5) * scalef; + } else { /* '+' */ + /* text above bars: 10 or 0 from bottom, and 10 from top */ + y0 += (isdigit(*ptr) ? 10 : 0) * scalef; + yr -= (isdigit(*ptr) ? 20 : 10) * scalef; + } + } + /* Define an array and then use "forall" (Hans Schou) */ + fprintf(f," [%5.2f %6.2f %6.2f %5.2f]%s", + yr, x0, y0, (j * scalef) - SHRINK_AMOUNT, + i%4 == 1 ? " " : "\n"); + } + xpos += j * scalef; + } + fprintf(f,"\n]\t{ {} forall setlinewidth moveto 0 exch rlineto stroke} " + "bind forall\n"); + + /* Then, the text */ + + mode = '-'; /* reinstantiate default */ + if (!(bc->flags & BARCODE_NO_ASCII)) { + fprintf(f, "[\n%% char xpos ypos fontsize\n"); + k=0; /* k is the "previous font size" */ + for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { + while (*ptr == ' ') ptr++; + if (!*ptr) break; + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; continue; + } + if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { + fprintf(stderr, "barcode: impossible data: %s\n", ptr); + continue; + } + + fprintf(f, " [("); + /* Both the backslash and the two parens are special */ + if (c=='\\' || c==')' || c=='(') + fprintf(f, "\\%c) ", c); + else + fprintf(f, "%c) ", c); + fprintf(f, "%6.2f %6.2f %5.2f]\n", + bc->xoff + f1 * scalef + bc->margin, + mode == '-' + ? (double)bc->yoff + bc->margin + : (double)bc->yoff + bc->margin+bc->height - 8*scalef, + fsav == f2 ? 0.0 : f2 * scalef); + fsav = f2; + } + fprintf(f,"] { {} forall dup 0.00 ne {\n\t" + "/Helvetica findfont exch scalefont setfont\n" + " } {pop} ifelse\n" + " moveto show} bind forall\n"); + + + } + + fprintf(f,"%% End barcode for \"%s\"\n\n", + printable ? bc->ascii : ""); + + if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { + if (bc->flags & BARCODE_OUT_PS) { + fprintf(f,"showpage\n"); + fprintf(f, "%%%%Trailer\n\n"); + } + + } + return 0; +} + + + + diff --git a/BarCode/rr/QBarCode.cpp b/BarCode/rr/QBarCode.cpp new file mode 100644 index 0000000..1549daf --- /dev/null +++ b/BarCode/rr/QBarCode.cpp @@ -0,0 +1,178 @@ +#include "QBarCode.h" +#include "ui_myBarCode.h" +#include "QImage" +#include "QFile" +#include "QFileInfo" +#include "QDebug" +#include "stdio.h" + +QBarCode::QBarCode(QWidget *parent) : + QDialog(parent), + ui(new Ui::QBarCode) +{ + ui->setupUi(this); + + connect(ui->BarCodeGenerate,SIGNAL(pressed()),this,SLOT(onEnCodeBar())); + + ui->lineEdit->setText("12345678ABCDEFG"); + + //onEnCodeBar(); + +} + +QBarCode::~QBarCode() +{ + delete ui; +} + + +void QBarCode::onEnCodeBar(){ + + QFile f1; + //ui->lineEdit->setText("dfdsfdsfdsfdsf"); + int ps = 1, pcl = 0, oflags; + ps = 0; pcl = 0; + + oflags = BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; + +// char *txt = ui->lineEdit->text.toStdString().c_str(); + //sprintf(txt,"%s", (char *)ui->lineEdit->text().data()); + /* and my data as code-128B autodetected */ + QString txt =ui->lineEdit->text(); + Barcode_Encode_and_Print((char *)txt.toStdString().c_str(),stdout, 0, 60, 240, 510, + oflags); + + /* A few code-39 ones */ + // Barcode_Encode_and_Print("silly code",stdout, 0, 0, 40, 320, + // BARCODE_39 | oflags); + +// Barcode_Encode_and_Print("SAMPLE CODES",stdout, 100, 30, 400, 80, +// BARCODE_39 | oflags); + + /* ISBN with add-5 */ +// Barcode_Encode_and_Print("1-56592-292-1 90000",stdout, 0, 0, 40, 430, +// BARCODE_ISBN | oflags); + + +} +/* + * Do it all in one step + */ +int QBarCode::Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags) +{ + struct Barcode_Item * bc; + + if (!(bc=Barcode_Create(text))) { + qDebug()<<"mem less then:";//<< -ENOMEM ; + return -1; + } + + if ( Barcode_Position(bc, wid, hei, xoff, yoff, 0.0) < 0 + || Barcode_Encode(bc, flags) < 0 + //|| Barcode_Print(bc, f, flags) < 0 + ) { + qDebug()<< bc->error; + Barcode_Delete(bc); + return -1; + } + //QFile f1; + bcText = text; + bcTextinfo = bc->textinfo; + bcPartial = bc->partial; + ui->textEdit->setText(bcPartial); + + Barcode_ToImage(bc); + + Barcode_Delete(bc); + return 0; +} + +// 将条形码编码转换成点阵图形 +int QBarCode::Barcode_ToImage(Barcode_Item * bc ){ + bc->ascii; + bc->partial; + bc->textinfo; + int len =QString(bc->partial).length(); + bcWidth =6; + for(int i=0;ipartial[i]&0x0f); + // + //bcWidth = len; + bcHeight = 40; + + QImage image(bcWidth,bcHeight,QImage::Format_ARGB32); + //image.dotsPerMeterX() + //image.size().setHeight(50); + image.fill(0x00ffffff); + //QPainter painter(&image); + //ui->textEdit->document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + QString txt = bc->ascii; + + ui->textEdit->setText( QString().sprintf("W:%d,H:%d,Len:%d",ui->BarCodeView->width(),ui->BarCodeView->height(),len)); + + //0b1a2a4123221223211221132221231213212223112312131311222314111b3c1a1b + //11:12:1 22:12:2 33:12:3 44:12:4 55:12:5 66:12:6 77:12:7 88:12:8 + //02112141232212232112211322212312132122231123121313112223141112331112 + + memset(pointMap,0,sizeof(pointMap)); + unsigned char *img= image.bits(); + for(int j=0;j< 20;j++){ + int i=3; + unsigned char p=0; + for(int n=0;( npartial[n]; + if(c<0x30 || c>127) continue; + c = c-0x30; + if(n%2==1){ + for(int r=0;rlabBarCode->setPixmap(QPixmap(QString::fromUtf8(".\\imgd.BMP"))); + + //ui->widgetPrintTextDisplay->dat = pointMap; + + ShowBarCode(fileName); +} + +void QBarCode::ShowBarCode(QString fileName) +{ + /****************界面初始化********************************/ + + this->pictureName =fileName ; + scene = new QGraphicsScene; + scene->setSceneRect( -200,0,bcWidth*4+200,bcHeight); + scene->setItemIndexMethod(QGraphicsScene::NoIndex); + QPixmap pixmap(this->pictureName); + pixmap = pixmap.scaledToWidth(2.5*bcWidth); + item = scene->addPixmap(pixmap); + + /***************设置view的场景*****************************/ + ui->BarCodeView->setScene(scene); + ui->BarCodeView->setRenderHint(QPainter::Antialiasing); + ui->BarCodeView->setCacheMode(QGraphicsView::CacheBackground); + ui->BarCodeView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + ui->BarCodeView->setDragMode(QGraphicsView::ScrollHandDrag); + //ui->graphicsView->resize(400,300); + + ui->BarCodeView->setScene(scene);//设置view的场景 + +} + diff --git a/BarCode/rr/QBarCode.h b/BarCode/rr/QBarCode.h new file mode 100644 index 0000000..080b347 --- /dev/null +++ b/BarCode/rr/QBarCode.h @@ -0,0 +1,44 @@ +#ifndef QBARCODE_H +#define QBARCODE_H + +#include +#include "barcode.h" +#include "QGraphicsScene" +#include "QGraphicsPixmapItem" + +namespace Ui { + class QBarCode; +} + +class QBarCode : public QDialog +{ + Q_OBJECT + +public: + explicit QBarCode(QWidget *parent = 0); + ~QBarCode(); + unsigned char pointMap[40*1000]; + QString pictureName;//当前显示的图片 +private slots: + void onEnCodeBar(); + +private: + void ShowBarCode(QString fileName); + int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags); + int Barcode_ToImage(Barcode_Item * bc ); + + QGraphicsScene *scene;//声明scene + QGraphicsPixmapItem *item;//声明item + + QString bcPartial; + QString bcTextinfo; + QString bcText; + int bcWidth,bcHeight; + + +private: + Ui::QBarCode *ui; +}; + +#endif // QBARCODE_H diff --git a/BarCode/rr/QBarCode.ui b/BarCode/rr/QBarCode.ui new file mode 100644 index 0000000..ceeb9bf --- /dev/null +++ b/BarCode/rr/QBarCode.ui @@ -0,0 +1,147 @@ + + + QBarCode + + + + 0 + 0 + 680 + 316 + + + + Form + + + + + + + + + + + 条形码类型 + + + + + + + 字体 + + + + + + + 条形码高度 + + + + + + + 放大等级 + + + + + + + + + + + 120 + 0 + + + + + + + + + + + 1 + + + 10 + + + 1 + + + + + + + 插入文档 + + + + + + + 文本信息 + + + + + + + + + + + 16777215 + 60 + + + + + + + + FileName + + + + + + + 打开文件 + + + + + + + 生成条形码 + + + + + + + 关闭 + + + + + + + + + TextLabel + + + + + + + + diff --git a/Binarization/Binarization.cpp b/Binarization/Binarization.cpp new file mode 100644 index 0000000..b506c55 --- /dev/null +++ b/Binarization/Binarization.cpp @@ -0,0 +1,141 @@ +#include "Binarization.h" + +CBinarization::CBinarization( QString imgPath ) + : threshold(0) +{ + // ¼ÓÔØͼƬ + _img = new QImage(); + if (NULL != _img) + { + _img->load(imgPath); + } +} + +// Éú³ɻҶÈͼÏñ +QImage* CBinarization::grayScaleImg() +{ + if (NULL == _img) + { + return NULL; + } + int nWidth = _img->width(); + int nHeight = _img->height(); + + // ÕâÀïÁôÒ⣬ÎÒʹÓÃÁËQImage::Format_Grayscale8¸ñʽµÄͼƬ£¬ÕâÖÖͼƬÿ¸öÏñËØֻÓÃÁË8bit´洢»ҶÈÑÕɫֵ + QImage* grayImg = new QImage(nWidth, nHeight, QImage::Format_RGB888); + QRgb rgbVal = 0; + int grayVal = 0; + + for (int x = 0; x < nWidth; ++x) + { + for (int y = 0; y < nHeight; ++y) + { + rgbVal = _img->pixel(x, y); + + grayVal = qGray(rgbVal); // ÕâÀïµ÷ÓÃQtµĺ¯Êý£¬ʹÓÃ(R * 11 + G * 16 + B * 5)/32µķ½·¨¼ÆËã + + grayImg->setPixel(x, y, QColor(grayVal, grayVal, grayVal).rgb()); + } + } + + return grayImg; +} + +int CBinarization::Otsu(QImage* img) +{ + if (NULL == img) + { + return -1; + } + vector histogram = Histogram(img); + int total = 0; + for (int i = 0; i != histogram.size(); ++i) + { + total += histogram[i]; + } + + double sum = 0.0; + for (unsigned int i = 1; i < histogram.size(); ++i) + sum += i * histogram[i]; + double sumB = 0.0; + double wB = 0.0; + double wF = 0.0; + double mB = 0.0; + double mF = 0.0; + double max = 0.0; + double between = 0.0; + double threshold = 0.0; + for (int i = 0; i != 256; ++i) + { + wB += histogram[i]; + if (wB == 0) + continue; + wF = total - wB; + if (wF == 0) + break; + sumB += i * histogram[i]; + mB = sumB / wB; + mF = (sum - sumB) / wF; + between = wB * wF * (mB - mF) * (mB - mF); + if ( between > max ) + { + threshold = i; + max = between; + } + } + return threshold; +} + +QImage* CBinarization::process(QImage* img) +{ + if (NULL == img) + { + return NULL; + } + int width = img->width(); + int height = img->height(); + int bytePerLine = img->bytesPerLine(); // ÿһÐеÄ×ֽÚÊý + unsigned char *data = img->bits(); + unsigned char *binarydata = new unsigned char[bytePerLine * height]; + + unsigned char g = 0; + for (int i = 0; i < height; ++i) + { + for (int j = 0; j < width; ++j) + { + g = *(data + i * bytePerLine + j * 3); // ÕâÀïj ³ËÒÔ 3 + if(int(g) >= threshold) + { + binarydata[ i * bytePerLine + j * 3] = 0xFF; // ÿ¸öɫֵÐèҪ¶Ô3¸ö×ֽڸ³ֵ + binarydata[ i * bytePerLine + j * 3 + 1] = 0xFF; + binarydata[ i * bytePerLine + j * 3 + 2] = 0xFF; + } + else + { + binarydata[ i * bytePerLine + j * 3] = 0x00; + binarydata[ i * bytePerLine + j * 3 + 1] = 0x00; + binarydata[ i * bytePerLine + j * 3 + 2] = 0x00; + } + } + } + + QImage *ret = new QImage(binarydata, width, height, bytePerLine, QImage::Format_RGB888); + return ret; +} + +std::vector CBinarization::Histogram( QImage* img ) +{ + unsigned char* graydata = img->bits(); + vector hist(256); // 256ɫ + for (int i = 0; i != img->width(); ++i) + { + for (int j = 0; j != img->height(); ++j) + { + int index = int(*graydata); + hist[index] += 1; + graydata += 1; // step + } + } + graydata = NULL; + return hist; +} diff --git a/Binarization/Binarization.h b/Binarization/Binarization.h new file mode 100644 index 0000000..e342802 --- /dev/null +++ b/Binarization/Binarization.h @@ -0,0 +1,24 @@ +#ifndef CBINARIZATION_H +#define CBINARIZATION_H + +#include +#include + +using namespace std; + +class CBinarization +{ +public: + CBinarization(QString imgPath); + + QImage* grayScaleImg(); + int Otsu(QImage* img); + QImage* process(QImage* img); + int threshold; + +private: + QImage* _img; + + vector Histogram(QImage* img); +}; +#endif diff --git a/CN/mainwindow.ui b/CN/mainwindow.ui new file mode 100644 index 0000000..7d8be97 --- /dev/null +++ b/CN/mainwindow.ui @@ -0,0 +1,3813 @@ + + + MainWindow + + + true + + + + 0 + 0 + 640 + 460 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 5 + 5 + + + + Qt::StrongFocus + + + InkJet + + + + + 0 + 0 + 641 + 455 + + + + + 0 + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + 1 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + + + 0 + 50 + + + + + + 0 + 0 + 686 + 47 + + + + + + + + 0 + 45 + + + + 编辑 + + + + :/icon/edit.png:/icon/edit.png + + + + + + + + 0 + 45 + + + + 打开文件 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + + 0 + 45 + + + + 二维码 + + + + :/icon/bypm.png:/icon/bypm.png + + + + + + + + 0 + 45 + + + + 条形码 + + + + :/icon/BarCode1.png:/icon/BarCode1.png + + + + + + + + 0 + 45 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + 0 + 45 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + 交替打印文件名 + + + + + + + + + + + + 0 + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 最大:[40行x 2048列] + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 140 + 25 + + + + + 140 + 25 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 同步器速度 + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + Qt::Vertical + + + + + + + + 0 + 25 + + + + + 100 + 25 + + + + 当前时间 + + + + + + + + + + + + + 640 + 107 + + + + 0 + + + + + + + + 610 + 95 + + + + + 620 + 96 + + + + BlankCursor + + + 0 + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi';"></p></body></html> + + + + + + + + + + 5 + 5 + 620 + 100 + + + + + 0 + 0 + + + + + 620 + 100 + + + + + 16777215 + 80 + + + + false + + + + + 0 + 0 + 500 + 53 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 60 + + + + + 60 + 16777215 + + + + + + + :/image/reset.png + + + + + + + + + 0 + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨线开关 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 喷头盖开 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水缸满 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 溶剂液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 回收故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 粘度故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 相位故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 高压故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 故障恢复 + + + + + + + + + 0 + + + 4 + + + + + 0 + + + 0 + + + 0 + + + + + + 110 + 0 + + + + + 110 + 16777215 + + + + 立即重新计米 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + Qt::Horizontal + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品总计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + Qt::Horizontal + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + + + + + + + + + 110 + 40 + + + + + 110 + 16777215 + + + + Qt::LeftToRight + + + false + + + 关机 + + + + :/icon/poweroff.png:/icon/poweroff.png + + + + + + + + + 7 + + + 5 + + + 0 + + + + + 6 + + + 3 + + + 0 + + + 0 + + + 3 + + + + + 3 + + + + + 3 + + + + + + 300 + 0 + + + + + 300 + 16777215 + + + + + + + true + + + + + + + + 160 + 0 + + + + + 180 + 20 + + + + 2014-08-23 + + + Qt::AlignCenter + + + + + + + + + + + 0 + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 70 + 20 + + + + 晶振电压 + + + + + + + + 35 + 20 + + + + 粘度 + + + + + + + + 35 + 20 + + + + 压力 + + + + + + + + 64 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 70 + 20 + + + + 隔膜位置 + + + + + + + + 70 + 0 + + + + + 64 + 20 + + + + + + + + + + + + + + 0 + 60 + + + + + 80 + 16777215 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 147 + 146 + 146 + + + + + + + + 开 + + + + :/icon/openreclaimtanl.png:/icon/openreclaimtanl.png + + + + + + + + 60 + 0 + + + + + 70 + 60 + + + + + + + + + + + + 0 + 60 + + + + + 80 + 16777215 + + + + 关 + + + + :/icon/closereclaimtanl.png:/icon/closereclaimtanl.png + + + + + + + + + + + + + 3 + + + 0 + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 0 + 170 + 0 + + + + + + + 85 + 170 + 127 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 186 + 188 + 185 + + + + + + + 242 + 241 + 240 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/startprint2.png + :/icon/startprint1.png + :/icon/startprint1.png + :/icon/startprint.png:/icon/startprint2.png + + + + 110 + 70 + + + + false + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 199 + 189 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 227 + 97 + 75 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 227 + 97 + 75 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/stopprint2.png + :/icon/stopprint1.png + :/icon/stopprint1.png + :/icon/stopprint.png:/icon/stopprint2.png + + + + 110 + 70 + + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 255 + 170 + 0 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 206 + 203 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/pauseprint2.png + :/icon/pauseprint1.png + :/icon/pauseprint1.png + :/icon/pauseprint.png:/icon/pauseprint2.png + + + + 110 + 70 + + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + 喷嘴逆清洗 + + + + + + + + + + + + + + + + PicWidget + QWidget +
PicWidget.h
+ 1 +
+ + ClickLabel + QLabel +
ClickLabel.h
+
+ + TextEditOption + QWidget +
TextEditOption.h
+ 1 +
+ + PrintTextDisplay + QWidget +
PrintTextDisplay.h
+ 1 +
+ + MyTextEdit + QTextEdit +
MyTextEdit.h
+
+
+ + + + +
diff --git a/ClickLabel.cpp b/ClickLabel.cpp new file mode 100644 index 0000000..a95580f --- /dev/null +++ b/ClickLabel.cpp @@ -0,0 +1,6 @@ +#include +#include +void ClickLabel::mousePressEvent(QMouseEvent *evt) +{ + emit pressed(); +} diff --git a/ClickLabel.h b/ClickLabel.h new file mode 100644 index 0000000..80d46f4 --- /dev/null +++ b/ClickLabel.h @@ -0,0 +1,20 @@ +#ifndef __CLICKLABEL__ +#define __CLICKLABEL__ + +#include + +class ClickLabel:public QLabel{ + Q_OBJECT + + signals: + void pressed(void); + public: + ClickLabel(QWidget *parent=0): QLabel(parent){ + } + + protected: + void mousePressEvent( QMouseEvent* ); + +}; + +#endif diff --git a/DacDisplayAndEdit.cpp b/DacDisplayAndEdit.cpp new file mode 100644 index 0000000..b52b015 --- /dev/null +++ b/DacDisplayAndEdit.cpp @@ -0,0 +1,96 @@ + +#include "DacDisplayAndEdit.h" +#include "ui_dacdisplayandedit.h" +#include "QLatin1Char" +#include "qdebug.h" +#include "qmessagebox.h" + +DacDisplayAndEdit::DacDisplayAndEdit(QWidget *parent) : + QWidget(parent), + ui(new Ui::DacDisplayAndEdit) +{ + ui->setupUi(this); + for(int i = 0; i < DAC_GRID_MAX_ROW*DAC_GRID_MAX_COL; i++){ + memLineEdit[i] = new QLineEdit(this); + memLineEdit[i]->setAccessibleName(QString::number(i)); + memLineEdit[i]->setEnabled(false); + ui->gridLayoutMem->addWidget(memLineEdit[i],(i/DAC_GRID_MAX_COL) + 1,(i%DAC_GRID_MAX_COL) + 1); + connect(memLineEdit[i],SIGNAL(editingFinished ()),this,SLOT(onLineEditEditingFinished())); + } + for(int i = 0; i < DAC_GRID_MAX_ROW; i++){ + rowLabel[i] = new QLabel(this); + ui->gridLayoutMem->addWidget(rowLabel[i],i + 1,0); + } + editFlag = false; + writeMemBaseAddr = 0; + readMemBaseAddr = 0; + setEnabled(1); +} + +DacDisplayAndEdit::~DacDisplayAndEdit() +{ + delete ui; +} +// updateSysStatusToUI +void DacDisplayAndEdit::updateSysStatusToUI(void){ + // +} +void DacDisplayAndEdit::updateAuthorization(int auth) +{ + //qDebug ()<setText(QString(" ")); + for(int i = 1; i < DAC_GRID_MAX_ROW*DAC_GRID_MAX_COL; i++){ + if(sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK]>25)sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK]=25; + if(sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK]<5) sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK]=5; + memLineEdit[i]->setText(QString("%1").arg(sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK],2,10/*,QLatin1Char('0')*/)); + } + } +} + +void DacDisplayAndEdit::on_pushButtonEdit_pressed() +{//ddd + if(sysPara){ + editFlag = !editFlag; + for(int i = 1; i < DAC_GRID_MAX_ROW*DAC_GRID_MAX_COL; i++){ + memLineEdit[i]->setEnabled(editFlag); + if(editFlag) memLineEdit[i]->setText(QString("%1").arg(sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK],2,10,QLatin1Char('0'))); + + } + ui->pushButtonEdit->setText(editFlag?tr("完成"):tr("编辑")); + } +} +void DacDisplayAndEdit::on_pushButtonDefault_pressed()// pushButtonDefault pushButtonDefault +{ + if(sysPara){ + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("是否将点距微调参数设置为默认值?")); + QPushButton *saveButton = msgBox.addButton(tr("是"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("否"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + msgBox.exec(); + if (msgBox.clickedButton() == saveButton) { + for(int i = 1; i < DAC_GRID_MAX_ROW*DAC_GRID_MAX_COL; i++){ + sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK]=15; + memLineEdit[i]->setText(tr("%1").arg(sysPara->para.adjVolDacRate[i&MAX_RD_DAC_SIZE_MASK],2,10,QLatin1Char('0'))); + } + } + } + else qDebug()<<"sysPara not bind!"; +} + +void DacDisplayAndEdit::onLineEditEditingFinished(){ + int val,addr=0; + bool ok; + QLineEdit * edit = qobject_cast(sender()); + QString name = edit->accessibleName(); + val = edit->text().toInt(&ok,10); + if(sysPara){ + addr = name.toInt(&ok); + if(val>25)val=25; + if(val<5) val =5; + sysPara->para.adjVolDacRate[(addr)&MAX_RD_DAC_SIZE_MASK] = (unsigned char)val; + } +} diff --git a/DacDisplayAndEdit.h b/DacDisplayAndEdit.h new file mode 100644 index 0000000..8c30d84 --- /dev/null +++ b/DacDisplayAndEdit.h @@ -0,0 +1,45 @@ +#ifndef DACDISPLAYANDEDIT_H +#define DACDISPLAYANDEDIT_H + +#include +#include +#include +#include +#define DAC_GRID_MAX_ROW 4 +#define DAC_GRID_MAX_COL 10 +#define MAX_RD_DAC_SIZE_MASK 0x3f +#define MAX_WR_DAC_SIZE_MASK 0x3f +namespace Ui { +class DacDisplayAndEdit; +} + +class DacDisplayAndEdit : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit DacDisplayAndEdit(QWidget *parent = 0); + ~DacDisplayAndEdit(); + + void updateSysStatusToUI(void); + void updateSysParaToUI(void); + void updateAuthorization(int auth); + +private slots: + void on_pushButtonEdit_pressed(); + void on_pushButtonDefault_pressed(); + void onLineEditEditingFinished(); + + +private: + Ui::DacDisplayAndEdit *ui; + QLineEdit *memLineEdit[DAC_GRID_MAX_ROW*DAC_GRID_MAX_COL]; + QLabel *rowLabel[DAC_GRID_MAX_ROW]; + bool editFlag; //是否当前处于编辑模式 + int writeMemBaseAddr; + int readMemBaseAddr; +}; + +#endif +// DacDisplayANDEDIT_H + diff --git a/DevOp.cpp b/DevOp.cpp new file mode 100644 index 0000000..8fd5c4c --- /dev/null +++ b/DevOp.cpp @@ -0,0 +1,6810 @@ +/* + * DevOp.cpp + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin:设备操作模块,各种泵阀之类的操作都在此处 + + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include "LogInfo.h" +#include +#include "InputMethod.h" +#include +#include +#include +#include +#include +#include +#ifndef Q_OS_WIN32 + #include + #include +#else + #define ioctl(a,...) (0 == 0) +#endif +#include +#include +#include +#include +#include +#include +#include "SysPara.h" +#include +#include "DevOp.h" +#include "Public.h" +#include "myinclude.h" + +#include "qnamespace.h" + +#define PRINT_CTRL_ADDR_BASE 0xa400 + +#define PRINT_DIGITAL_CHAR_BASE_ADDR (0xe000) + +#define WRITE_CALENDAR_DAT_ADDR (0xb100) + +#define RECYCLE_SLOT_STOP 0x1 +#define RECYCLE_SLOT_CLOSE 0x2 +#define RECYCLE_SLOT_OPEN 0x0 +#define PRINT_START_STOP_CTRL (PRINT_CTRL_ADDR_BASE + 0x40) +#define PRINT_RESET_PRODUCT_CNT (PRINT_CTRL_ADDR_BASE + 0x41) +#define RECYCLE_SLOT_CTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x42) +#define RESUME_FAULT_ADDR (PRINT_CTRL_ADDR_BASE + 0x43) + +#define VAR_CNT_ADDR (PRINT_CTRL_ADDR_BASE + 0x50) +#define VAR_CTRL_REG_ADDR (PRINT_CTRL_ADDR_BASE + 0x51) +#define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x59) +//#define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x5a) +#define WRITE_CNT1GROUP_COUNT 0xB13E +#define WRITE_CNT1GROUP_NUM 0xB13F +#define WRITE_CNT1GROUP_SETTING 0xB140 +#define READ_CNT1GROUP_CURR_LOOP 0x0190 +#define READ_CNT1GROUP_CURR_INDEX 0x0194 + +#define FPGA_STATUS_BASE_ADDR 0x0000 +#define FPGA_VERSOIN_NUM (FPGA_STATUS_BASE_ADDR + 0xfe) + + +#define READ_BUILD_DAT (FPGA_STATUS_BASE_ADDR + 0xf0) + +#define READ_PRINTDATA_XOR (FPGA_STATUS_BASE_ADDR + 0xf2) +#define READ_SYNC_COUNTER (FPGA_STATUS_BASE_ADDR + 0xf4) + +#define PHASE_DETECT_HIGH_VOLTAGE_TM 0x100 +#define READ_CALENDAR_DAT_ADDR 0x180 + +#define READ_RAND_FIFO_ADDR 0x200 // 读FPGA的随机码FIFO + +#define ROW_PRINT_SEQNENCE_ADDR 0xb200 //行扫描顺序 +#define DAC_TABLE_ADDR 0xb280 //每一个行点对应的DAC值 +#define NOT_GAP_DAC_TABLE_ADDR 0xb380 //每一个不隔点对应的DAC值 +#define FULL_COL_DAC_TABLE_ADDR 0xb480 //每一个不隔点对应的DAC值 + +#define MATCH_FULL_DAC_TABLE_ADDR 0xB500 // 匹配满列 DAC表 起始地址 +#define MATCH_1_DAC_TABLE_ADDR 0xB600 // 匹配单点 DAC表 起始地址 +#define MATCH_2_DAC_TABLE_ADDR 0xB700 // 匹配两点 DAC表 起始地址 +#define MATCH_3_DAC_TABLE_ADDR 0xB800 // 匹配三点 DAC表 起始地址 +#define MATCH_4_DAC_TABLE_ADDR 0xB900 // 匹配四点 DAC表 起始地址 +#define MATCH_5_DAC_TABLE_ADDR 0xBA00 // 匹配五点 DAC表 起始地址 +#define MATCH_G1_DAC_TABLE_ADDR 0xBC00 // 匹配空一点 DAC表 起始地址 +#define MATCH_G2_DAC_TABLE_ADDR 0xBC80 // 匹配空两点 DAC表 起始地址 +#define MATCH_G3_DAC_TABLE_ADDR 0xBD00 // 匹配空三点 DAC表 起始地址 +#define MATCH_G4_DAC_TABLE_ADDR 0xBD80 // 匹配空四点 DAC表 起始地址 +#define MATCH_G5_DAC_TABLE_ADDR 0xBE00 // 匹配空五点 DAC表 起始地址 +#define MATCH_G6_DAC_TABLE_ADDR 0xBE80 // 匹配空六点 DAC表 起始地址 +#define MATCH_P1_DAC_TABLE_ADDR 0xBF00 // 匹配预备一 DAC表 起始地址 +#define MATCH_P2_DAC_TABLE_ADDR 0xBF80 // 匹配预备二 DAC表 起始地址 +#define MATCH_C_DAC_TABLE_ADDR 0xC000 // 匹配复杂 DAC表 起始地址 + +#define WRITE_COUNTER3_ADDR (0xb150) +//#define READ_CNT3_CURVALUE_ADDR 0x01b4 +#define READ_CNT3_CURVALUE_ADDR 0x1834 + +#define LOCADDR '1' + + +// 传送打印内容的数据结构 +// $D1rccccLLLLddd...ddco +struct _DataFromPC { + char keyword; // 特征字符 $ + char fun; // 功能码,固定为"D", 表示传送打印点阵信息 + char devAddr; // 默认01, (01~08) + char printRowDotNum; // 信息点阵垂直有效行数5~40点 + int printColDotNum; // 信息点阵水平有效列数8~3100列,均为8的整数倍值。 + int Length; // (printRowDotNum* (1+printColDotNum/8)) + 1字节(检验码)+1字节(结束字符) + char *dotData; // 按行列顺序排列的点阵数据,实际点阵数据总字节数为:printRowDotNum* printColDotNum/8 + char crc; // 校验字节 + char eoc; // 结束符,固定为小写字母'o' +}dataFromPC,r_dataFromPC; + +struct _TextFromPC { + char keyword; // 特征字符 ‘#’ + char fun; // 功能码,固定为‘T’, 表示传送打印点阵信息 + char devAddr; // 默认 1, (1~8) + unsigned char Length; // Head(4) + 字串长度[32] + 1字节(检验码)+1字节(结束字符) + char mStr[32]; // 定长,不足补 '\0' + char crc; // 校验字节 + char eoc; // 结束符,固定为小写字母'o' +}TextFromPC,r_TextFromPC; // 38字节 + +// 传送参数和命令的数据结构 +// &C14PPFco +struct _ParaFromPC{ + unsigned char keyword; // 特征字符 & + unsigned char fun; // 功能码,固定为"C",表示传送参数或命令 + unsigned char devAddr; // 默认01, (01~08) + unsigned char Length; // 参数长度,从参数printCmd到 eoc 的总字节数 + unsigned char printCmd; // "P"表示开始打印,"S"表示停止打印,"p"表示暂停打印, "O"表示不操作 + unsigned char printMode; // "F" 正向打印,"R" 正向打印, "U" 上下颠倒打印,"T" 上下左右同时颠倒打印 + // 还可以添加其它参数 + + unsigned char crc; // 校验字节 + unsigned char eoc; // 结束符,固定为小写字母'o' + +}paraFromPC,r_paraFromPC; +// &R14S?co 查询喷码机状态 +// &R14D?co 查询打印内容点阵 + + +// 查询喷码机状态的数据结构 +/*所有警告都是高电平警告*/ +struct _StatusToPC{ + unsigned char keyword; // 特征字符 # + unsigned char fun; // 功能码,固定为"S",表示传送喷码机状态数据 + unsigned char devAddr; // 默认01, (01~08) + unsigned char Length; // 参数长度,从参数printCmd到 eoc 的总字节数 + unsigned char printCmd; // 打印操作当前状态, "P"表示正在打印,"S"表示停止打印,"p"表示暂停打印, "C"表示回收槽未开,"W"表示等待状态 + unsigned char printMode; // 当前打印方向状态,其中:"F" 正向打印,"R" 正向打印, "U" 上下颠倒打印,"T" 上下左右同时颠倒打印 + + unsigned char statWarn:8; // {墨线开关,高压报警,回收故障,墨水液位,溶剂液位,墨水渗漏,喷头盖开,粘度故障} + + unsigned char isPumpValveControledByHand:1; // 手动控制阀泵标志,1手动,0自动 + unsigned char mainInkPumpError:1; //主墨泵故障 + unsigned char selfCheckDone:1; // 自检完成标志, 1完成,0没有完成 + unsigned char reclainTankReachEnd:1; //回收槽打开完成标志 + unsigned char beeperOnFlag:1; // 报警标志 有故障 + unsigned char lostCommuFlag:1; //失去通信 + unsigned char isPrinting:1; // 正在打印标志 + unsigned char reclaimTankBlockedAppending:1; //回收槽被卡住 + + unsigned int selfCheckCnt; // 自检时间计数器,60s倒计时 + unsigned int currReclaimTankPos; // 回收槽开位置 + //unsigned char InkLineStaus; // 0 关,1-开ing,2--关ing,3-开完成 + unsigned int productCnt; // 产品计数器 + // 还可以添加一些其它状态 + + unsigned char crc; // 校验字节 + unsigned char eoc; // 结束符,固定为小写字母'o' +}statusToPC; +// 不足4的倍数时,自动补足到4的倍数。 如statusToPC原本为 22字节,但实际的sizeof(statusToPC) = 24 + +// 传送当前打印内容点阵到PC的数据结构 +struct _DataToPC { + unsigned char keyword; // 特征字符 # + unsigned char fun; // 功能码,固定为"D", 表示传送打印点阵信息 + unsigned char devAddr; // 默认01, (01~08) + unsigned char printRowDotNum; // 信息点阵垂直有效行数5~40点 + unsigned int printColDotNum; // 信息点阵水平有效列数8~3100列,均为8的整数倍值。 + unsigned int Length; // (printRowDotNum* (1+printColDotNum/8)) + 1字节(检验码)+1字节(结束字符) + unsigned char *dotData; // 按行列顺序排列的点阵数据,实际点阵数据总字节数为:printRowDotNum* printColDotNum/8 + unsigned char crc; // 校验字节 + unsigned char eoc; // 结束符,固定为小写字母'o' +}dataToPC; + +typedef struct adjlen_strut { + + unsigned char uint8varLenHeadEn:8; // 头部使能 + unsigned int changeHeadlen:24; // 头部可变长的长度。实际长度 + unsigned int headCounter:16; // 变量1起始值+这个数,执行可变长 + unsigned int endCounter:16; // 变量1结束值-这个数,执行可变长 + unsigned char uint8varLenEndEn:8; // 尾部使能 + unsigned int changeEndlen:24; // 尾部可变长的长度。实际长度 + +// unsigned char uint8varLenEn; +// unsigned int changelen:24; +}Adjlen_strut; + +static unsigned short WireDim_mm=3745; + +void GetCRC(unsigned char *send_tab,unsigned int strlen,unsigned char *CRC_tab) //strlen为校验数组的长度,CRC_tab生成长度为的CRC数组低位在前 +{ + unsigned int CRCfull=0xffff; + unsigned char CRChigh=0xff; + unsigned char CRClow=0xff; + unsigned char CRCLSB; + unsigned int i,j; + for(i=0;i>1)&0x7fff); + if(CRCLSB==1) + { + CRCfull=(unsigned int)(CRCfull^0xa001); + } + } + + } + CRClow = (unsigned char)((CRCfull) & 0xff); + CRChigh = (unsigned char)((CRCfull>>8) & 0xFF); + CRC_tab[0]=CRClow; + CRC_tab[1]=CRChigh; +} +unsigned char ValidCRC(unsigned char *send_tab,unsigned int strlen) //strlen为校验数组的长度,CRC_tab生成长度为的CRC数组低位在前 +{ + unsigned int CRCfull=0xffff; + unsigned char CRChigh=0xff; + unsigned char CRClow=0xff; + unsigned char CRCLSB; + unsigned int i,j; + if(strlen>=2) + { + for(i=0;i>1)&0x7fff); + if(CRCLSB==1) + { + CRCfull=(unsigned int)(CRCfull^0xa001); + } + } + + } + CRClow = (unsigned char)((CRCfull) & 0xff); + CRChigh = (unsigned char)((CRCfull>>8) & 0xFF); + + if((send_tab[strlen-2]==CRClow)&&(send_tab[strlen-1]==CRChigh)) + return 1; + else return 0; + } + else return 0; +} + +int DevOp::BigDisp(unsigned char Module[],unsigned char Wirediameter[]) +{ + int Len=23; + int i; + unsigned char CrcBuf[2]; + unsigned char SendBuf[]={ + 0x01,0x10, + 0x00,0x00,0x00,0x07,//7 + 0x0e,//14 + 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x30,0x31,0x32,//10 + 0x00,0x00,0x00,0x01, + 0,0}; + for(i=0;i<10;i++) + SendBuf[7+i]=Module[i]; + for(i=0;i<4;i++) + SendBuf[17+i]=Wirediameter[i]; + GetCRC(SendBuf ,7+ SendBuf[6], CrcBuf);// + SendBuf[Len-2] = CrcBuf[0]; + SendBuf[Len-1] = CrcBuf[1]; +#ifdef UART2 + sendCom((char*)SendBuf,Len); +#endif + //showData( QByteArray((char *)SendBuf,Len)); + +//01 10 00 00 00 07 0E 63 64 65 77 73 61 20 20 20 20 0E A1 00 00 74 D0 + +} +int DevOp::SmallDisp(unsigned char Module[],unsigned char Wirediameter[]) +{ + int Len=21; + int i=0; + unsigned char CrcBuf[2]; + unsigned char SendBuf[]={ + 0x01,0x10,//2 + 0x00,0x00,0x00,0x06,//4 + 0x0c,//1 + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,//10 + 0x00,0x00,//0x00,0x01, + 0,0}; + for(i=0;i<10;i++) + SendBuf[7+i]=Module[i]; + for(i=0;i<2;i++) + SendBuf[17+i]=Wirediameter[i]; + GetCRC(SendBuf ,7+ SendBuf[6], CrcBuf);// + SendBuf[Len-2] = CrcBuf[0]; + SendBuf[Len-1] = CrcBuf[1]; +#ifdef UART2 + sendCom((char*)SendBuf,Len); +#endif + //showData( QByteArray((char *)SendBuf,Len)); +} + +int DevOp::RecDim() +{ + unsigned char CrcBuf[2]; + unsigned char SendBuf[]={ + 0x02,0x03, + 0x00,0x61,0x00,0x01, + 0,0}; + GetCRC(SendBuf ,6, CrcBuf);// + SendBuf[6] = CrcBuf[0]; + SendBuf[7] = CrcBuf[1]; +#ifdef UART2 + if(myCom==0) uart2Init(); + sendCom((char *)SendBuf,8); +#endif + //showData( QByteArray((char *)SendBuf,Len)); +} +/* +"02 03 00 61 00 01 D5 E7 " +"01 10 00 00 00 07 0E 42 41 44 43 45 46 47 30 31 32 00 00 00 01 90 4E " +"02 03 00 61 00 01 D5 E7 " +"01 10 00 00 00 06 0C 42 41 44 43 45 46 47 30 31 32 00 12 46 A6 " + +02 03 02 23 83 A4 D5 // +02 03 02 00 00 FC 44 +02 03 02 0B C0 FB 24 +02 03 02 27 11 27 B8 +02 03 02 0D E3 B9 5D +02 03 02 0D FC F8 95 +02 03 02 07 E2 7E 3D +02 03 02 00 00 FC 44 +02 03 02 00 00 FC 44 +02 03 02 35 9C EB 7D +02 03 02 0B A4 FA CF +02 03 02 15 B4 F2 A3 +02 03 02 25 0B A7 13 +// 3.745 +02 03 02 0E 9B B9 8F +02 03 02 0E 9B B9 8F +02 03 02 0E A1 39 9C +02 03 02 0E B3 B9 91 +02 03 02 0E B8 F8 56 + +01 10 00 00 00 06 0C 42 41 44 43 45 46 47 30 31 32 0E B8 C2 B9 + +*/ + +void DevOp::DatToDisp(char FileName[], bool big ) +{ + unsigned char cc[4]={0x00,0x00,0x00,0x00}; + RecDim(); + if(big){ + unsigned short m= WireDim_mm; + cc[0]=(m>>8) & 0xff; + cc[1]=(m) & 0xff; + cc[2]=(m>>8) & 0xff; + cc[3]=(m) & 0xff; + + BigDisp((unsigned char *)FileName,cc); + } + else { + unsigned short m= WireDim_mm/10; + cc[0]=(m>>8) & 0xff; + cc[1]=(m) & 0xff; + SmallDisp((unsigned char *)FileName,cc); + } + +} +void DevOp::DatToDisp2() +{ + //(char *)(QFileInfo(sysPara->para.lastOpenedFileName).baseName().toAscii().data()); + QString FileName=QFileInfo(sysPara->para.lastOpenedFileName).fileName(); + unsigned char cc[4]={0x00,0x00,0x00,0x00}; + unsigned char buf[30]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};//10 + //RecDim(); + char big =sysPara->para.ExtScreenType; + int len=FileName.length(),n; + //n=len; + while(len) + { + len--; + if(FileName.at(len)=='.') break; + } + + //qDebug()<<"send to Ping"<< (unsigned char)big; + if(big<1) return; //无外接屏时 + WdgttyUsb0Cnt++; + if(WdgttyUsb0Cnt>2){ + WdgttyUsb0Cnt=0;//myCom=0; + uart2Init(); + } + //qDebug()<<"WdgttyUsb0Cnt"<para.ExtMeterType==0) m=sysPara->status.productCnt;//总米数 + else if(sysPara->para.ExtMeterType==1)m=QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + else m= QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); + + cc[0]=(m>>23) & 0xff; + cc[1]=(m>>16) & 0xff; + cc[2]=(m>>8) & 0xff; + cc[3]=(m) & 0xff; + BigDisp((unsigned char *)buf,cc); + } + else if(big==1) + { + unsigned short m= WireDim_mm/10; + cc[0]=(m>>8) & 0xff; + cc[1]=(m) & 0xff; + SmallDisp((unsigned char *)buf,cc); + } + +} + +void DevOp::uart2Init() +{ +//#ifdef ARMUART + // myCom = new Posix_QextSerialPort("/dev/ttySAC1",QextSerialBase::Polling); +//#else + static int mm=0; +#ifdef UART2 + qDebug()<< "UART2 "<isOpen())myCom->close(); + if(myCom==0) + { + myCom = new Posix_QextSerialPort("/dev/ttyUSB0",QextSerialBase::Polling); + if(myCom==0) myCom = new Posix_QextSerialPort("/dev/ttyUSB1",QextSerialBase::Polling); + } + //#endif + if(myCom->isOpen()) myCom->close(); + myCom ->open(QIODevice::ReadWrite); + + if (!myCom->isOpen()) + { + qDebug()<<"Uart2 is not open!"; + //sysPara->status.ExtScreenEn=0; + return; + } + sysPara->status.ExtScreenEn=1; + myCom->setBaudRate(BAUD9600); + myCom->setDataBits(DATA_8); + myCom->setParity(PAR_NONE); + myCom->setStopBits(STOP_1); + myCom->setFlowControl(FLOW_OFF); + myCom->setTimeout(1); + //uartThreadStart(); + sendCom("Uart Init ok."); + //qDebug()<status.ExtScreenEn; +#endif + +} + +DevOp::DevOp(SysPara * sysPara) +{ + this->sysPara = sysPara; + +#ifndef Q_OS_WIN32 + int fp; + char *pPwmMode; +#ifdef UART1 + uartThread = NULL; // 线程初始化 + + #ifdef ARMUART + //fp = open("/dev/tty1",O_RDONLY); // 改变console + //ioctl(fp,TIOCCONS); //TIOCCONS 的作用是使成为虚拟控制台 + //close(fp); + myCom = new Posix_QextSerialPort("/dev/ttySAC0",QextSerialBase::Polling); + + #else + printf("change1\n"); + fp = open("/dev/tty1",O_RDONLY); // 改变console + ioctl(fp,TIOCCONS); //TIOCCONS 的作用是使成为虚拟控制台 + close(fp); + + //myCom = new Posix_QextSerialPort("/dev/ttyS0",QextSerialBase::Polling); + // myCom = new Posix_QextSerialPort("/dev/ttyUSB0",QextSerialBase::Polling); + myCom = new Posix_QextSerialPort("/dev/ttyS1",QextSerialBase::Polling); + #endif + + data.clear(); + byteArray.clear(); + rec_cmd.mode=0; + + myCom ->open(QIODevice::ReadWrite); + if (!myCom->isOpen()) + qDebug()<<"Uart1 is not open!"; + myCom->setBaudRate(BAUD115200); + myCom->setDataBits(DATA_8); + myCom->setParity(PAR_NONE); + myCom->setStopBits(STOP_1); + myCom->setFlowControl(FLOW_OFF); + myCom->setTimeout(30); + //uartThreadStart(); + sendingEnable = true; + sendCom("The Printer Uart1 is Ok."); + //qDebug()<<("change TO TTY1.\n"); + //system("echo '123'>ttyS0"); + //qDebug()<<("change2\n"); +#endif + +#ifdef DEBUG_CNT + //qDebug()<<"QT_MAJOR_VERSION"<20) + OscillatorVoltage[i] = 68+i-50; + else if(i>11) + { + OscillatorVoltage[i] = 15+2*(i-10); + } + else + { + OscillatorVoltage[i]=11; + } + } + OscillatorVoltage[0]=0; +#endif + if(!sysPara){ + QMessageBox::critical(0,"错误","DevOp构造函数的sysParam不能为空"); //设个陷阱,防止误操作 + } +} + + +void DevOp::TTYS0ToConsole(void) +{ + int fp; +#ifdef UART1 + if(myCom->isOpen()) myCom->close(); + fp = open("/dev/tty0",O_RDONLY); //恢复console 到串口0 + ioctl(fp,TIOCCONS); + close(fp); + //qDebug()<<"ttyS0 to Console."; +#endif + +#ifdef UART2 + +#else + fp = open("/dev/tty0",O_RDONLY); //恢复console 到串口0 + ioctl(fp,TIOCCONS); + close(fp); +#endif + +} + + +DevOp::~DevOp(){ + +#ifdef UART2 + if(myCom->isOpen()) myCom->close(); +#endif + if(DAdataout >= 0) close(DAdataout); +#ifdef UART1 + if(myCom->isOpen()) myCom->close(); +#endif + + if(pwm_sp >= 0) + close(pwm_sp); + if(pwm_fd >= 0) + close(pwm_fd); + + if(Interrupt_fd >= 0) + close(Interrupt_fd); + if(iocontrl >= 0) + close(iocontrl); + + if(adc_fd >= 0) + close(adc_fd); + for(int i = 0; i < MAX_VARI_NUM; i++){ + vars_t *p_var = &sysPara->status.vars[i]; + if(p_var->original){ + if(p_var->dat) + free(p_var->dat); + } + } + if(myCom) + { + delete(myCom); + } +#ifdef __STC_POWER__ + if(comForPower) + { + comForPower->close(); + delete(comForPower); + } +#endif + //TTYS0ToConsole(); +} + +//QFile PrintDatafile("/home/plg/doc/printData.txt"); + +void DevOp::fpgaWr(int addr,unsigned char*dat,int len){ +#ifdef DEBUG_CNT + +#else + /* + for(int i = addr;i < addr + len ; i++){ + memWrMap[i%MAX_WR_MEM_SIZE] = dat[i - addr]; + } +*/ + if(DAdataout < 0) + return; + lseek(DAdataout, addr, SEEK_SET); + write(DAdataout, dat, len); +#endif +#if 0 + { + QString strtmp = "Addr:<" + QString::number(addr,16) + ">Data:"; + + //PrintDatafile.seek(0); + //file.write((char *)&jd.addr,(long long int)sizeof(jd)); + PrintDatafile.write(strtmp.toStdString().c_str()); + + //PrintDatafile.write((char *)dat,(qint64)len); + strtmp = ""; + QString strTxt; + for(int i =0; i 4){ + DisErrorMsg(); + return 0; + } + fpgaRd(addr, (unsigned char *)&data, len); + return data; +} + + +void DevOp::controlReleaseValve(bool openFlag){ + ioctl(iocontrl, openFlag, 7); + releaseValveOpenFlag = openFlag; + pumpValveCtrl(); +} + +void DevOp::controlMixValve(bool openFlag){ + ioctl(iocontrl, openFlag, 6); + mixValveFlag = openFlag; + pumpValveCtrl(); +} +void DevOp::controlInkValve(bool openFlag){ + ioctl(iocontrl, openFlag, 4); + inkValveOpenFlag = openFlag; + pumpValveCtrl(); +} +void DevOp::controlCycleValve(bool openFlag){ + ioctl(iocontrl, openFlag, 5); + cycleValveOpenFlag = openFlag; + pumpValveCtrl(); +} +void DevOp::controlCompressPump(bool openFlag){ + ioctl(iocontrl, !openFlag, 1); + compressPumpOpenFlag = openFlag; + pumpValveCtrl(); +} + +#define PWM_IOCTL_SET_FREQ 1 // PWM输出 +#define PWM_IOCTL_STOP 0 //设置为低电平输出 +#define PWM_IOCTL_HIGH 2 // 设置为高电平输出 +#define PWM_IOCTL_SET_WIDE 3 + +//#define FRE_SP 12000 +#define FRE_SP 13760 +void DevOp::controlViscosityPump(bool openFlag){ + viscosityPumpOpenFlag = openFlag; + pumpValveCtrl(); + if(openFlag){ + if(pwm_fd == -1) + pwm_fd = open("/dev/pwm", 0 |O_NONBLOCK); + ioctl(pwm_fd, PWM_IOCTL_SET_FREQ,50);//50 +#ifdef __VX__ + ioctl(pwm_fd, PWM_IOCTL_SET_WIDE,0); +#else + ioctl(pwm_fd, PWM_IOCTL_SET_WIDE,50); +#endif + //(sysPara->para.vicosityPumpType)?50:1); //50hz + } + else + { + if(pwm_fd != -1){ + ioctl(pwm_fd, PWM_IOCTL_HIGH); + close(pwm_fd); + pwm_fd = -1; + } + } + //qDebug()<<"pwm_fd"<para.reclaimPumpPWMWidth?sysPara->para.reclaimPumpPWMWidth:90)); + } + else{ + //ioctl(iocontrl, 0, 2); + ioctl(pwm_sp, PWM_IOCTL_STOP); //PWM_IOCTL_STOP= 2 + } + reclaimPumpOpenFlag = openFlag; + pumpValveCtrl(); +} + +void DevOp::controlHeater(bool openFlag){ + ioctl(iocontrl, !openFlag, 11); + heaterOnFlag = openFlag; + pumpValveCtrl(); + +} + +void DevOp::controlBeeper(bool openFlag){ + ioctl(iocontrl, !openFlag, 9); + beeperOnFlag = openFlag; + +} + +void DevOp::controlRedLight(bool openFlag){ //2013-12-11 红绿黄报警灯 + ioctl(iocontrl, openFlag, 12); + RedLightOnFlag = openFlag; +} + +void DevOp::controlGreenLight(bool openFlag){ + ioctl(iocontrl, openFlag, 13); + GreenLightOnFlag = openFlag; +} + +void DevOp::controlYellowLight(bool openFlag){ + ioctl(iocontrl, openFlag, 14); + YellowLightOnFlag = openFlag; +} + +void DevOp::controlFan1(bool openFlag) +{ + ioctl(iocontrl, openFlag, 15); + sysPara->status.flagOfStirrer = openFlag; +} + +void DevOp::controlFan2(bool openFlag) +{ + ioctl(iocontrl, openFlag, 16); +} + +void DevOp::powerOff(void){ + ioctl(iocontrl, 0, 0); +} + + +void DevOp::controlReclaimTankOpen(bool enableFlag){ + if(enableFlag) + fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_OPEN,1); + else + fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_STOP,1); + + reclaimTankCloseEnableFlag = false; + reclaimTankOpenEnableFlag = enableFlag; +} + + +void DevOp::controlReclaimTankClose(bool enableFlag){ + if(enableFlag) + fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_CLOSE,1); + else + fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_STOP,1); + + reclaimTankOpenEnableFlag = false; + reclaimTankCloseEnableFlag = enableFlag; +} + + +bool DevOp::isReleaseValveOpen(){ + return releaseValveOpenFlag; +} +bool DevOp::isMixValveOpen(){ + return mixValveFlag; +} +bool DevOp::isInkValveOpen(){ + return inkValveOpenFlag; +} +bool DevOp::isCycleValveOpen(){ + return cycleValveOpenFlag; +} +bool DevOp::isCompressPumpOpen(){ + return compressPumpOpenFlag; +} +bool DevOp::isViscosityPumpOpen(){ + + return viscosityPumpOpenFlag; +} +bool DevOp::isMainInkPumpOpen(){ + return mainInkPumpOpenFlag; +} +bool DevOp::isReclaimPumpOpen(){ + return reclaimPumpOpenFlag; +} +bool DevOp::isReclaimTankOpenEnable(){ + return reclaimTankOpenEnableFlag; +} +bool DevOp::isReclaimTankCloseEnable(){ + return reclaimTankCloseEnableFlag; +} + +bool DevOp::isBeeperEnable(){ + return beeperOnFlag; +} +bool DevOp::isRedLightEnable(){ //2013-12-11 红绿黄报警灯 + return RedLightOnFlag; +} + +bool DevOp::isGreenLightEnable(){ + return GreenLightOnFlag; +} + +bool DevOp::isYellowLightEnable(){ + return YellowLightOnFlag; +} +bool DevOp::isHearterEnable(){ + return heaterOnFlag; +} + +void DevOp::readFgaStatus(){ + fpgaRd(FPGA_STATUS_BASE_ADDR,(unsigned char *)&sysPara->status,FPGA_STATUS_BYTE_NUM); +} + +void DevOp::checkAuthorization(QString str){ + + fpgaWr(0xA800,(unsigned char *) str.toStdString().c_str(),str.length()); +} + +void DevOp::set_totalSynPulseNum(bool wren) +{ + short adjLen=0; +// unsigned int temp; +// unsigned char uint8varLenEn; + + Adjlen_strut adjlen_strut; + + int val = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + if(sysPara==0)return; + if(sysPara->para.varLenEn) + { +#ifdef __VX_OSC_VOL__ + adjLen = sysPara->para.varLen; + adjlen_strut.changeHeadlen = (int )( + (sysPara->para.synTriggerPrintLenMm+adjLen) + *sysPara->para.synPulseNumPerMm); + //adjlen_strut.headCounter = sysPara->para.headLen?sysPara->para.headLen:0; + adjlen_strut.headCounter = QString::number(sysPara->para.cnt1StartValue + sysPara->para.headLen).toUInt(0,16);//vx版本 + adjlen_strut.uint8varLenHeadEn = sysPara->para.headLen?1:0; + adjLen = sysPara->para.varLen1; + adjlen_strut.changeEndlen = (int )( + (sysPara->para.synTriggerPrintLenMm+adjLen) + *sysPara->para.synPulseNumPerMm); + //adjlen_strut.endCounter = sysPara->para.endLen?sysPara->para.endLen:0; + adjlen_strut.endCounter = QString::number(sysPara->para.cnt1EndValue - sysPara->para.endLen).toUInt(0,16); + adjlen_strut.uint8varLenEndEn = sysPara->para.endLen?1:0; +#else + adjLen = sysPara->para.varLen; + adjlen_strut.changeHeadlen = (int )( + (sysPara->para.synTriggerPrintLenMm+adjLen) + *sysPara->para.synPulseNumPerMm); + adjlen_strut.headCounter = sysPara->para.headLen?sysPara->para.headLen:0; + adjlen_strut.uint8varLenHeadEn = sysPara->para.headLen?1:0; + adjLen = sysPara->para.varLen1; + adjlen_strut.changeEndlen = (int )( + (sysPara->para.synTriggerPrintLenMm+adjLen) + *sysPara->para.synPulseNumPerMm); + adjlen_strut.endCounter = sysPara->para.endLen?sysPara->para.endLen:0; + adjlen_strut.uint8varLenEndEn = sysPara->para.endLen?1:0; +#endif +// qDebug()<< "uint8varLenHeadEn"<para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER)) + { + sysPara->para.totalSynPulseNum = (int )((sysPara->para.synTriggerPrintLenMm)*sysPara->para.synPulseNumPerMm); + } + else if(((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL + ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + && sysPara->para.eleEyeTriggerSynPrintEn)) + { + sysPara->para.totalSynPulseNum = (int )((sysPara->para.elecEyeTriggerInterval)*sysPara->para.synPulseNumPerMm); + } + +// if(sysPara->para.varLenEn == 0){ +// adjlen_strut.uint8varLenEn = 0; +// }else +// { +// adjlen_strut.uint8varLenEn = 1; +// } + + LogInfo::setRunStatusText(QString("a400: %1").arg(sysPara->para.printTotalColNum)); + fpgaWr(PRINT_CTRL_ADDR_BASE, (unsigned char *)&sysPara->para, 0x14); + fpgaWr(PRINT_CTRL_ADDR_BASE + 0x76, (unsigned char *)&adjlen_strut, sizeof(Adjlen_strut)); + + +// } +// qDebug()<<"adjlen_strut.changelen = "<para.varLen1="<para.varLen1; +// qDebug()<<"sysPara->para.varLenEn="<para.varLenEn; +// qDebug()<<"synTriggerPrintLenMm:"<para.synTriggerPrintLenMm; +// qDebug()<<"synPulseNumPerMm:"<para.synPulseNumPerMm; +// qDebug()<<"adjLen"<para.totalSynPulseNum; +#ifdef DEBUG_CNT + qDebug()<<"adjLen"<para.totalSynPulseNum; +#endif +} + +unsigned short short2BCD(unsigned short value) +{ + unsigned short bcd = 0; + bcd = (value/1000)*4096 + ((value%1000)/100)*256 + ((value%100)/10)*16 + value%10; + return bcd; +} + +int DevOp::writeFpgaPrintPara(bool ignoreWarn){ + +#ifdef SYS_LINUX + unsigned int type = sysPara->status.fpgaVersionNum >> 12; + if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable + || sysPara->status.build_dat.builTime == 73 || type == 6) + sysPara->loadVolteParaFromFile((PRINT_MODE)sysPara->para.currPrintMode); + + int currPrintCol = sysPara->status.currPrintCol + BLANK_COL_NUM; + sysPara->para.printRowDelay = sysPara->para.currPrintMode; + sysPara->para.pixNumPerCol = sysPara->status.currPrintRow; + sysPara->para.reducedPixelNum = sysPara->para.reducedPixelNumRatio*sysPara->para.pixNumPerCol/100; + sysPara->para.printDirection = (sysPara->para.upDownInverse?1:0) + ((sysPara->para.leftRightInverse?1:0)<<1) + ((sysPara->para.scanInverse?1:0)<<2); + sysPara->para.dotNumPerCol = (sysPara->para.pixNumPerCol- sysPara->para.lineEndAdjustPointCnt)*(sysPara->para.printRowDelay + 1) + + (sysPara->para.lineEndAdjustPointCnt)*(sysPara->para.lineEndAdjustPointDelay + 1); + sysPara->para.dotNumPerCol = sysPara->para.pixNumPerCol? + ((sysPara->para.dotNumPerCol*(sysPara->para.pixNumPerCol - sysPara->para.reducedPixelNum))/sysPara->para.pixNumPerCol):1; + sysPara->para.dotNumPerCol += sysPara->para.printColDelay; + + sysPara->para.dotNumPerCol =( sysPara->para.alterPrint.enable)? sysPara->para.dotNumPerCol/2:sysPara->para.dotNumPerCol; + + sysPara->para.lastLineEndPointFixedDACValue = sysPara->para.lastLineEndPointFixedValue * MAX_FPGA_DAC_VALUE/ 1000; + sysPara->para.productNumToGenerateOutputPulse = sysPara->para.pulseOutputEnable?sysPara->para.productCntPerOutputPulse:0; + sysPara->para.FullColFixDacVal = sysPara->para.FullColFixVal ; // NC + qDebug()<<"dotNumPerCol"<para.dotNumPerCol; + if(sysPara->para.pixNumPerCol - sysPara->para.reducedPixelNum < 2 && sysPara->para.pixNumPerCol > 4){ + if(!ignoreWarn){ + QMessageBox::warning(0,tr("警告"),QString("当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!!").arg(sysPara->para.pixNumPerCol).arg(sysPara->para.reducedPixelNum)); + } + } + + int DACStep = (sysPara->status.currPrintRow && sysPara->status.currAlterPrintRow > 0)? + (sysPara->para.endVoltage - sysPara->para.startVoltage) + * MAX_FPGA_DAC_VALUE/(100 * ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow)) + :0; + int steal_dac_step = sysPara->status.currPrintRow > 3? + (sysPara->para.endVoltage - sysPara->para.startVoltage) + * MAX_FPGA_DAC_VALUE/(100 * ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow-1:sysPara->status.currPrintRow-1)) + :0; + + sysPara->para.steal_dac_row = steal_dac_step; + + int printVerticalButtom = sysPara->para.startVoltage * MAX_FPGA_DAC_VALUE/100; + int printVerticalTop = sysPara->para.endVoltage * MAX_FPGA_DAC_VALUE/100; + int pointAdjustVoltagePos = sysPara->para.pointVoltageAdjustPos * MAX_FPGA_DAC_VALUE/100; //点距电压调整位置 + /*---------------------------------------------------------------------------------*/ +#if 1 + /*---------------------------------------------------------------------------------*/ + // 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值 +// unsigned int pixel_full_table[32] = { // 满点电压表 +// 60, 70, 79, 88, 96, 104, 112, 120, +// 128, 136, 144, 152, 159, 166, 173, 180, +// 187, 194, 201, 208, 215, 222, 229, 236, +// 245, 250, 257, 264, 271, 277, 283, 289 +// }; + + unsigned int pixel_1_table_64k[32] = { // 单点电压表 + 682, 745, 849, 941, 1051, 1146, 1242, 1337, + 1433, 1528, 1624, 1719, 1815, 1911, 1992, 2088, + 2184, 2279, 2375, 2457, 2538, 2620, 2702, 2784, + 2866, 2948, 3030, 3112, 3194, 3276, 3357, 3439 + }; + +#if 1 + unsigned int fast_pixel_1_table_96k[32] = { // 单点电压表 + 950, 1200, 1550, 1780, 2000, 2180, 2330, 2280, + 2450, 2620, 2730, 2870, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }; +#endif +// unsigned int fast_pixel_1_table_96k[32] = { // 单点电压表 +// 950, 1150, 1400, 1560, 1680, 1810, 1900, 0, +// 0, 0, 0, 0, 0, 0, 0, 0, +// 0, 0, 0, 0, 0, 0, 0, 0, +// 0, 0, 0, 0, 0, 0, 0, 0 +// }; + + unsigned int normal_pixel_1_table_128k[32] = { // 单点电压表 + 950, 1200, 1550, 1780, 2000, 2180, 2330, 2280, + 2450, 2620, 2730, 2870, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }; + +// unsigned int pixel_2_table[32][2] = { // 两点电压表 +// { 60, 69 }, { 67, 76 }, { 74, 83 }, { 81, 90 }, { 88, 97 }, { 95, 104 }, { 102, 112 }, { 109, 119 }, +// { 116, 126 }, { 123, 133 }, { 130, 140 }, { 137, 147 }, { 144, 154 }, { 151, 161 }, { 158, 168 }, { 165, 175 }, +// { 172, 182 }, { 179, 189 }, { 186, 196 }, { 193, 203 }, { 200, 210 }, { 207, 217 }, { 214, 224 }, { 221, 231 }, +// { 228, 238 }, { 235, 245 }, { 242, 252 }, { 249, 259 }, { 256, 266 }, { 263, 273 }, { 270, 280 }, { 277, 287 } +// }; + +// unsigned int pixel_3_table[32][3] = { // 三点电压表 +// { 60, 69, 76 }, { 67, 76, 83 }, { 74, 83, 90 }, { 81, 90, 97 }, +// { 88, 97, 104 }, { 95, 104, 112 }, { 102, 112, 120 }, { 109, 119, 127 }, +// { 116, 126, 134 }, { 123, 134, 142 }, { 130, 141, 149 }, { 137, 148, 156 }, +// { 144, 156, 163 }, { 151, 163, 170 }, { 158, 170, 177 }, { 165, 177, 184 }, +// { 172, 184, 191 }, { 179, 191, 197 }, { 186, 198, 205 }, { 193, 205, 212 }, +// { 200, 212, 219 }, { 207, 219, 226 }, { 214, 226, 233 }, { 221, 233, 240 }, +// { 228, 240, 247 }, { 235, 247, 254 }, { 242, 254, 261 }, { 249, 261, 268 }, +// { 256, 268, 275 }, { 263, 275, 282 }, { 270, 282, 289 }, { 277, 289, 296 } +// }; + +// unsigned int pixel_4_table[32][4] = { // 四点电压表 +// { 60, 69, 76, 83 }, { 67, 76, 83, 90 }, { 74, 83, 90, 97 }, { 81, 90, 97, 104 }, +// { 88, 97, 104, 112 }, { 95, 104, 112, 120 }, { 102, 112, 120, 127 }, { 109, 119, 127, 134 }, +// { 116, 126, 134, 142 }, { 123, 134, 142, 149 }, { 130, 141, 149, 156 }, { 137, 148, 156, 163 }, +// { 144, 156, 163, 170 }, { 151, 163, 170, 177 }, { 158, 170, 177, 184 }, { 165, 177, 184, 191 }, +// { 172, 184, 191, 197 }, { 179, 191, 197, 205 }, { 186, 198, 205, 212 }, { 193, 205, 212, 219 }, +// { 200, 212, 219, 226 }, { 207, 219, 226, 233 }, { 214, 226, 233, 240 }, { 221, 233, 240, 247 }, +// { 228, 240, 247, 254 }, { 235, 247, 254, 261 }, { 242, 254, 261, 268 }, { 249, 261, 268, 275 }, +// { 256, 268, 275, 282 }, { 263, 275, 282, 289 }, { 270, 282, 289, 296 }, { 277, 289, 296, 303 } +// }; +//#define DAC_RADIO (((float)sysPara->para.dacScale)/100) // 1V 对应的DAC,看起来13.05比较接近 + //整体阶梯缩放算法:比如缩放比例为80%,一列4个点最后一个点的比例为80%,阶梯为5%(100-80)/4=5,倒数第二个刚是75%,依此类推。 +//#define DAC_RADIO2 (nCurrPrintRow > 1 ? (((float)(100-((100-sysPara->para.dacScale)/((nCurrPrintRow-1)>0?(nCurrPrintRow-1):1)*i)))/100) : 13.05) + + int nCurrPrintRow = sysPara->status.currPrintRow; + + qint16 matchFullDACArray[40]; + qint16 matchOneDACArray[40]; + qint16 matchTwoDACArray[40][2]; + qint16 matchThreeDACArray[40][3]; + qint16 matchFourDACArray[40][4]; + qint16 matchFiveDACArray[40][5]; + qint16 matchGapDACArray[48][5]; + qint16 matchPreDACArray[16][5]; + qint16 matchComplexDACArray[32][4]; + qint16 matchOneDACArrayStandard[32]; + memset(matchFullDACArray, 0, sizeof(matchFullDACArray)); + memset(matchOneDACArray, 0, sizeof(matchOneDACArray)); + memset(matchTwoDACArray, 0, sizeof(matchTwoDACArray)); + memset(matchThreeDACArray, 0, sizeof(matchThreeDACArray)); + memset(matchFourDACArray, 0, sizeof(matchFourDACArray)); + memset(matchFiveDACArray, 0, sizeof(matchFiveDACArray)); + memset(matchGapDACArray, 0, sizeof(matchGapDACArray)); + memset(matchPreDACArray, 0, sizeof(matchPreDACArray)); + memset(matchComplexDACArray, 0, sizeof(matchComplexDACArray)); + memset(matchOneDACArrayStandard, 0, sizeof(matchOneDACArrayStandard)); + if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable){ + for (int i = 0; i < 40; i++) + { + matchFullDACArray[i] = sysPara->voltePara.pixel_full_table[i] ; + } + + for (int i = 0; i < 40; i++) + { + matchOneDACArray[i] = sysPara->voltePara.pixel_1_table[i] ; + } + + for (int i = 0; i < 40; i++) + { + for (int j = 0; j < 2; j++) + { + matchTwoDACArray[i][j] = sysPara->voltePara.pixel_2_table[i][j] ; + } + } + + for (int i = 0; i < 40; i++) + { + for (int j = 0; j < 3; j++) + { + matchThreeDACArray[i][j] = sysPara->voltePara.pixel_3_table[i][j] ; + } + } + + for (int i = 0; i < 40; i++) + { + for (int j = 0; j < 4; j++) + { + matchFourDACArray[i][j] = sysPara->voltePara.pixel_4_table[i][j] ; + } + } + + for (int i = 0; i < 40; i++) + { + for (int j = 0; j < 5; j++) + { + matchFiveDACArray[i][j] = sysPara->voltePara.pixel_5_table[i][j] ; + } + } + + for (int i = 0; i < 48; i++) + { + for (int j = 0; j < 5; j++) + { + matchGapDACArray[i][j] = sysPara->voltePara.pixel_gap_table[i][j] ; + } + } + + for (int i = 0; i < 16; i++) + { + for (int j = 0; j < 5; j++) + { + matchPreDACArray[i][j] = sysPara->voltePara.pixel_pre_table[i][j] ; + } + } + + for (int i = 0; i < 32; i++) + { + for (int j = 0; j < 4; j++) + { + matchComplexDACArray[i][j] = sysPara->voltePara.pixel_c_table[i][j] ; + } + } + + for (int i = 0; i < 16; i++) + { + sysPara->voltePara.pixel_para_table[i] = 0; + } + } + else{ +#if 1 + if (sysPara->para.oscillatoFreq == 0) { // 64K + for (int i = 0; i < 32; i++) + { + matchOneDACArrayStandard[i] = pixel_1_table_64k[i] ; + } + + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if(sysPara->para.printRowDelay == 0) + { + for (int i = 0; i < 32; i++) + { + matchOneDACArrayStandard[i] = fast_pixel_1_table_96k[i] ; + } + } + else if(sysPara->para.printRowDelay == 1) + { + for (int i = 0; i < 32; i++) + { + matchOneDACArrayStandard[i] = fast_pixel_1_table_96k[i] ; + } + } + } + else if (sysPara->para.oscillatoFreq == 3) { // 128k + for (int i = 0; i < 32; i++) + { + matchOneDACArrayStandard[i] = normal_pixel_1_table_128k[i] ; + } + } +#endif + } + +// for (int i = 0; i < 32; i++) +// { +// for (int j = 0; j < 2; j++) +// { +// matchTwoDACArray[i][j] = pixel_2_table[i][j] *DAC_RADIO2; +// } +// } + +// for (int i = 0; i < 32; i++) +// { +// for (int j = 0; j < 3; j++) +// { +// matchThreeDACArray[i][j] = pixel_3_table[i][j] *DAC_RADIO2; +// } +// } + +// for (int i = 0; i < 32; i++) +// { +// for (int j = 0; j < 4; j++) +// { +// matchFourDACArray[i][j] = pixel_4_table[i][j] *DAC_RADIO2; +// } +// } + + // 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值 + /*---------------------------------------------------------------------------------*/ +#endif + unsigned short DACArray[64]; + memset(DACArray,0,sizeof(DACArray)); + quint16 notGapDACArray[64]; + quint16 fullColDACArray[64]; + memset(notGapDACArray,0,sizeof(notGapDACArray)); + memset(fullColDACArray,0,sizeof(fullColDACArray)); + +//#define DAC_RADIO (14.36) // 1V 对应的DAC,看起来13.05比较接近 +//#define DAC_RADIO (13.05) // 1V 对应的DAC,看起来13.05比较接近 +//#define DAC_RADIO (13.05*sysPara->para.dacScale/100) // 1V 对应的DAC,看起来13.05比较接近 +#define DAC_RADIO (nCurrPrintRow > 1 ? (13.05*(100-((100-sysPara->para.dacScale)/((nCurrPrintRow-1)>0?(nCurrPrintRow-1):1)*i))/100) : 13.05) + if(1) + { + //int nCurrPrintRow = sysPara->status.currPrintRow; +#if 0 + + if(sysPara->para.FullColFixVal == 1) + { + //qDebug()<<"adj voltage"<status.currPrintRow; i++) + { + if (i<40) { + float temp = sysPara->para.printed_adj_dac[i] * DAC_RADIO; + // qDebug()<<"normal dac:"<status.currPrintRow; i++) + { + if (i<40) { + float temp = sysPara->para.printed_continue_col_dac[i] * DAC_RADIO; + // qDebug()<<"not gap:"<status.currPrintRow; i++) { + if (i<40) { + float temp = sysPara->para.printed_full_col_dac[i] * DAC_RADIO; + // qDebug()<<"full_col:"<status.currPrintRow; i++) + { + if(!sysPara->para.scanInverse) + DACArray[i] = printVerticalButtom + i*DACStep; + else + DACArray[i] = printVerticalTop - i*DACStep; + + if(DACArray[i] >= pointAdjustVoltagePos) { + DACArray[i] += sysPara->para.PointVoltageAdjustValue; + } + + notGapDACArray[i] = DACArray[i]; + fullColDACArray[i] = DACArray[i]; +// qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<status.currPrintRow; i++) + { + if(!sysPara->para.scanInverse) + DACArray[i] = printVerticalButtom + i*DACStep; + else + DACArray[i] = printVerticalTop - i*DACStep; + + if(DACArray[i] >= pointAdjustVoltagePos) { + DACArray[i] += sysPara->para.PointVoltageAdjustValue; + } + + notGapDACArray[i] = DACArray[i]; + fullColDACArray[i] = DACArray[i]; + // qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<para.mode0211) + { + fast_96k_9dot_full_default_dac[0] = 58; + fast_96k_9dot_full_default_dac[1] = 80; + fast_96k_9dot_full_default_dac[2] = 93; + fast_96k_9dot_full_default_dac[3] = 106; + fast_96k_9dot_full_default_dac[4] = 120; + fast_96k_9dot_full_default_dac[5] = 132; + fast_96k_9dot_full_default_dac[6] = 138; + fast_96k_9dot_full_default_dac[7] = 136; + fast_96k_9dot_full_default_dac[8] = 141; + } + int fast_96k_9dot_adj_default_dac[] = {62, 73, 84, 95, 106, 117, 128, 139, 150}; + int fast_96k_9dot_continue_default_dac[] = {0, 85, 98, 111, 124, 137, 148, 146, 153}; + + int fast_96k_12dot_full_default_dac[] = {60, 82, 96, 110, 124, 138, 152, 152, 164, 176, 188, 200}; + int fast_96k_12dot_adj_default_dac[] = {57, 71, 83, 95, 107, 119, 131, 143, 155, 167, 179, 191}; + int fast_96k_12dot_continue_default_dac[] = {0, 82, 98, 113, 126, 139, 152, 152, 164, 176, 188, 200}; + + int fast_96k_12dot_full_default_dac_U[] = {68, 92, 106, 120, 132, 144, 154, 154, 166, 178, 190, 200}; + int fast_96k_12dot_adj_default_dac_U[] = {0, 65, 83, 95, 108, 120, 132, 144, 156, 168, 180, 192}; + int fast_96k_12dot_continue_default_dac_U[] = {0, 0, 95, 111, 126 , 139, 151, 153, 165, 177, 188, 200}; + + int fast_96k_12dot_full_default_dac_UD[] = {63, 85, 99, 111, 123, 135, 147, 147, 158, 169, 180, 190}; + int fast_96k_12dot_adj_default_dac_UD[] = {0, 60, 77, 88, 99, 110, 122, 134, 146, 158, 170, 182}; + int fast_96k_12dot_continue_default_dac_UD[] = {0, 0, 90, 106, 121, 134, 146, 148, 160, 171, 181, 190}; + + int fast_96k_12dot_full_default_dac_H[] = {68, 90, 108, 125, 141, 156, 170, 170, 180, 193, 204, 214}; + int fast_96k_12dot_adj_default_dac_H[] = {59, 73, 86, 99, 112, 125, 138, 151, 164, 177, 190, 203}; + int fast_96k_12dot_continue_default_dac_H[] = {0, 87, 102, 117, 131 , 145, 159, 161, 173, 186, 199, 212}; + + int fast_96k_12dot_full_default_dac_HU[] = {68, 90, 108, 125, 141, 156, 169, 170, 181, 192, 203, 212}; + int fast_96k_12dot_adj_default_dac_HU[] = {0, 70, 86, 99, 112, 125, 138, 151, 164, 177, 190, 202}; + int fast_96k_12dot_continue_default_dac_HU[] = {0, 0, 100, 117, 130, 143, 157, 160, 173, 186, 199, 211}; + + int normal_96k_5dot_full_default_dac[] = {70, 84, 96, 106, 116}; + int normal_96k_5dot_adj_default_dac[] = {70, 81, 91, 101, 111}; + int normal_96k_5dot_continue_default_dac[] = {0, 82, 94, 104, 114}; + + int normal_96k_5dot_full_default_dac_S[] = {70, 83, 93, 103, 113}; + int normal_96k_5dot_adj_default_dac_S[] = {68, 78, 88, 98, 108}; + int normal_96k_5dot_continue_default_dac_S[] = {0, 83, 93, 103, 113}; + + int normal_96k_5dot_full_default_dac_H[] = {80, 96, 110, 124, 134}; + int normal_96k_5dot_adj_default_dac_H[] = {78, 91, 105, 117, 129}; + int normal_96k_5dot_continue_default_dac_H[] = {0, 94, 108, 121, 134}; + + int normal_96k_7dot_full_default_dac[] = {70, 84, 96, 106, 116, 126, 135}; + int normal_96k_7dot_adj_default_dac[] = {69, 80, 90, 100, 110, 120, 129}; + int normal_96k_7dot_continue_default_dac[] = {0, 82, 94, 104, 114, 124, 134}; + + int normal_96k_7dot_full_default_dac_S[] = {70, 83, 94, 105, 114, 124, 133}; + int normal_96k_7dot_adj_default_dac_S[] = {68, 77, 87, 97, 107, 117, 128}; + int normal_96k_7dot_continue_default_dac_S[] = {0, 83, 93, 103, 113, 123, 133}; + + int normal_96k_7dot_full_default_dac_H[] = {80, 96, 110, 124, 138, 152, 162}; + int normal_96k_7dot_adj_default_dac_H[] = {78, 91, 105, 118, 131, 144, 156}; + int normal_96k_7dot_continue_default_dac_H[] = {0, 94, 108, 121, 134, 147, 160}; + + int normal_96k_9dot_full_default_dac[] = {70, 84, 94, 104, 114, 124, 134, 144, 150}; + int normal_96k_9dot_adj_default_dac[] = {68, 78, 88, 98, 107, 117, 126, 136, 143}; + int normal_96k_9dot_continue_default_dac[] = {0, 82, 92, 102, 112, 122, 132, 142, 152}; + + int normal_96k_9dot_full_default_dac_H[] = {80, 98, 112, 126, 138, 148, 158, 168, 178}; + int normal_96k_9dot_adj_default_dac_H[] = {76, 88, 100, 112, 124, 135, 146, 157, 170}; + int normal_96k_9dot_continue_default_dac_H[] = {0, 94, 108, 120, 132, 144, 155, 165, 176}; + + int normal_96k_12dot_full_default_dac[] = {70, 86, 97, 106, 115, 124, 133, 142, 151, 160, 169, 176}; + int normal_96k_12dot_adj_default_dac[] = {68, 77, 86, 95, 104, 113, 122, 131, 140, 149, 158, 167}; + int normal_96k_12dot_continue_default_dac[] = {0, 83, 92, 101, 110, 119, 128, 137, 146, 156, 165, 174}; + + int normal_96k_12dot_full_default_dac_U[] = {72, 83, 92, 101, 110, 119, 128, 137, 146, 155, 164}; + int normal_96k_12dot_adj_default_dac_U[] = {0, 74, 83, 92, 101, 110, 119, 128, 137, 146, 155, 164}; + int normal_96k_12dot_continue_default_dac_U[] = {0, 0, 92, 101, 110, 119, 128, 137, 146, 155, 164, 173}; + + int normal_96k_12dot_full_default_dac_H[] = {80, 94, 106, 118, 130, 142, 153, 163, 173, 183, 193, 200}; + int normal_96k_12dot_adj_default_dac_H[] = {76, 87, 98, 108, 118, 128, 138, 148, 158, 168, 178, 189}; + int normal_96k_12dot_continue_default_dac_H[] = {0, 92, 104, 115, 126, 137, 148, 158, 168, 178, 188, 198}; + + int normal_96k_12dot_full_default_dac_HU[] = {78, 92, 102, 112, 122, 132, 142, 152, 162, 172, 182, 190}; + int normal_96k_12dot_adj_default_dac_HU[] = {0, 72, 83, 93, 103, 113, 123, 134, 146, 158, 170, 180}; + int normal_96k_12dot_continue_default_dac_HU[] = {0, 0, 92, 102, 112, 122, 132, 143, 155, 167, 179, 188}; + + int normal_96k_16dot_full_default_dac[] = {70, 80, 88, 98, 107, 116, 125, 134, 143, 153, 162, 171, 180, 189, 198, 205}; + int normal_96k_16dot_adj_default_dac[] = {64, 74, 88, 89, 97, 105, 113, 121, 129, 138, 147, 156, 165, 174, 183, 192}; + int normal_96k_16dot_continue_default_dac[] = {0, 77, 86, 95, 104, 113, 121, 130, 139, 147, 156, 166, 175, 185, 194,200}; + + int normal_96k_16dot_full_default_dac_H[] = {80, 96, 108, 118, 128, 138, 148, 158, 168, 178, 188, 198, 208, 218, 228, 236}; + int normal_96k_16dot_adj_default_dac_H[] = {76, 87, 98, 108, 118, 128, 137, 146, 155, 164, 173, 183, 193, 203, 214, 224}; + int normal_96k_16dot_continue_default_dac_H[] = {0, 92, 104, 114, 124, 134, 144, 154, 164, 174, 184, 194, 204, 214, 224, 234}; + + int slow1_96k_5dot_full_default_dac[] = {70, 80, 88, 97, 104}; + int slow1_96k_5dot_adj_default_dac[] = {68, 76, 85, 93, 101}; + int slow1_96k_5dot_continue_default_dac[] = {0, 79, 88, 96, 103}; + + int slow1_96k_5dot_full_default_dac_S[] = {70, 79, 87, 96, 104}; + int slow1_96k_5dot_adj_default_dac_S[] = {69, 77, 84, 91, 102}; + int slow1_96k_5dot_continue_default_dac_S[] = {0, 79, 88, 96, 104}; + + int slow1_96k_7dot_full_default_dac[] = {70, 80, 88, 97, 104, 111, 118}; + int slow1_96k_7dot_adj_default_dac[] = {68, 76, 85, 93, 101, 108, 113}; + int slow1_96k_7dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117}; + + int slow1_96k_7dot_full_default_dac_S[] = {70, 79, 87, 96, 104, 112, 119}; + int slow1_96k_7dot_adj_default_dac_S[] = {69, 77, 82, 90, 99, 107, 116}; + int slow1_96k_7dot_continue_default_dac_S[] = {0, 79, 88, 96, 103, 110, 119}; + + int slow1_96k_9dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133}; + int slow1_96k_9dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127}; + int slow1_96k_9dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131}; + + int slow1_96k_12dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133, 140, 147, 155}; + int slow1_96k_12dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127, 134, 141, 147}; + int slow1_96k_12dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131, 138, 145, 152}; + + int slow1_96k_16dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133, 140, 147, 154, 161, 168, 175, 181}; + int slow1_96k_16dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127, 134, 141, 148, 155, 162, 169, 176}; + int slow1_96k_16dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131, 138, 145, 152, 159, 166, 173, 180}; + + int slow1_96k_24dot_full_default_dac[] = {70, 80 , 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 173, 181, 187,194,201,208,215,222,229,236,242}; + int slow1_96k_24dot_adj_default_dac[] = {69, 76, 84, 91, 98, 106, 114, 121, 128, 136, 143, 150, 157, 164, 171, 177,183,190,196,203,209,215,221,227}; + int slow1_96k_24dot_continue_default_dac[] = {0, 79, 87, 95, 103, 110, 118, 125, 133, 140, 148, 155, 161, 169, 175, 181,186,195,200,208,215,222,228,234}; + + int fast_96k_5dot_full_default_dac_F[] = {70, 92, 107, 120, 130}; + int fast_96k_7dot_full_default_dac_F[] = {70, 92, 107, 120, 132, 142, 151}; + int normal_96k_5dot_full_default_dac_F[] = {70, 85, 95, 106, 116}; + int normal_96k_7dot_full_default_dac_F[] = {70, 85, 95, 107, 117, 126, 135}; + /* ==============96k end ========================*/ + + /* ==============128k ========================*/ + int fast_128k_5dot_full_default_dac[] = {80, 106, 121, 135, 145}; + int fast_128k_5dot_adj_default_dac[] = {77, 87, 100, 111, 122}; + int fast_128k_5dot_continue_default_dac[] = {0, 101, 114, 128, 142}; + int fast_128k_7dot_full_default_dac[] = {79, 105, 122, 140, 155, 169, 178}; + int fast_128k_7dot_adj_default_dac[] = {75, 87, 102, 113, 130, 142, 157}; + int fast_128k_7dot_continue_default_dac[] = { 0, 101, 119, 134, 149, 164, 178}; + int fast_128k_7dot_full_default_dac_A[] = {79, 105, 122, 137, 149, 164, 175}; + int fast_128k_7dot_adj_default_dac_A[] = {73, 84, 98, 112, 126, 140, 154}; + int fast_128k_7dot_continue_default_dac_A[] = { 0, 100, 117, 132, 147, 162, 175}; + int fast_128k_5dot_full_default_dac_A[] = {80, 106, 121, 140, 154}; + int fast_128k_5dot_adj_default_dac_A[] = {75, 90, 106, 120, 134}; + int fast_128k_5dot_continue_default_dac_A[] = {0, 105, 127, 142, 158}; + int fast_128k_5dot_full_default_dac_B[] = {83, 110, 123, 140, 148}; + int fast_128k_5dot_adj_default_dac_B[] = {78, 90, 103, 114, 126}; + int fast_128k_5dot_continue_default_dac_B[] = {0, 105, 118, 133, 146}; + int fast_128k_7dot_full_default_dac_B[] = {79, 105, 122, 140, 156, 167, 178}; + int fast_128k_7dot_adj_default_dac_B[] = {75, 87, 101, 114, 128, 142, 156}; + int fast_128k_7dot_continue_default_dac_B[] = { 0, 105, 120, 135, 150, 165, 180}; + int fast_128k_7dot_full_default_dac_C[] = {79, 105, 120, 135, 145, 155, 165}; + int fast_128k_7dot_adj_default_dac_C[] = {71, 85, 96, 107, 120, 133, 143}; + int fast_128k_7dot_continue_default_dac_C[] = { 0, 97, 113, 126, 139, 152, 165}; + int fast_128k_9dot_full_default_dac_A[] = {74, 99, 115, 130, 140, 150, 163, 158, 166}; + int fast_128k_9dot_adj_default_dac_A[] = {72, 82, 92, 104, 115, 127, 138, 149, 160}; + int fast_128k_9dot_continue_default_dac_A[] = {0, 95, 108, 121, 133, 145, 158, 157, 169}; + int fast_128k_9dot_full_default_dac_C[] = {78, 108, 125, 143, 158, 172, 185, 180, 191}; + int fast_128k_9dot_adj_default_dac_C[] = {73, 86, 99, 112, 125, 138, 151, 164, 178}; + int fast_128k_9dot_continue_default_dac_C[] = {0, 100, 116, 132, 144, 158, 174, 176, 191}; + int fast_128k_9dot_full_default_dac_B[] = {74, 100, 120, 140, 155, 170, 190, 188, 199}; + int fast_128k_9dot_adj_default_dac_B[] = {70, 86, 102, 117, 132, 147, 162, 177, 190}; + int fast_128k_9dot_continue_default_dac_B[] = {0, 100, 120, 136, 152, 168, 185, 187, 200}; + if(sysPara->para.reducedPixelNumRatio >=20){ + fast_128k_7dot_continue_default_dac_B[2] = 115; + fast_128k_9dot_continue_default_dac_B[2] = 115; + fast_128k_9dot_full_default_dac_B[8] = 202; + } + if(sysPara->para.recommendedPrintSpeed == 3){ + fast_128k_7dot_full_default_dac[0] = 78; + fast_128k_7dot_continue_default_dac[1] = 100; + fast_128k_7dot_continue_default_dac[2] = 116; + fast_128k_7dot_continue_default_dac[3] = 132; + fast_128k_7dot_adj_default_dac[0] = 72; + } + int fast_128k_9dot_full_default_dac[9] = {74, 99, 115, 130, 140, 153, 163, 158, 166}; + if(sysPara->para.mode0211) + { + fast_128k_9dot_full_default_dac[0] = 74; + fast_128k_9dot_full_default_dac[1] = 99; + fast_128k_9dot_full_default_dac[2] = 117; + fast_128k_9dot_full_default_dac[3] = 134; + fast_128k_9dot_full_default_dac[4] = 145; + fast_128k_9dot_full_default_dac[5] = 158; + fast_128k_9dot_full_default_dac[6] = 171; + fast_128k_9dot_full_default_dac[7] = 163; + fast_128k_9dot_full_default_dac[8] = 166; + } + int fast_128k_9dot_adj_default_dac[] = {72, 83, 96, 106, 118, 127, 138, 149, 158}; + int fast_128k_9dot_continue_default_dac[] = {0, 95, 108, 121, 133, 145, 158, 157, 167}; + if(sysPara->para.recommendedPrintSpeed == 1){ + fast_128k_5dot_full_default_dac[3] = 133; + fast_128k_5dot_full_default_dac[4] = 143; + fast_128k_5dot_adj_default_dac[1] = 89; + fast_128k_5dot_adj_default_dac[2] = 102; + fast_128k_5dot_adj_default_dac[3] = 114; + fast_128k_5dot_adj_default_dac[4] = 126; + + fast_128k_7dot_full_default_dac[0] = 74; + fast_128k_7dot_full_default_dac[1] = 99; + fast_128k_7dot_full_default_dac[2] = 115; + fast_128k_7dot_full_default_dac[3] = 130; + fast_128k_7dot_full_default_dac[4] = 140; + fast_128k_7dot_full_default_dac[5] = 150; + fast_128k_7dot_full_default_dac[6] = 160; + + fast_128k_7dot_adj_default_dac[0] = 72; + fast_128k_7dot_adj_default_dac[1] = 83; + fast_128k_7dot_adj_default_dac[2] = 96; + fast_128k_7dot_adj_default_dac[3] = 106; + fast_128k_7dot_adj_default_dac[4] = 118; + fast_128k_7dot_adj_default_dac[5] = 130; + fast_128k_7dot_adj_default_dac[6] = 142; + + fast_128k_7dot_continue_default_dac[1] = 95; + fast_128k_7dot_continue_default_dac[2] = 108; + fast_128k_7dot_continue_default_dac[3] = 121; + fast_128k_7dot_continue_default_dac[4] = 133; + fast_128k_7dot_continue_default_dac[5] = 146; + fast_128k_7dot_continue_default_dac[6] = 158; + + fast_128k_9dot_full_default_dac[5] = 152; + fast_128k_9dot_full_default_dac[6] = 162; + fast_128k_9dot_full_default_dac[7] = 160; + + if(sysPara->para.mode0211) + { + fast_128k_9dot_full_default_dac[0] = 74; + fast_128k_9dot_full_default_dac[1] = 99; + fast_128k_9dot_full_default_dac[2] = 117; + fast_128k_9dot_full_default_dac[3] = 134; + fast_128k_9dot_full_default_dac[4] = 145; + fast_128k_9dot_full_default_dac[5] = 158; + fast_128k_9dot_full_default_dac[6] = 171; + fast_128k_9dot_full_default_dac[7] = 163; + fast_128k_9dot_full_default_dac[8] = 166; + } + fast_128k_9dot_adj_default_dac[0] = 70; + fast_128k_9dot_adj_default_dac[1] = 81; + fast_128k_9dot_adj_default_dac[2] = 92; + fast_128k_9dot_adj_default_dac[3] = 103; + fast_128k_9dot_adj_default_dac[4] = 114; + fast_128k_9dot_adj_default_dac[5] = 125; + fast_128k_9dot_adj_default_dac[6] = 136; + fast_128k_9dot_adj_default_dac[7] = 147; + fast_128k_9dot_adj_default_dac[8] = 158; + } + int normal_128k_5dot_full_default_dac[] = {80, 96, 107, 118, 128}; + int normal_128k_5dot_adj_default_dac[] = {77, 87, 98, 108, 118}; + int normal_128k_5dot_continue_default_dac[] = {0, 94, 105, 116, 127}; + int normal_128k_7dot_full_default_dac[] = {80, 96, 107, 118, 128, 137, 143}; + int normal_128k_7dot_adj_default_dac[] = {77, 87, 98, 108, 116, 127, 134}; + int normal_128k_7dot_continue_default_dac[] = {0, 94, 104, 115, 126, 135, 144}; + int normal_128k_9dot_full_default_dac[] = {80, 96, 107, 118, 128, 137, 143, 154, 162}; + int normal_128k_9dot_adj_default_dac[] = {77, 87, 98, 108, 118, 128, 137, 147, 156}; + int normal_128k_9dot_continue_default_dac[] = {0, 93, 104, 115, 126, 135, 140, 151, 161}; + /* ==============128k end ========================*/ + +#endif + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if(!sysPara->para.scanInverse) + DACArray[i] = printVerticalButtom + i*DACStep; + else + DACArray[i] = printVerticalTop - i*DACStep; + + if(DACArray[i] >= pointAdjustVoltagePos) { + DACArray[i] += sysPara->para.PointVoltageAdjustValue; + } + + notGapDACArray[i] = DACArray[i]; + fullColDACArray[i] = DACArray[i]; + // qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<para.FullColFixVal == 1) + { + if (sysPara->status.currPrintRow <= 5) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_64k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96 + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_96k_5dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_5dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_5dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ + full_dac_temp = fast_96k_5dot_full_default_dac_F[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_5dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_5dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_5dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = normal_96k_5dot_adj_default_dac_S[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_5dot_continue_default_dac_S[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_5dot_full_default_dac_S[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ + full_dac_temp = normal_96k_5dot_full_default_dac_F[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = slow1_96k_5dot_adj_default_dac_S[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = slow1_96k_5dot_continue_default_dac_S[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = slow1_96k_5dot_full_default_dac_S[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + } + else if (sysPara->para.oscillatoFreq == 3) { // 128k + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_128k_5dot_adj_default_dac_A[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_5dot_continue_default_dac_A[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_5dot_full_default_dac_A[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_128k_5dot_adj_default_dac_B[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_5dot_continue_default_dac_B[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_5dot_full_default_dac_B[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_5dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_5dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_5dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 7) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_64k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_96k_7dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_7dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_7dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = fast_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_7dot_full_default_dac_S[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ + full_dac_temp = fast_96k_7dot_full_default_dac_F[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_7dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_7dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_7dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = normal_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_7dot_full_default_dac_S[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ + full_dac_temp = normal_96k_7dot_full_default_dac_F[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = slow1_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = slow1_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = slow1_96k_7dot_full_default_dac_S[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + } + else if (sysPara->para.oscillatoFreq == 3) { // 128K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = fast_128k_7dot_adj_default_dac_A[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_7dot_continue_default_dac_A[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_7dot_full_default_dac_A[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_128k_7dot_adj_default_dac_B[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_7dot_continue_default_dac_B[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_7dot_full_default_dac_B[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 3){ + adj_dac_temp = fast_128k_7dot_adj_default_dac_C[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_7dot_continue_default_dac_C[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_7dot_full_default_dac_C[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 25; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_7dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_7dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_7dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 9) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_64k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + // sysPara->voltePara.pixel_para_table[0] = 20; + // sysPara->voltePara.pixel_para_table[1] = 20; + // sysPara->voltePara.pixel_para_table[2] = 15; + // sysPara->voltePara.pixel_para_table[3] = 15; + // sysPara->voltePara.pixel_para_table[4] = 15; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_9dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_9dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_9dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + // sysPara->voltePara.pixel_para_table[0] = 20; + // sysPara->voltePara.pixel_para_table[1] = 20; + // sysPara->voltePara.pixel_para_table[2] = 30; + // sysPara->voltePara.pixel_para_table[3] = 30; + // sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + if (sysPara->para.oscillatoFreq == 3) { // 128K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_128k_9dot_adj_default_dac_A[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_9dot_continue_default_dac_A[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_9dot_full_default_dac_A[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 2){ + adj_dac_temp = fast_128k_9dot_adj_default_dac_B[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_9dot_continue_default_dac_B[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_9dot_full_default_dac_B[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 3){ + adj_dac_temp = fast_128k_9dot_adj_default_dac_C[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_128k_9dot_continue_default_dac_C[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_128k_9dot_full_default_dac_C[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 25; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 12) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if ((sysPara->para.printRowDelay == 0) && (i < 5)) {//交替 + float adj_dac_temp = fast_64k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.upDownInverse){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_U[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_UD[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_UD[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_UD[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 30; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 25; + } + if ((sysPara->para.printRowDelay == 0) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if ((sysPara->para.printRowDelay == 1) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = normal_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if ((sysPara->para.printRowDelay == 2) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = slow1_96k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_U[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + if ((sysPara->para.oscillatoFreq == 3) && (i < 5) && sysPara->para.alterPrint.enable) { // 128K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_5dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_5dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_5dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 16) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if ((sysPara->para.printRowDelay == 0) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_64k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_16dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_16dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_16dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 20; + sysPara->voltePara.pixel_para_table[1] = 20; + sysPara->voltePara.pixel_para_table[2] = 30; + sysPara->voltePara.pixel_para_table[3] = 30; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_16dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_16dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_16dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if ((sysPara->para.printRowDelay == 0) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if ((sysPara->para.printRowDelay == 1) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = normal_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if ((sysPara->para.printRowDelay == 2) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = slow1_96k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_96k_16dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_16dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_16dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_16dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_16dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_16dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + // sysPara->voltePara.pixel_para_table[4] = 38; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_16dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_16dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_16dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + if ((sysPara->para.oscillatoFreq == 3) && (i < 7) && sysPara->para.alterPrint.enable) { // 128K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_7dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_7dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_7dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 24) { + for(int i = 0; i < sysPara->status.currPrintRow; i++) + { + if (sysPara->para.oscillatoFreq == 0) { // 64K + if ((sysPara->para.printRowDelay == 0) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_64k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_64k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_64k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_64k_24dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_64k_24dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_64k_24dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_64k_24dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_64k_24dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_64k_24dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if (sysPara->para.oscillatoFreq == 2) { // 96K + if ((sysPara->para.printRowDelay == 0) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + // sysPara->voltePara.pixel_para_table[0] = 20; + // sysPara->voltePara.pixel_para_table[1] = 20; + // sysPara->voltePara.pixel_para_table[2] = 15; + // sysPara->voltePara.pixel_para_table[3] = 15; + // sysPara->voltePara.pixel_para_table[4] = 15; + } + else if ((sysPara->para.printRowDelay == 1) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = normal_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + // sysPara->voltePara.pixel_para_table[0] = 20; + // sysPara->voltePara.pixel_para_table[1] = 20; + // sysPara->voltePara.pixel_para_table[2] = 30; + // sysPara->voltePara.pixel_para_table[3] = 30; + // sysPara->voltePara.pixel_para_table[4] = 10; + } + else if ((sysPara->para.printRowDelay == 2) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = slow1_96k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + // sysPara->voltePara.pixel_para_table[0] = 20; + // sysPara->voltePara.pixel_para_table[1] = 20; + // sysPara->voltePara.pixel_para_table[2] = 30; + // sysPara->voltePara.pixel_para_table[3] = 30; + // sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + float adj_dac_temp = slow1_96k_24dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_24dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_24dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + if ((sysPara->para.oscillatoFreq == 3) && (i < 9) && sysPara->para.alterPrint.enable) { // 128K + if (sysPara->para.printRowDelay == 0) { + float adj_dac_temp = fast_128k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_128k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_128k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 1) { + float adj_dac_temp = normal_128k_9dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_128k_9dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_128k_9dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + sysPara->voltePara.pixel_para_table[0] = 15; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 10; + } + else if (sysPara->para.printRowDelay == 2) { + // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; + // DACArray[i] = adj_dac_temp; + // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; + // notGapDACArray[i] = continue_dac_temp; + // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; + // fullColDACArray[i] = full_dac_temp; + } + } + } + } + else if (sysPara->status.currPrintRow <= 32) { + for(int i = 0; i < sysPara->status.currPrintRow; i++){ + if (sysPara->para.oscillatoFreq == 2) { + if ((sysPara->para.printRowDelay == 0) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = fast_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = fast_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = fast_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.upDownInverse){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_U[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ + adj_dac_temp = fast_96k_12dot_adj_default_dac_UD[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = fast_96k_12dot_continue_default_dac_UD[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = fast_96k_12dot_full_default_dac_UD[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if ((sysPara->para.printRowDelay == 1) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = normal_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = normal_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = normal_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if(sysPara->para.recommendedPrintSpeed == 1){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_H[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + else if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ + adj_dac_temp = normal_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + continue_dac_temp = normal_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + full_dac_temp = normal_96k_12dot_full_default_dac_U[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + } + else if ((sysPara->para.printRowDelay == 2) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 + float adj_dac_temp = slow1_96k_12dot_adj_default_dac[i] * DAC_RADIO; + DACArray[i] = adj_dac_temp; + float continue_dac_temp = slow1_96k_12dot_continue_default_dac[i] * DAC_RADIO; + notGapDACArray[i] = continue_dac_temp; + float full_dac_temp = slow1_96k_12dot_full_default_dac[i] * DAC_RADIO; + fullColDACArray[i] = full_dac_temp; + } + sysPara->voltePara.pixel_para_table[0] = 30; + sysPara->voltePara.pixel_para_table[1] = 15; + sysPara->voltePara.pixel_para_table[2] = 15; + sysPara->voltePara.pixel_para_table[3] = 15; + sysPara->voltePara.pixel_para_table[4] = 25; + } + } + } + } + /* sysPara->para.FullColFixVal == 1 */ +#endif + +#ifdef FXCHG + if(sysPara->para.alterPrint.enable) { + for(int i = 0; i < sysPara->status.currPrintRow/2+1 && (i+sysPara->status.currPrintRow/2+1<40); i++) + { + DACArray[i+sysPara->status.currPrintRow/2+1] =(i < sysPara->status.currPrintRow )?DACArray[i]:0; + } + } +#endif + } + else { // "Vol 1167 6984 13909 19726 25543 26928 " 1167 1491 1815 2139 2463 2787 3111 + + int DacVolRang=printVerticalTop-printVerticalButtom; + int DacRateRang=0; + + for(int i = 1; i < ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow); i++) + DacRateRang+=sysPara->para.adjVolDacRate[i]; + + if(DacRateRang<5) DacRateRang=5*sysPara->status.currPrintRow; // + + //QString strv="Vol\n"; + /* ===0 */ + if(!sysPara->para.scanInverse) DACArray[0]=printVerticalButtom; + else DACArray[0]=printVerticalTop; + if(DACArray[0] >= pointAdjustVoltagePos) DACArray[0] += sysPara->para.PointVoltageAdjustValue; + /* 1 -- n */ + for(int i = 1; i < ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow); i++) + { + if(!sysPara->para.scanInverse) + DACArray[i] = DACArray[i-1]+ sysPara->para.adjVolDacRate[i] *DacVolRang/DacRateRang; + else + DACArray[i] = DACArray[i-1] - sysPara->para.adjVolDacRate[i] *DacVolRang/DacRateRang; + + if(DACArray[i] >= pointAdjustVoltagePos) + DACArray[i] += sysPara->para.PointVoltageAdjustValue; + } +#ifdef FXCHG + if(sysPara->para.alterPrint.enable) { + for(int i = 0; i < sysPara->status.currPrintRow/2+1 && (i+sysPara->status.currPrintRow/2+1<40); i++) + { + DACArray[i+sysPara->status.currPrintRow/2+1] =(i < sysPara->status.currPrintRow )?DACArray[i]:0; + } + } +#endif + } + unsigned short fast_128k_7dot_dac[]={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, + 900, 0, 0, 0, 0, 0, 0, 0, 0, + 0,1050, 0, 0, 0, 0, 0, 0, 0, + 920,1240, 0, 0, 0, 0, 0, 0, 0, + 0, 0,1240, 0, 0, 0, 0, 0, 0, + 940, 0,1350, 0, 0, 0, 0, 0, 0, + 0,1050,1400, 0, 0, 0, 0, 0, 0, + 950,1280,1460, 0, 0, 0, 0, 0, 0, + 0, 0, 0,1380, 0, 0, 0, 0, 0, + 920, 0, 0,1510, 0, 0, 0, 0, 0, + 0,1050, 0,1510, 0, 0, 0, 0, 0, + + 950,1280, 0,1600, 0, 0, 0, 0, 0, + 0, 0,1220,1600, 0, 0, 0, 0, 0, + 940, 0,1380,1600, 0, 0, 0, 0, 0, + 0,1050,1400,1600, 0, 0, 0, 0, 0, + 950,1290,1490,1630, 0, 0, 0, 0, 0, + 0, 0, 0, 0,1550, 0, 0, 0, 0, + 950, 0, 0, 0,1670, 0, 0, 0, 0, + 0,1050, 0, 0,1700, 0, 0, 0, 0, + 950,1280, 0, 0,1730, 0, 0, 0, 0, + 0, 0,1240, 0,1730, 0, 0, 0, 0, + + // 950, 0,1400, 0,1760, 0, 0, 0, 0, + // 0,1050,1400, 0,1770, 0, 0, 0, 0, + // 950,1290,1490, 0,1770, 0, 0, 0, 0, + // 0, 0, 0,1370,1770, 0, 0, 0, 0, + // 950, 0, 0,1540,1820, 0, 0, 0, 0, + // 0,1070, 0,1560,1820, 0, 0, 0, 0, + // 940,1280, 0,1620,1820, 0, 0, 0, 0, + // 0, 0,1260,1640,1820, 0, 0, 0, 0, + // 950, 0,1400,1640,1820, 0, 0, 0, 0, + // 0,1070,1400,1640,1820, 0, 0, 0, 0, + 940, 0,1400, 1,1600, 0, 0, 0, 0, + 0,1050,1400, 1,1600, 0, 0, 0, 0, + 930,1280,1480, 1,1600, 0, 0, 0, 0, + 0, 0, 0,5460,1600, 0, 0, 0, 0, + 950, 0, 0,5626,1620, 0, 0, 0, 0, + 0,1070, 0,5626,1620, 0, 0, 0, 0, + 940,1280, 0,5696,1620, 0, 0, 0, 0, + 0, 0,1260,5706,1620, 0, 0, 0, 0, + 950, 0,1400,5746,1620, 0, 0, 0, 0, + 0,1070,1440,5746,1620, 0, 0, 0, 0, + + // 950,1290,1490,1700,1840, 0, 0, 0, 0, + // 950,1290,1490,1680,1800, 0, 0, 0, 0, + // 0, 0, 0, 0, 0,1720, 0, 0, 0, + // 940, 0, 0, 0, 0,1830, 0, 0, 0, + // 0,1050, 0, 0, 0,1840, 0, 0, 0, + // 940,1280, 0, 0, 0,1880, 0, 0, 0, + // 0, 0,1240, 0, 0,1880, 0, 0, 0, + // 940, 0,1390, 0, 0,1920, 0, 0, 0, + // 0,1070,1420, 0, 0,1920, 0, 0, 0, + // 950,1280,1480, 0, 0,1940, 0, 0, 0, + // 0, 0, 0,1430, 0,1940, 0, 0, 0, + 950,1290,1480,5746,1620, 0, 0, 0, 0, + 0, 0, 0, 0, 0,1700, 0, 0, 0, + 940, 0, 0, 0, 0,1830, 0, 0, 0, + 0,1050, 0, 0, 0,1840, 0, 0, 0, + 940,1260, 0, 0, 0,1760, 0, 0, 0, + 0, 0,1240, 0, 0,1880, 0, 0, 0, + 940, 0,1380, 0, 1,1780, 0, 0, 0, + 0,1060,1400, 0, 1,1780, 0, 0, 0, + 940,1260,1440, 0, 1,1780, 0, 0, 0, + 0, 0, 0,1400, 1,1780, 0, 0, 0, + + // 940, 0, 0,1560, 0,1970, 0, 0, 0, + // 0,1060, 0,1580, 0,1970, 0, 0, 0, + // 950,1280, 0,1640, 0,1970, 0, 0, 0, + // 0, 0,1240,1640, 0,1970, 0, 0, 0, + // 950, 0,1400,1650, 0,1970, 0, 0, 0, + // 0,1070,1420,1650, 0,1970, 0, 0, 0, + // 950,1290,1490,1690, 0,1970, 0, 0, 0, + // 0, 0, 0, 0,1560,1970, 0, 0, 0, + // 940, 0, 0, 0,1710,2000, 0, 0, 0, + // 0,1060, 0, 0,1710,1990, 0, 0, 0, + 940, 0, 0,1500, 1,1780, 0, 0, 0, + 0,1060, 0,1540, 1,1780, 0, 0, 0, + 940,1280, 0,1600, 1,1780, 0, 0, 0, + 0, 0,1240,1600, 1,1780, 0, 0, 0, + 940, 0,1400,1640, 1,1780, 0, 0, 0, + 0,1060,1430,1640, 1,1780, 0, 0, 0, + 940,1260,1480,1660, 1,1780, 0, 0, 0, + 0, 0, 0, 0,5646,1780, 0, 0, 0, + 940, 0, 0, 0,5796,1800, 0, 0, 0, + 0,1060, 0, 0,5796,1800, 0, 0, 0, + + // 940,1280, 0, 0,1790,2020, 0, 0, 0, + // 0, 0,1240, 0,1790,2020, 0, 0, 0, + // 950, 0,1400, 0,1790,2000, 0, 0, 0, + // 0,1060,1420, 0,1810,2000, 0, 0, 0, + // 950,1280,1480, 0,1820,2000, 0, 0, 0, + // 0, 0, 0,1400,1810,2020, 0, 0, 0, + // 940, 0, 0,1600,1860,2020, 0, 0, 0, + // 0,1050, 0,1600,1860,2020, 0, 0, 0, + // 950,1280, 0,1660,1860,2020, 0, 0, 0, + // 0, 0,1290,1660,1860,2020, 0, 0, 0, + 940,1260, 0, 0,5856,1800, 0, 0, 0, + 0, 0,1240, 0,5856,1800, 0, 0, 0, + 940, 0,1400, 0,5866,1800, 0, 0, 0, + 0,1060,1420, 0,5866,1800, 0, 0, 0, + 940,1280,1480, 0,5876,1800, 0, 0, 0, + 0, 0, 0,1390,5876,1800, 0, 0, 0, + 940, 0, 0,1540,5896,1800, 0, 0, 0, + 0,1050, 0,1540,5896,1800, 0, 0, 0, + 940,1260, 0,1660,5916,1800, 0, 0, 0, + 0, 0,1240,1660,5916,1800, 0, 0, 0, + + // 950, 0,1410,1660,5940,1820, 0, 0, 0, + // 0,1070,1440,1660,5940,1820, 0, 0, 0, + // 950,1290,1510,1710,5960,1820, 0, 0, 0, + // 0, 0, 0, 0, 0, 0,1830, 0, 0, + // 930, 0, 0, 0, 0, 0,1830, 0, 0, + // 0,1050, 0, 0, 0, 0,1950, 0, 0, + // 940,1280, 0, 0, 0, 0,1980, 0, 0, + // 0, 0,1240, 0, 0, 0,1980, 0, 0, + // 940, 0,1380, 0, 0, 0,2000, 0, 0, + // 0,1060,1420, 0, 0, 0,2000, 0, 0, + 950, 0,1400,1670,5926,1800, 0, 0, 0, + 0,1060,1420,1670,5926,1800, 0, 0, 0, + 950,1260,1460,1670,5926,1800, 0, 0, 0, + 0, 0, 0, 0, 0, 0,1830, 0, 0, + 930, 0, 0, 0, 0, 0,1830, 0, 0, + 0,1050, 0, 0, 0, 0,1950, 0, 0, + 940,1280, 0, 0, 0, 0,1980, 0, 0, + 0, 0,1240, 0, 0, 0,1980, 0, 0, + 940, 0,1380, 0, 0, 0,2000, 0, 0, + 0,1060,1420, 0, 0, 0,2000, 0, 0, + + // 950,1280,1480, 0, 0, 0,2000, 0, 0, + // 0, 0, 0,1390, 0, 0,2000, 0, 0, + // 940, 0, 0,1530, 0, 0,2020, 0, 0, + // 0,1060, 0,1550, 0, 0,2020, 0, 0, + // 950,1280, 0,1630, 0, 0,2040, 0, 0, + // 0, 0,1240,1620, 0, 0,2040, 0, 0, + // 930, 0,1410,1660, 0, 0,2040, 0, 0, + // 0,1070,1440,1660, 0, 0,2060, 0, 0, + // 950,1290,1500,1680, 0, 0,2060, 0, 0, + // 0, 0, 0, 0,1570, 1,1900, 0, 0, + 940,1260,1440, 0, 0, 0,2000, 0, 0, + 0, 0, 0,1390, 0, 0,2000, 0, 0, + 940, 0, 0,1530, 0, 0,2000, 0, 0, + 0,1060, 0,1540, 0, 0,2000, 0, 0, + 940,1260, 0,1600, 0, 1,1870, 0, 0, + 0, 0,1240,1620, 0, 0,2000, 0, 0, + 940, 0,1410,1620, 0, 1,1900, 0, 0, + 0,1060,1420,1620, 0, 1,1900, 0, 0, + 940,1260,1460,1640, 0, 1,1900, 0, 0, + 0, 0, 0, 0,1570, 1,1900, 0, 0, + + 950, 0, 0, 0,1700, 1,1900, 0, 0, + 0,1060, 0, 0,1710, 1,1900, 0, 0, + 940,1280, 0, 0,1750, 1,1900, 0, 0, + 0, 0,1260, 0,1750, 1,1900, 0, 0, + 940, 0,1400, 0,1770, 1,1900, 0, 0, + 0,1060,1420, 0,1770, 1,1900, 0, 0, + 950,1280,1480, 0,1810, 1,1900, 0, 0, + 0, 0, 0,1400,1800, 1,1910, 0, 0, + 950, 0, 0,1560,1830, 1,1920, 0, 0, + 0,1060, 0,1580,1830, 1,1920, 0, 0, + + 940,1280, 0,1630,1830, 1,1920, 0, 0, + 0, 0,1260,1630,1830, 1,1920, 0, 0, + 950, 0,1420,1650,1840, 1,1920, 0, 0, + 0,1070,1430,1650,1840, 1,1920, 0, 0, + 950,1280,1480,1680,1850, 1,1920, 0, 0, + 0, 0, 0, 0, 0,5776,1930, 0, 0, + 940, 0, 0, 0, 0,5896,1930, 0, 0, + 0,1070, 0, 0, 1,5816,1930, 0, 0, + 950,1280, 0, 0, 1,5836,1930, 0, 0, + 0, 0,1240, 0, 1,5836,1930, 0, 0, + + 950, 0,1380, 0, 1,5836,1930, 0, 0, + 0,1070,1420, 0, 1,5836,1930, 0, 0, + 950,1280,1480, 0, 1,5836,1930, 0, 0, + 0, 0, 0,1480, 1,5876,1930, 0, 0, + 940, 0, 0,1550, 1,5876,1930, 0, 0, + 0,1070, 0,1550, 1,5876,1930, 0, 0, + 940,1280, 0,1620, 1,5876,1930, 0, 0, + 0, 0,1240,1620, 1,5876,1930, 0, 0, + 940, 0,1380,1620, 1,5876,1930, 0, 0, + 0,1070,1440,1660, 1,5876,1930, 0, 0, + + 950,1290,1490,1680, 1,1780,2080, 0, 0, + 0, 0, 0, 0,5656,5876,1930, 0, 0, + 950, 0, 0, 1,5676,5876,1930, 0, 0, + 0,1070, 0, 1,5676,5876,1930, 0, 0, + 940,1280, 0, 1,1580,6036,1930, 0, 0, + 0, 0,1240, 1,1580,6036,1930, 0, 0, + 940, 0,1400, 1,1580,6036,1930, 0, 0, + 0,1060,1440, 1,1580,6036,1930, 0, 0, + 950,1280,1480, 0,1780,6056,1930, 0, 0, + 0, 0, 0,1420,1790,6056,1930, 0, 0, + + 950, 0, 1,1400,1770,6056,1930, 0, 0, + 0,1070, 1,1400,1770,6056,1930, 0, 0, + 950,1280, 0,1630,1850,6091,1940, 0, 0, + 0, 0,1290,1650,1850,6091,1940, 0, 0, + 950, 0,1400,1670,1850,6091,1940, 0, 0, + 0,1100,1460,1670,1850,6091,1940, 0, 0, + 960,1320,1570,1760,1980, 1,1940, 0, 0 + }; + unsigned short normal_128k_7dot_dac[]={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, + 970, 0, 0, 0, 0, 0, 0, 0, 0, + 0,1115, 0, 0, 0, 0, 0, 0, 0, + 5066,1180, 0, 0, 0, 0, 0, 0, 0, + 0, 0,1245, 0, 0, 0, 0, 0, 0, + 970, 1,1310, 0, 0, 0, 0, 0, 0, + 0,5211,1340, 0, 0, 0, 0, 0, 0, + 5086,5296,1340, 0, 0, 0, 0, 0, 0, + 0, 0, 0,1385, 0, 0, 0, 0, 0, + 970, 1, 0,1430, 0, 0, 0, 0, 0, + 0,1120, 1,1450, 0, 0, 0, 0, 0, + + 5076,1200, 1,1460, 0, 0, 0, 0, 0, + 0, 0,5356,1490, 0, 0, 0, 0, 0, + 980, 1,5416,1490, 0, 0, 0, 0, 0, + 0,5256,5456,1480, 0, 0, 0, 0, 0, + 5086,5316,5456,1480, 0, 0, 0, 0, 0, + 0, 0, 0, 0,1535, 0, 0, 0, 0, + 980, 1, 0, 0,1560, 0, 0, 0, 0, + 0,1140, 1, 0,1580, 0, 0, 0, 0, + 5076,1200, 1, 0,1580, 0, 0, 0, 0, + 0, 0,1275, 1,1585, 0, 0, 0, 0, + + 980, 1,1310, 1,1585, 0, 0, 0, 0, + 0,5246,1360, 1,1585, 0, 0, 0, 0, + 5076,5296,1360, 1,1620, 0, 0, 0, 0, + 0, 0, 0,5521,1645, 0, 0, 0, 0, + 980, 1, 0,5546,1635, 0, 0, 0, 0, + 0,1140, 1,5566,1635, 0, 0, 0, 0, + 5076,1200, 1,5576,1635, 0, 0, 0, 0, + 0, 0,5406,5626,1635, 0, 0, 0, 0, + 980, 1,5436,5616,1635, 0, 0, 0, 0, + 0,5276,5476,5596,1635, 0, 0, 0, 0, + + 5086,5316,5456,5596,1635, 0, 0, 0, 0, + 0, 0, 0, 0, 0,1680, 0, 0, 0, + 980, 1, 0, 0, 0,1700, 0, 0, 0, + 0,1130, 1, 0, 0,1700, 0, 0, 0, + 5076,1200, 1, 0, 0,1720, 0, 0, 0, + 0, 0,1280, 1, 0,1720, 0, 0, 0, + 980, 1,1315, 1, 0,1720, 0, 0, 0, + 0,5236,1360, 1, 0,1740, 0, 0, 0, + 5086,5296,1360, 1, 0,1750, 0, 0, 0, + 0, 0, 0,1430, 1,1750, 0, 0, 0, + + 980, 1, 0,1460, 1,1750, 0, 0, 0, + 0,1140, 1,1470, 1,1750, 0, 0, 0, + 5076,1200, 1,1480, 1,1750, 0, 0, 0, + 0, 0,5396,1500, 1,1760, 0, 0, 0, + 980, 1,5426,1510, 1,1760, 0, 0, 0, + 0,5256,5456,1510, 1,1760, 0, 0, 0, + 5076,5316,5456,1510, 1,1770, 0, 0, 0, + 0, 0, 0, 0,5666,1780, 0, 0, 0, + 980, 1, 0, 0,5676,1780, 0, 0, 0, + 0,1130, 1, 0,5686,1780, 0, 0, 0, + + 5076,1200, 1, 0,5696,1780, 0, 0, 0, + 0, 0,1290, 1,5716,1780, 0, 0, 0, + 980, 1,1330, 1,5756,1780, 0, 0, 0, + 0,5236,1360, 1,5756,1780, 0, 0, 0, + 5076,5296,1360, 1,5756,1780, 0, 0, 0, + 0, 0, 0,5526,5746,1780, 0, 0, 0, + 980, 1, 0,5556,5756,1780, 0, 0, 0, + 0,1130, 1,5586,5756,1780, 0, 0, 0, + 5076,1200, 1,5586,5756,1780, 0, 0, 0, + 0, 0,5386,5601,5756,1780, 0, 0, 0, + + 980, 1,5436,5601,5756,1780, 0, 0, 0, + 0,5246,5466,5601,5756,1780, 0, 0, 0, + 5086,5306,5476,5601,5756,1780, 0, 0, 0, + 0, 0, 0, 0, 0, 0,1810, 0, 0, + 980, 1, 0, 0, 0, 0,1810, 0, 0, + 0,1130, 1, 0, 0, 0,1840, 0, 0, + 5076,1200, 1, 0, 0, 0,1840, 0, 0, + 0, 0,1290, 1, 0, 0,1850, 0, 0, + 980, 1,1330, 1, 0, 0,1850, 0, 0, + 0,5231,1360, 1, 0, 0,1850, 0, 0, + + 5076,5296,1360, 1, 0, 0,1850, 0, 0, + 0, 0, 0,1410, 1, 0,1850, 0, 0, + 980, 1, 0,1440, 1, 0,1860, 0, 0, + 0,1135, 1,1470, 1, 0,1860, 0, 0, + 5076,1200, 1,1480, 1, 0,1870, 0, 0, + 0, 0,5381,1505, 1, 0,1870, 0, 0, + 980, 1,5416,1510, 1, 0,1870, 0, 0, + 0,5236,5456,1510, 1, 0,1870, 0, 0, + 5086,5296,5456,1510, 1, 0,1880, 0, 0, + 0, 0, 0, 0,1550, 1,1880, 0, 0, + + 980, 1, 0, 0,1570, 1,1880, 0, 0, + 0,1130, 1, 0,1590, 1,1880, 0, 0, + 5076,1200, 1, 0,1610, 1,1890, 0, 0, + 0, 0,1300, 1,1620, 1,1890, 0, 0, + 980, 1,1330, 1,1620, 1,1890, 0, 0, + 0,5236,1360, 1,1630, 1,1890, 0, 0, + 5076,5296,1360, 1,1640, 1,1890, 0, 0, + 0, 0, 0,5506,1640, 1,1900, 0, 0, + 980, 1, 0,5546,1640, 1,1900, 0, 0, + 0,1135, 1,5556,1640, 1,1900, 0, 0, + + 5076,1200, 1,5556,1640, 1,1900, 0, 0, + 0, 0,5386,5596,1640, 1,1900, 0, 0, + 980, 1,5436,5606,1650, 1,1910, 0, 0, + 0,5226,5456,5606,1650, 1,1910, 0, 0, + 5086,5306,5466,5606,1650, 1,1910, 0, 0, + 0, 0, 0, 0, 0,5791,1910, 0, 0, + 980, 1, 0, 0, 0,5816,1910, 0, 0, + 0,1130, 1, 0, 0,5816,1910, 0, 0, + 5076,1200, 1, 0, 0,5816,1910, 0, 0, + 0, 0,1290, 1, 0,5816,1910, 0, 0, + + 990, 1,1320, 1, 0,5816,1910, 0, 0, + 0,5226,1360, 1, 0,5836,1910, 0, 0, + 5086,5306,1360, 1, 0,5836,1910, 0, 0, + 0, 0, 0,1420, 1,5846,1910, 0, 0, + 980, 1, 0,1450, 1,5846,1910, 0, 0, + 0,1130, 1,1450, 1,5846,1910, 0, 0, + 5076,1200, 1,1480, 1,5866,1910, 0, 0, + 0, 0,5386,1480, 1,5866,1910, 0, 0, + 980, 1,5426,1510, 1,5876,1920, 0, 0, + 0,5236,5476,1510, 1,5886,1920, 0, 0, + + 5086,5306,5456,1510, 1,5886,1920, 0, 0, + 0, 0, 0, 0,5641,5886,1920, 0, 0, + 980, 1, 0, 0,5646,5886,1920, 0, 0, + 0,1130, 1, 0,5676,5886,1920, 0, 0, + 5076,1200, 1, 0,5696,5886,1920, 0, 0, + 0, 0,1290, 1,5706,5896,1920, 0, 0, + 980, 1,1310, 1,5706,5896,1920, 0, 0, + 0,5226,1350, 1,5706,5896,1920, 0, 0, + 5086,5306,1350, 1,5706,5896,1920, 0, 0, + 0, 0, 0,5506,5736,5896,1920, 0, 0, + + 980, 1, 0,5526,5736,5896,1920, 0, 0, + 0,1130, 1,5546,5736,5896,1920, 0, 0, + 5076,1200, 1,5546,5736,5896,1920, 0, 0, + 0, 0,5386,5586,5736,5896,1920, 0, 0, + 980, 1,5406,5586,5736,5896,1920, 0, 0, + 0,5226,5456,5606,5756,5896,1920, 0, 0, + // 1000,1220,1360,1510,1660,1810,1940, 0, 0 + 5096,5316,5456,5606,5756,5906,1940, 0, 0 + }; + + unsigned short fast_128k_9dot_dac[]={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, + 950, 0, 0, 0, 0, 0, 0, 0, 0, + 0,1070, 0, 0, 0, 0, 0, 0, 0, + 970,1300, 0, 0, 0, 0, 0, 0, 0, + 0, 0,1240, 0, 0, 0, 0, 0, 0, + 970, 0,1410, 0, 0, 0, 0, 0, 0, + 0,1090,1450, 0, 0, 0, 0, 0, 0, + 970,1320,1500, 0, 0, 0, 0, 0, 0, + 0, 0, 0,1440, 0, 0, 0, 0, 0, + 970, 0, 0,1540, 0, 0, 0, 0, 0, + 0,1090, 0,1560, 0, 0, 0, 0, 0, + + 970,1320, 0,1630, 0, 0, 0, 0, 0, + 0, 0,1250,1630, 0, 0, 0, 0, 0, + 970, 0,1430,1660, 0, 0, 0, 0, 0, + 0,1090,1460,1660, 0, 0, 0, 0, 0, + 990,1340,1540,1700, 0, 0, 0, 0, 0, + 0, 0, 0, 0,1580, 0, 0, 0, 0, + 970, 0, 0, 0,1700, 0, 0, 0, 0, + 0,1090, 0, 0,1700, 0, 0, 0, 0, + 970,1320, 0, 0,1770, 0, 0, 0, 0, + 0, 0,1300, 0,1770, 0, 0, 0, 0, + + 970, 0,1430, 0,1770, 0, 0, 0, 0, + 0,1090,1460, 0,1800, 0, 0, 0, 0, + 990,1340,1540, 0,1830, 0, 0, 0, 0, + 0, 0, 0,1440,1830, 0, 0, 0, 0, + 970, 0, 0,1560,1830, 0, 0, 0, 0, + 0,1090, 0,1590,1830, 0, 0, 0, 0, + 990,1340, 0,1650,1840, 0, 0, 0, 0, + 0, 0,1300,1680,1840, 0, 0, 0, 0, + 990, 0,1440,1680,1840, 0, 0, 0, 0, + 0,1120,1480,1680,1840, 0, 0, 0, 0, + + 990,1340,1540,1720,1860, 0, 0, 0, 0, + 0, 0, 0, 0, 0,1720, 0, 0, 0, + 970, 0, 0, 0, 0,1860, 0, 0, 0, + 0,1090, 0, 0, 0,1860, 0, 0, 0, + 990,1340, 0, 0, 0,1900, 0, 0, 0, + 0, 0,1300, 0, 0,1900, 0, 0, 0, + 990, 0,1430, 0, 0,1900, 0, 0, 0, + 0,1090,1460, 0, 0,1920, 0, 0, 0, + 990,1340,1540, 0, 0,1920, 0, 0, 0, + 0, 0, 0,1440, 0,1920, 0, 0, 0, + + 990, 0, 0,1600, 0,1940, 0, 0, 0, + 0,1120, 0,1600, 0,1940, 0, 0, 0, + 990,1320, 0,1660, 0,1940, 0, 0, 0, + 0, 0,1260,1660, 0,1960, 0, 0, 0, + 990, 0,1460,1700, 0,1960, 0, 0, 0, + 0,1120,1480,1700, 0,1980, 0, 0, 0, + 990,1340,1540,1720, 0,1980, 0, 0, 0, + 0, 0, 0, 0,1570,1980, 0, 0, 0, + 990, 0, 0, 0,1710,2010, 0, 0, 0, + 0,1120, 0, 0,1730,2010, 0, 0, 0, + + 990,1340, 0, 0,1800,2010, 0, 0, 0, + 0, 0,1260, 0,1780,2010, 0, 0, 0, + 990, 0,1460, 0,1820,2010, 0, 0, 0, + 0,1120,1500, 0,1830,2010, 0, 0, 0, + 990,1340,1540, 0,1850,2020, 0, 0, 0, + 0, 0, 0,1480,1880,2020, 0, 0, 0, + 990, 0, 0,1600,1880,2020, 0, 0, 0, + 0,1120, 0,1620,1880,2020, 0, 0, 0, + 990,1340, 0,1670,1880,2020, 0, 0, 0, + 0, 0,1280,1670,1880,2020, 0, 0, 0, + + 990, 0,1440,1710,5976,1820, 0, 0, 0, + 0,1120,1500,1740,5976,1820, 0, 0, 0, + 990,1340,1540,1740,5976,1820, 0, 0, 0, + 0, 0, 0, 0, 0, 0,1820, 0, 0, + 970, 0, 0, 0, 0, 0,1960, 0, 0, + 0,1120, 0, 0, 0, 0,1980, 0, 0, + 990,1320, 0, 0, 0, 0,2020, 0, 0, + 0, 0,1260, 0, 0, 0,2020, 0, 0, + 990, 0,1440, 0, 0, 0,2060, 0, 0, + 0,1120,1500, 0, 0, 0,2060, 0, 0, + + 990,1340,1540, 0, 0, 0,2060, 0, 0, + 0, 0, 0,1480, 0, 0,2060, 0, 0, + 990, 0, 0,1580, 0, 0,2080, 0, 0, + 0,1120, 0,1620, 0, 0,2080, 0, 0, + 990,1320, 0,1680, 0, 0,2080, 0, 0, + 0, 0,1260,1680, 0, 0,2080, 0, 0, + 990, 0,1480,1700, 0, 0,2100, 0, 0, + 0,1120,1500,1700, 0, 0,2100, 0, 0, + 990,1340,1540,1720, 0, 0,2100, 0, 0, + 0, 0, 0, 0,1700, 1,1940, 0, 0, + + 990, 0, 0, 0,1740, 1,1940, 0, 0, + 0,1120, 0, 0,1760, 1,1940, 0, 0, + 990,1320, 0, 0,1780, 1,1940, 0, 0, + 0, 0,1320, 0,1800, 1,1940, 0, 0, + 990, 0,1480, 0,1830, 1,1940, 0, 0, + 0,1120,1500, 0,1840, 1,1940, 0, 0, + 990,1340,1540, 0,1860, 1,1940, 0, 0, + 0, 0, 0,1440,1860, 1,1940, 0, 0, + 990, 0, 0,1580,1860, 1,1940, 0, 0, + 0,1120, 0,1600,1860, 1,1940, 0, 0, + + 990,1320, 0,1660,1860, 1,1940, 0, 0, + 0, 0,1240,1660,1860, 1,1940, 0, 0, + 990, 1,1320,1660,1860, 1,1940, 0, 0, + 0,1120,1500,1660,1860, 1,1940, 0, 0, + 990,1340,1540,1660,1860, 1,1940, 0, 0, + 0, 0, 0, 0, 0,5776,1940, 0, 0, + 990, 0, 0, 0, 0,5956,1940, 0, 0, + 0,1120, 0, 0, 0,5956,1940, 0, 0, + 990,1320, 0, 0, 0,5996,1940, 0, 0, + 0, 0,1240, 0, 0,5996,1940, 0, 0, + + 990, 0,1440, 0, 0,5996,1940, 0, 0, + 0,1120,1500, 0, 0,5996,1940, 0, 0, + 990,1340,1540, 0, 0,5996,1940, 0, 0, + 0, 0, 0,1440, 0,5996,1940, 0, 0, + 990, 0, 0,1600, 0,5996,1940, 0, 0, + 0,1120, 0,1630, 0,5996,1940, 0, 0, + 990,1320, 0,1650, 0,5996,1940, 0, 0, + 0, 0,1240,1660, 0,5996,1940, 0, 0, + 990, 0,1460,1660, 0,5996,1940, 0, 0, + 0,1120,1500,1680, 0,5996,1940, 0, 0, + + 990,1340,1540,1680, 0,5996,1940, 0, 0, + 0, 0, 0, 0,5656,5876,1940, 0, 0, + 990, 0, 0, 0,5676,5876,1940, 0, 0, + 0,1120, 0, 0,5676,5876,1940, 0, 0, + 990,1320, 0, 1,1580,6036,1940, 0, 0, + 0, 0,1240, 1,1580,6036,1940, 0, 0, + 990, 0,1460, 1,1580,6036,1940, 0, 0, + 0,1120,1500, 1,1580,6036,1940, 0, 0, + 990,1340,1540, 1,1600,6036,1940, 0, 0, + 0, 0, 0,1420,1800,6056,1940, 0, 0, + + 990, 0, 1,1400,1700,6065,1940, 0, 0, + 0,1120, 1,1460,1700,6065,1940, 0, 0, + 990,1320, 1,1500,1700,6065,1940, 0, 0, + 0, 0,1320,1660,1860,6091,1940, 0, 0, + 990, 0,1400,1680,1860,6091,1940, 0, 0, + 0,1120,1480,1680,1880,6091,1940, 0, 0, + 990,1340,1540,1680,1880,6091,1940, 0, 0, + 0, 0, 0, 0, 0, 0, 0,2000, 0, + 990, 0, 0, 0, 0, 0, 0,2000, 0, + 0,1120, 0, 0, 0, 0, 0,2000, 0, + + 990,1320, 0, 0, 0, 0, 0,2000, 0, + 0, 0,1240, 0, 0, 0, 0,2000, 0, + 990, 0,1440, 0, 0, 0, 0,2180, 0, + 0,1120,1500, 0, 0, 0, 0,2180, 0, + 990,1340,1540, 0, 0, 0, 0,2180, 0, + 0, 0, 0,1400, 0, 0, 0,2180, 0, + 990, 0, 0,1560, 0, 0, 0,2180, 0, + 0,1120, 0,1600, 0, 0, 0,2180, 0, + 990,1320, 0,1660, 0, 0, 0,2180, 0, + 0, 0,1240,1680, 0, 0, 0,2180, 0, + + 990, 0,1440,1680, 0, 0, 0,2200, 0, + 0,1120,1500,1680, 0, 0, 0,2200, 0, + 990,1340,1540,1700, 0, 0, 0,2200, 0, + 0, 0, 0, 0,1600, 0, 0,2200, 0, + 990, 0, 0, 0,1720, 0, 0,2200, 0, + 0,1120, 0, 0,1720, 0, 0,2200, 0, + 990,1320, 0, 0,1740, 0, 0,2200, 0, + 0, 0,1240, 0,1760, 0, 0,2200, 0, + 990, 0,1480, 0,1780, 0, 0,2200, 0, + 0,1120,1500, 0,1780, 0, 1,2040, 0, + + 990,1340,1540, 0,1820, 0, 1,2040, 0, + 0, 0, 0,1420,1840, 0, 1,2040, 0, + 990, 0, 0,1560,1860, 0, 1,2040, 0, + 0,1120, 0,1600,1880, 0, 1,2040, 0, + 990,1320, 0,1620,1900, 0, 1,2040, 0, + 0, 0,1240,1660,1900, 0, 1,2040, 0, + 990, 0,1440,1680,1900, 0, 1,2040, 0, + 0,1120,1500,1700,1900, 0, 1,2040, 0, + 990,1340,1540,1720,1900, 0, 1,2040, 0, + 0, 0, 0, 0, 0,1720, 1,2040, 0, + + 990, 0, 0, 0, 0,1880, 1,2040, 0, + 0,1120, 0, 0, 0,1880, 1,2040, 0, + 990,1320, 0, 0, 0,1900, 1,2040, 0, + 0, 0,1240, 0, 0,1900, 1,2040, 0, + 990, 0,1480, 0, 0,1900, 1,2040, 0, + 0,1120,1500, 0, 0,1900, 1,2040, 0, + 990,1340,1540, 0, 0,1900, 1,2040, 0, + 0, 0, 0,1400, 0,1980, 1,2040, 0, + 990, 0, 0,1600, 0,1980, 1,2040, 0, + 0,1120, 0,1600, 0,1980, 1,2040, 0, + + 990,1320, 0,1660, 0,1980, 1,2040, 0, + 0, 0,1260,1660, 0,1980, 1,2040, 0, + 990, 0,1440,1700, 0,1980, 1,2040, 0, + 0,1120,1500,1700, 0,1980, 1,2040, 0, + 990,1340,1540,1720, 0,1980, 1,2040, 0, + 0, 0, 0, 0,1600,2040, 1,2040, 0, + 990, 0, 0, 0,1740,2040, 1,2080, 0, + 0,1120, 0, 0,1800,2040, 1,2080, 0, + 990,1320, 0, 0,1800,2040, 1,2080, 0, + 0, 0,1260, 0,1800,2040, 1,2080, 0, + + 990, 0,1440, 0,1880,2040, 1,2080, 0, + 0,1120,1500, 0,1880,2040, 1,2080, 0, + 990,1340,1540, 0,1880,2040, 1,2080, 0, + 0, 0, 0,1440,1880,2040, 1,2080, 0, + 990, 0, 0,1620,1880,2040, 1,2080, 0, + 0,1120, 0,1640,1880,2040, 1,2080, 0, + 990,1320, 0,1660,1880,2040, 1,2080, 0, + 0, 0,1260,1680,1880,2040, 1,2080, 0, + 990, 0,1460,1680,1880,2040, 1,2080, 0, + 0,1120,1500,1680,1880,2040, 1,2080, 0, + + 990,1340,1540,1680,1880,2040, 1,2080, 0, + 0, 0, 0, 0, 0, 0,5900,2080, 0, + 990, 0, 0, 0, 0, 0,6040,2080, 0, + 0,1120, 0, 0, 0, 0,6040,2080, 0, + 990,1320, 0, 0, 0, 0,6040,2080, 0, + 0, 0,1260, 0, 0, 0,6040,2080, 0, + 990, 0,1440, 0, 0, 0,6040,2080, 0, + 0,1120,1500, 0, 0, 0,6040,2080, 0, + 990,1340,1540, 0, 0, 0,6040,2080, 0, + 0, 0, 0,1440, 0, 0,6040,2080, 0, + + 990, 0, 0,1580, 0, 1,5960,2120, 0, + 0,1120, 0,1600, 0, 1,5960,2120, 0, + 990,1320, 0,1640, 0, 1,5960,2120, 0, + 0, 0,1260,1660, 0, 1,5960,2120, 0, + 990, 0,1440,1660, 0, 1,6020,2120, 0, + 0,1120,1500,1700, 0, 1,6020,2120, 0, + 990,1340,1540,1720, 0, 1,6020,2120, 0, + 0, 0, 0, 0,1600, 1,6020,2120, 0, + 990, 0, 0, 0,1740, 1,6020,2120, 0, + 0,1120, 0, 0,1760, 1,6020,2120, 0, + + 990,1320, 0, 0,1800, 1,6020,2120, 0, + 0, 0,1260, 0,1800, 1,6020,2120, 0, + 990, 0,1440, 0,1800, 1,6020,2120, 0, + 0,1120,1500, 0,1800, 1,6020,2120, 0, + 990,1340,1540, 0,1800, 1,6020,2120, 0, + 0, 0, 0,1400,1820, 1,6020,2120, 0, + 990, 0, 0,1560,1860, 1,6020,2120, 0, + 0,1120, 0,1580,1860, 1,6020,2120, 0, + 990,1320, 0,1620,1860, 1,6020,2120, 0, + 0, 0,1260,1660,1860, 1,6020,2120, 0, + + 990, 0,1440,5800,1860, 1,6020,2120, 0, + 0,1120,1500,5800,1860, 1,6020,2120, 0, + 990,1340,1540,5820,1860, 1,6020,2120, 0, + 0, 0, 0, 0, 0,5790,6020,2120, 0, + 990, 0, 0, 0, 0,5860,6020,2120, 0, + 0,1120, 0, 0, 0,5880,6020,2120, 0, + 990,1320, 0, 0, 0,5900,6020,2120, 0, + 0, 0,1260, 0, 0,5920,6020,2120, 0, + 990, 0,1440, 0, 0,5940,6020,2120, 0, + 0,1120,1500, 0, 0,5960,6020,2120, 0, + + 990,1340,1540, 0, 0,5980,6020,2120, 0, + 0, 0, 0,1380, 1,5840,6020,2120, 0, + 990, 0, 0,1540, 1,5840,6020,2120, 0, + 0,1120, 0,1560, 1,5840,6020,2120, 0, + 990,1320, 0,1580, 1,5840,6020,2120, 0, + 0, 0,1260,1660, 1,5840,6020,2120, 0, + 990, 0,1420,1660, 1,5840,6020,2120, 0, + 0,1120,1500,1700, 1,5840,6020,2120, 0, + 990,1340,1540,1720, 1,5840,6020,2120, 0, + 0, 0, 0, 0,5600,5840,6020,2120, 0, + + 990, 0, 0, 1,5680,5900,6060,2120, 0, + 0,1120, 0, 1,5680,5900,6060,2120, 0, + 990,1320, 0, 1,5680,5900,6060,2120, 0, + 0, 0,1260, 1,5680,5900,6060,2120, 0, + 990, 0,1440, 1,5680,5900,6060,2120, 0, + 0,1120,1500, 1,5680,5900,6060,2120, 0, + 990,1340,1540, 1,5680,5900,6060,2120, 0, + 0, 0, 0,5520,5760,5900,6060,2120, 0, + 990, 0, 0,5640,5780,5900,6100,2120, 0, + 0,1120, 0,5680,5780,5900,6100,2120, 0, + + 990,1320, 0,5680,5780,5900,6100,2120, 0, + 0, 0,5430,5680,5780,5900,6100,2120, 0, + 990, 1,5460,5680,5780,5900,6100,2120, 0, + 0,5216,5460,5680,5780,5900,6100,2120, 0, + 990,1360,1640,1860,2020,2180, 1,2100, 0, + 0, 0, 0, 0, 0, 0, 0, 0,2100, + 990, 0, 0, 0, 0, 0, 0, 0,2100, + 0,1120, 0, 0, 0, 0, 0, 0,2220, + 990,1320, 0, 0, 0, 0, 0, 0,2260, + 0, 0,1260, 0, 0, 0, 0, 0,2260, + + 990, 0,1440, 0, 0, 0, 0, 0,2300, + 0,1120,1500, 0, 0, 0, 0, 0,2300, + 990,1340,1540, 0, 0, 0, 0, 0,2300, + 0, 0, 0,1420, 0, 0, 0, 0,2300, + 990, 0, 0,1580, 0, 0, 0, 0,2300, + 0,1120, 0,1600, 0, 0, 0, 0,2300, + 990,1320, 0,1660, 0, 0, 0, 1,2200, + 0, 0,1260,1660, 0, 0, 0, 1,2200, + 990, 0,1440,1680, 0, 0, 0, 1,2200, + 0,1120,1500,1700, 0, 0, 0, 1,2200, + + 990,1340,1540,1720, 0, 0, 0, 1,2200, + 0, 0, 0, 0,1480, 0, 0, 1,2200, + 990, 0, 0, 0,1740, 0, 0, 1,2200, + 0,1120, 0, 0,1760, 0, 0, 1,2200, + 990,1320, 0, 0,1780, 0, 0, 1,2200, + 0, 0,1260, 0,1800, 0, 0, 1,2200, + 990, 0,1440, 0,1820, 0, 0, 1,2200, + 0,1120,1500, 0,1840, 0, 0, 1,2200, + 990,1340,1540, 0,1860, 0, 0, 1,2200, + 0, 0, 0,1440,1860, 0, 0, 1,2200, + + 990, 0, 0,1620,1880, 0, 0, 1,2200, + 0,1120, 0,1620,1880, 0, 0, 1,2200, + 990,1320, 0,1660,1880, 0, 0, 1,2200, + 0, 0,1260,1680,1880, 0, 0, 1,2200, + 990, 0,1460,1700,1880, 0, 0, 1,2200, + 0,1120,1500,1720,1880, 0, 0, 1,2200, + 990,1340,1540,1740,1880, 0, 0, 1,2200, + 0, 0, 0, 0, 0,1740, 0, 1,2200, + 990, 0, 0, 0, 0,1860, 0, 1,2200, + 0,1120, 0, 0, 0,1860, 0, 1,2200, + + 990,1320, 0, 0, 0,1880, 0, 1,2200, + 0, 0,1260, 0, 0,1880, 0, 1,2200, + 990, 0,1440, 0, 0,1960, 0, 1,2200, + 0,1120,1500, 0, 0,1960, 0, 1,2200, + 990,1340,1540, 0, 0,1960, 0, 1,2200, + 0, 0, 0,1440, 0,1960, 0, 1,2200, + 990, 0, 0,1580, 0,1980, 0, 1,2200, + 0,1120, 0,1600, 0,1980, 0, 1,2200, + 990,1320, 0,1660, 0,1980, 0, 1,2200, + 0, 0,1260,1660, 0,1980, 0, 1,2200, + + 990, 0,1440,1680, 0,2020, 0, 1,2200, + 0,1120,1500,1700, 0,2020, 0, 1,2200, + 990,1340,1540,1720, 0,2020, 0, 1,2200, + 0, 0, 0, 0,1580,2040, 0, 1,2200, + 990, 0, 0, 0,5820,1860, 0, 1,2200, + 0,1120, 0, 0,5860,1860, 0, 1,2200, + 990,1320, 0, 0,5880,1860, 0, 1,2200, + 0, 0,1260, 0,5900,1860, 0, 1,2200, + 990, 0,1440, 0,5920,1860, 0, 1,2200, + 0,1120,1500, 0,5920,1860, 0, 1,2200, + + 990,1340,1540, 0,5920,1860, 0, 1,2200, + 0, 0, 0,1400,5940,1860, 0, 1,2200, + 990, 0, 0,1600,5940,1860, 0, 1,2200, + 0,1120, 0,1620,5940,1860, 0, 1,2200, + 990,1320, 0,1640,5940,1860, 0, 1,2200, + 0, 0,1260,1660,5960,1860, 0, 1,2200, + 990, 0,1420,1680,5960,1860, 0, 1,2200, + 0,1120,1500,1700,5960,1860, 0, 1,2200, + 990,1340,1540,1720,5960,1860, 0, 1,2200, + 0, 0, 0, 0, 0, 0,1880, 1,2200, + + 990, 0, 0, 0, 0, 0,2020, 1,2200, + 0,1120, 0, 0, 0, 0,2020, 1,2200, + 990,1320, 0, 0, 0, 0,2060, 1,2200, + 0, 0,1260, 0, 0, 0,2060, 1,2200, + 990, 0,1440, 0, 0, 0,2080, 1,2200, + 0,1120,1500, 0, 0, 0,2080, 1,2200, + 990,1340,1540, 0, 0, 0,2080, 1,2200, + 0, 0, 0,1440, 0, 0,2080, 1,2200, + 990, 0, 0,1580, 0, 0,2080, 1,2200, + 0,1120, 0,1620, 0, 0,2080, 1,2200, + + 990,1320, 0,1640, 0, 0,2080, 1,2200, + 0, 0,1260,1660, 0, 0,2080, 1,2200, + 990, 0,1440,1680, 0, 0,2120, 1,2200, + 0,1120,1500,1700, 0, 0,2120, 1,2200, + 990,1340,1540,1720, 0, 0,2120, 1,2200, + 0, 0, 0, 0,1600, 0,2120, 1,2200, + 990, 0, 0, 0,1800, 0,2160, 1,2200, + 0,1120, 0, 0,1820, 0,2160, 1,2200, + 990,1320, 0, 0,1860, 0,2160, 1,2200, + 0, 0,1260, 0,1860, 0,2160, 1,2200, + + 990, 0,1460, 0,1860, 0,2160, 1,2200, + 0,1120,1500, 0,1860, 0,2160, 1,2200, + 990,1340,1540, 0,1860, 0,2160, 1,2200, + 0, 0, 0,1420,1860, 0,2160, 1,2200, + 990, 0, 0,1580,1860, 1,2000, 1,2200, + 0,1120, 0,1600,1860, 1,2000, 1,2200, + 990,1320, 0,1660,1860, 1,2000, 1,2200, + 0, 0,1260,1660,1860, 1,2000, 1,2200, + 990, 0,1460,1700,1900, 1,2000, 1,2200, + 0,1120,1500,1760,1900, 1,2000, 1,2200, + + 990,1340,1540,1780,1900, 1,2000, 1,2200, + 0, 0, 0, 0, 0,5840,2000, 1,2200, + 990, 0, 0, 0, 1,5870,2000, 1,2200, + 0,1120, 0, 0, 1,5870,2000, 1,2200, + 990,1320, 0, 0, 1,5870,2000, 1,2220, + 0, 0,1260, 0, 1,5870,2000, 1,2220, + 990, 0,1480, 0, 1,5880,2000, 1,2220, + 0,1120,1500, 0, 1,5880,2000, 1,2220, + 990,1340,1540, 0, 1,5900,2000, 1,2220, + 0, 0, 0,1440, 1,5900,2000, 1,2220, + + 990, 0, 0,1600, 1,5900,2000, 1,2220, + 0,1120, 0,1600, 1,5900,2000, 1,2220, + 990,1340, 0,1660, 1,5920,2000, 1,2220, + 0, 0,1260,1660, 1,5920,2000, 1,2220, + 990, 0,1480,1700, 1,5920,2000, 1,2220, + 0,1120,1500,1720, 1,5920,2000, 1,2220, + 990,1340,1540,1740, 1,5920,2000, 1,2220, + 0, 0, 0, 0,5680,5920,2000, 1,2220, + 990, 0, 0, 1,5700,5920,2000, 1,2220, + 0,1120, 0, 1,5700,5920,2000, 1,2220, + + 990,1320, 0, 1,5700,5920,2000, 1,2220, + 0, 0,1260, 1,5700,5920,2000, 1,2220, + 990, 0,1480, 1,5700,5920,2000, 1,2220, + 0,1120,1500, 1,5700,5920,2000, 1,2220, + 990,1340,1540, 1,5740,5920,2000, 1,2220, + 0, 0, 0,5500,5740,5920,2000, 1,2220, + 990, 0, 1,5560,5780,5920,2000, 1,2220, + 0,1120, 1,5560,5780,5920,2000, 1,2220, + 990,1320, 1,5580,5780,5920,2000, 1,2220, + 0, 0,5360,5580,5780,5920,2000, 1,2220, + + 990, 1,5420,5620,5780,5960,2020, 1,2240, + 0,5126,5460,5620,5780,5960,2020, 1,2240, + 990,5420,5460,5640,5820,5980,2020, 1,2240, + 0, 0, 0, 0, 0, 0, 0,6080,2260, + 990, 0, 0, 0, 0, 0, 1,6100,2240, + 0,1120, 0, 0, 0, 0, 1,6100,2240, + 990,1320, 0, 0, 0, 0, 1,6120,2240, + 0, 0,1260, 0, 0, 0, 1,6120,2240, + 990, 0,1440, 0, 0, 0, 1,6120,2240, + 0,1120,1500, 0, 0, 0, 1,6120,2240, + + 990,1340,1540, 0, 0, 0, 1,6120,2240, + 0, 0, 0,1440, 0, 0, 1,6120,2240, + 990, 0, 0,1620, 0, 0, 1,6120,2240, + 0,1120, 0,1620, 0, 0, 1,6120,2240, + 990,1320, 0,1660, 0, 0, 1,6120,2240, + 0, 0,1260,1660, 0, 0, 1,6120,2240, + 990, 0,1440,1680, 0, 0, 1,6120,2240, + 0,1120,1500,1700, 0, 0, 1,6120,2240, + 990,1340,1540,1740, 0, 0, 1,6120,2240, + 0, 0, 0, 0,1600, 0, 1,6120,2240, + + 990, 0, 0, 0,1740, 0, 1,6120,2240, + 0,1120, 0, 0,1760, 0, 1,6120,2240, + 990,1320, 0, 0,1800, 0, 1,6120,2240, + 0, 0,1260, 0,1800, 0, 1,6120,2240, + 990, 0,1460, 0,1840, 0, 1,6120,2240, + 0,1120,1500, 0,1860, 0, 1,6120,2240, + 990,1340,1540, 0,1880, 0, 1,6140,2240, + 0, 0, 0,1440,1880, 0, 1,6140,2240, + 990, 0, 0,1600,1880, 0, 1,6140,2240, + 0,1120, 0,1620,1880, 0, 1,6140,2240, + + 990,1320, 0,1660,1880, 0, 1,6140,2240, + 0, 0,1260,1660,1880, 0, 1,6140,2240, + 990, 0,1460,1700,1900, 0, 1,6140,2240, + 0,1120,1500,1700,1900, 0, 1,6140,2240, + 990,1340,1540,1710,1900, 0, 1,6140,2240, + 0, 0, 0, 0, 0,1720, 1,6140,2240, + 990, 0, 0, 0, 0,1920, 1,6140,2240, + 0,1120, 0, 0, 0,1920, 1,6140,2240, + 990,1340, 0, 0, 0,1940, 1,6140,2240, + 0, 0,1260, 0, 0,1940, 1,6140,2240, + + 990, 0,1440, 0, 0,2000, 1,6140,2240, + 0,1120,1500, 0, 0,2000, 1,6140,2240, + 990,1340,1540, 0, 0,2020, 1,6140,2240, + 0, 0, 0,1440, 0,2020, 1,6140,2240, + 990, 0, 0,1600, 0,2020, 1,6140,2240, + 0,1120, 0,1620, 0,2020, 1,6140,2240, + 990,1320, 0,1660, 0,2020, 1,6140,2240, + 0, 0,1260,1660, 0,2020, 1,6140,2240, + 990, 0,1440,1700, 0,2020, 1,6140,2240, + 0,1120,1500,1700, 0,2020, 1,6140,2240, + + 990,1340,1540,1740, 0,2020, 1,6140,2240, + 0, 0, 0, 0,1560,2020, 1,6140,2240, + 990, 0, 0, 0,1700,2020, 1,6140,2240, + 0,1120, 0, 0,1720,2020, 1,6140,2240, + 990,1340, 0, 0,1780,2020, 1,6140,2240, + 0, 0,1260, 0,1780,2020, 1,6140,2240, + 990, 0,1440, 0,1820,2020, 1,6140,2240, + 0,1120,1500, 0,1820,2020, 1,6140,2240, + 990,1340,1540, 1,1660,2020, 1,6140,2240, + 0, 0, 0,5540,5786,1800, 1,6140,2240, + + 990, 0, 1,5560,5776,1820, 1,6200,2240, + 0,1120, 1,5560,5776,1820, 1,6200,2240, + 990,1320, 1,5560,5776,1840, 1,6200,2240, + 0, 0,5356,5570,5776,1840, 1,6200,2240, + 990, 1,5396,5600,5786,1840, 1,6200,2240, + 0,5200,5435,5600,5786,1840, 1,6200,2240, + 990,5390,5435,5600,5786,1840, 1,6200,2240, + 0, 0, 0, 0, 0, 0,10076,10286,2180, + 990, 0, 0, 0, 0, 1,5971,6220,2240, + 0,1120, 0, 0, 0, 1,5971,6220,2240, + + 990,1320, 0, 0, 0, 1,5971,6220,2240, + 0, 0,1260, 0, 0, 1,5971,6220,2240, + 990, 0,1440, 0, 0, 1,5989,6220,2240, + 0,1120,1500, 0, 0, 1,5989,6220,2240, + 990,1340,1540, 0, 0, 1,5999,6220,2240, + 0, 0, 0,1440, 0, 1,5999,6220,2240, + 990, 0, 0,1580, 0, 1,5999,6220,2240, + 0,1120, 0,1600, 0, 1,5999,6220,2240, + 990,1320, 0,1660, 0, 1,6011,6220,2240, + 0, 0,1260,1660, 0, 1,6011,6220,2240, + + 990, 0,1440,1680, 0, 1,6011,6220,2240, + 0,1120,1500,1700, 0, 1,6011,6220,2240, + 990,1340,1540,1740, 0, 1,6019,6220,2240, + 0, 0, 0, 0,1600, 1,6019,6220,2240, + 990, 0, 0, 0,1780, 1,6019,6220,2240, + 0,1120, 0, 0,1780, 1,6019,6220,2240, + 990,1320, 0, 0,1820, 1,6019,6220,2240, + 0, 0,1260, 0,1820, 1,6019,6220,2240, + 990, 0,1440, 0,1820, 1,6019,6220,2240, + 0,1120,1500, 0,1820, 1,6019,6220,2240, + + 990,1340,1540, 0,1860, 1,6019,6220,2240, + 0, 0, 0,1400,1860, 1,6019,6220,2240, + 990, 0, 0,1600,1860, 1,6019,6220,2240, + 0,1120, 0,1600,1860, 1,6019,6220,2240, + 990,1340, 0,1640,1860, 1,6029,6220,2240, + 0, 0,1260,1660,1860, 1,6029,6220,2240, + 990, 0,1440,1700,1860, 1,6029,6220,2240, + 0,1120,1480,1700,1860, 1,6029,6220,2240, + 990,1350,1570,1720,1920, 1,6029,6220,2240, + 0, 0, 0, 0, 0,9920,6029,6220,2240, + + 990, 0, 0, 0, 1,5810,6029,6220,2240, + 0,1120, 0, 0, 1,5810,6029,6220,2240, + 990,1340, 0, 0, 1,5820,6029,6220,2240, + 0, 0,1260, 0, 1,5820,6029,6220,2240, + 990, 0,1440, 0, 1,5820,6029,6220,2240, + 0,1120,1500, 0, 1,5820,6029,6220,2240, + 990,1340,1540, 0, 1,5840,6029,6220,2240, + 0, 0, 0,1440, 1,5820,6029,6220,2240, + 990, 0, 0,1600, 1,5820,6029,6220,2240, + 0,1120, 0,1600, 1,5820,6029,6220,2240, + + 990,1320, 0,1660, 1,5820,6029,6220,2240, + 0, 0,1260,1660, 1,5820,6029,6220,2240, + 990, 0,1440,1680, 1,5820,6029,6220,2240, + 0,1120,1500,1700, 1,5820,6029,6220,2240, + 990,1340,1540,1720, 1,5820,6029,6220,2240, + 0, 0, 0, 0,5580,5820,6029,6220,2240, + 990, 0, 0, 1,5620,5820,6029,6220,2240, + 0,1120, 0, 1,5620,5820,6029,6220,2240, + 990,1320, 0, 1,5640,5820,6029,6220,2240, + 0, 0,1260, 1,5640,5820,6029,6220,2240, + + 990, 0,1440, 1,5640,5820,6029,6220,2240, + 0,1120,1500, 1,5640,5820,6029,6220,2240, + 990,1340,1540, 1,5660,5820,6029,6220,2240, + 0, 0, 0,5400,5660,5820,6029,6220,2240, + 990, 0, 1,5460,5660,5820,6029,6220,2240, + 0,1120, 1,5460,5660,5820,6029,6220,2240, + 990,1340, 1,5460,5660,5820,6029,6220,2240, + 0, 0, 0,5460,5660,5820,6029,6220,2240, + 990, 0, 1,5460,5660,5820,6029,6220,2240, + 0,1120, 1,5460,5660,5820,6029,6220,2240, + + 1020,1400,1660,1860,2060,2240,2350, 1,2250 + }; + unsigned short normal_128k_9dot_dac[]={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, + 960, 0, 0, 0, 0, 0, 0, 0, 0, + 0,1100, 0, 0, 0, 0, 0, 0, 0, + 980,1280, 0, 0, 0, 0, 0, 0, 0, + 0, 0,1250, 0, 0, 0, 0, 0, 0, + 980, 0,1390, 0, 0, 0, 0, 0, 0, + 0,1130,1440, 0, 0, 0, 0, 0, 0, + 980,1320,1480, 0, 0, 0, 0, 0, 0, + 0, 0, 0,1400, 0, 0, 0, 0, 0, + 980, 0, 0,1510, 0, 0, 0, 0, 0, + 0,1130, 0,1530, 0, 0, 0, 0, 0, + + 980,1320, 0,1580, 0, 0, 0, 0, 0, + 0, 0,1260,1580, 0, 0, 0, 0, 0, + 980, 1,1300,1580, 0, 0, 0, 0, 0, + 0,5246,5446,1460, 0, 0, 0, 0, 0, + 5076,5296,5446,1460, 0, 0, 0, 0, 0, + 0, 0, 0, 0,1520, 0, 0, 0, 0, + 980, 0, 0, 0,1620, 0, 0, 0, 0, + 0,1130, 0, 0,1640, 0, 0, 0, 0, + 980,1320, 0, 0,1690, 0, 0, 0, 0, + 0, 0,1280, 0,1680, 0, 0, 0, 0, + + 1000, 0,1430, 1,1570, 0, 0, 0, 0, + 0,1090,1460, 1,1570, 0, 0, 0, 0, + 990,1340,1540, 1,1580, 0, 0, 0, 0, + 0, 0, 0,5496,1600, 0, 0, 0, 0, + 970, 0, 1,5546,1600, 0, 0, 0, 0, + 0,1140, 1,5546,1600, 0, 0, 0, 0, + 1000,1320, 1,5546,1600, 0, 0, 0, 0, + 0, 0,5346,5566,1600, 0, 0, 0, 0, + 1000, 1,5416,5586,1600, 0, 0, 0, 0, + 0,5226,5446,5586,1600, 0, 0, 0, 0, + + 5076,5286,5446,5586,1600, 0, 0, 0, 0, + 0, 0, 0, 0, 0,1640, 0, 0, 0, + 980, 0, 0, 0, 0,1760, 0, 0, 0, + 0,1130, 0, 0, 0,1780, 0, 0, 0, + 980,1320, 0, 0, 1,1680, 0, 0, 0, + 0, 0,1280, 0, 0,1800, 0, 0, 0, + 980, 0,1420, 0, 1,1680, 0, 0, 0, + 0,1130,1460, 0, 1,1680, 0, 0, 0, + 1000,1320,1480, 0, 1,1680, 0, 0, 0, + 0, 0, 0,1380, 1,1680, 0, 0, 0, + + 980, 0, 0,1540, 1,1700, 0, 0, 0, + 0,1130, 0,1580, 1,1700, 0, 0, 0, + 1000,1320, 0,1620, 1,1700, 0, 0, 0, + 0, 0,5346,1480, 1,1700, 0, 0, 0, + 980, 1,5386,1480, 1,1700, 0, 0, 0, + 0,5246,5446,1480, 1,1700, 0, 0, 0, + 5076,5296,5446,1480, 1,1700, 0, 0, 0, + 0, 0, 0, 0,5616,1740, 0, 0, 0, + 980, 0, 0, 1,5636,1740, 0, 0, 0, + 0,1130, 0, 1,5646,1740, 0, 0, 0, + + 1000,1320, 0, 1,5656,1740, 0, 0, 0, + 0, 0,1280, 1,5666,1740, 0, 0, 0, + 980, 0,1420, 1,5676,1740, 0, 0, 0, + 0,1130,1460, 1,5676,1740, 0, 0, 0, + 1000,1320,1480, 1,5676,1740, 0, 0, 0, + 0, 0, 0,5498,5726,1740, 0, 0, 0, + 980, 0, 1,5526,5706,1740, 0, 0, 0, + 0,1130, 1,5526,5706,1740, 0, 0, 0, + 1000,1320, 1,5526,5706,1740, 0, 0, 0, + 0, 0,5356,5576,5706,1740, 0, 0, 0, + + 980, 1,5406,5576,5726,1740, 0, 0, 0, + 0,5216,5416,5576,5726,1740, 0, 0, 0, + 5076,5296,5446,5576,5726,1740, 0, 0, 0, + 0, 0, 0, 0, 0, 0,1760, 0, 0, + 980, 0, 0, 0, 0, 1,1780, 0, 0, + 0,1130, 0, 0, 0, 1,1790, 0, 0, + 1000,1320, 0, 0, 0, 1,1800, 0, 0, + 0, 0,1280, 0, 0, 1,1800, 0, 0, + 980, 0,1420, 0, 0, 1,1820, 0, 0, + 0,1130,1460, 0, 0, 1,1820, 0, 0, + + 1000,1320,1480, 0, 0, 1,1820, 0, 0, + 0, 0, 0,1400, 0, 1,1820, 0, 0, + 980, 0, 0,1540, 0, 1,1820, 0, 0, + 0,1130, 0,1560, 0, 1,1820, 0, 0, + 1000,1320, 0,1610, 0, 1,1830, 0, 0, + 0, 0,1280,1620, 0, 1,1830, 0, 0, + 980, 1,5386,1480, 0, 1,1840, 0, 0, + 0,5246,5446,1480, 0, 1,1840, 0, 0, + 5076,5296,5446,1480, 0, 1,1840, 0, 0, + 0, 0, 0, 0,1540, 1,1860, 0, 0, + + 980, 0, 0, 0,1690, 1,1840, 0, 0, + 0,1130, 0, 0,1700, 1,1840, 0, 0, + 1000,1320, 0, 0,1730, 1,1840, 0, 0, + 0, 0,1280, 0,1730, 1,1850, 0, 0, + 980, 0,1420, 1,1580, 1,1850, 0, 0, + 0,1130,1460, 1,1580, 1,1850, 0, 0, + 1000,1320,1480, 1,1580, 1,1850, 0, 0, + 0, 0, 0,5486,1600, 1,1850, 0, 0, + 980, 0, 1,5516,1610, 1,1850, 0, 0, + 0,1130, 1,5526,1610, 1,1850, 0, 0, + + 1000,1320, 1,5546,1610, 1,1850, 0, 0, + 0, 0,5326,5586,1610, 1,1850, 0, 0, + 980, 1,5396,5596,1630, 1,1850, 0, 0, + 0,5246,5446,5596,1630, 1,1850, 0, 0, + 5076,5296,5446,5596,1630, 1,1850, 0, 0, + 0, 0, 0, 0, 0,5776,1880, 0, 0, + 980, 0, 0, 0, 1,5796,1880, 0, 0, + 0,1130, 0, 0, 1,5796,1880, 0, 0, + 1000,1320, 0, 0, 1,5796,1880, 0, 0, + 0, 0,1280, 0, 1,5796,1880, 0, 0, + + 980, 0,1430, 0, 1,5796,1880, 0, 0, + 0,1130,1470, 0, 1,5796,1880, 0, 0, + 1000,1320,1490, 0, 1,5796,1880, 0, 0, + 0, 0, 0,1400, 1,5796,1880, 0, 0, + 980, 0, 0,1600, 1,5796,1880, 0, 0, + 0,1130, 0,1620, 1,5806,1880, 0, 0, + 1000,1320, 0,1640, 1,5816,1880, 0, 0, + 0, 0,1290,1660, 1,5816,1880, 0, 0, + 980, 1,5396,1500, 1,5826,1890, 0, 0, + 0,5246,5446,1500, 1,5826,1890, 0, 0, + + 5076,5296,5446,1500, 1,5826,1890, 0, 0, + 0, 0, 0, 0,5616,5846,1890, 0, 0, + 980, 0, 0, 1,5646,5866,1900, 0, 0, + 0,1130, 0, 1,5656,5866,1900, 0, 0, + 1000,1320, 0, 1,5666,5866,1900, 0, 0, + 0, 0,1280, 1,5666,5866,1900, 0, 0, + 980, 0,1430, 1,5686,5876,1900, 0, 0, + 0,1120,1470, 1,5696,5876,1900, 0, 0, + 1000,1320,1490, 1,5706,5876,1900, 0, 0, + 0, 0, 0,5466,5706,5876,1900, 0, 0, + + 980, 0, 1,5536,5746,5896,1900, 0, 0, + 0,1130, 1,5546,5746,5896,1900, 0, 0, + 1000,1320, 1,5566,5746,5896,1900, 0, 0, + 0, 0,5366,5596,5746,5896,1900, 0, 0, + 980, 1,5396,5596,5746,5896,1900, 0, 0, + 0,5206,5446,5596,5746,5896,1900, 0, 0, + 5076,5296,5446,5596,5746,5896,1900, 0, 0, + 0, 0, 0, 0, 0, 0, 0,1920, 0, + 980, 0, 0, 0, 0, 0, 1,1920, 0, + 0,1130, 0, 0, 0, 0, 1,1930, 0, + + 1000,1320, 0, 0, 0, 0, 1,1940, 0, + 0, 0,1280, 0, 0, 0, 1,1940, 0, + 980, 0,1410, 0, 0, 0, 1,1940, 0, + 0,1130,1460, 0, 0, 0, 1,1940, 0, + 1000,1320,1490, 0, 0, 0, 1,1940, 0, + 0, 0, 0,1390, 0, 0, 1,1940, 0, + 980, 0, 0,1540, 0, 0, 1,1950, 0, + 0,1130, 0,1560, 0, 0, 1,1950, 0, + 1000,1320, 0,1600, 0, 0, 1,1950, 0, + 0, 0,1280,1620, 0, 0, 1,1960, 0, + + 980, 1,5386,1480, 0, 0, 1,1960, 0, + 0,5246,5446,1480, 0, 0, 1,1960, 0, + 5076,5296,5446,1480, 0, 0, 1,1960, 0, + 0, 0, 0, 0,1540, 0, 1,1960, 0, + 980, 0, 0, 1,1540, 0, 1,1960, 0, + 0,1130, 0, 1,1550, 0, 1,1960, 0, + 1000,1320, 0, 1,1560, 0, 1,1960, 0, + 0, 0,1280, 1,1580, 0, 1,1960, 0, + 980, 0,1420, 1,1590, 0, 1,1960, 0, + 0,1130,1460, 1,1600, 0, 1,1960, 0, + + 1000,1320,1490, 1,1620, 0, 1,1960, 0, + 0, 0, 0,5496,1640, 0, 1,1960, 0, + 980, 0, 1,5516,1620, 0, 1,1960, 0, + 0,1130, 1,5526,1620, 0, 1,1960, 0, + 1000,1320, 1,5526,1620, 0, 1,1960, 0, + 0, 0,5246,5536,1620, 0, 1,1960, 0, + 980, 1,5386,5596,1620, 0, 1,1970, 0, + 0,5206,5446,5596,1620, 0, 1,1970, 0, + 5076,5296,5446,5596,1620, 0, 1,1970, 0, + 0, 0, 0, 0, 0,1660, 1,1970, 0, + + 980, 0, 0, 0, 1,1700, 1,1980, 0, + 0,1130, 0, 0, 1,1700, 1,1980, 0, + 1000,1320, 0, 0, 1,1700, 1,1980, 0, + 0, 0,1280, 0, 1,1710, 1,1980, 0, + 980, 0,1430, 0, 1,1720, 1,1980, 0, + 0,1130,1470, 0, 1,1720, 1,1980, 0, + 1000,1320,1490, 0, 1,1720, 1,1980, 0, + 0, 0, 0,1420, 1,1720, 1,1980, 0, + 980, 0, 1,1430, 1,1720, 1,1980, 0, + 0,1130, 1,1460, 1,1720, 1,1980, 0, + + 1000,1320, 1,1480, 1,1720, 1,1980, 0, + 0, 0,5356,1480, 1,1720, 1,1980, 0, + 990, 1,5386,1480, 1,1730, 1,1990, 0, + 0,5246,5446,1480, 1,1730, 1,1990, 0, + 5076,5296,5446,1480, 1,1730, 1,1990, 0, + 0, 0, 0, 0,5616,1750, 1,1990, 0, + 980, 0, 0, 1,5636,1760, 1,1990, 0, + 0,1130, 0, 1,5646,1760, 1,1990, 0, + 1000,1320, 0, 1,5666,1760, 1,1990, 0, + 0, 0,1280, 1,5666,1760, 1,1990, 0, + + 980, 0,1430, 1,5666,1760, 1,1990, 0, + 0,1130,1470, 1,5666,1760, 1,1990, 0, + 1000,1320,1490, 1,5696,1780, 1,1990, 0, + 0, 0, 0,5496,5706,1770, 1,1990, 0, + 980, 0, 1,5516,5706,1780, 1,2020, 0, + 0,1130, 1,5526,5716,1780, 1,2020, 0, + 1000,1320, 1,5546,5726,1780, 1,2020, 0, + 0, 0,5356,5546,5726,1780, 1,2020, 0, + 980, 1,5396,5596,5746,1780, 1,2020, 0, + 0,5206,5446,5596,5746,1780, 1,2020, 0, + + 5076,5296,5446,5596,5746,1780, 1,2020, 0, + 0, 0, 0, 0, 0, 0,5896,2020, 0, + 980, 0, 0, 0, 0, 1,5886,2020, 0, + 0,1120, 0, 0, 0, 1,5896,2020, 0, + 1000,1320, 0, 0, 0, 1,5896,2020, 0, + 0, 0,1280, 0, 0, 1,5896,2020, 0, + 980, 0,1430, 0, 0, 1,5946,2020, 0, + 0,1130,1470, 0, 0, 1,5946,2020, 0, + 1000,1320,1490, 0, 0, 1,5956,2020, 0, + 0, 0, 0,1400, 0, 1,5946,2020, 0, + + 980, 0, 1,1430, 0, 1,5956,2030, 0, + 0,1140, 1,1450, 0, 1,5956,2030, 0, + 1000,1320, 1,1460, 0, 1,5956,2030, 0, + 0, 0,5366,1480, 0, 1,5956,2030, 0, + 980, 1,5386,1480, 0, 1,5956,2030, 0, + 0,5246,5446,1480, 0, 1,5956,2030, 0, + 5076,5296,5446,1480, 0, 1,5956,2030, 0, + 0, 0, 0, 0,1580, 1,5956,2030, 0, + 980, 0, 0, 1,1590, 1,5976,2050, 0, + 0,1140, 0, 1,1600, 1,5976,2050, 0, + + 1000,1320, 0, 1,1600, 1,5976,2050, 0, + 0, 0,1300, 1,1600, 1,5976,2050, 0, + 980, 0,1440, 1,1610, 1,5976,2050, 0, + 0,1140,1480, 1,1620, 1,5976,2050, 0, + 1000,1330,1500, 1,1620, 1,5976,2050, 0, + 0, 0, 0,5496,1620, 1,5976,2050, 0, + 980, 0, 1,5526,1620, 1,5996,2050, 0, + 0,1140, 1,5546,1630, 1,5996,2050, 0, + 1000,1330, 1,5546,1630, 1,5996,2050, 0, + 0, 0,5346,5586,1630, 1,5996,2050, 0, + + 980, 1,5386,5596,1630, 1,5996,2050, 0, + 0,5246,5446,5596,1630, 1,5996,2050, 0, + 5076,5296,5446,5596,1630, 1,5996,2050, 0, + 0, 0, 0, 0, 0,5766,6006,2050, 0, + 980, 0, 0, 0, 1,5806,6006,2050, 0, + 0,1140, 0, 0, 1,5806,6006,2050, 0, + 1000,1320, 0, 0, 1,5816,6006,2050, 0, + 0, 0,1280, 0, 1,5806,6006,2050, 0, + 980, 0,1440, 0, 1,5816,6006,2050, 0, + 0,1140,1480, 0, 1,5826,6006,2050, 0, + + 1000,1320,1490, 0, 1,5826,6006,2050, 0, + 0, 0, 0,1430, 1,5826,6006,2050, 0, + 980, 0, 1,1450, 1,5826,6006,2050, 0, + 0,1140, 1,1460, 1,5836,6006,2050, 0, + 1000,1320, 1,1480, 1,5846,6006,2050, 0, + 0, 0,5366,1500, 1,5846,6006,2050, 0, + 980, 1,5406,1500, 1,5866,6026,2050, 0, + 0,5246,5446,1500, 1,5866,6026,2050, 0, + 5076,5296,5446,1500, 1,5866,6026,2050, 0, + 0, 0, 0, 0,5626,5886,6026,2050, 0, + + 980, 0, 0, 1,5676,5886,6026,2050, 0, + 0,1140, 0, 1,5676,5886,6026,2050, 0, + 1000,1320, 0, 1,5696,5886,6026,2050, 0, + 0, 0,1290, 1,5696,5886,6026,2050, 0, + 980, 0,1440, 1,5696,5896,6026,2050, 0, + 0,1140,1480, 1,5696,5896,6026,2050, 0, + 1000,1320,1500, 1,5716,5896,6026,2050, 0, + 0, 0, 0,5466,5716,5896,6026,2050, 0, + 980, 0, 1,5516,5726,5896,6026,2050, 0, + 0,1140, 1,5526,5726,5896,6026,2050, 0, + + 1000,1320, 1,5566,5726,5896,6026,2050, 0, + 0, 0,5356,5566,5726,5896,6026,2050, 0, + 980, 1,5376,5566,5726,5896,6026,2050, 0, + 0,5246,5446,5566,5726,5896,6026,2050, 0, + 5076,5296,5446,5566,5726,5896,6026,2050, 0, + 0, 0, 0, 0, 0, 0, 0, 0,2040, + 980, 0, 0, 0, 0, 0, 0, 1,2050, + 0,1130, 0, 0, 0, 0, 0, 1,2060, + 1000,1320, 0, 0, 0, 0, 0, 1,2070, + 0, 0,1280, 0, 0, 0, 0, 1,2070, + + 980, 0,1420, 0, 0, 0, 0, 1,2070, + 0,1130,1470, 0, 0, 0, 0, 1,2070, + 1000,1320,1490, 0, 0, 0, 0, 1,2070, + 0, 0, 0,1400, 0, 0, 0, 1,2070, + 980, 0, 0,1530, 0, 0, 0, 1,2080, + 0,1130, 0,1570, 0, 0, 0, 1,2080, + 1000,1320, 0,1610, 0, 0, 0, 1,2090, + 0, 0,1280,1630, 0, 0, 0, 1,2080, + 980, 1,5386,1480, 0, 0, 0, 1,2090, + 0,5246,5446,1480, 0, 0, 0, 1,2090, + + 5076,5296,5446,1490, 0, 0, 0, 1,2090, + 0, 0, 0, 0,1530, 0, 0, 1,2090, + 980, 0, 0, 1,1550, 0, 0, 1,2090, + 0,1130, 0, 1,1560, 0, 0, 1,2090, + 1000,1320, 0, 1,1580, 0, 0, 1,2090, + 0, 0,1280, 1,1580, 0, 0, 1,2090, + 980, 0,1430, 1,1580, 0, 0, 1,2090, + 0,1130,1470, 1,1590, 0, 0, 1,2090, + 1000,1320,1490, 1,1600, 0, 0, 1,2090, + 0, 0, 0,5496,1620, 0, 0, 1,2090, + + 980, 0, 1,5536,1620, 0, 0, 1,2100, + 0,1130, 1,5546,1620, 0, 0, 1,2100, + 1000,1320, 1,5566,1620, 0, 0, 1,2100, + 0, 0,5366,5586,1620, 0, 0, 1,2100, + 980, 1,5376,5566,1620, 0, 0, 1,2100, + 0,5246,5446,5566,1620, 0, 0, 1,2100, + 5096,5296,5446,5566,1620, 0, 0, 1,2100, + 0, 0, 0, 0, 0,1660, 0, 1,2100, + 980, 0, 0, 0, 1,1670, 0, 1,2100, + 0,1130, 0, 0, 1,1680, 0, 1,2100, + + 1000,1320, 0, 0, 1,1700, 0, 1,2100, + 0, 0,1280, 0, 1,1700, 0, 1,2100, + 980, 0,1430, 0, 1,1710, 0, 1,2110, + 0,1130,1470, 0, 1,1720, 0, 1,2110, + 1000,1320,1490, 0, 1,1730, 0, 1,2110, + 0, 0, 0,1400, 1,1720, 0, 1,2110, + 980, 0, 1,1420, 1,1720, 0, 1,2110, + 0,1130, 1,1440, 1,1720, 0, 1,2110, + 1000,1320, 1,1460, 1,1730, 0, 1,2110, + 0, 0,5346,1460, 1,1730, 0, 1,2110, + + 980, 1,5386,1480, 1,1740, 0, 1,2120, + 0,5246,5446,1480, 1,1740, 0, 1,2120, + 5076,5296,5446,1500, 1,1740, 0, 1,2120, + 0, 0, 0, 0,5616,1740, 0, 1,2120, + 980, 0, 0, 1,5626,1750, 0, 1,2120, + 0,1130, 0, 1,5636,1750, 0, 1,2120, + 1000,1320, 0, 1,5656,1750, 0, 1,2120, + 0, 0,1280, 1,5666,1750, 0, 1,2120, + 980, 0,1440, 1,5666,1750, 0, 1,2120, + 0,1130,1480, 1,5666,1750, 0, 1,2120, + + 1000,1320,1490, 1,5686,1750, 0, 1,2120, + 0, 0, 0,5486,5726,1750, 0, 1,2120, + 980, 0, 1,5496,5726,1750, 0, 1,2130, + 0,1140, 1,5526,5726,1750, 0, 1,2130, + 1000,1320, 1,5546,5726,1760, 0, 1,2130, + 0, 0,5356,5576,5726,1760, 0, 1,2130, + 980, 1,5376,5566,5726,1760, 0, 1,2130, + 0,5246,5446,5566,5726,1760, 0, 1,2130, + 5076,5296,5446,5566,5726,1760, 0, 1,2130, + 0, 0, 0, 0, 0, 0,1810, 1,2130, + + 980, 0, 0, 0, 0, 1,1820, 1,2130, + 0,1130, 0, 0, 0, 1,1820, 1,2130, + 1000,1320, 0, 0, 0, 1,1830, 1,2130, + 0, 0,1280, 0, 0, 1,1830, 1,2130, + 980, 0,1430, 0, 0, 1,1830, 1,2130, + 0,1130,1470, 0, 0, 1,1830, 1,2130, + 1000,1320,1490, 0, 0, 1,1830, 1,2130, + 0, 0, 0,1400, 0, 1,1830, 1,2130, + 980, 0, 1,1420, 0, 1,1850, 1,2130, + 0,1130, 1,1440, 0, 1,1850, 1,2130, + + 1000,1320, 1,1460, 0, 1,1850, 1,2130, + 0, 0,5346,1460, 0, 1,1850, 1,2130, + 980, 1,5386,1480, 0, 1,1860, 1,2130, + 0,5246,5446,1480, 0, 1,1860, 1,2130, + 5076,5296,5446,1500, 0, 1,1870, 1,2130, + 0, 0, 0, 0,1530, 1,1860, 1,2130, + 980, 0, 0, 1,1560, 1,1870, 1,2130, + 0,1130, 0, 1,1570, 1,1870, 1,2130, + 1000,1320, 0, 1,1580, 1,1870, 1,2130, + 0, 0,1280, 1,1580, 1,1870, 1,2130, + + 980, 0,1430, 1,1600, 1,1880, 1,2140, + 0,1130,1470, 1,1610, 1,1880, 1,2140, + 1000,1320,1490, 1,1610, 1,1880, 1,2140, + 0, 0, 0,5486,1620, 1,1880, 1,2140, + 980, 0, 1,5516,1620, 1,1890, 1,2140, + 0,1130, 1,5536,1620, 1,1890, 1,2140, + 1000,1320, 1,5566,1620, 1,1890, 1,2140, + 0, 0,5366,5586,1620, 1,1890, 1,2140, + 980, 1,5376,5566,1630, 1,1900, 1,2140, + 0,5246,5466,5566,1630, 1,1900, 1,2140, + + 5076,5296,5446,5566,1630, 1,1900, 1,2140, + 0, 0, 0, 0, 0,5376,1900, 1,2140, + 980, 0, 0, 0, 1,5776,1900, 1,2150, + 0,1130, 0, 0, 1,5796,1900, 1,2150, + 1000,1320, 0, 0, 1,5796,1900, 1,2150, + 0, 0,1280, 0, 1,5796,1900, 1,2150, + 980, 0,1440, 0, 1,5796,1900, 1,2150, + 0,1130,1480, 0, 1,5806,1900, 1,2150, + 1000,1320,1500, 0, 1,5806,1900, 1,2150, + 0, 0, 0,1430, 1,5806,1900, 1,2150, + + 980, 0, 1,1450, 1,5806,1910, 1,2160, + 0,1130, 1,1460, 1,5806,1910, 1,2160, + 1000,1320, 1,1470, 1,5816,1910, 1,2160, + 0, 0,5346,1480, 1,5816,1910, 1,2160, + 980, 1,5386,1480, 1,5816,1910, 1,2160, + 0,5246,5446,1480, 1,5816,1910, 1,2160, + 5076,5296,5446,1500, 1,5816,1910, 1,2160, + 0, 0, 0, 0,5586,5836,1910, 1,2160, + 980, 0, 0, 1,5626,5836,1910, 1,2160, + 0,1140, 0, 1,5636,5836,1910, 1,2160, + + 1000,1320, 0, 1,5646,5836,1910, 1,2160, + 0, 0,1290, 1,5646,5836,1910, 1,2160, + 980, 0,1430, 1,5646,5836,1910, 1,2160, + 0,1140,1480, 1,5656,5836,1910, 1,2160, + 1000,1320,1500, 1,5686,5836,1910, 1,2160, + 0, 0, 0,5446,5686,5836,1910, 1,2160, + 980, 0, 1,5516,5716,5856,1920, 1,2160, + 0,1140, 1,5536,5716,5856,1920, 1,2160, + 1000,1320, 1,5566,5726,5856,1920, 1,2160, + 0, 0,5366,5586,5736,5856,1920, 1,2160, + + 980, 1,5376,5566,5726,5856,1930, 1,2170, + 0,5246,5446,5566,5726,5856,1930, 1,2170, + 5076,5296,5446,5566,5726,5856,1930, 1,2170, + 0, 0, 0, 0, 0, 0, 0,6046,2170, + 980, 0, 0, 0, 0, 0, 1,6076,2180, + 0,1130, 0, 0, 0, 0, 1,6086,2180, + 1000,1320, 0, 0, 0, 0, 1,6086,2180, + 0, 0,1280, 0, 0, 0, 1,6086,2180, + 980, 0,1420, 0, 0, 0, 1,6086,2180, + 0,1130,1470, 0, 0, 0, 1,6086,2180, + + 1000,1320,1490, 0, 0, 0, 1,6086,2180, + 0, 0, 0,1400, 0, 0, 1,6086,2180, + 980, 0, 1,1420, 0, 0, 1,6086,2180, + 0,1130, 1,1440, 0, 0, 1,6086,2180, + 1000,1320, 1,1460, 0, 0, 1,6086,2180, + 0, 0,5346,1460, 0, 0, 1,6086,2180, + 980, 1,5386,1480, 0, 0, 1,6096,2180, + 0,5246,5446,1480, 0, 0, 1,6096,2180, + 5076,5296,5446,1500, 0, 0, 1,6096,2180, + 0, 0, 0, 0,1540, 0, 1,6096,2180, + + 980, 0, 0, 1,1570, 0, 1,6106,2180, + 0,1130, 0, 1,1580, 0, 1,6106,2180, + 1000,1320, 0, 1,1600, 0, 1,6106,2180, + 0, 0,1280, 1,1600, 0, 1,6106,2180, + 980, 0,1430, 1,1600, 0, 1,6106,2180, + 0,1130,1470, 1,1600, 0, 1,6106,2180, + 1000,1320,1490, 1,1610, 0, 1,6106,2180, + 0, 0, 0,5486,1610, 0, 1,6106,2180, + 980, 0, 1,5526,1620, 0, 1,6106,2180, + 0,1130, 1,5546,1620, 0, 1,6106,2180, + + 1000,1320, 1,5546,1630, 0, 1,6106,2180, + 0, 0,5346,5586,1630, 0, 1,6106,2180, + 980, 1,5376,5566,1630, 0, 1,6116,2180, + 0,5246,5446,5566,1630, 0, 1,6116,2180, + 5076,5296,5446,5566,1630, 0, 1,6116,2180, + 0, 0, 0, 0, 0,1700, 1,6116,2180, + 980, 0, 0, 0, 1,1720, 1,6116,2180, + 0,1130, 0, 0, 1,1730, 1,6116,2180, + 1000,1320, 0, 0, 1,1730, 1,6116,2180, + 0, 0,1280, 0, 1,1730, 1,6116,2180, + + 980, 0,1430, 0, 1,1740, 1,6116,2180, + 0,1130,1470, 0, 1,1740, 1,6116,2180, + 1000,1320,1490, 0, 1,1740, 1,6116,2180, + 0, 0, 0,1430, 1,1740, 1,6116,2180, + 980, 0, 1,1430, 1,1740, 1,6116,2180, + 0,1130, 1,1450, 1,1740, 1,6116,2180, + 1000,1320, 1,1460, 1,1740, 1,6116,2180, + 0, 0,5366,1470, 1,1740, 1,6116,2180, + 980, 1,5386,1480, 1,1750, 1,6116,2180, + 0,5246,5446,1480, 1,1750, 1,6116,2180, + + 5076,5296,5446,1500, 1,1750, 1,6116,2180, + 0, 0, 0, 0,5616,1750, 1,6116,2180, + 980, 0, 0, 1,5616,1770, 1,6126,2190, + 0,1130, 0, 1,5636,1770, 1,6126,2190, + 1000,1320, 0, 1,5646,1770, 1,6126,2190, + 0, 0,1280, 1,5646,1770, 1,6126,2190, + 980, 0,1430, 1,5646,1770, 1,6126,2190, + 0,1130,1480, 1,5666,1770, 1,6126,2190, + 1000,1320,1500, 1,5686,1770, 1,6126,2190, + 0, 0, 0,5446,5686,1770, 1,6126,2190, + + 980, 0, 1,5516,5716,1770, 1,6126,2190, + 0,1130, 1,5536,5726,1770, 1,6126,2190, + 1000,1320, 1,5566,5726,1770, 1,6126,2190, + 0, 0,5366,5586,5736,1770, 1,6126,2190, + 980, 1,5376,5566,5726,1780, 1,6136,2190, + 0,5246,5446,5566,5726,1780, 1,6136,2190, + 5076,5296,5446,5566,5726,1780, 1,6136,2190, + 0, 0, 0, 0, 0, 0,5886,6136,2190, + 980, 0, 0, 0, 0, 1,5906,6156,2190, + 0,1130, 0, 0, 0, 1,5916,6156,2190, + + 1000,1320, 0, 0, 0, 1,5936,6156,2190, + 0, 0,1280, 0, 0, 1,5916,6156,2190, + 980, 0,1430, 0, 0, 1,5946,6176,2190, + 0,1130,1470, 0, 0, 1,5956,6176,2190, + 1000,1320,1490, 0, 0, 1,5956,6176,2190, + 0, 0, 0,1420, 0, 1,5966,6176,2190, + 980, 0, 1,1430, 0, 1,5966,6166,2190, + 0,1130, 1,1450, 0, 1,5966,6166,2190, + 1000,1320, 1,1460, 0, 1,5966,6166,2190, + 0, 0,5366,1470, 0, 1,5966,6166,2190, + + 980, 1,5376,1480, 0, 1,5966,6166,2190, + 0,5246,5446,1480, 0, 1,5966,6166,2190, + 5076,5296,5446,1500, 0, 1,5966,6166,2190, + 0, 0, 0, 0,1580, 1,5966,6166,2190, + 980, 0, 0, 1,1600, 1,5976,6166,2190, + 0,1130, 0, 1,1600, 1,5976,6166,2190, + 1000,1320, 0, 1,1600, 1,5976,6166,2190, + 0, 0,1280, 1,1600, 1,5976,6166,2190, + 980, 0,1430, 1,1600, 1,5976,6166,2190, + 0,1130,1480, 1,1600, 1,5976,6166,2190, + + 1000,1320,1490, 1,1610, 1,5976,6166,2190, + 0, 0, 0,5446,1620, 1,5976,6166,2190, + 980, 0, 1,5526,1620, 1,5986,6166,2190, + 0,1130, 1,5546,1620, 1,5986,6166,2190, + 1000,1320, 1,5546,1630, 1,5986,6166,2190, + 0, 0,5346,5566,1630, 1,5986,6166,2190, + 980, 1,5376,5566,1630, 1,5986,6166,2190, + 0,5246,5446,5566,1630, 1,5986,6166,2190, + 5076,5296,5446,5566,1630, 1,5986,6166,2190, + 0, 0, 0, 0, 0,9876,10080,10240,2160, + + 980, 0, 0, 0, 1,5776,6016,6166,2190, + 0,1130, 0, 0, 1,5786,6016,6166,2190, + 1000,1320, 0, 0, 1,5796,6016,6166,2190, + 0, 0,1280, 0, 1,5786,6016,6166,2190, + 980, 0,1440, 0, 1,5796,6016,6166,2190, + 0,1130,1480, 0, 1,5796,6016,6166,2190, + 1000,1320,1490, 0, 1,5796,6016,6166,2190, + 0, 0, 0,1430, 1,5796,6016,6166,2190, + 980, 0, 1,1430, 1,5796,6016,6166,2190, + 0,1130, 1,1450, 1,5796,6016,6166,2190, + + 1000,1320, 1,1460, 1,5796,6016,6166,2190, + 0, 0,5366,1470, 1,5816,6016,6166,2190, + 980, 1,5376,1480, 1,5826,6016,6166,2200, + 0,5246,5446,1480, 1,5836,6016,6166,2200, + 5076,5296,5446,1500, 1,5836,6016,6166,2200, + 0, 0, 0, 0,9736,5836,6016,6166,2200, + 980, 0, 0, 1,9736,5846,6016,6166,2200, + 0,1130, 0, 1,9736,5846,6016,6166,2200, + 1000,1320, 0, 1,9736,5846,6016,6166,2200, + 0, 0,1290, 1,9736,5846,6016,6166,2200, + + 980, 0,1440, 1,9756,5846,6016,6166,2200, + 0,1130,1480, 1,9756,5846,6016,6166,2200, + 1000,1320,1500, 1,9756,5846,6016,6166,2200, + 0, 0, 0,9586, 1,5746,5986,6146,2200, + 980, 0, 1,9576,5666,5866,6016,6166,2210, + 0,1130, 1,9586,5666,5866,6016,6166,2210, + 1000,1320, 1,9596,5666,5866,6016,6166,2210, + 0, 0,9486, 1,5626,5846,6016,6166,2210, + 980, 1,5386,5566,5726,5866,6016,6166,2210, + 0,5246, 1,5436,5666,5856,6006,6166,2210, + + 5100,5300,5450,5600,5750,5900,6050,6200,2200 + }; + + if(sysPara->para.flagOfFastMode && sysPara->status.FPGAVersionType == 0) + { + if ((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 7)) + fpgaWr(0xB500,(unsigned char *)fast_128k_7dot_dac,2304); + else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 7)) + fpgaWr(0xB500,(unsigned char *)normal_128k_7dot_dac,2304); + else if((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 9)) + fpgaWr(0xB500,(unsigned char *)normal_128k_9dot_dac,9216); + else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 9)) + fpgaWr(0xB500,(unsigned char *)normal_128k_9dot_dac,9216); + } + else if(type == 6){ + writeDacValue2Fpga_No72NewVoltData(); + } + else if(sysPara->status.FPGAVersionType == 1 || (sysPara->status.FPGAVersionType == 2 && sysPara->para.flagOfFastMode)) + { + if ((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 7)) + fpgaWr(0xB200,(unsigned char *)fast_128k_7dot_dac,2304); + else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 7)) + fpgaWr(0xB200,(unsigned char *)normal_128k_7dot_dac,2304); + else if((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 9)) + fpgaWr(0xB200,(unsigned char *)normal_128k_9dot_dac,9216); + else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 9)) + fpgaWr(0xB200,(unsigned char *)normal_128k_9dot_dac,9216); + } + else if(sysPara->status.build_dat.builTime == 73) + writeDacValue2Fpga_No73(); + else{ + fpgaWr(DAC_TABLE_ADDR,(unsigned char *)DACArray,sizeof(DACArray)); /* DAC vol: 0xB280 */ + fpgaWr(NOT_GAP_DAC_TABLE_ADDR,(unsigned char *)notGapDACArray,sizeof(notGapDACArray)); /* DAC vol: 0xB380 */ + fpgaWr(FULL_COL_DAC_TABLE_ADDR,(unsigned char *)fullColDACArray,sizeof(fullColDACArray)); /* DAC vol: 0xB480 */ + + if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable){ + fpgaWr(MATCH_FULL_DAC_TABLE_ADDR, (unsigned char *)matchFullDACArray, sizeof(matchFullDACArray));// 写入 匹配满列 DAC表 + fpgaWr(MATCH_1_DAC_TABLE_ADDR, (unsigned char *)matchOneDACArray, sizeof(matchOneDACArray));// 写入 匹配单点 DAC表 + fpgaWr(MATCH_2_DAC_TABLE_ADDR, (unsigned char *)matchTwoDACArray, sizeof(matchTwoDACArray));// 写入 匹配两点 DAC表 + fpgaWr(MATCH_3_DAC_TABLE_ADDR, (unsigned char *)matchThreeDACArray, sizeof(matchThreeDACArray));// 写入 匹配三点 DAC表 + fpgaWr(MATCH_4_DAC_TABLE_ADDR, (unsigned char *)matchFourDACArray, sizeof(matchFourDACArray));// 写入 匹配四点 DAC表 + fpgaWr(0xA4C0, (unsigned char *)sysPara->voltePara.pixel_para_table, sizeof(sysPara->voltePara.pixel_para_table));// 写入8个 + fpgaWr(MATCH_5_DAC_TABLE_ADDR, (unsigned char *)matchFiveDACArray, sizeof(matchFiveDACArray));// 写入 匹配五点 DAC表 + + fpgaWr(MATCH_G1_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[0]), (40 * 2));// 写入 匹配空一点 DAC表 + fpgaWr(MATCH_G2_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[8]), (40 * 2));// 写入 匹配空两点 DAC表 + fpgaWr(MATCH_G3_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[16]), (40 * 2));// 写入 匹配空三点 DAC表 + fpgaWr(MATCH_G4_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[24]), (40 * 2));// 写入 匹配空四点 DAC表 + fpgaWr(MATCH_G5_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[32]), (40 * 2));// 写入 匹配空五点 DAC表 + fpgaWr(MATCH_G6_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[40]), (40 * 2));// 写入 匹配空六点 DAC表 + + fpgaWr(MATCH_P1_DAC_TABLE_ADDR, (unsigned char *)(matchPreDACArray[0]), (40 * 2));// 写入 匹配预备一 DAC表 + fpgaWr(MATCH_P2_DAC_TABLE_ADDR, (unsigned char *)(matchPreDACArray[8]), (40 * 2));// 写入 匹配预备二 DAC表 + + fpgaWr(MATCH_C_DAC_TABLE_ADDR, (unsigned char *)(matchComplexDACArray), sizeof(matchComplexDACArray));// 写入 匹配复杂 DAC表 + } + else + fpgaWr(MATCH_1_DAC_TABLE_ADDR, (unsigned char *)matchOneDACArrayStandard, sizeof(matchOneDACArrayStandard));// 写入 匹配单点 DAC表 + } + /*---------------------------------------------------------------------------------*/ + unsigned char sequenceArray[64]; + memset(sequenceArray,0,sizeof(sequenceArray)); + int sequenceNum = 0; + int startSequencePos = 0; + int currSequencePos = 0; + int rowSequenceMode = sysPara->para.rowSequenceMode?sysPara->para.rowSequenceMode:1; + for(int i = 0; i < sysPara->status.currPrintRow; i++){ + sequenceArray[i] = currSequencePos; + currSequencePos += rowSequenceMode; + if(currSequencePos >= sysPara->status.currPrintRow){ + startSequencePos ++; + currSequencePos = startSequencePos; + } + sequenceNum ++; + if(sequenceNum >= sysPara->status.currPrintRow) + break; + } + if(!sysPara->para.flagOfFastMode) + fpgaWr(ROW_PRINT_SEQNENCE_ADDR,(unsigned char *)sequenceArray,sizeof(sequenceArray)); /* 0xB200 */ + /*---------------------------------------------------------------------------------*/ + + //sysPara->para.phase_detect_high_cnt = (sysPara->para.phaseHighLowRatio*sysPara->para.divideRatio*2)/100; + sysPara->para.phase_detect_high_cnt = (50*sysPara->para.divideRatio*2)/100; + sysPara->para.phase_detect_voltage = sysPara->para.phaseDetectVol* MAX_FPGA_DAC_VALUE/1000; + //qDebug()<<"WriteFPGA:"<para.phase_detect_high_cnt<para.phaseHighLowRatio<para.divideRatio; + //qDebug()<<"WriteFPGA:"<para.phase_detect_voltage; + if(( sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER && (sysPara->para.eleEyeClearCntInSynMode ) ) + || ((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL + || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + && sysPara->para.synClearCntInEleEyeMode)) + sysPara->para.extClearAllCntEnable = sysPara->para.eleEyeClearCntInSynMode; // 01 10 11 + else sysPara->para.extClearAllCntEnable = 0; // 0 + + //qDebug()<<"extClearAllCntEnable"<para.extClearAllCntEnable<para.eleEyeClearCntInSynMode; + //if(sysPara->para.eleEyeClearCntInSynMode==2) sysPara->para.extClearAllCntEnable |=0x02; + + /*-----------------------------------------------------------------------------------------------*/ + //sysPara->para.timeTriggerPrintDelayMs = sysPara->para.printDelayMs; + unsigned int timeTpDly=sysPara->para.printDelayMs; + if(sysPara->para.printTriggerMode == PRINT_TRIGGER_TIME){ + if((sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_END_TO_HEAD)){ + int dotNumPerCol = sysPara->para.dotNumPerCol; + //int printClkNum = dotNumPerCol*(1 + sysPara->para.charBold)*currPrintCol*(2*sysPara->para.divideRatio); + //int printTmMs = printClkNum/(FPGA_SYS_HZ/1000); + long printTmMs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000); + //qDebug()<para.timeTriggerPrintDelayMs += printTmMs; + timeTpDly +=printTmMs; + //qDebug()<<"DelayMs:"<para.printDelayMs<<"TmMS:"<para.printDelayMs<para.timeTriggerPrintDelayMs; + } + sysPara->para.timeTriggerPrintDelayMs = timeTpDly; // 20150112 + sysPara->para.timeTriggerPrintDelayMsH=timeTpDly>>16; + //qDebug()<<"timeTpDly"<para.HighVoltageAmplitude/10; + if((unsigned int)currHighVoltageIndex >= ARRAY_SIZE(sysPara->para.highVoltageRecord)){ + if(!ignoreWarn){ + QMessageBox::warning(NULL,tr("警告"),tr("字高超出范围")); + } + } + else { + int expected_voltage_DAC = sysPara->para.highVoltageRecord[currHighVoltageIndex]; + int highVoltageStep = 0; + if((unsigned int)currHighVoltageIndex < (ARRAY_SIZE(sysPara->para.highVoltageRecord) - 1)){ + highVoltageStep = sysPara->para.highVoltageRecord[currHighVoltageIndex + 1] - sysPara->para.highVoltageRecord[currHighVoltageIndex]; + } + else + highVoltageStep = sysPara->para.highVoltageRecord[currHighVoltageIndex] - sysPara->para.highVoltageRecord[currHighVoltageIndex - 1]; + + expected_voltage_DAC += highVoltageStep*(sysPara->para.HighVoltageAmplitude%10)/10; + if(!expected_voltage_DAC){ + sysPara->para.maxHighVoltageDAC = 0; //为零时,逻辑将忽略所有高压故障 +#ifndef DEBUG_CNT + if(!ignoreWarn && (PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1)) + QMessageBox::warning(NULL,tr("警告"),tr("字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误")); +#endif + } + else + sysPara->para.maxHighVoltageDAC = expected_voltage_DAC + sysPara->para.highVoltageLevel; + } + + sysPara->para.printTotalColNum = currPrintCol; + + set_totalSynPulseNum(0); + /* + int adjLen=0; + if(sysPara->para.varLenEn){//sysPara->para.cnt1EndValue + adjLen =( ((sysPara->para.cnt1StartValue+sysPara->para.headLen)>sysPara->status.calandar_and_dat.cnt1CurrValue) + || ((sysPara->para.cnt1EndValue-sysPara->para.endLen)status.calandar_and_dat.cnt1CurrValue) + )?sysPara->para.varLen:0; + } + + sysPara->para.totalSynPulseNum = (int )( + (sysPara->para.synTriggerPrintLenMm+adjLen) + *sysPara->para.synPulseNumPerMm); + */ + + + if((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + ||((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL + ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + && sysPara->para.eleEyeTriggerSynPrintEn)) + { + unsigned int displayAreaTotalSynNum; + if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH) + { + #define MIN_CHAR_WIDTH 0.1 //0.1mm/列 + #define MAX_CHAR_WIDTH 4.0 //4.0mm/列 + displayAreaTotalSynNum = (int )( + (MIN_CHAR_WIDTH +sysPara->para.synCharWidthRatio*(MAX_CHAR_WIDTH - MIN_CHAR_WIDTH) /100) + *currPrintCol*sysPara->para.synPulseNumPerMm + ); + // sysPara->para.synCharWidthRatio=8 -->列宽(0.1+ 8*(4.0-0.1)/100) = 0.412 mm + if(displayAreaTotalSynNum >= 99*sysPara->para.totalSynPulseNum/100){ + //if((displayAreaTotalSynNum*(1 + sysPara->para.charBold)) >= 99*sysPara->para.totalSynPulseNum/100){ + displayAreaTotalSynNum = 99*sysPara->para.totalSynPulseNum/100; + if(!ignoreWarn && currPrintCol) + QMessageBox::warning(NULL,tr("警告"),tr("喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短!")); + + } + } + else + displayAreaTotalSynNum = (int )(sysPara->para.totalSynPulseNum*sysPara->para.synTriggerPrintLenRatio/100); + + if(!displayAreaTotalSynNum){ + if(!ignoreWarn && currPrintCol) + QMessageBox::critical(NULL,tr("错误"),tr("在同步计米的情况下无打印串或显示区域为零")); + } + else { + if(currPrintCol){ + int synNumPerCol = displayAreaTotalSynNum*(1<<8)/(currPrintCol*(1 + sysPara->para.charBold)); + //加宽的时候,相当于列数翻倍 + if(displayAreaTotalSynNum >= (1<<24)){ + if(!ignoreWarn) + QMessageBox::critical(NULL,tr("错误"),tr("在同步计米的情况下喷印同步脉冲数过多,请检查你的配置")); + } + if(synNumPerCol >= (1<< 16)){ + if(!ignoreWarn) + QMessageBox::critical(NULL,tr("警告"),tr("喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度")); + } + if(synNumPerCol < 5){ + if(!ignoreWarn) + QMessageBox::critical(NULL,tr("警告"),tr("喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度")); + } + sysPara->para.synNumPerCol = synNumPerCol; + } + //sysPara->para.synPulsePerMmX8 = (unsigned short)(sysPara->para.synPulseNumPerMm *256); + if(sysPara->para.synPulseNumPerMm<1 || sysPara->para.synPulseNumPerMm>50) { +// sysPara->para.synPulseNumPerMm = 10; 不对脉冲数作出限制 +// if(!ignoreWarn) +// QMessageBox::critical(NULL,tr("警告"),tr("Encoder pulse counter per MM parameter error!")); + } + sysPara->para.synPulsePerMmX8 = (unsigned short)((unsigned int)sysPara->para.synPulseNumPerMm <<8); + qDebug ()<<"s-"<para.synNumPerCol<<"-"<para.synPulsePerMmX8 ; + } + } + sysPara->para.magicNum = FPGA_MAGIC_NUM_AFTER_CONF; //用来做验证的 + /*-----------------------------------临时处理一下------------------------------------------------*/ + unsigned char tmpHighVoltageAmplitude = sysPara->para.HighVoltageAmplitude; + short phaseShift = sysPara->para.phaseShift; + if(phaseShift < 0){ + sysPara->para.phaseShift += 2*sysPara->para.divideRatio; + } + if(!sysPara->status.reclainTankReachEnd){ + sysPara->para.HighVoltageAmplitude = 0; + } + +#if 0 /* 原始值发给FPGA */ + if(sysPara->para.SynCntEn) sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; + else { + sysPara->para.SynCntEn1 = sysPara->status.isPrinting; + } +#else + sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; +#endif + if(sysPara->para.diaphramOffset == 0 || sysPara->para.diaphramOffset > 60) { + sysPara->para.diaphramOffset = 10; + } + fpgaWr(PRINT_CTRL_ADDR_BASE+0x72,(unsigned char *)&sysPara->para.diaphramOffset,2); //发送隔膜位置偏移量 + fpgaWr(PRINT_CTRL_ADDR_BASE+0x74,(unsigned char *)&sysPara->para.steal_dac_row,2); + //fpgaWr(PRINT_CTRL_ADDR_BASE+0x76,(unsigned char *)&sysPara->para.phaseHighCnt,2); +// qDebug()<<"DACStep:"<para.steal_dac_row; +#if 0 + int actHvAmp = sysPara->para.HighVoltageAmplitude; + float tempHvAmp;// = sysPara->para.HighVoltageAmplitude * 1.73; + if(sysPara->para.HighVoltageAmplitude == 0) { + tempHvAmp = 0; + } + else if(sysPara->para.HighVoltageAmplitude == 1) { + tempHvAmp = 63.5; + } + else { + tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 1.0; //0.51 + //tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 0.95; + } + sysPara->para.HighVoltageAmplitude = (unsigned char)tempHvAmp; + //qDebug()<<"HighVoltageAmplitude:"<para.HighVoltageAmplitude; +#endif + fpgaWr(PRINT_CTRL_ADDR_BASE,(unsigned char *)&sysPara->para,FPGA_PRINT_PARA_BYTE_NUM); //0x3C +#if 0 + sysPara->para.HighVoltageAmplitude = actHvAmp; +#endif +// unsigned char eleMaskTimeAndMirrorCnt[4]; +// eleMaskTimeAndMirrorCnt[0] = sysPara->para.eleMaskTime & 0xFF; +// eleMaskTimeAndMirrorCnt[1] = (sysPara->para.eleMaskTime & 0xFF00)>>8; +// eleMaskTimeAndMirrorCnt[2] = sysPara->para.AltMirrorGap & 0xFF; +// eleMaskTimeAndMirrorCnt[3] = (sysPara->para.AltMirrorGap & 0xFF00)>>8; +// fpgaWr(PRINT_CTRL_ADDR_BASE+0x3C,&eleMaskTimeAndMirrorCnt[0],4); //0x3C 3D 3E 3F LockTime Alt-MirrorGap + fpgaWr(PRINT_CTRL_ADDR_BASE+0x3C,(unsigned char *)&sysPara->para.eleMaskTime,4); //0x3C 3D 3E 3F LockTime Alt-MirrorGap + +#ifdef ALT16 + fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.alterPrint,12); // Send AltePrit and cntNatureValue option 2017-7-18 + fpgaWr(PRINT_CTRL_ADDR_BASE+0x68,(unsigned char *)&sysPara->para.stepPrint,sizeof(sysPara->para.stepPrint)); // Send StepPring 2017-7-18 +#else + fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.stepPrint,12); // Send StepPring and AltePrit and cntNatureValue option 2014-2-23 +#endif + sysPara->devOp->pumpValveCtrl(); // send data to A45A~5B Ctrl Para //20140423 + + unsigned int volGap = (int )(sysPara->para.outputPulseDelayMs *sysPara->para.synPulseNumPerMm); + + fpgaWr(PRINT_CTRL_ADDR_BASE+0x64,(unsigned char *)&volGap,4);// 0x64~0x68 // 发送卷间隔 + + unsigned short pulseOutputAfterCnt1Printed = sysPara->para.pulse_sinal_value*10*sysPara->para.synPulseNumPerMm; + sysPara->devOp->fpgaWr(PRINT_CTRL_ADDR_BASE + 0x88, (unsigned char *)&pulseOutputAfterCnt1Printed, 2); + unsigned short pulseOutputAfterCnt1Print = short2BCD(sysPara->para.productNumToGenerateOutputPulse); + //qDebug()<<"pulseOutputAfterCnt1Print:"<para.printRowDelay*sysPara->para.printRowDelay); + //v[2]=v[0]/sqrt(v[1]); + //reg_adv[i] = (reg_adv1[i]<256)? reg_adv1[i]:255; + //str+= QString().sprintf("[%d,%d,%d,%d]\n",v[0],v[1], int(v[0]/v[1]),int(v[2])); + v[0] =v[0]+(DACStep/(2+i*i)); + str+= QString().sprintf("%d,",v[0]); + } + //fpgaWr(PRINT_CTRL_ADDR_BASE+0xA0,(unsigned char *)®_adv,32);// 0x64~0x68 +#ifdef DEBUG_CNT + qDebug()<para.HighVoltageAmplitude = tmpHighVoltageAmplitude; + sysPara->para.phaseShift = phaseShift; + if(sysPara->para.OuputPulseCol > 200) + sysPara->para.OuputPulseCol = 200; + //quint32 chargeDivideRatio_total = sysPara->para.OuputPulseCol; + quint16 chargeDivideRatio = sysPara->para.OuputPulseCol; + // 这是加减速误差的补偿 + //fpgaWr(PRINT_CTRL_ADDR_BASE+0x6e,(unsigned char *)&chargeDivideRatio,2); + /*---------------------------------------------------------------------------------------*/ +#ifdef DEBUG1 + qDebug()<<"writeFpgaPrintPara"<para.oscillatorVoltage); //因为经过调整参数,所以开机也要多发送一次 +#endif + sysPara->saveParaToFile(); + sysPara->status.configDone = 1; +#ifdef DEBUG1 + qDebug()<<"writeFpgaPrintPara"<<"12"; +#endif +#endif + return 0; +} +// 齿轮泵设置 +void DevOp::WriteMoterPump(void) +{ + fpgaWr(PRINT_CTRL_ADDR_BASE+0x70, (unsigned char *)&sysPara->para.gearPumpValue, 2); +} +void DevOp::ReadSomeDataForLostPrint(void) +{ +#ifdef SYS_LINUX + fpgaRd(FPGA_STATUS_BASE_ADDR+0x46,(unsigned char *)&sysPara->status.r_print_q, 14); +#endif +} + +void DevOp::ReadCnt1GroupStatus(void) +{ +#ifdef SYS_LINUX +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + fpgaRd(READ_CNT1GROUP_CURR_LOOP,(unsigned char *)&sysPara->status.cnt1GroupCurrentLoop,sizeof(sysPara->status.cnt1GroupCurrentLoop)); + fpgaRd(READ_CNT1GROUP_CURR_INDEX,(unsigned char *)&sysPara->status.cnt1GroupRunningIndex,sizeof(sysPara->status.cnt1GroupRunningIndex)); +#endif +#endif +} +void DevOp::writeCnt1GroupSetting(bool bCntByGroupEnable){ +#ifdef SYS_LINUX +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + struct { + unsigned char cnt1GroupNum; + int StartValue; + int EndValue; + int LoopTimes; + }cnt1GroupSettingSend; + if(sysPara->para.cnt1ByGroupEnalbe) + { + fpgaWr(WRITE_CNT1GROUP_COUNT,(unsigned char *)&sysPara->para.Cnt1ByGroup.cnt1GroupCnt,sizeof(sysPara->para.Cnt1ByGroup.cnt1GroupCnt)); + + for(int i=0;ipara.Cnt1ByGroup.cnt1GroupCnt;i++) + { + cnt1GroupSettingSend.cnt1GroupNum = (unsigned char)i; + //memcpy((unsigned char *)&cnt1GroupSettingSend.cnt1GroupSettings, &sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i], sizeof(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i])); + + cnt1GroupSettingSend.StartValue = QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].StartValue).toUInt(0,16);//bcd + cnt1GroupSettingSend.EndValue = QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].EndValue).toUInt(0,16); + cnt1GroupSettingSend.LoopTimes = sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].LoopTimes; + fpgaWr(WRITE_CNT1GROUP_NUM,(unsigned char *)&cnt1GroupSettingSend.cnt1GroupNum,1); + fpgaWr(WRITE_CNT1GROUP_SETTING,(unsigned char *)&cnt1GroupSettingSend.StartValue,12); + #if 0 + qDebug()<<"index "<status.calandar_and_dat,16); + + fpgaRd((READ_CALENDAR_DAT_ADDR + 0x34) ,(unsigned char *)&sysPara->status.Status_Counter3.cnt3CurrValue,4); +} + +void DevOp::writeFpgaCalandar(bool Enable){ + Q_UNUSED(Enable); +#ifdef SYS_LINUX + time_t rawtime; + struct tm *pTm; + char buffer[20]; + time( &rawtime ); + pTm = localtime( &rawtime ); + strftime(buffer, sizeof buffer, "%U", pTm);//%U 从星期天算,%W 从星期一算 + + QTime t = QTime::currentTime(); + QDate d = QDate::currentDate(); + int year = d.year(); + sysPara->para.calandar_and_dat.leap_year = (year%400 == 0) || ((year%4 == 0) && (year%100 != 0)); + //sysPara->para.calandar_and_dat.week = d.weekNumber();// + sysPara->para.calandar_and_dat.dayofweek = d.dayOfWeek(); +// sysPara->para.calandar_and_dat.week = QString(buffer).toInt(); + sysPara->para.calandar_and_dat.week = d.weekNumber(); + sysPara->para.calandar_and_dat.year = d.year(); + sysPara->para.calandar_and_dat.month = d.month(); + sysPara->para.calandar_and_dat.day = d.day(); + sysPara->para.calandar_and_dat.hour = t.hour(); + sysPara->para.calandar_and_dat.minute = t.minute(); + sysPara->para.calandar_and_dat.second = t.second(); + + //将变量初始值写入寄存器 + + sysPara->para.calandar_and_dat.cnt1InitValue = QString::number(sysPara->para.cnt1StartValue).toUInt(0,16); //bcd + sysPara->para.calandar_and_dat.cnt1End = QString::number(sysPara->para.cnt1EndValue).toUInt(0,16); + sysPara->para.calandar_and_dat.cnt1Repeat = sysPara->para.cnt1RepeateValue; + sysPara->para.calandar_and_dat.cnt1CurrValue = QString::number(sysPara->para.cnt1CurrValue).toUInt(0,16); + + int step = sysPara->para.cnt1StepValue; + if (step == 0) + step = 1; + step = step < 0?(100000000 + step):step; //务必对负数的值小心处理 + sysPara->para.calandar_and_dat.cnt1Step = QString::number(step).toUInt(0,16); + + sysPara->para.calandar_and_dat.cnt2InitValue = QString::number(sysPara->para.cnt2StartValue).toUInt(0,16); + sysPara->para.calandar_and_dat.cnt2End = QString::number(sysPara->para.cnt2EndValue).toUInt(0,16); + sysPara->para.calandar_and_dat.cnt2Repeat = sysPara->para.cnt2RepeateValue; + sysPara->para.calandar_and_dat.cnt2CurrValue = QString::number(sysPara->para.cnt2CurrValue).toUInt(0,16); + + step = sysPara->para.cnt2StepValue; + if (step == 0) + step = 1; + step = step < 0?(100000000 + step):step; + sysPara->para.calandar_and_dat.cnt2Step = QString::number(step).toUInt(0,16); + + sysPara->para.calandar_and_dat.cntCurrValueInitEnable = + (sysPara->status.cnt3CurrentValueInitDoneFlag?0:4)+ + (sysPara->status.cnt2CurrentValueInitDoneFlag?0:2) + + (sysPara->status.cnt1CurrentValueInitDoneFlag?0:1); + + fpgaWr(WRITE_CALENDAR_DAT_ADDR,(unsigned char *)&sysPara->para.calandar_and_dat,sizeof(sysPara->para.calandar_and_dat)); + + /*write counter3*/ + sysPara->para.Counter3.cnt3CurrValue = QString::number(sysPara->para.cnt3CurrValue).toUInt(0,16); +// qDebug()<<"cnt3CurrValue:"<para.cnt3CurrValue; +// qDebug()<<"sysPara->status.cnt3CurrentValueInitDoneFlag:"<status.cnt3CurrentValueInitDoneFlag; + sysPara->para.Counter3.cnt3End = QString::number(sysPara->para.cnt3EndValue).toUInt(0,16); + sysPara->para.Counter3.cnt3InitValue = QString::number(sysPara->para.cnt3StartValue).toUInt(0,16); + sysPara->para.Counter3.cnt3Repeat = sysPara->para.cnt3RepeateValue; + step = sysPara->para.cnt3StepValue; + if (step == 0) + step = 1; + step = step < 0?(100000000 + step):step; + sysPara->para.Counter3.cnt3Step = QString::number(step).toUInt(0,16); + fpgaWr(WRITE_COUNTER3_ADDR,(unsigned char *)&sysPara->para.Counter3,sizeof(sysPara->para.Counter3)); + + //qDebug()<<"sizeof(sysPara->para.Counter3):"<para.Counter3); + /*write counter3 end*/ + + sysPara->status.cnt3CurrentValueInitDoneFlag = true; + sysPara->status.cnt2CurrentValueInitDoneFlag = true; + sysPara->status.cnt1CurrentValueInitDoneFlag = true; + + //qDebug()<<"year:"<para.calandar_and_dat.year; +#endif +} + +void DevOp::writeFpgaVariCtrl(void){ +#ifdef SYS_LINUX + writeFpgaCalandar(0); + fpgaWrD(VAR_CNT_ADDR,sysPara->status.variNum,1); /* 0xa450 变量个数 */ + reg_var_print_ctrl_t reg_var_print_ctrl; + for(int i = 0; i < sysPara->status.variNum; i++){ + vars_t *p_var = &sysPara->status.vars[i]; + if(p_var->original && p_var->dat){ + fpgaWr(PRINT_DIGITAL_CHAR_BASE_ADDR + p_var->bassAddr,p_var->dat,p_var->datWidth *p_var->rowByteNum); + } + memset((char *)®_var_print_ctrl,0,sizeof(reg_var_print_ctrl)); + reg_var_print_ctrl.charColNum = p_var->digitalNum?p_var->width/p_var->digitalNum:0; + reg_var_print_ctrl.charRamBaseAddr = p_var->bassAddr; + reg_var_print_ctrl.charRowNum = p_var->endRowPos - p_var->startRowPos; + reg_var_print_ctrl.horizonWidth = p_var->width;//字模的宽度 + reg_var_print_ctrl.colOffset = p_var->startColPos+BLANK_COL_NUM; + reg_var_print_ctrl.verticalOffset = p_var->startRowPos; + reg_var_print_ctrl.varDigitalNum = p_var->digitalNum; + // reg_var_print_ctrl.varTypeSel = p_var->type %20; + reg_var_print_ctrl.varTypeSel = Public::getType(p_var->type) %20; + fpgaWr(VAR_CTRL_REG_ADDR,(unsigned char *)®_var_print_ctrl,sizeof(reg_var_print_ctrl)); + + } + #endif +} + +void DevOp::printCtrl(int cmd){ + //printCtrl2(cmd); + fpgaWrD(PRINT_START_STOP_CTRL,cmd,1); +} + +void DevOp::printCtrl2(int cmd){ + if(sysPara->para.SynCntEn) sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; + else { + sysPara->para.SynCntEn1 = sysPara->status.isPrinting; + } +#ifdef ALT16 + fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.alterPrint,12); // Send AltePrit and cntNatureValue option 2017-7-18 + fpgaWr(PRINT_CTRL_ADDR_BASE+0x68,(unsigned char *)&sysPara->para.stepPrint,sizeof(sysPara->para.stepPrint)); // Send StepPring 2017-7-18 +#else + fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.stepPrint,12); // Send StepPring and AltePrit and cntNatureValue option 2014-2-23 +#endif + cmd=1; +} + +unsigned int DevOp::readFpgaVersionNum(){ + fpgaRd(0x00EC,&sysPara->status.FPGAChipType,1); + return (sysPara->status.fpgaVersionNum = fpgaRdD(FPGA_VERSOIN_NUM,2)); +} + +void DevOp::readbuilDat(void){ + fpgaRd(READ_BUILD_DAT,(unsigned char *)&sysPara->status.build_dat,sizeof(sysPara->status.build_dat)); + fpgaRd(FPGA_STATUS_BASE_ADDR + 0xed,(unsigned char *)&sysPara->status.build_dat.year,sizeof(sysPara->status.build_dat.year)); + fpgaRd(FPGA_STATUS_BASE_ADDR + 0xee,(unsigned char *)&sysPara->status.build_dat.month,sizeof(sysPara->status.build_dat.month)); + fpgaRd(FPGA_STATUS_BASE_ADDR + 0xef,(unsigned char *)&sysPara->status.build_dat.day,sizeof(sysPara->status.build_dat.day)); +} + +void DevOp::readPrintDataXor(void){ + fpgaRd(READ_PRINTDATA_XOR, (unsigned char *)&sysPara->status.xor_sync, 2); +} + +void DevOp::readSyncCounterAtZero(void){ + fpgaRd(READ_SYNC_COUNTER, (unsigned char *)&sysPara->status.xor_sync.sync_counter_at_zero, sizeof(sysPara->status.xor_sync.sync_counter_at_zero)); +} + +void DevOp::clearProductCnt(unsigned int mode){ + fpgaWrD(PRINT_RESET_PRODUCT_CNT,mode,1); +} + +void DevOp::resumeFault(){ + fpgaWrD(RESUME_FAULT_ADDR,1,1); +} + + +void DevOp::highVoltageCtrl(int val){ + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.HighVoltageAmplitude) - (unsigned int)(&sysPara->para),(unsigned int)val,1); + //qDebug()<<"highVoltageCtrl"<status.waitHightVolOn =0; + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.maxHighVoltageDAC) - (unsigned int)(&sysPara->para),(unsigned int)val,2); + +} + +void DevOp::setPhaseByHand(int val){ + sysPara->para.phaseByHand = val; + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phaseByHand) - (unsigned int)(&sysPara->para),(unsigned int)val,1); +} + +void DevOp::readPhaseDetectHighTm(void){ + fpgaRd(PHASE_DETECT_HIGH_VOLTAGE_TM,(unsigned char *)&sysPara->status.phaseDetectHighTm,sizeof(sysPara->status.phaseDetectHighTm)); + +} + +void DevOp::setPhaseDetectVoltageDutyCycle(int duty){ + unsigned value = (duty * sysPara->para.divideRatio * 2) / 100; + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phase_detect_high_cnt) - (unsigned int)(&sysPara->para),value,2); + //qDebug()<<"WriteFPGA:"<para.phaseHighLowRatio<para.divideRatio; +} + +void DevOp::setBlickLightPeriod(int value){ + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.blinkLightPeriod) - (unsigned int)(&sysPara->para),value,2); +} + +void DevOp::setOscillatorVoltage(int value){ +#ifdef __VX_OSC_VOL__ + if(value<100) + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.oscillatorVoltage) - (unsigned int)(&sysPara->para),OscillatorVoltage[value],1); +#else + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.oscillatorVoltage) - (unsigned int)(&sysPara->para),value,1); +#endif +} + +void DevOp::setDivideRatio(int value){ + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.divideRatio) - (unsigned int)(&sysPara->para),value,2); +} + +void DevOp::setLastLineEndPointFixedValue(int value){ + fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.lastLineEndPointFixedDACValue) - (unsigned int)(&sysPara->para),value*MAX_FPGA_DAC_VALUE/1000,2); +} +void DevOp::mainInkCtrl() +{ + fpgaWrD(MAININKCTRL_ADDR,(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0),1); +} + +void DevOp::pumpValveCtrl(int viscosityAdjustByTemp)//20140423 OK +{ + char buf[20]; + int i=0; + int viscostyRealValue, tempOffset; + static int hadGetIndoorTemperature=0; + memset(buf,0,sizeof(buf)); + + buf[i++]=(isReleaseValveOpen()?(1<<3):0) + +(isMainInkPumpOpen()?(1<<2):0) + + (sysPara->status.selfCheckDone?(1<<1):0) + + (sysPara->status.isPumpValveControledByHand?1:0); + if(!sysPara->para.gearPumpEnable) { + buf[i++] = (sysPara->para.pressure/5)&0xff; + //buf[i++]=((sysPara->para.pressure/5)/256)&0xff; + buf[i++] = ((sysPara->para.pressure/5)>>8)&0xff; + } + else { + buf[i++] = (sysPara->para.pressure)&0xff; + //buf[i++]=((sysPara->para.pressure/5)/256)&0xff; + buf[i++] = (sysPara->para.pressure>>8)&0xff; + } + buf[i++]=(sysPara->para.viscosityPumpInterval*100)&0xff; + //buf[i++]=((sysPara->para.viscosityPumpInterval*100)/256)&0xff; + buf[i++]=((sysPara->para.viscosityPumpInterval*100)>>8)&0xff; + if(!hadGetIndoorTemperature) + { + hadGetIndoorTemperature = viscosityAdjustByTemp; + } + if(!hadGetIndoorTemperature) + { + buf[i++]=(sysPara->para.viscosity)&0xff; + //buf[i++]=((sysPara->para.viscosity)/256)&0xff; + buf[i++]=((sysPara->para.viscosity)>>8)&0xff; + } + else + { + tempOffset = sysPara->status.indoorTemperature-35; + if(tempOffset>5)//超过40度就按照40度计算 + { + tempOffset = 5; + } + if(tempOffset>0) + { + if(sysPara->para.viscosityAdjust==1)//0.6% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*3)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*3)/500; + } + else if(sysPara->para.viscosityAdjust==2)//1.0% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*5)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset/100; + } + else if(sysPara->para.viscosityAdjust==3)//1.6% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*8)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset*8/500; + } + else if(sysPara->para.viscosityAdjust==3)//2.0% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*10)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset*2/100; + } + else + { + viscostyRealValue = sysPara->para.viscosity; + } + } + else + { + viscostyRealValue = sysPara->para.viscosity; + } + buf[i++]=viscostyRealValue&0xff; + buf[i++]=(viscostyRealValue>>8)&0xff; + } + buf[i++]=(sysPara->para.reclaimPumpPWMWidth)&0xff; + buf[i++]=((sysPara->para.temperature))&0xff; + buf[i++]=(sysPara->devOp->isReclaimPumpOpen()?(1<<0):0) + | (sysPara->devOp->isCompressPumpOpen()?(1<<1):0) + | (sysPara->devOp->isViscosityPumpOpen()?(1<<2):0) + | (sysPara->devOp->isCycleValveOpen()?(1<<3):0) + | (sysPara->devOp->isInkValveOpen()?(1<<4):0) + | (sysPara->devOp->isMixValveOpen()?(1<<5):0); + + // fpgaWrD(MAININKCTRL_ADDR,(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0),1); + fpgaWr(MAININKCTRL_ADDR,(unsigned char *)buf,i);// //20140423 5A,5B + +/* +`ifdef AUTOCTRL + 8'h5c: reg_set_viscosityPumpInterval[0+:8]<= ctrl_reg_dat; // 粘度泵动作时间间隔(默认值60s) + 8'h5d: reg_set_viscosityPumpInterval[8+:6]<= ctrl_reg_dat[5:0]; // 粘度泵动作时间间隔, 上位机 *100后再传送 + 8'h5e: reg_set_viscosity[0+:8] <= {ctrl_reg_dat}; // 粘度设定值 + 8'h5f: reg_set_viscosity[8+:8] <= {ctrl_reg_dat}; // 粘度设定值 + 8'h60: reg_set_reclaimPumpPWMWidth <= ctrl_reg_dat; // 回收泵力度PWM 0~90 + 8'h61: reg_set_temperature <= ctrl_reg_dat; // 喷头温度设定值 + 8'h62: {reg_is_MixValve_open,reg_is_InkValve_open, reg_is_CycleValve_open,reg_is_ViscoPump_open, + reg_is_CompressPump_open,reg_is_ReclaimPump_open}<=ctrl_reg_dat; + // 混合阀//供墨阀// 循环阀//粘度泵 // 压缩机// 回收泵 + +`endif + */ + +} +#ifdef __STC_POWER__ + +#include +#include +#include +//#include +#define STC_CHIP_ADDR 0x50 + +int DevOp::Heartbeat(char bPowerOn) +{ +// int flag = bPowerOn; +// qDebug()<<"Heartbeat: "<isOpen()) + { + int n = comForPower->write(temp); + //qDebug()<<"power com send "<isOpen()) + { + int n; +#if 0 + n= comForPower->bytesAvailable(); + if(n>0) + { + recResponse.append(comForPower->read(n)); + QString str; + str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); + qDebug()<write(temp); + qDebug()<<"set wake up "<bytesAvailable(); + if(n>0) + { + recResponse.append(comForPower->read(n)); + QString str; + str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); + qDebug()<< "n" << n <<" " <isOpen()) + { + int n = comForPower->bytesAvailable(); + if(n>0) + { + recResponse.append(comForPower->read(n)); + } + n = comForPower->write(temp); +// QElapsedTimer timer; +// timer.start(); +// while(timer.elapsed()<50) +// { +// ; +// } + MySleep(200); + n = comForPower->bytesAvailable(); + if(n<=0) + { + + return 0; + } + + // 接收数据 + recResponse.append(comForPower->read(n)); + //qDebug()<<"n" << n<<" power by:"< +#include +#include +#include +#include + +qint8 DevOp::GetTemp(QString ainFile, quint8 *pTemp) +{ + int value; + qint8 ret = 0; + FILE *fp; + std::string ain_str = ainFile.toStdString(); + const char *file_path = ain_str.c_str(); + //sprintf(pChar, "%s", BOART_TEMP_DEVICE); + fp = fopen(file_path, "r" ); + if( fp==NULL ) + { + //qDebug()<<"open file fail:"<status.ExtScreenEn; +} + +#ifdef UART2 +//======================================================================================= +void DevOp::sendCom(char *buf,int len) +{ + QByteArray temp; + temp.append(buf,len); + if(sysPara->status.ExtScreenEn && (myCom->isOpen())) + myCom->write(temp); +} + +void DevOp::sendCom(QString s) +{ + if(sysPara->status.ExtScreenEn && (myCom->isOpen())) + { + myCom->write(s.toAscii()); + } +} + +int DevOp::recUart2() +{ + if(!sysPara->status.ExtScreenEn)return 0; + + int n=myCom->bytesAvailable(); + if(n<=0) + { + + if(recData.length()) + { + //showData(recData); + //recData.constBegin() + readCom(recData.at(1),recData,recData.at(0)); + recData.clear(); + } + return 0; + } + if (!myCom->isOpen()) return 0; + // 接收数据 + recData.append(myCom->read(n)); + return recData.length(); +} + +void DevOp::readCom(char mode,QByteArray rec,int addr) +{ + //qDebug() << "read11:"<< rec.length(); + recLen = rec.length(); + recData = rec; + int len=recData.length(); + if(mode== 'R' || mode== 'S' ) + { + if(addr==FPGA_STATUS_BASE_ADDR){ + //if(len>FPGA_STATUS_BYTE_NUM) return; + //qDebug() << "read11:"<< rec.length()<status,recData,FPGA_STATUS_BYTE_NUM); + len = sizeof(sysPara->status.calandar_and_dat); + addr = 0x80; + memcpy((unsigned char *)&sysPara->status.calandar_and_dat,recData.mid(addr,len),len); + + if(sysPara->status.detectBestOscillatorVoltageAppending + || sysPara->status.detectHighVoltageAppending ) + { + memcpy((unsigned char *)&sysPara->status.phaseDetectHighTm, + recData.mid(PHASE_DETECT_HIGH_VOLTAGE_TM,sizeof(sysPara->status.phaseDetectHighTm)), + sizeof(sysPara->status.phaseDetectHighTm)); + } + + len = sizeof(sysPara->status.fpgaVersionNum); + addr = 0x62; + memcpy((unsigned char *)&sysPara->status.fpgaVersionNum,recData.mid(addr,len),len); + + memcpy((unsigned char *)&sysPara->status.build_dat, + recData.mid(0x60,sizeof(sysPara->status.build_dat)), + sizeof(sysPara->status.build_dat)); + if(!sysPara->para.gearPumpEnable) + sysPara->status.PRESSURE *= 5; //响应群众号召,数值放大五倍 + + } + else return; + } + } + else if(addr ==0x01 )//仪表返回到信息 + { + // qDebug()<<"C:"<isOpen()) { return 2;} + // check if sending operation is enable + + if (!sendingEnable ) { + //qDebug()<<"com is busy."; + return 3;} + if(uartThread) + { + uartThread->addDataToSend(data); + } + else { + myCom->write(data); + } + //showData(data); + return 1; +} + + +// Stop the currently receiving data operation (don't terminate the thread) +void DevOp::stopReceiving() +{ + // If the Receiving is not alread active OR the uartThread is not initialized + if (!receivingEnable || !uartThread) + return; + // If the SerialPort is currently receiving data, stop + if (uartThread->isRunning()) + { + saveStateReceiveData = false; + uartThread->stopReceiving(); + // wait(); + //uartThread->wait(); + } +} +// Start the receiving thread +// return 1 OK +// return 2 port closed +// return 3 receiving operation disable +uchar DevOp::uartThreadStart() +{ + // check the port if is open + if (!myCom->isOpen()) return 2; + + if (!uartThread) + uartThread = new UartThread(*myCom); + + enableReceiving(); + enableSending(); + + // check if receiving operation is enable + if (!receivingEnable && !uartThread) return 3; + // If the SerialPort receiving thread is not currently active, start it + if (!uartThread->isRunning()) + { + saveStateReceiveData = true; + uartThread->start(); + //qDebug()<<"uartThread start."; + } + return 1; +} + +/******************************* Methods **************************************/ +// Add the data to the Send Queue +void UartThread::addDataToSend(const QByteArray &dataToAdd) +{ + + for (int i=0; i0) + { + recDelay1=10; + data.append(port.read(numBytes)); + //qDebug()<<"rec"<write(temp); +} +void DevOp::readUart1(){ + int numBytes = 0; + static int r_num=0,rlen=0; + unsigned char crc8; + + + numBytes = myCom->bytesAvailable(); + if (numBytes>0) + { + //recDelay1=0; + //mutexReceive.lock(); + data = myCom->read(numBytes); + //mutexReceive.unlock(); + //qDebug()<<"Rec:"<write(QByteArray().append("sos.")); + //rec and process different; + switch(rec_cmd.mode){ + case 0: + // &S14??co + if((data.at(0)=='&' && (data.at(1)=='R' ||data.at(1)=='S' || data.at(1)=='C' )) &&(data.at(2)==LOCADDR) && data.endsWith("o")) { + // qDebug()<30){ + if((rec_r.at(0)=='$' ) &&(rec_r.at(1)=='D' ) && (rec_r.at(2)==LOCADDR) )//data.endsWith("o")) + { + if(rec_cmd.addr==0){ + rec_cmd.addr = rec_r.at(2); + r_dataFromPC.printRowDotNum =dat_r.at(0); // + r_dataFromPC.printColDotNum = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // + r_dataFromPC.Length = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // + + //qDebug()<<"len:"< (rec_cmd.len +12) && rec_cmd.len) + rec_cmd.mode=0; + } + else { + rec_cmd.mode=0; + } + + if((data.left(2)=="&C" || data.left(2)=="&R" ||data.left(2)=="&S" )&&(data.at(2)==LOCADDR) && data.endsWith("o")) { + rec_cmd.flag_m= data.at(1); rec_cmd.addr = data.at(2); + rec_r.clear(); + rec_r.append(data); + readCom( rec_cmd.flag_m,rec_r,rec_cmd.addr ); + rec_cmd.mode=0; + } + } + else rec_cmd.mode=0; + + break; + + case 2:// $D1rccccLLLLddd...ddco + dat_r.append(data); + rec_r.append(data); + //qDebug()<(1+r_dataFromPC.printRowDotNum*(1+r_dataFromPC.printColDotNum/8) )) {rec_cmd.mode=0;r_dataFromPC.keyword=0;} + dat_r.clear(); + crc8=0; + } + else if(r_num>11){ + if(rlen){ + dat_r.append(data) ; + rlen=rlen-data.length(); + crc8 = crc8 ^ data.at(0); + } + else { + rec_cmd.mode=0; + if(data.at(0)=='o' && crc8==0 ) + readCom( rec_cmd.flag_m,dat_r,rec_cmd.addr ); + else readCom( rec_cmd.flag_m,QByteArray("!Error"),rec_cmd.addr); + } + } + r_num++; + break; + + case 3: + break; + + case 4: + break; + + default: + break; + } + //recDelay=0; + + } + +} + +void DevOp::sendCom(QString s) +{ + myCom->write(s.toAscii()); +} + +void DevOp::readCom(char mode,QByteArray rec,int addr) +{ // sendData ?? + qDebug() << "read11:"<status.printCmd; + statusToPC.printMode='X';//sysPara->status.printMode; + statusToPC.statWarn=sysPara->status.statWarn; + statusToPC.isPumpValveControledByHand=sysPara->status.isPumpValveControledByHand; + statusToPC.mainInkPumpError=sysPara->status.mainInkPumpError; + statusToPC.selfCheckDone=sysPara->status.selfCheckDone; + statusToPC.reclainTankReachEnd=sysPara->status.reclainTankReachEnd; + statusToPC.beeperOnFlag=sysPara->status.beeperOnFlag; + statusToPC.lostCommuFlag=sysPara->status.lostCommuFlag; + statusToPC.isPrinting=sysPara->status.isPrinting; + statusToPC.reclaimTankBlockedAppending=sysPara->status.reclaimTankBlockedAppending; + statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; + + statusToPC.currReclaimTankPos=sysPara->status.currReclaimTankPos; + statusToPC.productCnt=sysPara->status.productCnt; //unsigned int productCnt; + //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; + //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; + //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; + + qDebug()<status.currPrintRow; + dataToPC.printColDotNum = sysPara->status.currPrintCol; + //dataToPC.Length = (dataToPC.printRowDotNum* (1+dataToPC.printColDotNum/8))+2; + dataToPC.Length = (dataToPC.printColDotNum* MAX_PRINT_ROW_BYTE_NUM)+2; + dataToPC.dotData = sysPara->status.printDat;//(unsigned char *)calloc(dataToPC.printRowDotNum,MAX_PRINT_ROW_BYTE_NUM); + //memcpy((void *)dataToPC.dotData, , dataToPC.Length-2); + //qDebug()<status.currPrintRow<status.printDat,dataToPC.Length-2); + sendCom((char *) &dataToPC.crc,2); + //sendCom("dfsaffadsf"); + //QString s=""; for(int i=0;istatus.currPrintRow; + dataToPC.printColDotNum = sysPara->status.currPrintCol; + dataToPC.Length = (dataToPC.printColDotNum* MAX_PRINT_ROW_BYTE_NUM)+2; + dataToPC.dotData = sysPara->status.printDat;//(unsigned char *)calloc(dataToPC.printRowDotNum,MAX_PRINT_ROW_BYTE_NUM); + sendCom((char *) &dataToPC,12); + sendCom((char *) &sysPara->status.printDat,dataToPC.Length-2); + sendCom((char *) &dataToPC.crc,2); + //sendCom("dfsaffadsf"); + //QString s=""; for(int i=0;ipara.qrOption.text,s.toAscii(),s.length()); + memcpy( (unsigned char *)sysPara->para.qrOption.text,s.toAscii(),s.length()); + //sprintf(sysPara->para.qrOption.text,s.toAscii(),s.length()); + sysPara->para.qrOption.text[s.length()]='\0'; // 不可缺少的哦 + sysPara->para.qrOption.RecFromHost=1; //RecFromHost + sysPara->para.qrOption.VarNum = (mode=='V'); + //qDebug()<para.qrOption.text)<<"sysPara->para.qrOption.VarNum"<para.qrOption.VarNum; + sendCom("OK");//sendCom(s); + sendCom("\r\n"); + sysPara->saveParaToFile(); + // 设置标志位 1,主程序中根据标志位来进行转换,并刷新显示 + } + else if(mode== 'C' && rec.startsWith("&")&& rec.endsWith("o")){// 写paraCmd 参数的命令 + sendCom(rec); + } + else if(mode== 'D' && rec.startsWith("$")&& rec.endsWith("o")){// 写paraData点阵内容的命令 + //memcpy((unsigned char *)&sysPara->status,recData,FPGA_STATUS_BYTE_NUM); + //memcpy((unsigned char *)&sysPara->status.calandar_and_dat,recData.mid(addr,len),len); + + sendCom(rec); + + } + else { + sendCom(QString().sprintf("addr:%d",LOCADDR)); + } + +} + +// Enable the SerialPort to send data (init the thread) +void DevOp::enableSending() +{ + if (!uartThread) + uartThread = new UartThread1(*myCom); + + if (!sendingEnable) + { + sendingEnable = true; + } +} +// Disable the SerialPort to send data (terminate the thread) +void DevOp::disableSending() +{ + // If the Sending is already active AND there is a sendThread + if (sendingEnable) + { + sendingEnable = false; + } + + if ( !isReceivingEnable() && uartThread) + { + delete uartThread; + uartThread = NULL; + } +} + +bool DevOp::isSendingEnable() const +{ + return sendingEnable; +} + +// Enable the SerialPort to receive data (init the thread) +void DevOp::enableReceiving() +{ + // If the Receiving is not already active AND the receiveThead is not initialized + if (!uartThread) + uartThread = new UartThread1(*myCom); + + if (!receivingEnable) + { + if(uartThread) qDebug()<isOpen()) { return 2;} + // check if sending operation is enable + if (!sendingEnable ) { + //qDebug()<<"com is busy."; + return 3;} + if(uartThread) + { + uartThread->addDataToSend(data); + } + else myCom->write(data); + return 1; +} + + +// Stop the currently receiving data operation (don't terminate the thread) +void DevOp::stopReceiving() +{ + // If the Receiving is not alread active OR the uartThread is not initialized + if (!receivingEnable || !uartThread) + return; + // If the SerialPort is currently receiving data, stop + if (uartThread->isRunning()) + { + saveStateReceiveData = false; + uartThread->stopReceiving(); + // wait(); + //uartThread->wait(); + } +} +// Start the receiving thread +// return 1 OK +// return 2 port closed +// return 3 receiving operation disable +uchar DevOp::uartThreadStart() +{ + // check the port if is open + + if (!myCom->isOpen()) return 2; + + if (!uartThread) + uartThread = new UartThread1(*myCom); + + enableReceiving(); + //qDebug()<<("recOK\n"); + enableSending(); + // check if receiving operation is enable + if (!receivingEnable && !uartThread) return 3; + // If the SerialPort receiving thread is not currently active, start it + if (!uartThread->isRunning()) + { + saveStateReceiveData = true; + + uartThread->start(); + qDebug()<<"uartThread start."; + } + return 1; +} + +/******************************* Methods **************************************/ +// Add the data to the Send Queue +void UartThread1::addDataToSend(const QByteArray &dataToAdd) +{ + + for (int i=0; i0) + { + recDelay1=0; + mutexReceive.lock(); + data = port.read(numBytes); + mutexReceive.unlock(); + //qDebug()<<"Rec:"<30){ + if((rec_r.at(0)=='$' ) &&(rec_r.at(1)=='D' ) && (rec_r.at(2)==LOCADDR) )//data.endsWith("o")) + { + if(rec_cmd.addr==0){ + rec_cmd.addr = rec_r.at(2); + r_dataFromPC.printRowDotNum =dat_r.at(0); // + r_dataFromPC.printColDotNum = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // + r_dataFromPC.Length = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // + + //qDebug()<<"len:"< (rec_cmd.len +12) && rec_cmd.len) + rec_cmd.mode=0; + } + else { + rec_cmd.mode=0; + } + + if((data.left(2)=="&C" || data.left(2)=="&R" ||data.left(2)=="&S" )&&(data.at(2)==LOCADDR) && data.endsWith("o")) { + rec_cmd.flag_m= data.at(1); rec_cmd.addr = data.at(2); + rec_r.clear(); + rec_r.append(data); + emit dataReceived( rec_cmd.flag_m,rec_r,rec_cmd.addr ); + rec_cmd.mode=0; + } + } + else rec_cmd.mode=0; + + break; + + case 2:// $D1rccccLLLLddd...ddco + dat_r.append(data); + rec_r.append(data); + //qDebug()<(1+r_dataFromPC.printRowDotNum*(1+r_dataFromPC.printColDotNum/8) )) {rec_cmd.mode=0;r_dataFromPC.keyword=0;} + dat_r.clear(); + crc8=0; + } + else if(r_num>11){ + if(rlen){ + dat_r.append(data) ; + rlen=rlen-data.length(); + crc8 = crc8 ^ data.at(0); + } + else { + rec_cmd.mode=0; + if(data.at(0)=='o' && crc8==0 ) + emit dataReceived( rec_cmd.flag_m,dat_r,rec_cmd.addr ); + else emit dataReceived( rec_cmd.flag_m,QByteArray("!Error"),rec_cmd.addr); + } + } + r_num++; + break; + + case 3: + break; + + case 4: + break; + + default: + break; + } + recDelay=0; + + } + } +} +// 26 52 01 04 3F 3F 63 6F &S14??co +// 24 43 01 04 3F 3F 63 6F $C14??co +#endif +#ifdef __STC_POWER__ +void DevOp::comForPower_init(void) +{ + if(comForPower==NULL) + comForPower = new Posix_QextSerialPort("/dev/ttyO4",QextSerialBase::Polling); + if(comForPower) + { + comForPower ->open(QIODevice::ReadWrite); + + if (!comForPower->isOpen()) + { + qDebug()<<"uart for power is not open!"; + return; + } + comForPower->setBaudRate(BAUD115200); + comForPower->setDataBits(DATA_8); + comForPower->setParity(PAR_NONE); + comForPower->setStopBits(STOP_1); + comForPower->setFlowControl(FLOW_OFF); + comForPower->setTimeout(1);; + } + else + { + qDebug()<<"uart for power not exit!"; + } +} +#endif + +#ifdef __com_485_ + +extern void MySleep(unsigned int msec); +Posix_QextSerialPort* DevOp::comForRFID = NULL; + +void DevOp::comForRFID_init(void) +{ + if(comForRFID==NULL) + comForRFID = new Posix_QextSerialPort("/dev/ttyO1",QextSerialBase::Polling); + if(comForRFID) + { + comForRFID->open(QIODevice::ReadWrite); + + if (!comForRFID->isOpen()) + { + qDebug()<<"uart for RFID is not open!"; + return; + } + comForRFID->setBaudRate(BAUD38400); + comForRFID->setDataBits(DATA_8); + comForRFID->setParity(PAR_EVEN); + comForRFID->setStopBits(STOP_1); + comForRFID->setFlowControl(FLOW_OFF); + comForRFID->setTimeout(1); + } + else + { + qDebug()<<"uart for RFID not exit!"; + } +} + +#if 0 +int DevOp::comReadRFID_data() +{ +// UCHAR Cmd[23] = { 0x01, 0x17, 0xA4, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +// UCHAR revdata[100]; +// Cmd[1] = 0x08; +// Cmd[2] = 0xA3; +// Cmd[4] = 0x06; //读块6 +// CheckSumOut(Cmd, Cmd[1]); +// QByteArray temp; + QByteArray recResponse; +// temp.append((const char*)Cmd,Cmd[1]); + if(comForRFID->isOpen()) + { + //int n = comForRFID->write(temp); + //qDebug()<<"power com send "<bytesAvailable(); + if(n>0) + { + recResponse.append(comForRFID->read(n)); + QString str; + str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); + qDebug()<isOpen()) +// { +// int n = comForRFID->write(temp); +// //qDebug()<<"power com send "<bytesAvailable(); +// if(n>0) +// { +// recResponse.append(comForRFID->read(n)); +// QString str; +// str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); +// qDebug()<status.RandomNum>0) + DevOp.Read_RanddomFromFpga(); + +*/ +// 20161217 修改测试 +// 20170711 随机码位置错位问题 + +void DevOp::Read_RanddomFromFpga() +{ + unsigned char buf[256]; + QByteArray str; + QString ss; + int i,len,n,c; + //fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,sizeof(sysPara->status.calandar_and_dat)); + if(sysPara->status.RandomNum>0) + { + if(sysPara->status.RandomNum>32){ + qDebug()<<"RandomNum:"<status.RandomNum; + return; + } + + len = sysPara->status.RandomNum*8; + + if(len>256)return; + + fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,len); + ss=""; + n=0; + for(i=0;istatus.RandomDigitNum) //12 + ; //0,1,2,3 4,5,6,7,8,9 0 1,2,3,4,5 + else if( k >= 16-sysPara->status.RandomDigitNum) + { + //ss+=QString().sprintf("%02X ",buf[i]); + if(c==0) str.append( ((buf[i]>>4)& 0x0f)|0x30); + else if(c==1) str.append((buf[i]& 0x0f)|0x30); + if(k==15) + { + str.append(" "); + //ss+="\r\n"; + } + } + else ; + n++; + } + + } + //qDebug()<3500000) + { + sysPara->status.RandomBackCnt=10; + ss= "mv /home/plg/Xrand2.txt /home/plg/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; + system(ss.toAscii()); + return; + } + } + +} + +/* 原来的 +void DevOp::Read_RanddomFromFpga() +{ + unsigned char buf[256]; + QByteArray str; + QString ss; + int i,len,n; + //fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,sizeof(sysPara->status.calandar_and_dat)); + if(sysPara->status.RandomNum>0) + { + len = sysPara->status.RandomNum*8; + fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,len); + ss=""; + n=0; + for(i=0;istatus.RandomDigitNum) //12 + ; //0,1,2,3 4,5,6,7,8,9 0 1,2,3,4,5 + else if( k >= 16-sysPara->status.RandomDigitNum) + { + //ss+=QString().sprintf("%02X ",buf[i]); + str.append( buf[i]>>4& 0x0f|0x30); + str.append(buf[i]& 0x0f|0x30); + if(k==14) { + str.append(" "); + //ss+="\r\n"; + } + } + else ; + + n+=2; + } + //qDebug()<3500000) + { + sysPara->status.RandomBackCnt=10; + ss= "mv /home/plg/Xrand2.txt /home/plg/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; + system(ss.toAscii()); + return; + } + } + +} +*/ +void DevOp::RandTxtBakup(char ok) // ok 0:不一定备份,1直接备份 +{ + QFile f1("/home/plg/Xrand2.txt"); + QString str; + str= "mv /home/plg/Xrand2.txt /udisk/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; + if(sysPara->status.RandomBackCnt>5){ + system(str.toAscii()); + system("mv /home/plg/rand*.txt /udisk/"); + //system("rm /home/plg/rand*.txt"); + sysPara->status.RandomBackCnt=0; + } + else + { + //f1.open(QFile::ReadWrite); + int len= f1.size(); + //f1.close(); + if(len>3500000 || ok ) + { + system(str.toAscii()); + system("mv /home/plg/rand*.txt /udisk/"); + } + + } +} + +void DevOp::writeDacValue2Fpga_No72NewVoltData(){ + // LogInfo::setRunStatusText(tr("writeDacValue2Fpga_No72NewVoltData")); + qDebug()<<"writeDacValue2Fpga_No72NewVoltData"; + + fpgaWr(0xA600, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray1), (128)); + fpgaWr(0xA680, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray2[0]), (64 * 2*2)); + fpgaWr(0xA780, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray3[0]), (64 * 3*2)); + fpgaWr(0xA900, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray4[0]), (64 * 4*2)); + fpgaWr(0xAB00, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray5[0]), (64 * 5*2)); + fpgaWr(0xB380, (unsigned char *)(sysPara->voltePara_25Dots.matchContinousDACArray), (64 * 2)); + fpgaWr(0xBC00, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalDiffVoltageValue[0]), (64 * 50)); + fpgaWr(0xB400, (unsigned char *)(sysPara->voltePara_25Dots.matchExtraLineDACArray), (64)); + fpgaWr(0xB440, (unsigned char *)(sysPara->voltePara_25Dots.matchFirstOnePointExtraLineDACArray), (64)); + fpgaWr(0xD200, (unsigned char *)(sysPara->voltePara_25Dots.matchAdjustParaDACArray), (8)); //超10个空点巨点补偿 + fpgaWr(0xCD00, (unsigned char *)(sysPara->voltePara_25Dots.matchGiantPointVoltageValue[0]), (64*16)); + fpgaWr(0xB280, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArrayFirst1), (64*2)); //一列第一个点是单点 + +} +void DevOp::writeDacValue2Fpga_No73() +{ + LogInfo::setRunStatusText(tr("No73 send DAC Data.")); + + quint16 matchFullDACArray[48]; + quint16 matchStealDACArray[48]; + quint16 matchContinousDACArray[48]; + + quint16 rowDelayArray[64]; + quint16 head1RowDelayArray[64]; + + quint8 adjDACParameter[64]; + + quint8 matchTotalTableDACArray[15][64]; + quint8* matchOneDACArray = &matchTotalTableDACArray[0][0]; + quint8* matchTwoDACArray = &matchTotalTableDACArray[1][0]; + quint8* matchThreeDACArray = &matchTotalTableDACArray[3][0]; + quint8* matchFourDACArray = &matchTotalTableDACArray[6][0]; + quint8* matchFiveDACArray = &matchTotalTableDACArray[10][0]; + + quint8 matchPrevious1DotDACArray[48]; + quint8 matchPrevious2DotDACArray[48]; + quint8 matchPrevious3DotDACArray[48]; + quint8 matchPrevious4DotDACArray[48]; + quint8 matchPrevious5DotDACArray[48]; + quint8 matchGapDACArray[64][5]; + quint8 matchP3dotGapDACArray[64][5]; + + memset(matchFullDACArray, 0, sizeof(matchFullDACArray)); + memset(matchStealDACArray, 0, sizeof(matchStealDACArray)); + memset(matchContinousDACArray, 0, sizeof(matchContinousDACArray)); + memset(rowDelayArray, 0, sizeof(rowDelayArray)); + memset(head1RowDelayArray, 0, sizeof(head1RowDelayArray)); + + memset(matchTotalTableDACArray, 0, sizeof(matchTotalTableDACArray)); + + memset(matchPrevious1DotDACArray, 0, sizeof(matchPrevious1DotDACArray)); + memset(matchPrevious2DotDACArray, 0, sizeof(matchPrevious2DotDACArray)); + memset(matchPrevious3DotDACArray, 0, sizeof(matchPrevious3DotDACArray)); + memset(matchPrevious4DotDACArray, 0, sizeof(matchPrevious4DotDACArray)); + memset(matchPrevious5DotDACArray, 0, sizeof(matchPrevious5DotDACArray)); + memset(matchGapDACArray, 0, sizeof(matchGapDACArray)); + memset(matchP3dotGapDACArray, 0, sizeof(matchP3dotGapDACArray)); + memset(adjDACParameter, 0, sizeof(adjDACParameter)); + + QFile file("./conf/full_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + matchFullDACArray[i] = sysPara->voltePara_No73.pixel_full_table[i] ; + out << sysPara->voltePara_No73.pixel_full_table[i]<< "\n"; + } + file.close(); + + file.setFileName("./conf/steal_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + matchStealDACArray[i] = sysPara->voltePara_No73.pixel_steal_table[i]; + out << sysPara->voltePara_No73.pixel_steal_table[i]<< "\n"; + } + file.close(); + + file.setFileName("./conf/continous_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + matchContinousDACArray[i] = sysPara->voltePara_No73.pixel_continous_table[i]; + out << sysPara->voltePara_No73.pixel_continous_table[i]<< "\n"; + } + file.close(); + + file.setFileName("./conf/row_delay.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + rowDelayArray[i] = sysPara->voltePara_No73.row_delay_table[i]; + out << sysPara->voltePara_No73.row_delay_table[i]<< "\n"; + } + file.close(); + + file.setFileName("./conf/head1_row_delay.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + head1RowDelayArray[i] = sysPara->voltePara_No73.head1_row_delay_table[i]; + out << sysPara->voltePara_No73.head1_row_delay_table[i]<< "\n"; + } + file.close(); + file.setFileName("./conf/1_table_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + *matchOneDACArray = sysPara->voltePara_No73.pixel_1_table[i];// - head1_base_table[i]; + out << sysPara->voltePara_No73.pixel_1_table[i] <<" "<< *matchOneDACArray << "\n"; + ++matchOneDACArray; + } + file.close(); + + file.setFileName("./conf/2_table_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + *matchTwoDACArray = sysPara->voltePara_No73.pixel_2_table[i][0];// - head1_base_table[i]; + ++matchTwoDACArray; + *matchTwoDACArray = sysPara->voltePara_No73.pixel_2_table[i][1];// - tail1_base_table[i]; + ++matchTwoDACArray; + out << sysPara->voltePara_No73.pixel_2_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_2_table[i][1]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/3_table_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][0];// - head1_base_table[i]; + ++matchThreeDACArray; + *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][1];// - head2_base_table[i]; + ++matchThreeDACArray; + *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][2];// - tail1_base_table[i]; + ++matchThreeDACArray; + out << sysPara->voltePara_No73.pixel_3_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_3_table[i][1]; + out << ","; + out << sysPara->voltePara_No73.pixel_3_table[i][2]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/4_table_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][0];// - head1_base_table[i]; + ++matchFourDACArray; + *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][1];// - head2_base_table[i]; + ++matchFourDACArray; + *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][2];// - head3_base_table[i]; + ++matchFourDACArray; + *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][3];// - tail1_base_table[i]; + ++matchFourDACArray; + out << sysPara->voltePara_No73.pixel_4_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_4_table[i][1]; + out << ","; + out << sysPara->voltePara_No73.pixel_4_table[i][2]; + out << ","; + out << sysPara->voltePara_No73.pixel_4_table[i][3]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/5_table_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + QTextStream out(&file); + *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][0];// - head1_base_table[i]; + ++matchFiveDACArray; + *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][1];// - head2_base_table[i]; + ++matchFiveDACArray; + *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][2];// - head3_base_table[i]; + ++matchFiveDACArray; + *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][3];// - tail2_base_table[i]; + ++matchFiveDACArray; + *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][4];// - tail1_base_table[i]; + ++matchFiveDACArray; + out << sysPara->voltePara_No73.pixel_5_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_5_table[i][1]; + out << ","; + out << sysPara->voltePara_No73.pixel_5_table[i][2]; + out << ","; + out << sysPara->voltePara_No73.pixel_5_table[i][3]; + out << ","; + out << sysPara->voltePara_No73.pixel_5_table[i][4]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/gap_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + for (int j = 0; j < 5; j++) + { + matchGapDACArray[i][j] = sysPara->voltePara_No73.pixel_gap_table[i][j]; + } + QTextStream out(&file); + out << sysPara->voltePara_No73.pixel_gap_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_table[i][1]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_table[i][2]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_table[i][3]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_table[i][4]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/p3dot_gap_dac_raw.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < 48; i++) + { + for (int j = 0; j < 5; j++) + { + matchP3dotGapDACArray[i][j] = sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][j]; + } + QTextStream out(&file); + out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][0]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][1]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][2]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][3]; + out << ","; + out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][4]; + out << "\n"; + } + file.close(); + + file.setFileName("./conf/general_dac_parameter.txt"); + file.open(QIODevice::WriteOnly); + for (int i = 0; i < sizeof(sysPara->voltePara_No73.pixel_general_dac_parameter)/sizeof(sysPara->voltePara_No73.pixel_general_dac_parameter[0]); i++) + { + adjDACParameter[i] = sysPara->voltePara_No73.pixel_general_dac_parameter[i]; + QTextStream out(&file); + out << adjDACParameter[i]; + out << "\n"; + } + file.close(); + + fpgaWr(0xB300, (unsigned char *)(matchFullDACArray), sizeof (matchFullDACArray)); + fpgaWr(0xB380, (unsigned char *)(matchContinousDACArray), sizeof (matchContinousDACArray)); + + fpgaWr(0xB400, (unsigned char *)(&rowDelayArray[0]), sizeof (rowDelayArray)); + fpgaWr(0xB480, (unsigned char *)(&head1RowDelayArray[0]), sizeof (head1RowDelayArray)); + + fpgaWr(0xB500, (unsigned char *)(matchTotalTableDACArray[0]), sizeof (matchTotalTableDACArray)); + fpgaWr(0xBC00, (unsigned char *)(matchP3dotGapDACArray[0]), sizeof (matchP3dotGapDACArray)); + fpgaWr(0xBE00, (unsigned char *)(matchGapDACArray[0]), sizeof (matchGapDACArray)); + fpgaWr(0xC000, (unsigned char *)sysPara->voltePara_No73.pixel_big_table, sizeof(sysPara->voltePara_No73.pixel_big_table));// 写入8个 big data + fpgaWr(0xC100, (unsigned char *)adjDACParameter, sizeof(adjDACParameter));// 写入8个 + +} diff --git a/DevOp.h b/DevOp.h new file mode 100644 index 0000000..b746eec --- /dev/null +++ b/DevOp.h @@ -0,0 +1,438 @@ +/* + * DevOp.h + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef DEVOP_H_ +#define DEVOP_H_ + +#define JETV1 1 +#define JETV2 2 +#define JETV3 3 // EP3C10F144 +#define JETV23 4 // V5,V4主板编号均为4; V6没有正式投入使用 +#define JETV7 7 // EP4CE15F144, ARM 335X +#define PRODUCT_VERSION(ver) ((ver>>13) & 0x7) + +class SysPara; + +#include +#include +#include "myinclude.h" +#include +#include +#include +#include +#include + +#ifdef UART2 +#include "posix_qextserialport.h" +#endif +#ifdef UART1 +#include "posix_qextserialport.h" +#endif +#define DisTraceMsg() printf("###############TRACE,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__); +#define DisWarnmsg() printf("~~~~~~~~~~~~~~~WARN,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__); +#define DisErrorMsg() printf("!!!!!!!!!!!!!!!ERROR! ,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__); + +#define PRINT_CTRL_STOP 0 +#define PRINT_CTRL_START 1 +#define PRINT_CTRL_PAUSE 2 +#define PRINT_CTRL_DAC_DISABLE 3 +#define PRINT_CTRL_DAC_ENABLE 4 +#define PRINT_CTRL_STOPSYNCNT 5 + + +#define MAX_FPGA_DAC_VALUE_FOR_NEW ((1<<12)*95/100) //由于硬件原因,当DAC大于一定值后,电压不再变化,所以做一下限制 +#define MAX_FPGA_DAC_VALUE_FOR_V1 (255) //老板子的最大值到256 +#define MAX_FPGA_DAC_VALUE ((PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1)?MAX_FPGA_DAC_VALUE_FOR_V1:MAX_FPGA_DAC_VALUE_FOR_NEW) + +#define MAX_POINT_DISTANCE_ADJUST_VAL (1<<10) //点距微调的最大值 + +#define MAX_MOTOR_RUN_CURRENT 600 +#define MIN_MOTOR_RUN_CURRENT 80 + +#define MAX_RECLAIM_BLOCK_CNT 5 //500ms + +#define MAX_RELEASE_VALVE_DELAY_CNT 4 +/*所有警告都是高电平警告*/ +#define WARN_STATUS_INK_SWINT (1<<7) /*墨线开头,来自喷头,必须开的时候才能打印,关的时候为1,开的时候为0*/ +#define WARN_STATUS_POWER_MON (1<<6) //高压报警 +#define WARN_STATUS_RECYCLE_FAULT (1<<5) //高电平表示有故障 +#define WARN_STATUS_INK_WARN (1<<4) +#define WARN_STATUS_SOLV_WARN (1<<3) +#define WARN_STATUS_SUMP_WARN (1<<2) //墨水渗漏 +#define WARN_STATUS_HDINT (1<<1) /*喷头盖,盖上为0,否则为1,必须盖上才能打印,电磁铁有正反面*/ +#define WARN_STATUS_VISCOTITY_MEASURE_READY (1<<0) // 球已经到上位等灯 + + +#define FPGA_SYS_HZ 100000000 + +#define MAX_WR_MEM_SIZE (1<<16) //写空间最大地址范围 +#define MAX_WR_MEM_SIZE_MASK (MAX_WR_MEM_SIZE - 1) +#define MAX_RD_MEM_SIZE (1<<9) //读空间最大地址范围 +#define MAX_RD_MEM_SIZE_MASK (MAX_RD_MEM_SIZE - 1) + +/* am335x core board control pwm output */ +#define VISCO_PUMP_REQUEST "echo 1 > /sys/class/pwm/ecap.2/request" +#define VISCO_PUMP_RELEASE "echo 0 > /sys/class/pwm/ecap.2/request" +#define VISCO_PUMP_RUN "echo 1 > /sys/class/pwm/ecap.2/run" +#define VISCO_PUMP_STOP "echo 0 > /sys/class/pwm/ecap.2/run" +#define VISCO_PUMP_50Hz "echo 50 > /sys/class/pwm/ecap.2/period_freq" +#define VISCO_PUMP_50P "echo 50 > /sys/class/pwm/ecap.2/duty_percent" +#define VISCO_PUMP_HIGH "echo 1 > /sys/class/pwm/ecap.2/polarity" +#define VISCO_PUMP_LOW "echo 0 > /sys/class/pwm/ecap.2/polarity" + +#define SUCTION_PUMP_REQUEST "echo 1 > /sys/class/pwm/ehrpwm.0:1/request" +#define SUCTION_PUMP_RELEASE "echo 0 > /sys/class/pwm/ehrpwm.0:1/request" +#define SUCTION_PUMP_RUN "echo 1 > /sys/class/pwm/ehrpwm.0:1/run" +#define SUCTION_PUMP_STOP "echo 0 > /sys/class/pwm/ehrpwm.0:1/run" +#define SUCTION_PUMP_HIGH "echo 1 > /sys/class/pwm/ehrpwm.0:1/polarity" +#define SUCTION_PUMP_LOW "echo 0 > /sys/class/pwm/ehrpwm.0:1/polarity" +#define SUCTION_PUMP_90P "echo 90 > /sys/class/pwm/ehrpwm.0:1/duty_percent" +#define SUCTION_PUMP_12000Hz "echo 12000 > /sys/class/pwm/ehrpwm.0:1/period_freq" + +#ifdef __ADC_INPUT__ +#define BOART_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage4_raw" +#define INK_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage5_raw" +#define REVERSE_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage6_raw" +#endif + +#ifdef UART2 +class UartThread; +typedef struct { + char mode; + int addr; + int len; + char flag_m; + QByteArray Buf; +}rec_cmd_t; + +#endif + +#ifdef UART1 +class UartThread1; +typedef struct { + char mode; + int addr; + int len; + char flag_m; + QByteArray Buf; +}rec_cmd_t1; + +#endif + +/* + * 请不要直接初始化此函数,如果需要,请通过SysPara的devOP来访问此类 + * */ +class DevOp : public QObject +{ + Q_OBJECT +public : + DevOp(SysPara * sysPara); + ~DevOp(); + + void set_totalSynPulseNum(bool wren);// 设置可变长度 + void TTYS0ToConsole(); + void WriteMoterPump(void); + void controlReleaseValve(bool openFlag); + void controlMixValve(bool openFlag); + void controlInkValve(bool openFlag); //控制墨线,即供墨阀 + void controlCycleValve(bool openFlag); + void controlCompressPump(bool openFlag); + void controlViscosityPump(bool openFlag); + void controlMainInkPump(bool openFlag); + void controlReclaimPump(bool openFlag,bool fullSpeed); + + void controlHeater(bool openFlag); + void controlBeeper(bool openFlag); + + void controlReclaimTankOpen(bool enableFlag); + void controlReclaimTankClose(bool enableFlag); + + void powerOff(void); + + bool isReleaseValveOpen(); + bool isMixValveOpen(); + bool isInkValveOpen(); + bool isCycleValveOpen(); + bool isCompressPumpOpen(); + bool isViscosityPumpOpen(); + bool isMainInkPumpOpen(); + bool isReclaimPumpOpen(); + + bool isReclaimTankOpenEnable(); + bool isReclaimTankCloseEnable(); + bool isBeeperEnable(); + bool isHearterEnable(); + + int writeFpgaPrintPara(bool ignoreWarn = false); + void readFgaStatus(void); + + void printCtrl(int cmd); + void ReadCnt1GroupStatus(void); + void writeCnt1GroupSetting(bool bCntByGroupEnable); + void writeFpgaCalandar(bool Enable); + void writeFpgaVariCtrl(); + void readCalandarDat(); + void resumeFault(); + void highVoltageCtrl(int val); + void maxHighVoltageDACCtrl(int val); + void setPhaseByHand(int val); + void readPhaseDetectHighTm(); + void setPhaseDetectVoltageDutyCycle(int duty); + void setBlickLightPeriod(int value); + void setOscillatorVoltage(int value); + void setDivideRatio(int value); + void setLastLineEndPointFixedValue(int value); + void checkAuthorization(QString str); + + void mainInkCtrl(); + void pumpValveCtrl(int viscosityAdjustByTemp=0); + void clearProductCnt(unsigned int mode); + unsigned readFpgaVersionNum(void); + void fpgaWr(int addr,unsigned char*dat,int len); + void fpgaRd(int addr,unsigned char*dat,int len); + void fpgaWrD(int addr,unsigned int dat,int len); + void fpgaResetWarning(char mode); + bool fpgaDevOpenFlag; + + unsigned char memWrMap[MAX_WR_MEM_SIZE]; + unsigned char memRdMap[MAX_RD_MEM_SIZE]; +unsigned char color_flag; + void controlRedLight(bool openFlag); + void controlGreenLight(bool openFlag); + void controlYellowLight(bool openFlag); + void controlFan1(bool openFlag); + void controlFan2(bool openFlag); + + bool isGreenLightEnable(); + bool isYellowLightEnable(); + bool isRedLightEnable(); + void readbuilDat(); + void readPrintDataXor(); + void readSyncCounterAtZero(); + void printCtrl2(int cmd); + void ReadSomeDataForLostPrint(void); + +#ifdef __STC_POWER__ + int Heartbeat(char bPowerOn); + int setWakeUpTimer(char wakeUpTime_day); + int getPowerSource(void); + Posix_QextSerialPort *comForPower; + void comForPower_init(); +#endif +#ifdef __RFID_CARD + static Posix_QextSerialPort *comForRFID; + static void comForRFID_init(); + int comReadRFID_data(); + int comWriteRFID_data(); + static QString strRevdata; +#endif + +#ifdef __ADC_INPUT__ + qint8 GetTemp(QString ainFile, quint8 *pTemp); +#endif + void Read_RanddomFromFpga(); // 读FPGARANDFIFO + void RandTxtBakup(char ok); + // 上海外接屏功能 + int BigDisp(unsigned char Module[], unsigned char Wirediameter[]); + int RecDim();//unsigned char buf[], unsigned char Dim[]); + int SmallDisp(unsigned char Module[], unsigned char Wirediameter[]); + void DatToDisp(char FileName[], bool big); + void DatToDisp2(); + void showData(QByteArray dat); + void uart2Init(); + void writeDacValue2Fpga_No72NewVoltData(); + void writeDacValue2Fpga_No73(); + +#ifdef UART2 + Posix_QextSerialPort *myCom; + // MySerialPort * myserialport; + QByteArray recData; + QQueue recQueue; + int recLen; + void stopReceiving(); + bool isReceivingEnable() const; + void disableReceiving(); + void enableReceiving(); + + uchar sendData(const QByteArray &data); + + void stopSending(); + bool isSendingEnable() const; + void disableSending(); + void enableSending(); + uchar uartThreadStart(); + + //void printCtrl2(int cmd); + int recUart2(); + +public slots: + void readCom(char mode,QByteArray recData,int addr); + void sendCom(QString s); + void sendCom(char *buf, int len); + +signals: + void dataReceived(char,const QByteArray &dataReceived,int); +#endif + +#ifdef UART1 + Posix_QextSerialPort *myCom1; + // MySerialPort * myserialport; + QByteArray recData1; + QQueue recQueue1; + int recLen1; + void stopReceiving(); + bool isReceivingEnable() const; + void disableReceiving(); + void enableReceiving(); + + uchar sendData(const QByteArray &data); + + void stopSending(); + bool isSendingEnable() const; + void disableSending(); + void enableSending(); + uchar uartThreadStart(); + //void printCtrl2(int cmd); + //void TTYS0ToConsole(); + QByteArray data,dat_r,rec_r; + QByteArray byteArray; + rec_cmd_t1 rec_cmd; + +public slots: + void readCom(char mode,QByteArray recData,int addr); + void sendCom(QString s); + void sendCom(char *buf, int len); + void readUart1(); +signals: + void dataReceived(char,const QByteArray &dataReceived,int); +#endif + +private: + int WdgttyUsb0Cnt; + bool releaseValveOpenFlag; + bool mixValveFlag; + bool inkValveOpenFlag; + bool cycleValveOpenFlag; + bool compressPumpOpenFlag; + bool viscosityPumpOpenFlag; + bool mainInkPumpOpenFlag; + bool reclaimPumpOpenFlag; + + bool reclaimTankOpenEnableFlag; + bool reclaimTankCloseEnableFlag; + bool beeperOnFlag; + + bool RedLightOnFlag; + bool GreenLightOnFlag; + bool YellowLightOnFlag; + + bool heaterOnFlag; + int com2; + int pwm_sp; + int pwm_fd; + int Interrupt_fd; + int iocontrl; + int DAdataout; + + int adc_fd; +#ifdef __VX_OSC_VOL__ + qint8 OscillatorVoltage[100];//VX 电路不一样,所以需要重新调整 +#endif + SysPara *sysPara; + + + unsigned int fpgaRdD(int addr,int len); + +// 0xA451--- 为什么ARM的顺序相反呢? + typedef struct { + unsigned int varDigitalNum:4; // 数字的个数 + unsigned int charRamBaseAddr:12; // 基址 + unsigned int colOffset:16; // 列偏移 + unsigned int horizonWidth:9;//字模宽度 + unsigned int verticalOffset:6; // 行偏移 + unsigned int charRowNum:6; // 每个字符占行个数 + unsigned int charColNum:6; // 每个字符占列个数 + unsigned int varTypeSel:4; + unsigned int dummy:1; + }reg_var_print_ctrl_t; + +#ifdef UART2 + UartThread *uartThread; + bool sendingEnable; + bool receivingEnable; + // Variables to restore the previous state to a reopening of the SerialPort + //bool closeCalled; + //bool saveStateSendingEnable; + //bool saveStateReceivingEnable; + bool saveStateReceiveData; +#endif + + +#ifdef UART1 + UartThread1 *uartThread; + bool sendingEnable; + bool receivingEnable; + // Variables to restore the previous state to a reopening of the SerialPort + //bool closeCalled; + //bool saveStateSendingEnable; + //bool saveStateReceivingEnable; + bool saveStateReceiveData; +#endif + +}; + + +#ifdef UART2 +class UartThread : public QThread +{ + Q_OBJECT +public: + UartThread(Posix_QextSerialPort &adrPort); + ~UartThread(); + void stopReceiving(); + QQueue dataToSend; + QMutex mutexSend; + void stopSending(); + void addDataToSend(const QByteArray &dataToAdd); +protected: + void run(); +signals: + void dataReceived(char,const QByteArray &dataReceived,int); +private : + Posix_QextSerialPort &port; + QMutex mutexReceive; + bool stopped; + rec_cmd_t rec_cmd; +}; +#endif +#ifdef UART1 +class UartThread1 : public QThread +{ + Q_OBJECT +public: + UartThread1(Posix_QextSerialPort &adrPort); + ~UartThread1(); + void stopReceiving(); + QQueue dataToSend; + QMutex mutexSend; + void stopSending(); + void addDataToSend(const QByteArray &dataToAdd); +protected: + void run(); +signals: + void dataReceived(char,const QByteArray &dataReceived,int); +private : + Posix_QextSerialPort &port; + QMutex mutexReceive; + bool stopped; + rec_cmd_t1 rec_cmd; +}; +#endif +#endif /* DEVOP_H_ */ diff --git a/DialogAuthorization.cpp b/DialogAuthorization.cpp new file mode 100644 index 0000000..4a80065 --- /dev/null +++ b/DialogAuthorization.cpp @@ -0,0 +1,28 @@ +#include "DialogAuthorization.h" +#include "ui_dialogauthorization.h" + +DialogAuthorization::DialogAuthorization(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogAuthorization) +{ + ui->setupUi(this); + this->setWindowTitle(tr("输入密码")); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + ui->lineEditAuth->setEchoMode(QLineEdit::Password); // 密码不回显 + +} + +DialogAuthorization::~DialogAuthorization() +{ + delete ui; +} + + +QString DialogAuthorization::getAuth(){ + return ui->lineEditAuth->text(); +} + +void DialogAuthorization::clearAuth(){ + ui->lineEditAuth->setText(tr("")); + +} diff --git a/DialogAuthorization.h b/DialogAuthorization.h new file mode 100644 index 0000000..8185651 --- /dev/null +++ b/DialogAuthorization.h @@ -0,0 +1,25 @@ +#ifndef DIALOGAUTHORIZATION_H +#define DIALOGAUTHORIZATION_H + +#include + +namespace Ui { +class DialogAuthorization; +} + +class DialogAuthorization : public QDialog +{ + Q_OBJECT + +public: + explicit DialogAuthorization(QWidget *parent = 0); + ~DialogAuthorization(); + + QString getAuth(); + void clearAuth(); +private: + Ui::DialogAuthorization *ui; + //QTimer time1; +}; + +#endif // DIALOGAUTHORIZATION_H diff --git a/DialogFileOperation.cpp b/DialogFileOperation.cpp new file mode 100644 index 0000000..e66249b --- /dev/null +++ b/DialogFileOperation.cpp @@ -0,0 +1,254 @@ +#include "DialogFileOperation.h" +#include "ui_dialogfileoperation.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +DialogFileOperation::DialogFileOperation(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogFileOperation) +{ + ui->setupUi(this); + this->setWindowTitle(tr("文件操作")); + ui->textEditView->setReadOnly(true); + ui->textEditView->setLineWrapMode(QTextEdit::NoWrap); + ui->textEditView->document()->setDocumentMargin(0); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + EditMode=4; +} + +void DialogFileOperation::refreshListView(int mode){ + + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QDir dir(dirPath); + QStringList filters; + EditMode = mode; + if(mode==TXTFILE) filters << "*.html" << "*.txt" << "*.TXT" << "*.jpeg" << "*.gif" << "*.jpg" << "*.bmp"<< "*.BMP"<< "*.bin"; // txtmode + else if(mode==PICFILE) filters << "*.png";// <<"*.jpg" ; // picmode + else if(mode==SCENE) filters << "*.xml"; + else filters << "*.html" << "*.bmp" << "*.BMP"<<"*.jpg"<<"*.gif"; + dir.setNameFilters(filters); + dir.setFilter(QDir::Files); + QStringListModel *model = new QStringListModel(dir.entryList()); + ui->listViewFile->setEditTriggers(QAbstractItemView::NoEditTriggers); + ui->listViewFile->setModel(model); //useList是个QListView + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index(0 , 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } +} + + +DialogFileOperation::~DialogFileOperation() +{ + delete ui; +} + +void DialogFileOperation::on_listViewFile_entered(const QModelIndex &index) +{ + + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QString filePath = dirPath + index.data().toString(); + if(filePath.endsWith(".gif") || filePath.endsWith(".jpeg") || filePath.endsWith(".jpg") || + filePath.endsWith(".png") || filePath.endsWith(".bmp")|| filePath.endsWith(".BMP")|| filePath.endsWith(".nda")){ + ui->textEditView->clear(); + ui->textEditView->setHtml(QString("").arg(filePath)); + } + else if(filePath.endsWith(".xml")) + { + emit createSceneImage(filePath); + ui->textEditView->setHtml(QString("").arg("./printSceneView.png")); + } + else { + QFile file(filePath); + if (!file.open(QFile::ReadOnly)) + return ; + QByteArray data = file.readAll(); + QTextCodec *codec = Qt::codecForHtml(data); + QString str = codec->toUnicode(data); + if (Qt::mightBeRichText(str)) { + if(!ui->radioButtonLocal->isChecked()) + str.replace(DOC_ROOT_DIR,UDISK_DOC_ROOT_DIR); //必须替换相应的路径 + ui->textEditView->setHtml(str); + } else { + str = QString::fromLocal8Bit(data); + ui->textEditView->setPlainText(str); + } + } +} +void DialogFileOperation::on_listViewFile_clicked(const QModelIndex &index) +{ + on_listViewFile_entered(index); +} + +void DialogFileOperation::on_pushButtonNext_pressed() +{ + QModelIndex currIndex = ui->listViewFile->currentIndex(); + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index((currIndex.row() + 1)%count, 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } +} + + +void DialogFileOperation::on_pushButtonLast_pressed() +{ + QModelIndex currIndex = ui->listViewFile->currentIndex(); + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index(currIndex.row() == 0?(count - 1):(currIndex.row() - 1), 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } +} + +void DialogFileOperation::on_pushButtonExit_pressed() +{ + hide(); +} + +void DialogFileOperation::on_pushButtonDelFile_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认删除当前文件?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QModelIndex index = ui->listViewFile->currentIndex(); + int currRow = index.row(); + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QString filePath = dirPath + index.data().toString(); + QFile file(filePath); + + if(!QFileInfo(filePath).baseName().startsWith("UP")){ + if(file.exists())file.remove(); + file.setFileName(PARA_ROOT_DIR + QFileInfo(filePath).baseName()+".dpn" ); + //file.setFileName( PARA_ROOT_DIR + QFileInfo(filePath).baseName()+".dpn" ); + if(file.exists())file.remove(); + } + + //Public::resetPara(); // 20140923 这个BUG导致系统参数被恢复 + refreshListView(EditMode); + int count = ui->listViewFile->model()->rowCount(); + if(count){ + index = ui->listViewFile->model()->index((currRow > (count - 1))?(count - 1):currRow , 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } + } + +} +void DialogFileOperation::on_pushButtonDelAll_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认删除所有文件?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + // 删除所有文件的方法要改进 + + system((char *)((QString("mkdir %1").arg(TESTDIR)).toAscii().data())); + system((char *)((QString("cp %1/UP* %2/. ").arg(DOC_ROOT_DIR).arg(TESTDIR)).toAscii().data())); //先备份UP* + + system((char *)((QString("rm %1/*.*").arg(dirPath)).toAscii().data()));// 删除所有打印文件 + + system((char *)((QString("rm %1*.ini").arg(PARA_ROOT_DIR)).toAscii().data())); // 删除所有参数文件 + system((char *)((QString("rm %1*.dpn").arg(PARA_ROOT_DIR)).toAscii().data())); + + system((char *)((QString("cp %1/UP.* %1/UP1.* %2/. ").arg(TESTDIR).arg(DOC_ROOT_DIR)).toAscii().data())); + //system((char *)((QString("cp %1* %2/. ").arg(TESTDIR).arg(PARA_ROOT_DIR)).toAscii().data())); + refreshListView(EditMode); + } +} + +void DialogFileOperation::on_pushButtonImport_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("提示"), + tr("是否确认从U盘导入所有文件?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + system((char *)((tr("mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/").arg(UDISK_DOC_ROOT_DIR).arg(PARA_ROOT_DIR)).toAscii().data()));//把参数文件移动到参数目录下 + system((char *)((tr("cp %1/* %2/").arg(UDISK_DOC_ROOT_DIR).arg(DOC_ROOT_DIR)).toAscii().data())); + refreshListView(EditMode); + QMessageBox::information(this, tr("提示"), + tr("成功从U盘导入?")); + } +} + +void DialogFileOperation::on_pushButtonExport_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("提示"), + tr("是否确认将所有文件导出到U盘?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QDir dir(UDISK_DOC_ROOT_DIR); + if(!dir.exists()){ + system((char *)((QString("mkdir -p %1").arg(UDISK_DOC_ROOT_DIR)).toAscii().data())); + } +// QDir dirCONF(UDISK_CONF_ROOT_DIR); +// if(!dirCONF.exists()){ +// system((char *)((QString("mkdir -p %1").arg(UDISK_CONF_ROOT_DIR)).toAscii().data())); +// } + system((char *)((QString("cp %1/* %2/").arg(DOC_ROOT_DIR).arg(UDISK_DOC_ROOT_DIR)).toAscii().data())); +// system((char *)((QString("cp %1/* %2/").arg("/home/plg/conf/").arg(UDISK_CONF_ROOT_DIR)).toAscii().data())); + refreshListView(EditMode); + QMessageBox::information(this, tr("提示"), + tr("成功导出到U盘?")); + } +} + +void DialogFileOperation::on_pushButtonInsert_clicked() +{ + QModelIndex index = ui->listViewFile->currentIndex(); + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QString filePath = dirPath + index.data().toString(); + emit openFile(filePath,true); + hide(); +} + +void DialogFileOperation::on_pushButtonOpen_clicked() +{ + QModelIndex index = ui->listViewFile->currentIndex(); + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QString filePath = dirPath + index.data().toString(); + emit openFile(filePath,false); + hide(); +} + +void DialogFileOperation::on_radioButtonLocal_released() +{ + refreshListView(EditMode); +} + +void DialogFileOperation::on_radioButtonUdisk_released() +{ + + QDir dir(UDISK_DOC_ROOT_DIR); + if(!dir.exists()){ + dir.mkdir("/udisk/doc"); + QMessageBox::warning(0,tr("警告"),tr("U盘未插入或U盘根目录下的doc文件夹不存在!")); + } + refreshListView(EditMode); +} + +void DialogFileOperation::modbus_openfile(QString filename) +{ + emit openFile(filename,true); +} diff --git a/DialogFileOperation.h b/DialogFileOperation.h new file mode 100644 index 0000000..1ab92ce --- /dev/null +++ b/DialogFileOperation.h @@ -0,0 +1,68 @@ +#ifndef DIALOGFILEOPERATION_H +#define DIALOGFILEOPERATION_H + +#include +#include "DialogFileOperation.h" +#include +namespace Ui { +class DialogFileOperation; +} + +class DialogFileOperation : public QDialog +{ + Q_OBJECT + +public: + explicit DialogFileOperation(QWidget *parent = 0); + ~DialogFileOperation(); + void refreshListView(int mode); + void modbus_openfile(QString filename); + int EditMode; +private slots: + + + void on_pushButtonNext_pressed(); + + void on_pushButtonLast_pressed(); + + void on_pushButtonExit_pressed(); + + void on_pushButtonDelFile_pressed(); + + void on_pushButtonDelAll_pressed(); + + void on_pushButtonImport_pressed(); + + void on_pushButtonExport_pressed(); + + void on_pushButtonInsert_clicked(); + + void on_pushButtonOpen_clicked(); + + void on_radioButtonLocal_released(); + + void on_radioButtonUdisk_released(); + + + + void on_listViewFile_entered(const QModelIndex &index); + + void on_listViewFile_clicked(const QModelIndex &index); + +Q_SIGNALS: + void openFile(QString filePath,bool insertFlag); + void createSceneImage(QString filePath); + +private: + Ui::DialogFileOperation *ui; +}; + +#endif // DIALOGFILEOPERATION_H + + + + + + + + diff --git a/DialogFontSize.cpp b/DialogFontSize.cpp new file mode 100644 index 0000000..5f8f110 --- /dev/null +++ b/DialogFontSize.cpp @@ -0,0 +1,339 @@ +#include "DialogFontSize.h" +#include "ui_dialogfontsize.h" +#include +#include +#include +#include +#include + +DialogFontSize::DialogFontSize(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogFontSize) +{ + ui->setupUi(this); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + this->setWindowTitle(tr("选择字体大小")); + //connect(ui->fontComboBox,SIGNAL(currentIndexChanged(QString)),SLOT(ChangeFont(QString))); + font.setFamily("wenquanyi"); + font.setPixelSize(12); + ui->lineEdit->setFont(font); + connect(ui->radioButton7HoriL,SIGNAL(clicked(bool)),this,SLOT(Button7HoriL(bool))); + connect(ui->radioButton7HoriR,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + connect(ui->radioButton7Bangla,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + connect(ui->radioButton7PointNum,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + + connect(ui->radioButton9HoriL,SIGNAL(clicked(bool)),this,SLOT(Button7HoriL(bool))); + connect(ui->radioButton9HoriR,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + + connect(ui->radioButton5Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriL(bool))); + connect(ui->radioButton7Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + + connect(ui->radioButton9Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriL(bool))); + connect(ui->radioButton12Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + + connect(ui->radioButton16Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriL(bool))); + connect(ui->radioButton24Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + connect(ui->radioButton21PointNum,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + connect(ui->radioButton32Point,SIGNAL(clicked(bool)),this,SLOT(Button7HoriR(bool))); + +#ifdef VNLGXX + ui->checkBoxBold->hide(); + ui->radioButton5Point->hide(); + ui->radioButton7Point->hide(); + ui->radioButton9Point->hide(); + ui->radioButton12Point->hide(); + ui->radioButton16Point->hide(); + ui->radioButton24Point->hide(); +#else +// ui->checkBoxBold->hide(); +// ui->labelFont->hide(); +// ui->fontComboBox->hide(); +// ui->comboBoxFontSize->hide(); +#endif + GetFileInfo(); + +} + +DialogFontSize::~DialogFontSize() +{ + delete ui; +} + +void DialogFontSize::Button7HoriL(bool ok){ + int pixsize; + getValue(&pixsize); + + + //qDebug()<lineEdit->font().family()<lineEdit->font().pixelSize(); + + +} + +void DialogFontSize::Button7HoriR(bool ok){ + int pixsize; + getValue(&pixsize); + + //qDebug()<lineEdit->font().family()<lineEdit->font().pixelSize(); +} + +void DialogFontSize::ChangeFont(QString fontFamily){ + + font.setFamily(fontFamily); + + //font.setPixelSize(pixelSize); + ui->lineEdit->setFont(font); // 设置预览字体 + +// if(fontFamily=="wenquanyi" ){ +// ui->comboBoxFontSize->clear(); +// ui->comboBoxFontSize->addItem("12"); +// ui->comboBoxFontSize->addItem("16"); +// //ui->comboBoxFontSize->addItem("12"); + + +// } +// else if(fontFamily=="biyang"){ +// ui->comboBoxFontSize->clear(); +// ui->comboBoxFontSize->addItem("5"); +// ui->comboBoxFontSize->addItem("7"); +// ui->comboBoxFontSize->addItem("9"); +// //ui->comboBoxFontSize->addItem("10"); + +// } +// else { +// ui->comboBoxFontSize->clear(); +// ui->comboBoxFontSize->addItem("14"); +// ui->comboBoxFontSize->addItem("16"); +// ui->comboBoxFontSize->addItem("18"); +// ui->comboBoxFontSize->addItem("20"); +// ui->comboBoxFontSize->addItem("24"); +// ui->comboBoxFontSize->addItem("28"); +// ui->comboBoxFontSize->addItem("32"); +// ui->comboBoxFontSize->addItem("36"); +// } + +} + +void DialogFontSize::GetFileInfo(){ + // /usr/local/Trolltech/QtEmbedded-4.6.3/include/QtCore/QObject:1: from /usr/local/Trolltech/QtEmbedded-4.6.3/include/QtCore/QObject:1, + QString fileName; + QString fileDate=""; + QString fontPath= +#ifdef DEBUG_CNT + "/usr/local/Trolltech/QtEmbedded-4.6.3/lib/fonts/" +#else + "/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/" +#endif + ; + QDir FontsFile("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"); + if(FontsFile.exists("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"))//2451 + { + fontPath = "/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"; + } + if(FontsFile.exists("/usr/lib/fonts/"))//am335x + { + fontPath = "/usr/lib/fonts/"; + } + fileName.sprintf("_%d_50.qpf2",font.pixelSize()); + + + QFileInfo fileInfo; + + if(font.family()=="SerifL") + fileName = fontPath +"serifl_7_50.qpf2"; + else if(font.family()=="SerifR") + fileName = fontPath +"serifr_7_50.qpf2"; + else if(font.family()=="SerifL9") + fileName = fontPath +"serifl_9_50.qpf2"; + else if(font.family()=="SerifR9") + fileName = fontPath +"serifr_9_50.qpf2"; + else fileName = fontPath +font.family()+fileName; + fileInfo.setFile(fileName); + QDateTime dt= fileInfo.created(); + //fileInfo.lastModified(); + QString s = dt.toString("yyyy-MM-dd hh:mm:ss"); + //qDebug()<<"GetFileInfo"<labFontInfo->setText(fileInfo.fileName()+" "+s+""); + ui->labFontInfo->setText( QString("%1").arg(chsum)); +} + +void DialogFontSize::getValue(int *size){ + int pixelSize = 12; + bool ok; + font.setFamily("wenquanyi"); +#ifdef VNLGXX + + int n = ui->comboBoxFontSize->currentText().toInt(&ok,10); + if(ok) pixelSize = n; + +#else + if(ui->radioButton5Point->isChecked()){ + pixelSize = 5; + font.setFamily("biyang"); + } + else if(ui->radioButton7Point->isChecked()){ + pixelSize = 7; + font.setFamily("biyang"); + } + else if(ui->radioButton9Point->isChecked()){ + pixelSize = 9; + font.setFamily("biyang"); + } + else if(ui->radioButton12Point->isChecked()){ + pixelSize = 12; + + } + else if(ui->radioButton16Point->isChecked()){ + pixelSize = 16; + } + else if(ui->radioButton24Point->isChecked()){ + pixelSize = 24; + } + else if(ui->radioButton7HoriL->isChecked()){ + pixelSize = 5; + font.setFamily("SerifL"); + + } + else if(ui->radioButton7HoriR->isChecked()){ + pixelSize = 5; + font.setFamily("SerifR"); + } + else if(ui->radioButton9HoriL->isChecked()){ + pixelSize = 7; + font.setFamily("SerifL9"); + + } + else if(ui->radioButton9HoriR->isChecked()){ + pixelSize = 7; + font.setFamily("SerifR9"); + } + else if(ui->radioButton7Bangla->isChecked()){ + pixelSize = 7; + font.setFamily("bangla"); + } + else if(ui->radioButton7PointNum->isChecked()){ + pixelSize = 7; + font.setFamily("biyangF"); + } + else if(ui->radioButton21PointNum->isChecked()){ + pixelSize = 24; + font.setFamily("biyangF"); + } + else if(ui->radioButton12NewRoman->isChecked()){ + pixelSize = 12; + font.setFamily("Roman"); + } + else if(ui->radioButton32Point->isChecked()){ + pixelSize = 32; + } + + /* radioButton7Hori + else if(ui->radioButton28Point->isChecked()){ + pixelSize = 28; + } + else if(ui->radioButton32Point->isChecked()){ + pixelSize = 32; + }*/ + +#endif + + font.setPixelSize(pixelSize); + ui->lineEdit->setFont(font); // 设置预览字体 + + *size = pixelSize; + + +} + +void DialogFontSize::setValue(int value){ + +#ifdef VNLGXX + //QString s; + //s.sprintf("%d",value); + //ui->comboBoxFontSize->setEditText(s); + //if(value<12) ui->fontComboBox->setCurrentIndex(0); + +#else + if(value == 5 && font.family()=="biyang"){ + ui->radioButton5Point->setChecked(true); + } + else if(value == 5 && font.family()=="SerifL"){ + ui->radioButton7HoriL->setChecked(true); + + } + else if(value == 5 && font.family()=="SerifR" ){ + ui->radioButton7HoriR->setChecked(true); + + } + else if(value == 7 && font.family()=="SerifL9"){ + ui->radioButton9HoriL->setChecked(true); + + } + else if(value == 7 && font.family()=="SerifR9"){ + ui->radioButton9HoriR->setChecked(true); + + } + else if(value == 7 && font.family()=="bangla"){ + ui->radioButton7Bangla->setChecked(true); + } + else if(value == 7 && font.family()=="biyangF"){ + ui->radioButton7PointNum->setChecked(true); + } + else if(value == 21 && font.family()=="biyangF"){ + ui->radioButton21PointNum->setChecked(true); + } + else if(value == 12 && font.family()=="Roman"){ + ui->radioButton12NewRoman->setChecked(true); + } + else if(value == 7){ + ui->radioButton7Point->setChecked(true); + } + else if(value == 9){ + ui->radioButton9Point->setChecked(true); + } + else if(value == 12){ + ui->radioButton12Point->setChecked(true); + } + else if(value == 16){ + ui->radioButton16Point->setChecked(true); + } + + else if(value == 24){ + ui->radioButton24Point->setChecked(true); + } + else if(value == 32){ + ui->radioButton32Point->setChecked(true); + } + /* + else if(value == 28){ + ui->radioButton28Point->setChecked(true); + } + else if(value == 32){ + ui->radioButton32Point->setChecked(true); + } + */ + +#endif + +} + +QString DialogFontSize::getFontFamily(){ + + return ui->lineEdit->font().family(); +} + +QFont DialogFontSize::getFont(){ + + return ui->lineEdit->font(); +} + +void DialogFontSize::on_pushButton_pressed() +{ + GetFileInfo();// 显示字库校验码 +} diff --git a/DialogFontSize.h b/DialogFontSize.h new file mode 100644 index 0000000..5c9eaf7 --- /dev/null +++ b/DialogFontSize.h @@ -0,0 +1,37 @@ +#ifndef DIALOGFONTSIZE_H +#define DIALOGFONTSIZE_H + +#include + +namespace Ui { +class DialogFontSize; +} + +class DialogFontSize : public QDialog +{ + Q_OBJECT + +public: + explicit DialogFontSize(QWidget *parent = 0); + ~DialogFontSize(); + void getValue(int *size); + void setValue(int value); + QFont font; + QString getFontFamily(); + QFont getFont(); + + void GetFileInfo();//String fileName, String fileDate + +public slots: + void ChangeFont(QString fontFamily); + void Button7HoriL(bool ok); + void Button7HoriR(bool ok); + +private slots: + void on_pushButton_pressed(); + +private: + Ui::DialogFontSize *ui; +}; + +#endif // DIALOGFONTSIZE_H diff --git a/DialogInputTxt.cpp b/DialogInputTxt.cpp new file mode 100644 index 0000000..0906cdb --- /dev/null +++ b/DialogInputTxt.cpp @@ -0,0 +1,14 @@ +#include "DialogInputTxt.h" +#include "ui_DialogInputTxt.h" + +DialogInputTxt::DialogInputTxt(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogInputTxt) +{ + ui->setupUi(this); +} + +DialogInputTxt::~DialogInputTxt() +{ + delete ui; +} diff --git a/DialogInputTxt.h b/DialogInputTxt.h new file mode 100644 index 0000000..bd0e63b --- /dev/null +++ b/DialogInputTxt.h @@ -0,0 +1,22 @@ +#ifndef DIALOGINPUTTXT_H +#define DIALOGINPUTTXT_H + +#include + +namespace Ui { + class DialogInputTxt; +} + +class DialogInputTxt : public QDialog +{ + Q_OBJECT + +public: + explicit DialogInputTxt(QWidget *parent = 0); + ~DialogInputTxt(); + +private: + Ui::DialogInputTxt *ui; +}; + +#endif // DIALOGINPUTTXT_H diff --git a/DialogInputTxt.ui b/DialogInputTxt.ui new file mode 100644 index 0000000..8287858 --- /dev/null +++ b/DialogInputTxt.ui @@ -0,0 +1,78 @@ + + + DialogInputTxt + + + + 0 + 0 + 400 + 117 + + + + Dialog + + + + + 20 + 80 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 20 + 30 + 361 + 27 + + + + + + + + buttonBox + accepted() + DialogInputTxt + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogInputTxt + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/DialogInsertVari.cpp b/DialogInsertVari.cpp new file mode 100644 index 0000000..b7d456e --- /dev/null +++ b/DialogInsertVari.cpp @@ -0,0 +1,222 @@ +#include "DialogInsertVari.h" +#include "ui_dialoginsertvari.h" +#include "myinclude.h" +//#include "SysPara.h" + +DialogInsertVari::DialogInsertVari(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogInsertVari) +{ + + ui->setupUi(this); + this->setWindowTitle(tr("变量插入")); + //this->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowContextHelpButtonHint | Qt::WindowMaximizeButtonHint); + //this->setWindowFlags(windowFlags()&~Qt::WindowCloseButtonHint); + //setWindowFlags(Qt::WindowTitleHint | Qt::WindowContextHelpButtonHint); + //setWindowFlags(Qt::CustomizeWindowHint); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + + + bool Flag=0; + digitWidth = 4; + ui->radioButtonDigital9->setDisabled(!Flag); + ui->radioButtonDigitalA->setDisabled(!Flag); + ui->radioButtonDigitalB->setDisabled(!Flag); + ui->radioButtonDigitalC->setDisabled(!Flag); + ui->radioButtonDigitalD->setDisabled(!Flag); + ui->radioButtonDigitalE->setDisabled(!Flag); + ui->radioButtonDigitalF->setDisabled(!Flag); + //ui->radioButtonDigitalH->setDisabled(!Flag); + + connect(ui->radioButtonVarRandom,SIGNAL(toggled(bool)),this,SLOT(onRanDomPressed(bool))); + + connect(ui->radioButtonHour,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + connect(ui->radioButtonMinute,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + connect(ui->radioButtonWeek,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + connect(ui->radioButtonMonth,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + connect(ui->radioButtonSecond,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + connect(ui->radioButtonDay,SIGNAL(toggled(bool)),this,SLOT( onDigitTwoBit(bool))); + + connect(ui->radioButtonYear,SIGNAL(toggled(bool)),this,SLOT( onDigitFourBit(bool))); + connect(ui->radioButtonVar1,SIGNAL(toggled(bool)),this,SLOT( onDigitFourBit(bool))); + connect(ui->radioButtonVar2,SIGNAL(toggled(bool)),this,SLOT( onDigitFourBit(bool))); + connect(ui->radioButtonCNT3,SIGNAL(toggled(bool)),this,SLOT( onDigitFourBit(bool))); +#ifdef _2DCODE_ + connect(ui->radioButtonBarCode,SIGNAL(toggled(bool)),this,SLOT( onDigitOtherBit(bool))); + connect(ui->radioButtonQRCode,SIGNAL(toggled(bool)),this,SLOT( onDigitOtherBit(bool))); + connect(ui->radioButtonDataMatrix,SIGNAL(toggled(bool)),this,SLOT( onDigitOtherBit(bool))); +#else + delete ui->radioButtonBarCode; + delete ui->radioButtonQRCode; + delete ui->radioButtonDataMatrix; +#endif + + + //ui->radioButtonDigitalH->hide(); +#ifndef CABLEUSER + ui->radioButtonVar1->hide(); + ui->radioButtonVar2->hide(); + ui->radioButtonYear->setChecked(1); +#endif +} + +DialogInsertVari::~DialogInsertVari() +{ + delete ui; +} +void DialogInsertVari::setValue(QString txt){ + //ui->label_2->setText(txt); +} +void DialogInsertVari::onRanDomPressed(bool Flag){ + if(Flag) ui->radioButtonDigitalD->setChecked(Flag); + else ui->radioButtonDigital4->setChecked(1); + ui->radioButtonDigital9->setDisabled(!Flag); + ui->radioButtonDigitalA->setDisabled(!Flag); + ui->radioButtonDigitalB->setDisabled(!Flag); + ui->radioButtonDigitalC->setDisabled(!Flag); + ui->radioButtonDigitalD->setDisabled(!Flag); + ui->radioButtonDigitalE->setDisabled(!Flag); + ui->radioButtonDigitalF->setDisabled(!Flag); + //ui->radioButtonDigitalH->setDisabled(!Flag); +} + +void DialogInsertVari::onDigitOtherBit(bool Flag){ + + if(digitWidth>8) + ui->radioButtonDigital4->setChecked(1); + + ui->radioButtonDigital9->setDisabled(Flag); + ui->radioButtonDigitalA->setDisabled(Flag); + ui->radioButtonDigitalB->setDisabled(Flag); + ui->radioButtonDigitalC->setDisabled(Flag); + ui->radioButtonDigitalD->setDisabled(Flag); + ui->radioButtonDigitalE->setDisabled(Flag); + ui->radioButtonDigitalF->setDisabled(Flag); + //ui->radioButtonDigitalH->setDisabled(Flag); +} + +void DialogInsertVari::onDigitTwoBit(bool Flag){ + if(Flag)ui->radioButtonDigital2->setChecked(Flag); + else ui->radioButtonDigital4->setChecked(1); + + ui->radioButtonDigital9->setDisabled(Flag); + ui->radioButtonDigitalA->setDisabled(Flag); + ui->radioButtonDigitalB->setDisabled(Flag); + ui->radioButtonDigitalC->setDisabled(Flag); + ui->radioButtonDigitalD->setDisabled(Flag); + ui->radioButtonDigitalE->setDisabled(Flag); + ui->radioButtonDigitalF->setDisabled(Flag); + //ui->radioButtonDigitalH->setDisabled(Flag); +} + +void DialogInsertVari::onDigitFourBit(bool Flag){ + if(Flag)ui->radioButtonDigital4->setChecked(Flag); + else ui->radioButtonDigital2->setChecked(1); + ui->radioButtonDigital9->setDisabled(Flag); + ui->radioButtonDigitalA->setDisabled(Flag); + ui->radioButtonDigitalB->setDisabled(Flag); + ui->radioButtonDigitalC->setDisabled(Flag); + ui->radioButtonDigitalD->setDisabled(Flag); + ui->radioButtonDigitalE->setDisabled(Flag); + ui->radioButtonDigitalF->setDisabled(Flag); + //ui->radioButtonDigitalH->setDisabled(Flag); +} + + +void DialogInsertVari::getValue(int *varType,int *digitalWidth,unsigned char *splitMode){ + int type = 0,width = 0; + if(ui->radioButtonYear->isChecked()) + type = 0; + else if(ui->radioButtonMonth->isChecked()) + type = 1; + else if(ui->radioButtonDay->isChecked()) + type = 2; + else if(ui->radioButtonWeek->isChecked()) + type = 3; + else if(ui->radioButtonHour->isChecked()) + type = 4; + else if(ui->radioButtonMinute->isChecked()) + type = 5; + else if(ui->radioButtonSecond->isChecked()) + type = 6; + else if(ui->radioButtonVar1->isChecked()) + type = 7; + else if(ui->radioButtonVar2->isChecked()) + type = 8; +#ifdef _2DCODE_ + else if(ui->radioButtonDataMatrix->isChecked()) + type = 9; + else if(ui->radioButtonQRCode->isChecked()) + type = 10; + else if(ui->radioButtonBarCode->isChecked()) + type = 11; +#endif + else if(ui->radioButtonVarRandom->isChecked()) + type = 12; + else if(ui->radioButtonCNT3->isChecked()) + type = 13; + else if(ui->radioButtonExpiry->isChecked()) + { + type = 80; + + } + else if(ui->radioButtonCurDate->isChecked()) + { + type = 81; + } +// else if(ui->radioButtonClass->isChecked()) +// { +// type = 82; +// } + + + + if(ui->radioButtonDigital1->isChecked()) + width = 1; + else if(ui->radioButtonDigital2->isChecked()) + width = 2; + else if(ui->radioButtonDigital3->isChecked()) + width = 3; + else if(ui->radioButtonDigital4->isChecked()) + width = 4; + else if(ui->radioButtonDigital5->isChecked()) + width = 5; + else if(ui->radioButtonDigital6->isChecked()) + width = 6; + else if(ui->radioButtonDigital7->isChecked()) + width = 7; + else if(ui->radioButtonDigital8->isChecked()) + width = 8; + else if(ui->radioButtonDigital9->isChecked()) + width = 9; + else if(ui->radioButtonDigitalA->isChecked()) + width = 10; + else if(ui->radioButtonDigitalB->isChecked()) + width = 11; + else if(ui->radioButtonDigitalC->isChecked()) + width = 12; + else if(ui->radioButtonDigitalD->isChecked()) + width = 13; + else if(ui->radioButtonDigitalE->isChecked()) + width = 14; + else if(ui->radioButtonDigitalF->isChecked()) + width = 15; + //else if(ui->radioButtonDigitalH->isChecked()) + // width = 16; + if(varType && digitalWidth){ + *varType = type; + *digitalWidth = width; + digitWidth = width; + } + if (type == 82) { // class + *digitalWidth = 1; + digitWidth = 1; + + } + +} + +void DialogInsertVari::on_buttonBox_accepted() +{ + +} diff --git a/DialogInsertVari.h b/DialogInsertVari.h new file mode 100644 index 0000000..9fc91e7 --- /dev/null +++ b/DialogInsertVari.h @@ -0,0 +1,32 @@ +#ifndef DIALOGINSERTVARI_H +#define DIALOGINSERTVARI_H + +#include + +namespace Ui { +class DialogInsertVari; +} + +class DialogInsertVari : public QDialog +{ + Q_OBJECT + +public: + explicit DialogInsertVari(QWidget *parent = 0); + ~DialogInsertVari(); + void getValue(int *varType,int *digitalWidth,unsigned char *splitMode); + void setValue(QString txt); +protected slots: + void onRanDomPressed(bool Flag); + void onDigitOtherBit(bool Flag); + void onDigitTwoBit(bool Flag); + void onDigitFourBit(bool Flag); +private slots: + void on_buttonBox_accepted(); + +private: + Ui::DialogInsertVari *ui; + int digitWidth; +}; + +#endif // DIALOGINSERTVARI_H diff --git a/DialogLineSpace.cpp b/DialogLineSpace.cpp new file mode 100644 index 0000000..a9b0aa9 --- /dev/null +++ b/DialogLineSpace.cpp @@ -0,0 +1,67 @@ +#include "DialogLineSpace.h" +#include "ui_dialoglinespace.h" + +DialogLineSpace::DialogLineSpace(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogLineSpace) +{ + ui->setupUi(this); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + this->setWindowTitle(tr("选择行间距和字符间距")); +} + +DialogLineSpace::~DialogLineSpace() +{ + delete ui; +} + +void DialogLineSpace::getValue(int *lineSpace,int *charSpace){ + *lineSpace = 0; + + if(ui->radioButton0Pixel->isChecked()) + *lineSpace = 0; + else if(ui->radioButton1Pixel->isChecked()) + *lineSpace = 1; + else if(ui->radioButton2Pixel->isChecked()) + *lineSpace = 2; + else if(ui->radioButton3Pixel->isChecked()) + *lineSpace = 3; + else if(ui->radioButton4Pixel->isChecked()) + *lineSpace = 4; + else if(ui->radioButton5Pixel->isChecked()) + *lineSpace = 5; + else if(ui->radioButton6Pixel->isChecked()) + *lineSpace = 6; + else if(ui->radioButton7Pixel->isChecked()) + *lineSpace = 7; + + *charSpace = 0; + if(ui->radioButtonCharSpace0Pixel->isChecked()) + *charSpace = 0; + else if(ui->radioButtonCharSpace1Pixel->isChecked()) + *charSpace = 1; + else if(ui->radioButtonCharSpace2Pixel->isChecked()) + *charSpace = 2; + else if(ui->radioButtonCharSpace3Pixel->isChecked()) + *charSpace = 3; +} + +void DialogLineSpace::setValue(int lineSpace,int charSpace){ + if(lineSpace > 7 || lineSpace < 0) + lineSpace = 0; + ui->radioButton0Pixel->setChecked(lineSpace == 0); + ui->radioButton1Pixel->setChecked(lineSpace == 1); + ui->radioButton2Pixel->setChecked(lineSpace == 2); + ui->radioButton3Pixel->setChecked(lineSpace == 3); + ui->radioButton4Pixel->setChecked(lineSpace == 4); + ui->radioButton5Pixel->setChecked(lineSpace == 5); + ui->radioButton6Pixel->setChecked(lineSpace == 6); + ui->radioButton7Pixel->setChecked(lineSpace == 7); + + if(charSpace > 3 || charSpace < 0) + charSpace = 0; + ui->radioButtonCharSpace0Pixel->setChecked(charSpace == 0); + ui->radioButtonCharSpace1Pixel->setChecked(charSpace == 1); + ui->radioButtonCharSpace2Pixel->setChecked(charSpace == 2); + ui->radioButtonCharSpace3Pixel->setChecked(charSpace == 3); +} diff --git a/DialogLineSpace.h b/DialogLineSpace.h new file mode 100644 index 0000000..5dc72aa --- /dev/null +++ b/DialogLineSpace.h @@ -0,0 +1,24 @@ +#ifndef DIALOGLINESPACE_H +#define DIALOGLINESPACE_H + +#include + +namespace Ui { +class DialogLineSpace; +} + +class DialogLineSpace : public QDialog +{ + Q_OBJECT + +public: + explicit DialogLineSpace(QWidget *parent = 0); + ~DialogLineSpace(); + void getValue(int *lineSpace,int *charSpace); + void setValue(int lineSpace,int charSpace); + +private: + Ui::DialogLineSpace *ui; +}; + +#endif // DIALOGLINESPACE_H diff --git a/DialogSaveFile.cpp b/DialogSaveFile.cpp new file mode 100644 index 0000000..910e694 --- /dev/null +++ b/DialogSaveFile.cpp @@ -0,0 +1,157 @@ +#include "DialogSaveFile.h" +#include "ui_dialogsavefile.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +DialogSaveFile::DialogSaveFile(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogSaveFile) +{ + ui->setupUi(this); + this->setWindowTitle(tr("保存")); + ui->textEditView->setReadOnly(true); + ui->textEditView->setLineWrapMode(QTextEdit::NoWrap); + ui->textEditView->document()->setDocumentMargin(0); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + EditMode=4; +} + +void DialogSaveFile::refreshListView(int mode){ + + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QDir dir(dirPath); + QStringList filters; + EditMode = mode; + if(mode == TXTFILE) filters << "*.html" << "*.txt" << "*.TXT" << "*.jpeg" << "*.gif" << "*.jpg" << "*.bmp"<< "*.BMP"; // txtmode + else if(mode == PICFILE) filters << "*.png";// <<"*.jpg" ; // picmode + else if(mode == SCENE) filters << "*.xml";// scene mode + else filters << "*.html" << "*.bmp" << "*.BMP" <<"*.jpg"<<"*.gif"; + dir.setNameFilters(filters); + dir.setFilter(QDir::Files); + QStringListModel *model = new QStringListModel(dir.entryList()); + ui->listViewFile->setEditTriggers(QAbstractItemView::NoEditTriggers); + ui->listViewFile->setModel(model); //useList是个QListView + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index(0 , 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } +} + + +DialogSaveFile::~DialogSaveFile() +{ + delete ui; +} + +void DialogSaveFile::on_listViewFile_entered(const QModelIndex &index) +{ + + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + QString filePath = dirPath + index.data().toString(); + if(filePath.endsWith(".gif") || filePath.endsWith(".jpeg") || filePath.endsWith(".jpg") || + filePath.endsWith(".png") || filePath.endsWith(".bmp")|| filePath.endsWith(".BMP")|| filePath.endsWith(".nda")){ + ui->textEditView->clear(); + ui->textEditView->setHtml(QString("").arg(filePath)); + } + else { + QFile file(filePath); + if (!file.open(QFile::ReadOnly)) + return ; + QByteArray data = file.readAll(); + QTextCodec *codec = Qt::codecForHtml(data); + QString str = codec->toUnicode(data); + if (Qt::mightBeRichText(str)) { + if(!ui->radioButtonLocal->isChecked()) + str.replace(DOC_ROOT_DIR,UDISK_DOC_ROOT_DIR); //必须替换相应的路径 + ui->textEditView->setHtml(str); + } else { + str = QString::fromLocal8Bit(data); + ui->textEditView->setPlainText(str); + } + } + ui->lineEdit->setText( QFileInfo(ui->listViewFile->currentIndex().data().toString()).baseName() ); +} +void DialogSaveFile::on_listViewFile_clicked(const QModelIndex &index) +{ + on_listViewFile_entered(index); +} + +void DialogSaveFile::on_pushButtonNext_pressed() +{ + QModelIndex currIndex = ui->listViewFile->currentIndex(); + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index((currIndex.row() + 1)%count, 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } + ui->lineEdit->setText(QFileInfo(ui->listViewFile->currentIndex().data().toString()).baseName()); +} + +void DialogSaveFile::on_pushButtonLast_pressed() +{ + QModelIndex currIndex = ui->listViewFile->currentIndex(); + int count = ui->listViewFile->model()->rowCount(); + if(count){ + QModelIndex index = ui->listViewFile->model()->index(currIndex.row() == 0?(count - 1):(currIndex.row() - 1), 0); + ui->listViewFile->setCurrentIndex(index); + on_listViewFile_entered(index); + } + ui->lineEdit->setText(QFileInfo(ui->listViewFile->currentIndex().data().toString()).baseName()); +} + +void DialogSaveFile::on_pushButtonExit_pressed() +{ + hide(); +} +//void DialogSaveFile::on_lostfocuse_pressed() +//{ +// hide(); +//} +void DialogSaveFile::on_pushButtonSave_clicked() +{ + QModelIndex index = ui->listViewFile->currentIndex(); + QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR; + //QString filePath = dirPath + index.data().toString(); + QString filePath = dirPath + ui->lineEdit->text();// index.data().toString(); + //qDebug()<<"filePath1"; + emit saveFile(filePath,false); + //qDebug()<<"filePath2"; + hide(); +} + +void DialogSaveFile::on_radioButtonLocal_released() +{ + refreshListView(EditMode); +} + +void DialogSaveFile::on_radioButtonUdisk_released() +{ + + QDir dir(UDISK_DOC_ROOT_DIR); + if(!dir.exists()){ + QMessageBox::warning(0,tr("警告"),tr("U盘未插入或U盘根目录下的doc文件夹不存在!")); + } + refreshListView(EditMode); +} +void DialogSaveFile::setEnterFileName(QString strFile) +{ + ui->lineEdit->setText(strFile); + //ui->lineEdit->setFocus(); +} +void DialogSaveFile::setTitleTxt(QString str) +{ + setWindowTitle(str); +} diff --git a/DialogSaveFile.h b/DialogSaveFile.h new file mode 100644 index 0000000..05524df --- /dev/null +++ b/DialogSaveFile.h @@ -0,0 +1,47 @@ +#ifndef DialogSaveFile_H +#define DialogSaveFile_H + +#include +#include "DialogSaveFile.h" +#include +namespace Ui { +class DialogSaveFile; +} + +class DialogSaveFile : public QDialog +{ + Q_OBJECT + +public: + explicit DialogSaveFile(QWidget *parent = 0); + ~DialogSaveFile(); + void refreshListView(int mode); + int EditMode; + void setEnterFileName(QString strFile); + void setTitleTxt(QString str); +private slots: + + + void on_pushButtonNext_pressed(); + void on_pushButtonLast_pressed(); + void on_pushButtonExit_pressed(); + void on_pushButtonSave_clicked(); + void on_radioButtonLocal_released(); + void on_radioButtonUdisk_released(); + void on_listViewFile_entered(const QModelIndex &index); + void on_listViewFile_clicked(const QModelIndex &index); +Q_SIGNALS: + void saveFile(QString filePath,bool Flag); +private: + Ui::DialogSaveFile *ui; +}; + +#endif // DialogSaveFile_H + + + + + + + + diff --git a/DigitalInput.cpp b/DigitalInput.cpp new file mode 100644 index 0000000..d695584 --- /dev/null +++ b/DigitalInput.cpp @@ -0,0 +1,67 @@ +#include "DigitalInput.h" +#include "ui_digitalinput.h" +#include "MyInputMethod.h" +DigitalInput::DigitalInput(MyInputMethod *myInputMethod,QWidget *parent) : + QWidget(parent,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)), + ui(new Ui::DigitalInput) +{ + ui->setupUi(this); + this->myInputMethod = myInputMethod; + + connect(ui->Key_0,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_1,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_2,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_3,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_4,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_5,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_6,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_7,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_8,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_9,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_pluse,SIGNAL(pressed()),this,SLOT(onCharPressed())); + connect(ui->Key_backspace,SIGNAL(pressed()),this,SLOT(onKeyBackspacePressed())); + connect(ui->Key_selectAll,SIGNAL(pressed()),this,SLOT(onKeySelectAllPressed())); + connect(ui->Key_up,SIGNAL(pressed()),this,SLOT(onKeyUpPressed())); + connect(ui->Key_down,SIGNAL(pressed()),this,SLOT(onKeyDownPressed())); + +} + +DigitalInput::~DigitalInput() +{ + delete ui; +} + + +void DigitalInput::onCharPressed(){ + QPushButton * button = qobject_cast(sender()); + QString text = button->text(); + myInputMethod->sendString (text); +} + +void DigitalInput::onKeyBackspacePressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Backspace,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} + +void DigitalInput::onKeySelectAllPressed(){ + static int init = 0; +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_A,Qt::ControlModifier,true,false); //向系统发送键盘事件 + if(!init) + QWSServer::sendKeyEvent(0,Qt::Key_A,Qt::ControlModifier,true,false); //向系统发送键盘事件 + init = 1; +#endif +} +void DigitalInput::onKeyUpPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Up,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} +void DigitalInput::onKeyDownPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Down,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} + + diff --git a/DigitalInput.h b/DigitalInput.h new file mode 100644 index 0000000..12e8264 --- /dev/null +++ b/DigitalInput.h @@ -0,0 +1,33 @@ +#ifndef DIGITALINPUT_H +#define DIGITALINPUT_H + +#include +class MyInputMethod; +namespace Ui { +class DigitalInput; +} + +class DigitalInput : public QWidget +{ + Q_OBJECT + +public: + explicit DigitalInput(MyInputMethod *myInputMethod,QWidget *parent = 0); + ~DigitalInput(); + + +private slots: + void onCharPressed(); + void onKeyBackspacePressed(); + void onKeySelectAllPressed(); + void onKeyUpPressed(); + void onKeyDownPressed(); + + +private: + Ui::DigitalInput *ui; + + MyInputMethod *myInputMethod; +}; + +#endif // DIGITALINPUT_H diff --git a/EN/mainwindow.ui b/EN/mainwindow.ui new file mode 100644 index 0000000..0324a47 --- /dev/null +++ b/EN/mainwindow.ui @@ -0,0 +1,3873 @@ + + + MainWindow + + + true + + + + 0 + 0 + 638 + 458 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 5 + 5 + + + + Qt::StrongFocus + + + InkJet + + + + + 9 + 9 + 620 + 440 + + + + + 0 + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + 1 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + + + 0 + 50 + + + + + + 0 + 0 + 686 + 47 + + + + + + + + 0 + 45 + + + + 编辑 + + + + :/icon/edit.png:/icon/edit.png + + + + + + + + 0 + 45 + + + + 打开文件 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + + 0 + 45 + + + + 二维码 + + + + :/icon/bypm.png:/icon/bypm.png + + + + + + + + 0 + 45 + + + + 条形码 + + + + :/icon/BarCode1.png:/icon/BarCode1.png + + + + + + + + 0 + 45 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + 0 + 45 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + 交替打印文件名 + + + + + + + + + + + + 0 + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 最大:[40行x 2048列] + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 140 + 25 + + + + + 140 + 25 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 同步器速度 + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + Qt::Vertical + + + + + + + + 0 + 25 + + + + + 100 + 25 + + + + 当前时间 + + + + + + + + + + + + + 640 + 107 + + + + 1 + + + + + + + + 610 + 95 + + + + + 620 + 96 + + + + BlankCursor + + + 0 + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi';"></p></body></html> + + + + + + + + + + 5 + 5 + 620 + 100 + + + + + 0 + 0 + + + + + 620 + 100 + + + + + 16777215 + 80 + + + + false + + + + + 0 + 0 + 500 + 53 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 60 + + + + + 60 + 16777215 + + + + + + + :/image/reset.png + + + + + + + + + 0 + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨线开关 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 喷头盖开 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水缸满 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 溶剂液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 回收故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 粘度故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 相位故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 高压故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 故障恢复 + + + + + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + + + + 110 + 0 + + + + + 110 + 16777215 + + + + 立即重新计米 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + Qt::Horizontal + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品总计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + Qt::Horizontal + + + + + + + + 110 + 35 + + + + + 130 + 16777215 + + + + Qt::LeftToRight + + + false + + + 关机 + + + + :/icon/poweroff.png:/icon/poweroff.png + + + + + + + + + 7 + + + 5 + + + 0 + + + + + 6 + + + 3 + + + 0 + + + 0 + + + 3 + + + + + 1 + + + 0 + + + + + 3 + + + + + + 0 + 20 + + + + + 16524 + 16777215 + + + + + + + true + + + + + + + + + 2 + + + + + 4 + + + 3 + + + 0 + + + + + + 0 + 20 + + + + + 1000 + 20 + + + + 粘度 + + + + + + + + 0 + 20 + + + + + 10000 + 20 + + + + 压力 + + + + + + + + 1000 + 20 + + + + 隔膜位置 + + + + + + + + 1000 + 20 + + + + 晶振电压 + + + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 70 + 0 + + + + + 1000 + 20 + + + + + + + + + + + + 64 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 0 + 20 + + + + + 600 + 16777215 + + + + QFrame::NoFrame + + + + + + + + + + + 0 + 0 + + + + + 600 + 20 + + + + 2014-08-23 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + 0 + 50 + + + + + 80 + 16777215 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 147 + 146 + 146 + + + + + + + + 开 + + + + :/icon/openreclaimtanl.png:/icon/openreclaimtanl.png + + + + + + + + 60 + 0 + + + + + 70 + 60 + + + + + + + + + + + + 0 + 50 + + + + + 80 + 16777215 + + + + 关 + + + + :/icon/closereclaimtanl.png:/icon/closereclaimtanl.png + + + + + + + + + + + + + 0 + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 0 + 170 + 0 + + + + + + + 85 + 170 + 127 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 186 + 188 + 185 + + + + + + + 242 + 241 + 240 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/startprint2.png + :/icon/startprint1.png + :/icon/startprint1.png + :/icon/startprint.png:/icon/startprint2.png + + + + 110 + 70 + + + + false + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 199 + 189 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 227 + 97 + 75 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 227 + 97 + 75 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/stopprint2.png + :/icon/stopprint1.png + :/icon/stopprint1.png + :/icon/stopprint.png:/icon/stopprint2.png + + + + 110 + 70 + + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + + + + + + 255 + 170 + 0 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 206 + 203 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/pauseprint2.png + :/icon/pauseprint1.png + :/icon/pauseprint1.png + :/icon/pauseprint.png:/icon/pauseprint2.png + + + + 110 + 70 + + + + + + + + + 0 + 70 + + + + + 110 + 16777215 + + + + 喷嘴逆清洗 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + PicWidget + QWidget +
PicWidget.h
+ 1 +
+ + ClickLabel + QLabel +
ClickLabel.h
+
+ + TextEditOption + QWidget +
TextEditOption.h
+ 1 +
+ + PrintTextDisplay + QWidget +
PrintTextDisplay.h
+ 1 +
+ + MyTextEdit + QTextEdit +
MyTextEdit.h
+
+
+ + + + +
diff --git a/InkJetPrinter.cpp b/InkJetPrinter.cpp new file mode 100644 index 0000000..7327881 --- /dev/null +++ b/InkJetPrinter.cpp @@ -0,0 +1,2948 @@ +#include "InkJetPrinter.h" +#include "ui_inkjetprinter.h" +#include "QDebug" +#include "LogInfo.h" +#include "mainwindow.h" +#include "./Network/NetworkManager.h" +#include "ZkEdit.h" +#include "myinclude.h" +//#include "PIDController/fuzzy_PID.h" +#include +// ℃℉㎡±ΦφΩ◆✪@☢*✿❧ + + +//#define DEBUG_CNT +#define MAX_VOL 300 +#define MIN_VOL 0 +void PID_init(); +#define ONLYCNTCLEAR + +static bool firstTime = 1; +InkJetPrinter::InkJetPrinter(QWidget *parent) : + QTabWidget(parent), + ui(new Ui::InkJetPrinter) +{ + + system("ifconfig eth1 down"); + system("rm /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/*.ttf > tty1"); + + ui->setupUi(this); + + SysPara *para = new SysPara(); + + +// t_label = new QLabel(); +// t_label->setWindowFlags(Qt::WindowStaysOnTopHint); +// t_label->setGeometry(0,0,640,480); +// t_label->setPixmap(QPixmap(QString::fromUtf8(":/image/Turkey_logo.png"))); + + bindSysPara(para); + + ui->tabMainWindow->bindSysPara(para); + sysPara->status.InkOrSOLVEmptyCnt=0; + + t1.start();//calandar_and_dat_t + //qDebug()<<"sizeof(calandar_and_dat_t):"<status):"<para):"<modbusStatus):"<modbusStatus); +// qDebug()<<"sizeof(sysPara->modbusParas):"<modbusParas); +// sysPara_t testSysPara; +// uint8_t *pp = (uint8_t*)&testSysPara; +// testSysPara.totalSynPulseNum = 0x556677; + +// qDebug()<<"offsetof(SysPara, testSysPara):"<<*(pp+0x11); +// qDebug()<<"offsetof(SysPara, testSysPara.totalSynPulseNum):"<<(testSysPara.totalSynPulseNum); + +// //qDebug()<<"offsetof(ModbusPrintParas, printCommand):"<start(); + + ui->tabMainWindow->SetEditMode(sysPara->para.EditMode); + ui->tabOtherInfo->bindSysPara(para); + ui->tabPrintSetting->bindSysPara(para); + ui->tabSystemSetting->bindSysPara(para); + ui->tabOtherInfo->bindSysPara(para); + ui->tabTriggerMode->bindSysPara(para); + ui->tabSystemManage->bindSysPara(para); + //ui->tabSystemManage->bindDlgInputAddr(ui->tabPrintSetting->dlgInputAddr); + ui->tabPicEdit->bindSysPara(para); +//#ifdef __NETWORKMANAGER__ +#if 1 + ui->tabNetworkManager->bindSysPara(para); +#else + //ui->tabNetworkManager->deleteLater(); + removeTab(9); +#endif + + ui->tabMainWindow->updateSysParaToUI(); + ui->tabPrintSetting->updateSysParaToUI(); + ui->tabPrintSetting->getFpgaVersionSetDisable(); + ui->tabSystemSetting->updateSysParaToUI(); + ui->tabOtherInfo->updateSysParaToUI(); + ui->tabTriggerMode->updateSysParaToUI(); + + dlgShowMsg =new DlgShowMsg; + dlgShowMsg->hide(); + + timer = new QTimer(); + connect(timer, SIGNAL(timeout()), this, SLOT(timerHandler())); + timer->start(10); + + viscosity_timer = new QTimer(); + connect(viscosity_timer, SIGNAL(timeout()), this, SLOT(viscosity_timerHandler())); + + jd_timer = new QTimer(); + connect(jd_timer, SIGNAL(timeout()), this, SLOT(jd_timerHandler())); + jd_timer->start(500); + jd_res = 0; + if(sysPara->para.gearPumpEnable) + { + pushButtonStartFlag = true; + } + //connect(this,SIGNAL(SpeedOver(int)),this,SLOT(OnSpeedOver(int))); + + connect(this,SIGNAL(currentChanged(int)),this,SLOT(onInkJetPrinterCurrentChanged(int))); + + connect(this,SIGNAL(setReclaimTankCurrentPos(int)),ui->tabMainWindow,SLOT(onReclainTankPositionChanged(int))); + + connect(this,SIGNAL(reclaimTankCloseDone()),ui->tabMainWindow,SLOT(checkForPowerOff())); + connect(this,SIGNAL(reclaimTankBlock()),this,SLOT(onReclaimTankBlock())); + connect(ui->tabPrintSetting,SIGNAL(authChanged(int)),this,SLOT(onAuthChanged(int))); + connect (this,SIGNAL(sendPicScene(PicScene*)),ui->tabPrintSetting,SLOT(updateUIForSpecialCondition(PicScene*))); + + connect(ui->tabPrintSetting,SIGNAL(authChanged(int)),ui->tabOtherInfo,SLOT(onAuthChanged(int))); + //test + connect(ui->tabMainWindow,SIGNAL(InkjetCleanUP()),ui->tabSystemSetting,SLOT(on_pushButtonCleanUP_pressed())); + connect(ui->tabMainWindow,SIGNAL(clearPressureFault()),this,SLOT(resetPressureCnt())); + connect(ui->tabSystemSetting,SIGNAL(pressureAdjust()),this,SLOT(pressureAdjustForsystemseeting())); + +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + connect(this,SIGNAL(updateCnt1GroupDisp(bool)),ui->tabPrintSetting,SLOT(onUpdateCnt1GroupDisp(bool))); +#endif + + msgtest = new QMessageBox(this); + connect(msgtest, SIGNAL(finished(int)), this, SLOT(OnFinished(int))); + +#ifdef MIMA + connect(ui->tabPrintSetting->dlgInputAddr,SIGNAL(printErrorStatus(QString,unsigned int)),this,SLOT(onPrintErrorStatus(QString,unsigned int)));// +#endif + connect(ui->tabSystemSetting,SIGNAL(changeEditMode(int)),this,SLOT(onchangeEditMode(int))); + // connect(ui->tabSystemSetting,SIGNAL(changeEditMode(int)),ui->tabMainWindow,SLOT(changeEditMode(int))); + connect(ui->tabSystemSetting,SIGNAL(setRunStatus(QString )),ui->tabMainWindow,SLOT(setRunStatus(QString))); + + connect(ui->tabSystemManage,SIGNAL(enableReclaimButton(bool)),ui->tabMainWindow,SLOT(onEnableReclaimCtrlButton(bool))); + connect(ui->tabSystemManage,SIGNAL(configChanged(void)),this,SLOT(onConfigChanged(void))); + connect(ui->tabPrintSetting, SIGNAL(change_OutputPulse()), ui->tabTriggerMode, SLOT(OutputPulse())); + connect (ui->tabMainWindow,SIGNAL(openFileChange()),ui->tabPrintSetting,SLOT( PrintupdateSysParaToUI() )); + connect (ui->tabMainWindow,SIGNAL(openFileChange()),ui->tabSystemSetting,SLOT( SystemupdateSysParaToUI() )); + connect (ui->tabMainWindow,SIGNAL(openFileChange()),ui->tabOtherInfo,SLOT( OtherupdateSysParaToUI() )); + connect (ui->tabMainWindow,SIGNAL(openFileChange()),ui->tabTriggerMode,SLOT( TriggerupdateSysParaToUI() )); + connect (ui->tabMainWindow,SIGNAL(openFileChange()),ui->tabMainWindow->getTexteditOption(),SLOT( updateSysParaToZero() )); + connect (ui->tabMainWindow,SIGNAL(setMainTabNow(int)),this,SLOT(setCurrentIndex(int))); + //if(sysPara->para.EditMode==PICFILE){ + connect(ui->tabPrintSetting,SIGNAL(authChanged(int)),ui->tabPicEdit,SLOT(updateAuthorization(int)));// 字库编辑使能 + connect (ui->tabPicEdit,SIGNAL(setMainTabNow(int)),this,SLOT(setCurrentIndex(int))); + connect (ui->tabPicEdit ,SIGNAL(openCurrentFile (QString ,bool )),ui->tabMainWindow,SLOT(openPicFIleOpen(QString ,bool ))); + connect (ui->tabMainWindow,SIGNAL(openCurrFile(QString)),ui->tabPicEdit,SLOT( EditCurrFile(QString))); + connect (ui->tabPicEdit ,SIGNAL(setMainTabEdit (int)),ui->tabMainWindow,SLOT(SetMainTabEdit(int))); + //} + //connect (ui->tabPrintSetting,SIGNAL(setMainTabNow(int)),this,SLOT(setCurrentIndex(int))); + + connect (ui->tabMainWindow,SIGNAL(openCurrFile(QString)),this,SLOT(onChangeTab(QString))); + + connect (ui->tabMainWindow,SIGNAL(CloseJd()),this,SLOT(close_jd_timer())); + + connect (ui->tabMainWindow,SIGNAL(pushButtonStartPressed(bool)),this,SLOT(handlePushButtonStartPressed(bool))); + connect (ui->tabMainWindow,SIGNAL(repeatInitedPid()),this,SLOT(handleInitedPID())); + connect (ui->tabMainWindow,SIGNAL(setCNT1Select(bool)),ui->tabPrintSetting,SLOT(setCNT1BackColor(bool))); + connect (ui->tabMainWindow,SIGNAL(setCNT2Select(bool)),ui->tabPrintSetting,SLOT(setCNT2BackColor(bool))); + connect (ui->tabMainWindow,SIGNAL(setCNT3Select(bool)),ui->tabPrintSetting,SLOT(setCNT3BackColor(bool))); + connect(ui->tabMainWindow,SIGNAL(setDisableAll()),this,SLOT(disableTabClick())); + + sysPara->status.rWarnViscoReady=0; + +#ifdef SYS_LINUX + onAuthChanged(AUTH_NONE); +#else + onAuthChanged(AUTH_NONE | AUTH_SUPER_USER2 |AUTH_DISPLAY_SYSTEM_SETTING| 0xffff); +#endif + + + + sysPara->status.WorkTimeOut=0; + ui->tabMainWindow->changeEditMode(0); + emit onchangeEditMode(0); // 20140912 + sysPara->devOp->printCtrl( PRINT_CTRL_STOP); +#ifdef MYTEST + onAuthChanged(AUTH_NONE | AUTH_SUPER_USER2 |AUTH_DISPLAY_SYSTEM_SETTING| 0xffff); +#else + ui->tabMainWindow->on_pushButtonReclaimTankClose_pressed(); +#endif + + sysPara->status.viscosityFaultCnt=0; + setCurrentIndex(0); + sysPara->status.updateSoftEN=0; + sysPara->status.adjHightVolInitEN=0; + sysPara->status.FileChangeRestCntFlag=0; + sysPara->status.HVFaultCloseEn=0; + sysPara->devOp->printCtrl( PRINT_CTRL_STOP); + sysPara->devOp->writeFpgaCalandar(1);// + //qDebug()<para.calandar_and_dat.year; + sysPara->status.cnt1GroupRunningIndex=0; + //sysPara->status.cnt1RepeatCurrent=0; + sysPara->status.cnt1GroupCurrentLoop=0; + + //JSON data + connect(ui->tabNetworkManager, SIGNAL(updateJSONData()), ui->tabMainWindow, SLOT(JSON_UpdateDATA()), Qt::QueuedConnection); + connect(ui->tabNetworkManager,SIGNAL(net_stopPrint()),ui->tabMainWindow,SLOT(on_pushButtonStopPrint_pressed()), Qt::QueuedConnection); + connect(ui->tabMainWindow,SIGNAL(getJSONData()),ui->tabNetworkManager,SLOT(on_GetJsonpushButton_clicked()), Qt::QueuedConnection); + connect(ui->tabNetworkManager,SIGNAL(OpenNewFile()),ui->tabMainWindow->getTexteditOption(),SLOT(onOpenNewFile()), Qt::QueuedConnection); + //JSON data +#ifdef MODBUS + + modbus = NULL; + memset((uint8_t *)&sysPara->modbusParas, 0, sizeof(sysPara->modbusParas)); + sysPara->modbusStatus.receiveEnbleFlag = 1; + snprintf((char *)sysPara->modbusParas.selectFileName, sizeof(sysPara->modbusParas.selectFileName), "%s",QFileInfo(sysPara->para.lastOpenedFileName).fileName().toAscii().constData()); + modbus = new ModbusTcp(&sysPara->modbusParas, &sysPara->modbusStatus); + connect(modbus, SIGNAL(updateQRcode()), ui->tabMainWindow, SLOT(modbusUpdateQRCode()), Qt::QueuedConnection); + connect(modbus, SIGNAL(openFile(QString,bool)), ui->tabMainWindow->getTexteditOption(), SLOT(onFileOpen(QString,bool)), Qt::QueuedConnection); + connect(modbus, SIGNAL(startPrint()), ui->tabMainWindow, SLOT(on_pushButtonStartPrint_pressed()), Qt::QueuedConnection); + connect(modbus, SIGNAL(pausePrint()), ui->tabMainWindow, SLOT(on_pushButtonPausePrint_pressed()), Qt::QueuedConnection);//暂时屏蔽排除问题 + connect(modbus,SIGNAL(stopPrint()),ui->tabMainWindow,SLOT(on_pushButtonStopPrint_pressed()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar()),this,SLOT(onModbusWriteCalendar()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar1()),this,SLOT(onModbusWriteCalendar1CurrValue()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar1EndValue()),this,SLOT(onModbusWriteCalendar1EndValue()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar2EndValue()),this,SLOT(onModbusWriteCalendar2EndValue()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar2RepeatValue()),this,SLOT(onModbusWriteCalendar2RepeatValue()), Qt::QueuedConnection); + connect(modbus,SIGNAL(writeCalendar2InitValue()),this,SLOT(onModbusWriteCalendar2InitValue()), Qt::QueuedConnection); + connect(modbus,SIGNAL(CNTResetNow()),ui->tabMainWindow,SLOT(onModbusCNTResetNowPressed()), Qt::QueuedConnection); + connect(modbus,SIGNAL(faultResume()),ui->tabMainWindow,SLOT(onLabelFaultRusumePressed()), Qt::QueuedConnection); + connect(modbus,SIGNAL(receivedPrintContent(int)),ui->tabMainWindow,SLOT(onModbusPrintReceivedContent(int)), Qt::QueuedConnection); + connect(modbus,SIGNAL(mbLineAndCharSpace(int, int)),ui->tabMainWindow->getTexteditOption(),SLOT(onMbSetLineAndChar(int, int)), Qt::QueuedConnection); + connect(this,SIGNAL(updataPara2UI()),ui->tabPrintSetting,SLOT( PrintupdateSysParaToUI() ), Qt::QueuedConnection); + connect(this, SIGNAL(openFile(QString,bool)), ui->tabMainWindow->getTexteditOption(), SLOT(onFileOpen(QString,bool)), Qt::QueuedConnection); + connect(this, SIGNAL(startPrint()), ui->tabMainWindow, SLOT(on_pushButtonStartPrint_pressed()), Qt::QueuedConnection); +#endif + ui->tabMainWindow->enableReclaimCtrlButton(false); +#ifdef __STC_POWER__ + if(sysPara->devOp->getPowerSource() == POWER_SOURCE_TIMER) + { + sysPara->status.powerSource = POWER_SOURCE_TIMER; + sysPara->status.needPowerOffTimerout = 1; + sysPara->status.waitPowerOffTime = 18; //运行半个钟 + LogInfo::setRunStatusText(tr("定时开机")); + //qDebug()<<"power by:"<< sysPara->status.powerSource; + } + else + { + sysPara->status.powerSource = POWER_SOURCE_KEY; + sysPara->status.needPowerOffTimerout = 0; + } + sysPara->devOp->setWakeUpTimer('3'); + qDebug()<<"power by:"<< sysPara->status.powerSource; +#endif + //pidControllerInit(); + PID_init(); + + +#ifndef __DAC_ADJ_FUNCTION__ + qDebug()<<"__DAC_ADJ_FUNCTION__"; + removeTab(indexOf(ui->tabDacAdjust)); + removeTab(indexOf(ui->tabFpgaDebug)); +#else + +// qDebug()<<"!!!!!!!!!!!!!!!!!!!!deleteLater"; + + removeTab(indexOf(ui->tabDacAdjust)); + removeTab(indexOf(ui->tabFpgaDebug)); +// removeTab(indexOf(ui->tabNetworkManager)); + ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tab_3)); + + ui->vol0SpinBox->setMinimum(0); + ui->vol1SpinBox->setMinimum(0); + ui->vol2SpinBox->setMinimum(0); + ui->vol3SpinBox->setMinimum(0); + ui->vol4SpinBox->setMinimum(0); + ui->vol5SpinBox->setMinimum(0); + ui->vol6SpinBox->setMinimum(0); + ui->vol7SpinBox->setMinimum(0); + ui->vol8SpinBox->setMinimum(0); + ui->vol9SpinBox->setMinimum(0); + ui->vol10SpinBox->setMinimum(0); + ui->vol11SpinBox->setMinimum(0); + ui->vol12SpinBox->setMinimum(0); + ui->vol13SpinBox->setMinimum(0); + ui->vol14SpinBox->setMinimum(0); + ui->vol15SpinBox->setMinimum(0); + ui->vol16SpinBox->setMinimum(0); + ui->vol17SpinBox->setMinimum(0); + ui->vol18SpinBox->setMinimum(0); + ui->vol19SpinBox->setMinimum(0); + ui->vol20SpinBox->setMinimum(0); + ui->vol21SpinBox->setMinimum(0); + ui->vol22SpinBox->setMinimum(0); + ui->vol23SpinBox->setMinimum(0); + ui->vol24SpinBox->setMinimum(0); + ui->vol25SpinBox->setMinimum(0); + ui->vol26SpinBox->setMinimum(0); + ui->vol27SpinBox->setMinimum(0); + ui->vol28SpinBox->setMinimum(0); + ui->vol29SpinBox->setMinimum(0); + ui->vol30SpinBox->setMinimum(0); + ui->vol31SpinBox->setMinimum(0); + ui->vol32SpinBox->setMinimum(0); + ui->vol33SpinBox->setMinimum(0); + ui->vol34SpinBox->setMinimum(0); + ui->vol35SpinBox->setMinimum(0); + ui->vol36SpinBox->setMinimum(0); + ui->vol37SpinBox->setMinimum(0); + ui->vol38SpinBox->setMinimum(0); + ui->vol39SpinBox->setMinimum(0); + + ui->vol0SpinBox->setMaximum(MAX_VOL); + ui->vol1SpinBox->setMaximum(MAX_VOL); + ui->vol2SpinBox->setMaximum(MAX_VOL); + ui->vol3SpinBox->setMaximum(MAX_VOL); + ui->vol4SpinBox->setMaximum(MAX_VOL); + ui->vol5SpinBox->setMaximum(MAX_VOL); + ui->vol6SpinBox->setMaximum(MAX_VOL); + ui->vol7SpinBox->setMaximum(MAX_VOL); + ui->vol8SpinBox->setMaximum(MAX_VOL); + ui->vol9SpinBox->setMaximum(MAX_VOL); + ui->vol10SpinBox->setMaximum(MAX_VOL); + ui->vol11SpinBox->setMaximum(MAX_VOL); + ui->vol12SpinBox->setMaximum(MAX_VOL); + ui->vol13SpinBox->setMaximum(MAX_VOL); + ui->vol14SpinBox->setMaximum(MAX_VOL); + ui->vol15SpinBox->setMaximum(MAX_VOL); + ui->vol16SpinBox->setMaximum(MAX_VOL); + ui->vol17SpinBox->setMaximum(MAX_VOL); + ui->vol18SpinBox->setMaximum(MAX_VOL); + ui->vol19SpinBox->setMaximum(MAX_VOL); + ui->vol20SpinBox->setMaximum(MAX_VOL); + ui->vol21SpinBox->setMaximum(MAX_VOL); + ui->vol22SpinBox->setMaximum(MAX_VOL); + ui->vol23SpinBox->setMaximum(MAX_VOL); + ui->vol24SpinBox->setMaximum(MAX_VOL); + ui->vol25SpinBox->setMaximum(MAX_VOL); + ui->vol26SpinBox->setMaximum(MAX_VOL); + ui->vol27SpinBox->setMaximum(MAX_VOL); + ui->vol28SpinBox->setMaximum(MAX_VOL); + ui->vol29SpinBox->setMaximum(MAX_VOL); + ui->vol30SpinBox->setMaximum(MAX_VOL); + ui->vol31SpinBox->setMaximum(MAX_VOL); + ui->vol32SpinBox->setMaximum(MAX_VOL); + ui->vol33SpinBox->setMaximum(MAX_VOL); + ui->vol34SpinBox->setMaximum(MAX_VOL); + ui->vol35SpinBox->setMaximum(MAX_VOL); + ui->vol36SpinBox->setMaximum(MAX_VOL); + ui->vol37SpinBox->setMaximum(MAX_VOL); + ui->vol38SpinBox->setMaximum(MAX_VOL); + ui->vol39SpinBox->setMaximum(MAX_VOL); + + ui->fvol0SpinBox->setMinimum(0); + ui->fvol1SpinBox->setMinimum(0); + ui->fvol2SpinBox->setMinimum(0); + ui->fvol3SpinBox->setMinimum(0); + ui->fvol4SpinBox->setMinimum(0); + ui->fvol5SpinBox->setMinimum(0); + ui->fvol6SpinBox->setMinimum(0); + ui->fvol7SpinBox->setMinimum(0); + ui->fvol8SpinBox->setMinimum(0); + ui->fvol9SpinBox->setMinimum(0); + ui->fvol10SpinBox->setMinimum(0); + ui->fvol11SpinBox->setMinimum(0); + ui->fvol12SpinBox->setMinimum(0); + ui->fvol13SpinBox->setMinimum(0); + ui->fvol14SpinBox->setMinimum(0); + ui->fvol15SpinBox->setMinimum(0); + ui->fvol16SpinBox->setMinimum(0); + ui->fvol17SpinBox->setMinimum(0); + ui->fvol18SpinBox->setMinimum(0); + ui->fvol19SpinBox->setMinimum(0); + ui->fvol20SpinBox->setMinimum(0); + ui->fvol21SpinBox->setMinimum(0); + ui->fvol22SpinBox->setMinimum(0); + ui->fvol23SpinBox->setMinimum(0); + ui->fvol24SpinBox->setMinimum(0); + ui->fvol25SpinBox->setMinimum(0); + ui->fvol26SpinBox->setMinimum(0); + ui->fvol27SpinBox->setMinimum(0); + ui->fvol28SpinBox->setMinimum(0); + ui->fvol29SpinBox->setMinimum(0); + ui->fvol30SpinBox->setMinimum(0); + ui->fvol31SpinBox->setMinimum(0); + ui->fvol32SpinBox->setMinimum(0); + ui->fvol33SpinBox->setMinimum(0); + ui->fvol34SpinBox->setMinimum(0); + ui->fvol35SpinBox->setMinimum(0); + ui->fvol36SpinBox->setMinimum(0); + ui->fvol37SpinBox->setMinimum(0); + ui->fvol38SpinBox->setMinimum(0); + ui->fvol39SpinBox->setMinimum(0); + + ui->fvol0SpinBox->setMaximum(MAX_VOL); + ui->fvol1SpinBox->setMaximum(MAX_VOL); + ui->fvol2SpinBox->setMaximum(MAX_VOL); + ui->fvol3SpinBox->setMaximum(MAX_VOL); + ui->fvol4SpinBox->setMaximum(MAX_VOL); + ui->fvol5SpinBox->setMaximum(MAX_VOL); + ui->fvol6SpinBox->setMaximum(MAX_VOL); + ui->fvol7SpinBox->setMaximum(MAX_VOL); + ui->fvol8SpinBox->setMaximum(MAX_VOL); + ui->fvol9SpinBox->setMaximum(MAX_VOL); + ui->fvol10SpinBox->setMaximum(MAX_VOL); + ui->fvol11SpinBox->setMaximum(MAX_VOL); + ui->fvol12SpinBox->setMaximum(MAX_VOL); + ui->fvol13SpinBox->setMaximum(MAX_VOL); + ui->fvol14SpinBox->setMaximum(MAX_VOL); + ui->fvol15SpinBox->setMaximum(MAX_VOL); + ui->fvol16SpinBox->setMaximum(MAX_VOL); + ui->fvol17SpinBox->setMaximum(MAX_VOL); + ui->fvol18SpinBox->setMaximum(MAX_VOL); + ui->fvol19SpinBox->setMaximum(MAX_VOL); + ui->fvol20SpinBox->setMaximum(MAX_VOL); + ui->fvol21SpinBox->setMaximum(MAX_VOL); + ui->fvol22SpinBox->setMaximum(MAX_VOL); + ui->fvol23SpinBox->setMaximum(MAX_VOL); + ui->fvol24SpinBox->setMaximum(MAX_VOL); + ui->fvol25SpinBox->setMaximum(MAX_VOL); + ui->fvol26SpinBox->setMaximum(MAX_VOL); + ui->fvol27SpinBox->setMaximum(MAX_VOL); + ui->fvol28SpinBox->setMaximum(MAX_VOL); + ui->fvol29SpinBox->setMaximum(MAX_VOL); + ui->fvol30SpinBox->setMaximum(MAX_VOL); + ui->fvol31SpinBox->setMaximum(MAX_VOL); + ui->fvol32SpinBox->setMaximum(MAX_VOL); + ui->fvol33SpinBox->setMaximum(MAX_VOL); + ui->fvol34SpinBox->setMaximum(MAX_VOL); + ui->fvol35SpinBox->setMaximum(MAX_VOL); + ui->fvol36SpinBox->setMaximum(MAX_VOL); + ui->fvol37SpinBox->setMaximum(MAX_VOL); + ui->fvol38SpinBox->setMaximum(MAX_VOL); + ui->fvol39SpinBox->setMaximum(MAX_VOL); + + ui->cVol0SpinBox->setMinimum(0); + ui->cVol1SpinBox->setMinimum(0); + ui->cVol2SpinBox->setMinimum(0); + ui->cVol3SpinBox->setMinimum(0); + ui->cVol4SpinBox->setMinimum(0); + ui->cVol5SpinBox->setMinimum(0); + ui->cVol6SpinBox->setMinimum(0); + ui->cVol7SpinBox->setMinimum(0); + ui->cVol8SpinBox->setMinimum(0); + ui->cVol9SpinBox->setMinimum(0); + ui->cVol10SpinBox->setMinimum(0); + ui->cVol11SpinBox->setMinimum(0); + ui->cVol12SpinBox->setMinimum(0); + ui->cVol13SpinBox->setMinimum(0); + ui->cVol14SpinBox->setMinimum(0); + ui->cVol15SpinBox->setMinimum(0); + ui->cVol16SpinBox->setMinimum(0); + ui->cVol17SpinBox->setMinimum(0); + ui->cVol18SpinBox->setMinimum(0); + ui->cVol19SpinBox->setMinimum(0); + ui->cVol20SpinBox->setMinimum(0); + ui->cVol21SpinBox->setMinimum(0); + ui->cVol22SpinBox->setMinimum(0); + ui->cVol23SpinBox->setMinimum(0); + ui->cVol24SpinBox->setMinimum(0); + ui->cVol25SpinBox->setMinimum(0); + ui->cVol26SpinBox->setMinimum(0); + ui->cVol27SpinBox->setMinimum(0); + ui->cVol28SpinBox->setMinimum(0); + ui->cVol29SpinBox->setMinimum(0); + ui->cVol30SpinBox->setMinimum(0); + ui->cVol31SpinBox->setMinimum(0); + ui->cVol32SpinBox->setMinimum(0); + ui->cVol33SpinBox->setMinimum(0); + ui->cVol34SpinBox->setMinimum(0); + ui->cVol35SpinBox->setMinimum(0); + ui->cVol36SpinBox->setMinimum(0); + ui->cVol37SpinBox->setMinimum(0); + ui->cVol38SpinBox->setMinimum(0); + ui->cVol39SpinBox->setMinimum(0); + + ui->cVol0SpinBox->setMaximum(MAX_VOL); + ui->cVol1SpinBox->setMaximum(MAX_VOL); + ui->cVol2SpinBox->setMaximum(MAX_VOL); + ui->cVol3SpinBox->setMaximum(MAX_VOL); + ui->cVol4SpinBox->setMaximum(MAX_VOL); + ui->cVol5SpinBox->setMaximum(MAX_VOL); + ui->cVol6SpinBox->setMaximum(MAX_VOL); + ui->cVol7SpinBox->setMaximum(MAX_VOL); + ui->cVol8SpinBox->setMaximum(MAX_VOL); + ui->cVol9SpinBox->setMaximum(MAX_VOL); + ui->cVol10SpinBox->setMaximum(MAX_VOL); + ui->cVol11SpinBox->setMaximum(MAX_VOL); + ui->cVol12SpinBox->setMaximum(MAX_VOL); + ui->cVol13SpinBox->setMaximum(MAX_VOL); + ui->cVol14SpinBox->setMaximum(MAX_VOL); + ui->cVol15SpinBox->setMaximum(MAX_VOL); + ui->cVol16SpinBox->setMaximum(MAX_VOL); + ui->cVol17SpinBox->setMaximum(MAX_VOL); + ui->cVol18SpinBox->setMaximum(MAX_VOL); + ui->cVol19SpinBox->setMaximum(MAX_VOL); + ui->cVol20SpinBox->setMaximum(MAX_VOL); + ui->cVol21SpinBox->setMaximum(MAX_VOL); + ui->cVol22SpinBox->setMaximum(MAX_VOL); + ui->cVol23SpinBox->setMaximum(MAX_VOL); + ui->cVol24SpinBox->setMaximum(MAX_VOL); + ui->cVol25SpinBox->setMaximum(MAX_VOL); + ui->cVol26SpinBox->setMaximum(MAX_VOL); + ui->cVol27SpinBox->setMaximum(MAX_VOL); + ui->cVol28SpinBox->setMaximum(MAX_VOL); + ui->cVol29SpinBox->setMaximum(MAX_VOL); + ui->cVol30SpinBox->setMaximum(MAX_VOL); + ui->cVol31SpinBox->setMaximum(MAX_VOL); + ui->cVol32SpinBox->setMaximum(MAX_VOL); + ui->cVol33SpinBox->setMaximum(MAX_VOL); + ui->cVol34SpinBox->setMaximum(MAX_VOL); + ui->cVol35SpinBox->setMaximum(MAX_VOL); + ui->cVol36SpinBox->setMaximum(MAX_VOL); + ui->cVol37SpinBox->setMaximum(MAX_VOL); + ui->cVol38SpinBox->setMaximum(MAX_VOL); + ui->cVol39SpinBox->setMaximum(MAX_VOL); + + loadVoltageValue(); + connect(ui->savePushButton,SIGNAL(clicked()), this,SLOT( DacAdjustStore())); +#endif +#ifdef __FPGA_DEBUG__ + connect(ui->fpgaWriteBytePushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugWriteByte())); + connect(ui->fpgaReadBytePushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugReadByte())); + + connect(ui->fpgaWriteWordPushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugWriteWord())); + connect(ui->fpgaReadWordPushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugReadWord())); + + connect(ui->fpgaWriteDWordPushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugWriteDWord())); + connect(ui->fpgaReadDWordPushButton,SIGNAL(clicked()), this,SLOT( fpgaDebugReadDWord())); +#endif + sysPara->status.statWarn = sysPara->status.statWarn | WARN_STATUS_INK_WARN; //先置墨水标示为1 +} + + +void InkJetPrinter::loadVoltageValue() +{ +#ifdef __DAC_ADJ_FUNCTION__ + ui->vol0SpinBox->setValue(sysPara->para.printed_adj_dac[0]); + ui->vol1SpinBox->setValue(sysPara->para.printed_adj_dac[1]); + ui->vol2SpinBox->setValue(sysPara->para.printed_adj_dac[2]); + ui->vol3SpinBox->setValue(sysPara->para.printed_adj_dac[3]); + ui->vol4SpinBox->setValue(sysPara->para.printed_adj_dac[4]); + ui->vol5SpinBox->setValue(sysPara->para.printed_adj_dac[5]); + ui->vol6SpinBox->setValue(sysPara->para.printed_adj_dac[6]); + ui->vol7SpinBox->setValue(sysPara->para.printed_adj_dac[7]); + ui->vol8SpinBox->setValue(sysPara->para.printed_adj_dac[8]); + ui->vol9SpinBox->setValue(sysPara->para.printed_adj_dac[9]); + + ui->vol10SpinBox->setValue(sysPara->para.printed_adj_dac[10]); + ui->vol11SpinBox->setValue(sysPara->para.printed_adj_dac[11]); + ui->vol12SpinBox->setValue(sysPara->para.printed_adj_dac[12]); + ui->vol13SpinBox->setValue(sysPara->para.printed_adj_dac[13]); + ui->vol14SpinBox->setValue(sysPara->para.printed_adj_dac[14]); + ui->vol15SpinBox->setValue(sysPara->para.printed_adj_dac[15]); + ui->vol16SpinBox->setValue(sysPara->para.printed_adj_dac[16]); + ui->vol17SpinBox->setValue(sysPara->para.printed_adj_dac[17]); + ui->vol18SpinBox->setValue(sysPara->para.printed_adj_dac[18]); + ui->vol19SpinBox->setValue(sysPara->para.printed_adj_dac[19]); + + ui->vol20SpinBox->setValue(sysPara->para.printed_adj_dac[20]); + ui->vol21SpinBox->setValue(sysPara->para.printed_adj_dac[21]); + ui->vol22SpinBox->setValue(sysPara->para.printed_adj_dac[22]); + ui->vol23SpinBox->setValue(sysPara->para.printed_adj_dac[23]); + ui->vol24SpinBox->setValue(sysPara->para.printed_adj_dac[24]); + ui->vol25SpinBox->setValue(sysPara->para.printed_adj_dac[25]); + ui->vol26SpinBox->setValue(sysPara->para.printed_adj_dac[26]); + ui->vol27SpinBox->setValue(sysPara->para.printed_adj_dac[27]); + ui->vol28SpinBox->setValue(sysPara->para.printed_adj_dac[28]); + ui->vol29SpinBox->setValue(sysPara->para.printed_adj_dac[29]); + + ui->vol30SpinBox->setValue(sysPara->para.printed_adj_dac[30]); + ui->vol31SpinBox->setValue(sysPara->para.printed_adj_dac[31]); + ui->vol32SpinBox->setValue(sysPara->para.printed_adj_dac[32]); + ui->vol33SpinBox->setValue(sysPara->para.printed_adj_dac[33]); + ui->vol34SpinBox->setValue(sysPara->para.printed_adj_dac[34]); + ui->vol35SpinBox->setValue(sysPara->para.printed_adj_dac[35]); + ui->vol36SpinBox->setValue(sysPara->para.printed_adj_dac[36]); + ui->vol37SpinBox->setValue(sysPara->para.printed_adj_dac[37]); + ui->vol38SpinBox->setValue(sysPara->para.printed_adj_dac[38]); + ui->vol39SpinBox->setValue(sysPara->para.printed_adj_dac[39]); + + ui->cVol0SpinBox->setValue(sysPara->para.printed_continue_col_dac[0]); + ui->cVol1SpinBox->setValue(sysPara->para.printed_continue_col_dac[1]); + ui->cVol2SpinBox->setValue(sysPara->para.printed_continue_col_dac[2]); + ui->cVol3SpinBox->setValue(sysPara->para.printed_continue_col_dac[3]); + ui->cVol4SpinBox->setValue(sysPara->para.printed_continue_col_dac[4]); + ui->cVol5SpinBox->setValue(sysPara->para.printed_continue_col_dac[5]); + ui->cVol6SpinBox->setValue(sysPara->para.printed_continue_col_dac[6]); + ui->cVol7SpinBox->setValue(sysPara->para.printed_continue_col_dac[7]); + ui->cVol8SpinBox->setValue(sysPara->para.printed_continue_col_dac[8]); + ui->cVol9SpinBox->setValue(sysPara->para.printed_continue_col_dac[9]); + + ui->cVol10SpinBox->setValue(sysPara->para.printed_continue_col_dac[10]); + ui->cVol11SpinBox->setValue(sysPara->para.printed_continue_col_dac[11]); + ui->cVol12SpinBox->setValue(sysPara->para.printed_continue_col_dac[12]); + ui->cVol13SpinBox->setValue(sysPara->para.printed_continue_col_dac[13]); + ui->cVol14SpinBox->setValue(sysPara->para.printed_continue_col_dac[14]); + ui->cVol15SpinBox->setValue(sysPara->para.printed_continue_col_dac[15]); + ui->cVol16SpinBox->setValue(sysPara->para.printed_continue_col_dac[16]); + ui->cVol17SpinBox->setValue(sysPara->para.printed_continue_col_dac[17]); + ui->cVol18SpinBox->setValue(sysPara->para.printed_continue_col_dac[18]); + ui->cVol19SpinBox->setValue(sysPara->para.printed_continue_col_dac[19]); + + ui->cVol20SpinBox->setValue(sysPara->para.printed_continue_col_dac[20]); + ui->cVol21SpinBox->setValue(sysPara->para.printed_continue_col_dac[21]); + ui->cVol22SpinBox->setValue(sysPara->para.printed_continue_col_dac[22]); + ui->cVol23SpinBox->setValue(sysPara->para.printed_continue_col_dac[23]); + ui->cVol24SpinBox->setValue(sysPara->para.printed_continue_col_dac[24]); + ui->cVol25SpinBox->setValue(sysPara->para.printed_continue_col_dac[25]); + ui->cVol26SpinBox->setValue(sysPara->para.printed_continue_col_dac[26]); + ui->cVol27SpinBox->setValue(sysPara->para.printed_continue_col_dac[27]); + ui->cVol28SpinBox->setValue(sysPara->para.printed_continue_col_dac[28]); + ui->cVol29SpinBox->setValue(sysPara->para.printed_continue_col_dac[29]); + + ui->cVol30SpinBox->setValue(sysPara->para.printed_continue_col_dac[30]); + ui->cVol31SpinBox->setValue(sysPara->para.printed_continue_col_dac[31]); + ui->cVol32SpinBox->setValue(sysPara->para.printed_continue_col_dac[32]); + ui->cVol33SpinBox->setValue(sysPara->para.printed_continue_col_dac[33]); + ui->cVol34SpinBox->setValue(sysPara->para.printed_continue_col_dac[34]); + ui->cVol35SpinBox->setValue(sysPara->para.printed_continue_col_dac[35]); + ui->cVol36SpinBox->setValue(sysPara->para.printed_continue_col_dac[36]); + ui->cVol37SpinBox->setValue(sysPara->para.printed_continue_col_dac[37]); + ui->cVol38SpinBox->setValue(sysPara->para.printed_continue_col_dac[38]); + ui->cVol39SpinBox->setValue(sysPara->para.printed_continue_col_dac[39]); + + ui->fvol0SpinBox->setValue(sysPara->para.printed_full_col_dac[0]); + ui->fvol1SpinBox->setValue(sysPara->para.printed_full_col_dac[1]); + ui->fvol2SpinBox->setValue(sysPara->para.printed_full_col_dac[2]); + ui->fvol3SpinBox->setValue(sysPara->para.printed_full_col_dac[3]); + ui->fvol4SpinBox->setValue(sysPara->para.printed_full_col_dac[4]); + ui->fvol5SpinBox->setValue(sysPara->para.printed_full_col_dac[5]); + ui->fvol6SpinBox->setValue(sysPara->para.printed_full_col_dac[6]); + ui->fvol7SpinBox->setValue(sysPara->para.printed_full_col_dac[7]); + ui->fvol8SpinBox->setValue(sysPara->para.printed_full_col_dac[8]); + ui->fvol9SpinBox->setValue(sysPara->para.printed_full_col_dac[9]); + + ui->fvol10SpinBox->setValue(sysPara->para.printed_full_col_dac[10]); + ui->fvol11SpinBox->setValue(sysPara->para.printed_full_col_dac[11]); + ui->fvol12SpinBox->setValue(sysPara->para.printed_full_col_dac[12]); + ui->fvol13SpinBox->setValue(sysPara->para.printed_full_col_dac[13]); + ui->fvol14SpinBox->setValue(sysPara->para.printed_full_col_dac[14]); + ui->fvol15SpinBox->setValue(sysPara->para.printed_full_col_dac[15]); + ui->fvol16SpinBox->setValue(sysPara->para.printed_full_col_dac[16]); + ui->fvol17SpinBox->setValue(sysPara->para.printed_full_col_dac[17]); + ui->fvol18SpinBox->setValue(sysPara->para.printed_full_col_dac[18]); + ui->fvol19SpinBox->setValue(sysPara->para.printed_full_col_dac[19]); + + ui->fvol20SpinBox->setValue(sysPara->para.printed_full_col_dac[20]); + ui->fvol21SpinBox->setValue(sysPara->para.printed_full_col_dac[21]); + ui->fvol22SpinBox->setValue(sysPara->para.printed_full_col_dac[22]); + ui->fvol23SpinBox->setValue(sysPara->para.printed_full_col_dac[23]); + ui->fvol24SpinBox->setValue(sysPara->para.printed_full_col_dac[24]); + ui->fvol25SpinBox->setValue(sysPara->para.printed_full_col_dac[25]); + ui->fvol26SpinBox->setValue(sysPara->para.printed_full_col_dac[26]); + ui->fvol27SpinBox->setValue(sysPara->para.printed_full_col_dac[27]); + ui->fvol28SpinBox->setValue(sysPara->para.printed_full_col_dac[28]); + ui->fvol29SpinBox->setValue(sysPara->para.printed_full_col_dac[29]); + + ui->fvol30SpinBox->setValue(sysPara->para.printed_full_col_dac[30]); + ui->fvol31SpinBox->setValue(sysPara->para.printed_full_col_dac[31]); + ui->fvol32SpinBox->setValue(sysPara->para.printed_full_col_dac[32]); + ui->fvol33SpinBox->setValue(sysPara->para.printed_full_col_dac[33]); + ui->fvol34SpinBox->setValue(sysPara->para.printed_full_col_dac[34]); + ui->fvol35SpinBox->setValue(sysPara->para.printed_full_col_dac[35]); + ui->fvol36SpinBox->setValue(sysPara->para.printed_full_col_dac[36]); + ui->fvol37SpinBox->setValue(sysPara->para.printed_full_col_dac[37]); + ui->fvol38SpinBox->setValue(sysPara->para.printed_full_col_dac[38]); + ui->fvol39SpinBox->setValue(sysPara->para.printed_full_col_dac[39]); + if(sysPara->para.dacScale < 40 || sysPara->para.dacScale>150) + sysPara->para.dacScale = 100; + //ui->dacScaledSpinBox->setValue(sysPara->para.dacScale); + //memcpy(sysPara->status.printed_adj_dac, sysPara->para.printed_adj_dac, sizeof(sysPara->para.printed_adj_dac)); +#endif +} + +float PID_realize(float speed); + +#if 1 +struct _pid{ + float SetSpeed;//定义设定值 + float ActualSpeed;//定义实际值 + float err;//定义偏差值 + float err_last;//定义上一个偏差值 + float Kp,Ki,Kd;//定义比例、积分、微分系数 + float voltage;//定义电压值(控制执行器的变量) + float integral;//定义积分值 + float integral_max; //积分限幅(根据实际调整) +}pid; + +void PID_init(){ + //cout<<"PID_init begin \n"; + pid.SetSpeed=0.0; + pid.ActualSpeed=0.0; + pid.err=0.0; + pid.err_last=0.0; + pid.voltage=0.0; + pid.integral=0.0; + pid.Kp=0.21; //0.25 + pid.Ki=0.006; //0.015 + pid.Kd=0.0; + //cout<<"PID_init end \n"; +} + +static float u = 1.0; + +float PID_realize(float speed, float act){ + unsigned char index = 1; + pid.SetSpeed=speed; + pid.ActualSpeed = act; + pid.err=pid.SetSpeed-pid.ActualSpeed; + if(u < 900) + { + pid.integral+=pid.err; + } + pid.voltage=pid.Kp*pid.err + index*pid.Ki*pid.integral + pid.Kd*(pid.err-pid.err_last); + pid.err_last=pid.err; + pid.ActualSpeed =pid.voltage*1.0; + return pid.ActualSpeed; +} +#endif +float PID_realize2(float speed, float act){ + pid.Kp = 0.8; + pid.Ki = 0.02; + pid.Kd = 0.5; + pid.integral_max = 12000; + pid.SetSpeed=speed; + pid.ActualSpeed = act; + pid.err=pid.SetSpeed-pid.ActualSpeed; + + float Pout = pid.Kp * pid.err; + pid.integral += pid.err; + if (pid.integral > pid.integral_max) { + pid.integral = pid.integral_max; + } else if (pid.integral < -pid.integral_max) { + pid.integral = -pid.integral_max; + } + float Iout = pid.Ki * pid.integral; + float Dout = pid.Kd * ((pid.err + pid.err_last)/2 - pid.err_last); + + pid.voltage = Pout + Iout + Dout; + pid.err_last=pid.err; + return pid.voltage; +} + +void InkJetPrinter::pressureAdj(int type) +{ + //float u, actual; + signed short delta_u; + signed short old = (signed short)sysPara->para.gearPumpValue; + static unsigned int oldPressure = 0; + static qint32 printOut = 0; + if(printOut++%2 !=0) { + return; + } + int oldTargetPresuure = sysPara->para.pressure; + if(type == 1){ + sysPara->para.pressure = sysPara->para.pressure*1.2; + } + if(!sysPara->status.gearPumpRunStopFlag) + { + if(sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable) + u=PID_realize2((float)sysPara->para.pressure,(float)sysPara->status.PRESSURE); + + else if(u > 0 || ((sysPara->para.pressure - sysPara->status.PRESSURE) > 0) ) + { + u=PID_realize((float)sysPara->para.pressure,(float)sysPara->status.PRESSURE); + } + } + + if(u > 0) + { + sysPara->para.gearPumpValue = (unsigned short)u; + } + else + { + sysPara->para.gearPumpValue = 0; + } + if(sysPara->para.gearPumpValue>800) { + sysPara->para.gearPumpValue = 800; + } + /*********************改回收泵后压力调整*********************************/ + if(sysPara->para.gearPumpValue && sysPara->para.flagOfReclaimPumEnable){ + int maxValue = 200 + (sysPara->para.pressure - 500)*0.1; + if(maxValue > 260) maxValue = 260; + if(sysPara->para.gearPumpValue < 60) + sysPara->para.gearPumpValue = 75; + else if(sysPara->para.gearPumpValue > maxValue) + sysPara->para.gearPumpValue = maxValue; + } + /************************************************************/ + + if(sysPara->status.gearPumpRunStopFlag) + { + sysPara->para.gearPumpValue = 0; + } + if(sysPara->status.flagOfSpeedAlarm) + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + oldPressure = sysPara->status.PRESSURE; + sysPara->para.pressure = oldTargetPresuure; +} + +void InkJetPrinter::DacAdjustStore() +{ +#ifdef __DAC_ADJ_FUNCTION__ + sysPara->para.printed_adj_dac[0] = ui->vol0SpinBox->value(); + sysPara->para.printed_adj_dac[1] = ui->vol1SpinBox->value(); + sysPara->para.printed_adj_dac[2] = ui->vol2SpinBox->value(); + sysPara->para.printed_adj_dac[3] = ui->vol3SpinBox->value(); + sysPara->para.printed_adj_dac[4] = ui->vol4SpinBox->value(); + sysPara->para.printed_adj_dac[5] = ui->vol5SpinBox->value(); + sysPara->para.printed_adj_dac[6] = ui->vol6SpinBox->value(); + sysPara->para.printed_adj_dac[7] = ui->vol7SpinBox->value(); + sysPara->para.printed_adj_dac[8] = ui->vol8SpinBox->value(); + sysPara->para.printed_adj_dac[9] = ui->vol9SpinBox->value(); + sysPara->para.printed_adj_dac[10] = ui->vol10SpinBox->value(); + sysPara->para.printed_adj_dac[11] = ui->vol11SpinBox->value(); + sysPara->para.printed_adj_dac[12] = ui->vol12SpinBox->value(); + sysPara->para.printed_adj_dac[13] = ui->vol13SpinBox->value(); + sysPara->para.printed_adj_dac[14] = ui->vol14SpinBox->value(); + sysPara->para.printed_adj_dac[15] = ui->vol15SpinBox->value(); + sysPara->para.printed_adj_dac[16] = ui->vol16SpinBox->value(); + sysPara->para.printed_adj_dac[17] = ui->vol17SpinBox->value(); + sysPara->para.printed_adj_dac[18] = ui->vol18SpinBox->value(); + sysPara->para.printed_adj_dac[19] = ui->vol19SpinBox->value(); + + sysPara->para.printed_adj_dac[20] = ui->vol20SpinBox->value(); + sysPara->para.printed_adj_dac[21] = ui->vol21SpinBox->value(); + sysPara->para.printed_adj_dac[22] = ui->vol22SpinBox->value(); + sysPara->para.printed_adj_dac[23] = ui->vol23SpinBox->value(); + sysPara->para.printed_adj_dac[24] = ui->vol24SpinBox->value(); + sysPara->para.printed_adj_dac[25] = ui->vol25SpinBox->value(); + sysPara->para.printed_adj_dac[26] = ui->vol26SpinBox->value(); + sysPara->para.printed_adj_dac[27] = ui->vol27SpinBox->value(); + sysPara->para.printed_adj_dac[28] = ui->vol28SpinBox->value(); + sysPara->para.printed_adj_dac[29] = ui->vol29SpinBox->value(); + + sysPara->para.printed_adj_dac[30] = ui->vol30SpinBox->value(); + sysPara->para.printed_adj_dac[31] = ui->vol31SpinBox->value(); + sysPara->para.printed_adj_dac[32] = ui->vol32SpinBox->value(); + sysPara->para.printed_adj_dac[33] = ui->vol33SpinBox->value(); + sysPara->para.printed_adj_dac[34] = ui->vol34SpinBox->value(); + sysPara->para.printed_adj_dac[35] = ui->vol35SpinBox->value(); + sysPara->para.printed_adj_dac[36] = ui->vol36SpinBox->value(); + sysPara->para.printed_adj_dac[37] = ui->vol37SpinBox->value(); + sysPara->para.printed_adj_dac[38] = ui->vol38SpinBox->value(); + sysPara->para.printed_adj_dac[39] = ui->vol39SpinBox->value(); + //memcpy(sysPara->para.printed_adj_dac, sysPara->status.printed_adj_dac, sizeof(sysPara->para.printed_adj_dac)); + + sysPara->para.printed_continue_col_dac[0] = ui->cVol0SpinBox->value(); + sysPara->para.printed_continue_col_dac[1] = ui->cVol1SpinBox->value(); + sysPara->para.printed_continue_col_dac[2] = ui->cVol2SpinBox->value(); + sysPara->para.printed_continue_col_dac[3] = ui->cVol3SpinBox->value(); + sysPara->para.printed_continue_col_dac[4] = ui->cVol4SpinBox->value(); + sysPara->para.printed_continue_col_dac[5] = ui->cVol5SpinBox->value(); + sysPara->para.printed_continue_col_dac[6] = ui->cVol6SpinBox->value(); + sysPara->para.printed_continue_col_dac[7] = ui->cVol7SpinBox->value(); + sysPara->para.printed_continue_col_dac[8] = ui->cVol8SpinBox->value(); + sysPara->para.printed_continue_col_dac[9] = ui->cVol9SpinBox->value(); + sysPara->para.printed_continue_col_dac[10] = ui->cVol10SpinBox->value(); + sysPara->para.printed_continue_col_dac[11] = ui->cVol11SpinBox->value(); + sysPara->para.printed_continue_col_dac[12] = ui->cVol12SpinBox->value(); + sysPara->para.printed_continue_col_dac[13] = ui->cVol13SpinBox->value(); + sysPara->para.printed_continue_col_dac[14] = ui->cVol14SpinBox->value(); + sysPara->para.printed_continue_col_dac[15] = ui->cVol15SpinBox->value(); + sysPara->para.printed_continue_col_dac[16] = ui->cVol16SpinBox->value(); + sysPara->para.printed_continue_col_dac[17] = ui->cVol17SpinBox->value(); + sysPara->para.printed_continue_col_dac[18] = ui->cVol18SpinBox->value(); + sysPara->para.printed_continue_col_dac[19] = ui->cVol19SpinBox->value(); + + sysPara->para.printed_continue_col_dac[20] = ui->cVol20SpinBox->value(); + sysPara->para.printed_continue_col_dac[21] = ui->cVol21SpinBox->value(); + sysPara->para.printed_continue_col_dac[22] = ui->cVol22SpinBox->value(); + sysPara->para.printed_continue_col_dac[23] = ui->cVol23SpinBox->value(); + sysPara->para.printed_continue_col_dac[24] = ui->cVol24SpinBox->value(); + sysPara->para.printed_continue_col_dac[25] = ui->cVol25SpinBox->value(); + sysPara->para.printed_continue_col_dac[26] = ui->cVol26SpinBox->value(); + sysPara->para.printed_continue_col_dac[27] = ui->cVol27SpinBox->value(); + sysPara->para.printed_continue_col_dac[28] = ui->cVol28SpinBox->value(); + sysPara->para.printed_continue_col_dac[29] = ui->cVol29SpinBox->value(); + + sysPara->para.printed_continue_col_dac[30] = ui->cVol30SpinBox->value(); + sysPara->para.printed_continue_col_dac[31] = ui->cVol31SpinBox->value(); + sysPara->para.printed_continue_col_dac[32] = ui->cVol32SpinBox->value(); + sysPara->para.printed_continue_col_dac[33] = ui->cVol33SpinBox->value(); + sysPara->para.printed_continue_col_dac[34] = ui->cVol34SpinBox->value(); + sysPara->para.printed_continue_col_dac[35] = ui->cVol35SpinBox->value(); + sysPara->para.printed_continue_col_dac[36] = ui->cVol36SpinBox->value(); + sysPara->para.printed_continue_col_dac[37] = ui->cVol37SpinBox->value(); + sysPara->para.printed_continue_col_dac[38] = ui->cVol38SpinBox->value(); + sysPara->para.printed_continue_col_dac[39] = ui->cVol39SpinBox->value(); + + sysPara->para.printed_full_col_dac[0] = ui->fvol0SpinBox->value(); + sysPara->para.printed_full_col_dac[1] = ui->fvol1SpinBox->value(); + sysPara->para.printed_full_col_dac[2] = ui->fvol2SpinBox->value(); + sysPara->para.printed_full_col_dac[3] = ui->fvol3SpinBox->value(); + sysPara->para.printed_full_col_dac[4] = ui->fvol4SpinBox->value(); + sysPara->para.printed_full_col_dac[5] = ui->fvol5SpinBox->value(); + sysPara->para.printed_full_col_dac[6] = ui->fvol6SpinBox->value(); + sysPara->para.printed_full_col_dac[7] = ui->fvol7SpinBox->value(); + sysPara->para.printed_full_col_dac[8] = ui->fvol8SpinBox->value(); + sysPara->para.printed_full_col_dac[9] = ui->fvol9SpinBox->value(); + sysPara->para.printed_full_col_dac[10] = ui->fvol10SpinBox->value(); + sysPara->para.printed_full_col_dac[11] = ui->fvol11SpinBox->value(); + sysPara->para.printed_full_col_dac[12] = ui->fvol12SpinBox->value(); + sysPara->para.printed_full_col_dac[13] = ui->fvol13SpinBox->value(); + sysPara->para.printed_full_col_dac[14] = ui->fvol14SpinBox->value(); + sysPara->para.printed_full_col_dac[15] = ui->fvol15SpinBox->value(); + sysPara->para.printed_full_col_dac[16] = ui->fvol16SpinBox->value(); + sysPara->para.printed_full_col_dac[17] = ui->fvol17SpinBox->value(); + sysPara->para.printed_full_col_dac[18] = ui->fvol18SpinBox->value(); + sysPara->para.printed_full_col_dac[19] = ui->fvol19SpinBox->value(); + + sysPara->para.printed_full_col_dac[20] = ui->fvol20SpinBox->value(); + sysPara->para.printed_full_col_dac[21] = ui->fvol21SpinBox->value(); + sysPara->para.printed_full_col_dac[22] = ui->fvol22SpinBox->value(); + sysPara->para.printed_full_col_dac[23] = ui->fvol23SpinBox->value(); + sysPara->para.printed_full_col_dac[24] = ui->fvol24SpinBox->value(); + sysPara->para.printed_full_col_dac[25] = ui->fvol25SpinBox->value(); + sysPara->para.printed_full_col_dac[26] = ui->fvol26SpinBox->value(); + sysPara->para.printed_full_col_dac[27] = ui->fvol27SpinBox->value(); + sysPara->para.printed_full_col_dac[28] = ui->fvol28SpinBox->value(); + sysPara->para.printed_full_col_dac[29] = ui->fvol29SpinBox->value(); + + sysPara->para.printed_full_col_dac[30] = ui->fvol30SpinBox->value(); + sysPara->para.printed_full_col_dac[31] = ui->fvol31SpinBox->value(); + sysPara->para.printed_full_col_dac[32] = ui->fvol32SpinBox->value(); + sysPara->para.printed_full_col_dac[33] = ui->fvol33SpinBox->value(); + sysPara->para.printed_full_col_dac[34] = ui->fvol34SpinBox->value(); + sysPara->para.printed_full_col_dac[35] = ui->fvol35SpinBox->value(); + sysPara->para.printed_full_col_dac[36] = ui->fvol36SpinBox->value(); + sysPara->para.printed_full_col_dac[37] = ui->fvol37SpinBox->value(); + sysPara->para.printed_full_col_dac[38] = ui->fvol38SpinBox->value(); + sysPara->para.printed_full_col_dac[39] = ui->fvol39SpinBox->value(); + //sysPara->para.dacScale = ui->dacScaledSpinBox->value(); + sysPara->devOp->writeFpgaPrintPara(); +#endif +} + + +InkJetPrinter::~InkJetPrinter() +{ + delete ui; + delete timer; +#ifdef MODBUS + if (modbus) { + delete modbus; + } +#endif + if (fileTransceiv) { + fileTransceiv->deleteLater(); + } +} + +void InkJetPrinter::jd_timerHandler(void) +{ + static int count_time = 0; + + count_time++; + if(count_time>= 20){ //each 10s + count_time = 0; +#ifdef MIMA + jd_res = ui->tabPrintSetting->dlgInputAddr->isEnabled(); +// qDebug()<<"jd_timerHandler"; +#endif + } +} +extern void MySleep(unsigned int msec); +extern unsigned char test_flag; +bool gearPumpRunNormalFlag = false; +void InkJetPrinter::timerHandler(void){ + // QFile file("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtssl.o"); + + int pulse_100ms = 0; + int pulse_1s = 0; + int pulse_10s = 0; + int pulse_100s = 0; + int pulse_300ms = 0; + static int pulse_3s = 0; + static int pulse_4s = 0; + static int pulse_5s = 0; + static int reciclar_30s = 0; + static int pulse_30s = 0; + static int xxxm=0; +// static char res=0; + static int save_weeknum = 0; + static bool gearPumpRunFlag = false; + static bool ControledSwitchFlag = false; + static bool gearPumpStartFlag = false; + static bool delay3s = false; + //gearPumpRunStopFlag = false; + bool InkSwintFlag = false,lastInkSwintFlag = false; + + static float gearPumpRunNormalValue = 0.0; +#ifdef DEBUG1 + sysPara->status.selfCheckDone=1; +#endif + + if(sysPara){ +#ifdef MODBUS +// processCommands(); +#endif + +#ifdef MIMA + if(xxxm==0) + { + +#ifdef AM335TEST + +#else + +#ifdef MYTEST + xxxm=1; +#else + QFile file("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtssl.o"); + if(!file.exists()) return; +#endif +#endif + } + xxxm=1; + +#endif + + sysPara->para.ReadFileErrorCnt=0; // 正常打开文件 + + // /opt/FriendlyARM/mini2440/rootfs_qtopia_qt4/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib + if(sysPara->para.gearPumpEnable) + { + ui->tabMainWindow->enablePushButtonStart(true); + if(!pushButtonStartFlag) + { + gearPumpRunNormalFlag = false; + } + ui->tabSystemSetting->setSpinBoxPressureMaxValue(900); + if(!gearPumpRunFlag) + { + ui->tabMainWindow->enableReclaimCtrlButton(false); + } + } + else + { + ui->tabMainWindow->enablePushButtonStart(false); + ui->tabSystemSetting->setSpinBoxPressureMaxValue(5000); + } + + /*-----------------------形成脉冲-----------------------------*/ + sysPara->status.delay10ms ++; + if(sysPara->status.delay10ms == 10){ + pulse_100ms = 1; + sysPara->status.delay10ms = 0; + } + if(pulse_100ms){ + sysPara->status.delay100ms ++; + if(sysPara->status.delay100ms == 10){ + pulse_1s = 1; + sysPara->status.delay100ms = 0; + } + pulse_300ms = (sysPara->status.delay100ms%3) == 0; //1秒3次,并非精确的300ms + + } + if((sysPara->status.delay10ms%3) == 0) //读取状态后再检測 + { + //if(pushButtonStartFlag && !gearPumpRunFlag && !sysPara->status.isPumpValveControledByHand)//刚启动前3秒 + if(!(sysPara->status.statWarn & WARN_STATUS_INK_WARN) && !gearPumpRunFlag && !sysPara->status.isPumpValveControledByHand)//刚启动前3秒 + { + if(sysPara->para.gearPumpEnable) { + sysPara->para.gearPumpValue = 150; + sysPara->devOp->WriteMoterPump(); + gearPumpStartFlag = true; + //LogInfo::setRunStatusText(tr("墨水显启动齿轮泵!")); + } + } + } + if(pushButtonStartFlag && sysPara->status.selfCheckDone) + { + if((sysPara->status.PRESSURE > (sysPara->para.pressure -10)) && (sysPara->status.PRESSURE < (sysPara->para.pressure +10))) + { + if(pulse_1s) + { + pulse_5s++; + } + if( pulse_5s == 5) + { + pulse_5s = 0; + gearPumpRunNormalFlag = true; + gearPumpRunNormalValue = u; + } + } + } + if(sysPara->status.isPumpValveControledByHand) + { + gearPumpRunNormalFlag = false; + ControledSwitchFlag = false; + pulse_3s = 0; + //PID_init(); 放下回收槽会导致齿轮泵停止 + } + if(!(sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){//墨线开关,压力抖动 + InkSwintFlag = true; + } + else + { + InkSwintFlag = false; + } + if(lastInkSwintFlag != InkSwintFlag) + { + lastInkSwintFlag = InkSwintFlag; + gearPumpRunNormalFlag = false; + } + if(gearPumpRunNormalFlag && !sysPara->status.isPumpValveControledByHand && sysPara->para.gearPumpEnable ) + { + static int count_3s = 0; + //if(sysPara->status.PRESSURE <= (int)(sysPara->para.pressure * 0.9) || sysPara->status.PRESSURE >= (int)(sysPara->para.pressure * 1.1)) + if(u > gearPumpRunNormalValue*1.5)//改大一点 + { + if(pulse_1s) + { + count_3s++; + if(count_3s == 3) + { + count_3s = 0; + ui->tabMainWindow->setRunStatus(tr("压力泄漏或压力传感器故障!")); + sysPara->status.gearPumpRunStopFlag = true; + gearPumpRunNormalFlag = false; + LogInfo::setRunStatusText(tr("运行中压力泄漏,停齿轮泵!")); + } + } + } + else + { + count_3s = 0; + } + } + if(sysPara->para.gearPumpEnable && (sysPara->status.gearPumpRunSpeed < 100) && test_flag){ + if(test_flag % 2) + ui->tabMainWindow->on_pushButtonReclaimTankClose_pressed(); + test_flag = 0; + } + if(pulse_1s) { + if(sysPara->status.selfCheckDone && sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable) + checkPressureControl(); + if((QTime::currentTime()>=QTime(00,00,00))&&(QTime::currentTime()<=QTime(00,00,02))&&sysPara->para.Reciclar){ + if(ui->tabMainWindow->getCurrPrintStatus() != 1){ + ui->tabMainWindow->_on_pushButtonPowerOff_pressed(false); + LogInfo::setRunStatusText(tr("测试时间结束,准备关机")); + ui->tabMainWindow->setRunStatus(tr("测试时间结束,准备关机")); + } + } + if(sysPara->status.selfCheckDone && sysPara->para.Reciclar && test_flag){ + reciclar_30s++; + if(reciclar_30s > 30){ + reciclar_30s = 0; + test_flag++; + } + } + else if(reciclar_30s){ + reciclar_30s = 0; + } + + QDate d = QDate::currentDate(); + + if(save_weeknum == 0) + { + save_weeknum = d.weekNumber(); + } + + if(save_weeknum != d.weekNumber()) + { + sysPara->devOp->writeFpgaCalandar(1); + save_weeknum = d.weekNumber(); + } + + sysPara->status.delay1s ++; + if(sysPara->status.delay1s == 3 && !delay3s) + delay3s = true; + if(sysPara->status.delay1s == 10){ + pulse_10s = 1; + sysPara->status.delay1s = 0; + } + //if(pushButtonStartFlag) + pulse_4s++; + if(gearPumpStartFlag) + { + pulse_3s ++; + if(pulse_3s == 3) + { + pulse_3s = 0; +// if(sysPara->status.PRESSURE <10 && !sysPara->status.isPumpValveControledByHand && !gearPumpRunFlag) +// { +// ui->tabMainWindow->setRunStatus(tr("压力泄漏或压力传感器故障!")); +// sysPara->status.gearPumpRunStopFlag = true; +// LogInfo::setRunStatusText(tr("开始运行压力泄漏,停齿轮泵!")); +// } + gearPumpRunFlag = true; + ControledSwitchFlag = true; + } + } + #ifdef QTV4 + + //if( sysPara->status.InkLineStaus>1 ) sysPara->para.openInkLineTime++; + if( sysPara->status.reclainTankReachEnd) sysPara->para.openInkLineTime++; + #else + if( sysPara->status.reclainTankReachEnd) sysPara->para.openInkLineTime++; + #endif + } + if(pulse_10s){ +#ifdef __STC_POWER__ + { + sysPara->devOp->Heartbeat(1); + } +#endif +#ifdef MODBUS + if(!modbus->m_thread.isRunning()) + modbus->m_thread.start(); +#endif + //ui->tabOtherInfo->phaseDetectResultRecord(); + sysPara->status.delay10s ++; + if(sysPara->status.delay10s == 10){ + pulse_100s = 1; + sysPara->status.delay10s = 0; +#ifdef __STC_POWER__ + if(sysPara->status.needPowerOffTimerout && (ui->tabMainWindow->getCurrPrintStatus() != 1)) + { + qDebug()<<"check sysPara->status.waitPowerOffTime"<status.waitPowerOffTime; + if(sysPara->status.waitPowerOffTime) + { + sysPara->status.waitPowerOffTime--; + if(!sysPara->status.waitPowerOffTime) + { + ui->tabMainWindow->_on_pushButtonPowerOff_pressed(false); + LogInfo::setRunStatusText(tr("定时开机循环完成,准备关机")); + ui->tabMainWindow->setRunStatus(tr("准备关机")); + } + } + } +#endif + } +#ifdef AM335TEST + jd_res =0; +#else +//#ifdef MIMA + +// res = ui->tabPrintSetting->dlgInputAddr->isEnabled(); + +//#endif +#endif + } + + /*------------------------------------------------------*/ +#ifdef UART2 + static bool Flag300=0; + if(sysPara->status.ExtScreenEn && sysPara->para.ExtScreenType) + { + + if(sysPara->para.ExtScreenType==2) + { + if(pulse_300ms) + { + if(Flag300) sysPara->devOp->RecDim(); + else sysPara->devOp->DatToDisp2(); + Flag300 = !Flag300; + + } + } + else if(pulse_1s) + { + if(Flag300) sysPara->devOp->RecDim(); + else sysPara->devOp->DatToDisp2(); + Flag300 = !Flag300; + } + sysPara->devOp->recUart2(); + } +#endif + + sysPara->devOp->readFgaStatus(); + sysPara->status.gearPumpRunSpeed = 0; + +#if 0 + unsigned char ByteData = 0; + static unsigned char lastByteData = 0; + + sysPara->devOp->fpgaRd(0x00fc,(unsigned char *)&ByteData,1);//读取1字节 + //ui->tabMainWindow->setRunStatus(tr("ByteData:<%1>").arg(ByteData)); + if((ByteData & 0x80) != lastByteData) + { + //LogInfo::setRunStatusText(tr("结果:%1").arg(ByteData & 0x80)); + lastByteData = ByteData & 0x80; + if(sysPara->status.selfCheckDone) + { + if(ui->tabMainWindow->getCurrPrintStatus() == 3) + { + ui->tabMainWindow->on_pushButtonStartPrint_pressed(); + } + else + { + ui->tabMainWindow->on_pushButtonStopPrint_pressed(); + } + } + } +#endif +// unsigned int PulseMs = 0; //时间间隔 + + unsigned int PulseCnt = 0; //时间间隔内的脉冲累计数 + +// sysPara->devOp->fpgaRd(0x0052,(unsigned char *)&ByteData,1);//读取时间间隔高字节 +// PulseMs = ByteData * 256; +// sysPara->devOp->fpgaRd(0x0051,(unsigned char *)&ByteData,1);//读取时间间隔低字节 +// PulseMs += ByteData; + + //sysPara->devOp->fpgaRd(0x004F,(unsigned char *)&ByteData,1);//读取脉冲个数高字节 + //PulseCnt = ByteData * 256; + sysPara->devOp->fpgaRd(0x004E,(unsigned char *)&PulseCnt,2);//读取脉冲个数低字节 + { + //sysPara->status.gearPumpRunSpeed = (PulseCnt * 60 * 1000) / (PulseMs * 2); + sysPara->status.gearPumpRunSpeed = (PulseCnt * 60 * 1000) / (500 * 2); + } + + if(!sysPara->para.gearPumpEnable) + sysPara->status.PRESSURE *= 5; //响应群众号召,数值放大五倍 + sysPara->devOp->ReadSomeDataForLostPrint(); +#ifdef UART1 + if(pulse_100ms){ + //static int uartReadcnt=0; + emit sysPara->devOp->readUart1(); + } +#endif + +#ifdef ONLYCNTCLEAR + //static int r_productCnt=0; + //if(sysPara->status.productCnt>1) r_productCnt=sysPara->para.totalProductCnt+sysPara->status.productCnt; + //if(sysPara->status.ele_product_cnt_reset>1){ + // sysPara->para.totalProductCnt = r_productCnt; //sysPara->status.productCnt; + //} +#endif + /*-------------------------------------------------------*/ + bool lostCommuFlag = 0; + if(sysPara->status.configDone){ + lostCommuFlag = sysPara->status.maginNum != FPGA_MAGIC_NUM_AFTER_CONF; + } + else { + lostCommuFlag = sysPara->status.maginNum != FPAG_INIT_MAGIC_NUM; + } +#ifdef AM335TEST + sysPara->status.WorkTimeOut=0; +#else +#ifdef MIMA + if(jd_res &(1<<2)) { + sysPara->status.WorkTimeOut=1; + } +#endif +#endif + + #ifdef X86TEST + lostCommuFlag=0; + #endif +#ifdef MODBUS + + if(sysPara->status.delay10ms%5 == 0) + { +#if 1 //复位发送打印数据 + if((ui->tabMainWindow->getCurrPrintStatus() == 1)&&sysPara->para.ResetSendData) + { + static bool oneTimeFlag = false; + if(sysPara->status.productCnt== 0 && (oneTimeFlag==false))//计米复位发送打印数据 + { + oneTimeFlag = true; + ui->tabMainWindow->on_pushButtonStartPrint_pressed(); + //复位重设起始值 + if(sysPara->para.cnt1ResetToInitValue) + { + sysPara->para.cnt1CurrValue = sysPara->para.cnt1StartValue; + sysPara->status.cnt1CurrentValueInitDoneFlag = false; + sysPara->devOp->writeFpgaCalandar(0); + } + } + if(sysPara->status.productCnt != 0) + { + oneTimeFlag = false; + } + } +#endif + static unsigned int lastProductCount=0; + if(sysPara->status.productCnt != lastProductCount || sysPara->status.printDoneFlag) + { + sysPara->status.printDoneFlag = false; + lastProductCount = sysPara->status.productCnt; + sysPara->modbusStatus.printFinishFlag = 1; + memcpy((void*)(&sysPara->modbusStatus.orderCode), (void*)(&sysPara->modbusParas.QRcode_buf), 2);//写返回序列号 + ui->tabMainWindow->UpdateDateTimeQRCode(QDateTime::currentDateTime().toString("hh:mm")); + } + if (modbus->getModbusStatus() == 1) { + refreshModbusStatus(); + } + } +#endif + if(lostCommuFlag){ + static unsigned char lostCommuCnt=0; + if(sysPara->status.currentRunStatus != RUN_STATUS_LOST_COMMUNICATION_WITH_FPGA) { + // 增加FPGA通信异常判别阀值,避免产生误判。2017.8.30 + if(lostCommuCnt<10) lostCommuCnt ++; + else { + sysPara->status.fpgaVersionNum = 0; + LogInfo::setRunStatusText(tr("与FPGA失去通信!!!")); + sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlInkValve(false); + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->controlMixValve(false); + //sysPara->devOp->controlReclaimPump(false); + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlReleaseValve(false); + sysPara->devOp->controlHeater(false); + qDebug()<<"lostCommuteCation now."<status.maginNum; + } + } + sysPara->status.currentRunStatus = RUN_STATUS_LOST_COMMUNICATION_WITH_FPGA; + } + else if(!sysPara->status.lostCommuFlag && !SIMULATE_PRINTING_MODE) { + if(sysPara->status.currentRunStatus == RUN_STATUS_LOST_COMMUNICATION_WITH_FPGA) + LogInfo::setRunStatusText(tr("与FPGA通信恢复正常")); + + sysPara->status.currentRunStatus = RUN_STATUS_IDLE; + if(gearPumpRunFlag || sysPara->para.gearPumpEnable == 0) + { + if(!sysPara->status.selfCheckDone) + { /*开机自检*/ + autoControlValvePump(); + pressureAdj(0); + /*-----------------------------------------------------*/ + if(!sysPara->status.selfCheckCnt) { + LogInfo::setRunStatusText(tr("开始自检,请等待60秒...............")); + ui->tabMainWindow->enableReclaimCtrlButton(false); + ui->tabMainWindow->enablePrintButton(false); + sysPara->devOp->mainInkCtrl(); + sysPara->para.TrunOnPowerCnt++;// 20151218 开机次数加1 + sysPara->saveParaToFile(); // 保存开机次数值 + + sysPara->status.lastProductCnt = sysPara->status.productCnt ; //这会让产品计数显示出来 + + ui->tabMainWindow->updateTotalCnt(0); + + +#ifdef X86TEST + // if(sysPara->status.selfCheckCnt < MAX_SELF_CHECK_CNT-2)sysPara->status.selfCheckCnt = MAX_SELF_CHECK_CNT-2; + +#endif + } + if((sysPara->status.selfCheckCnt % 100) == 0) + ui->tabMainWindow->setRunStatus(tr("开始自检,请等待%1秒...............").arg((MAX_SELF_CHECK_CNT - sysPara->status.selfCheckCnt)/100)); + + sysPara->status.selfCheckCnt ++; + if(sysPara->status.selfCheckCnt >= MAX_SELF_CHECK_CNT) + { + sysPara->status.selfCheckDone = 1; + LogInfo::setRunStatusText(tr("自检完成!!!")); + ui->tabMainWindow->setRunStatus(tr("自检完成!!!")); + ui->tabMainWindow->enableReclaimCtrlButton(true); + sysPara->devOp->mainInkCtrl(); + sysPara->status.canRunAirPushing = true; + if(sysPara->para.Reciclar) + test_flag = 1; + } + else { + if((sysPara->status.selfCheckCnt % 200) == 0) + // sysPara->devOp->controlReclaimTankOpen(false); + ui->tabMainWindow->enableReclaimCtrlButton(false); + } + } + else { + // 开机自检完成的前提下 + if (!sysPara->status.airPushing || ui->tabMainWindow->m_2sFlag) { + autoControlValvePump(); + } + if(sysPara->para.gearPumpEnable && !sysPara->status.isPumpValveControledByHand && ControledSwitchFlag) { + pressureAdj(0); + } + } + } + else{ + static bool flag = 1; + if(delay3s){ + if(flag){ + flag = 0; + LogInfo::setRunStatusText(tr("缺少墨水,喷码机不能正常工作!")); + qDebug()<<"缺少墨水,喷码机不能正常工作!"; + } + ui->tabMainWindow->setRunStatus(tr("缺少墨水,喷码机不能正常工作!")); + } + } + /*----------------------------控制温度--------------------------------------*/ + if(pulse_100ms){ + autoControlHeater(); + sysPara->devOp->readSyncCounterAtZero(); + } + } + sysPara->status.lostCommuFlag = lostCommuFlag; //务必放在后面 + static unsigned int lastProductCnt =0; +#ifdef DEBUG_CNT + static unsigned int times=0; + static int lasttimes=0; + + if(sysPara->status.delay1s != lasttimes) + ++times; + lasttimes = sysPara->status.delay1s; + sysPara->status.productCnt =times ; + +#endif + //emit ui->tabMainWindow->alterDataPrint(0); + static int lastalterMode=-1; + if(sysPara->para.alterPrint.enable) + { + sysPara->para.AlterMode=sysPara->status.AlterMode; // 电眼触发交替功能:新增这一行 + if( (sysPara->para.AlterMode!=lastalterMode) + || (lastProductCnt != sysPara->status.productCnt) + ) + { + //qDebug()<<"Update Diap"<para.AlterMode; + ui->tabMainWindow->alterDataPrint (sysPara->para.AlterMode); + } + } + else sysPara->para.AlterMode=0; + lastalterMode = sysPara->para.AlterMode; + lastProductCnt = sysPara->status.productCnt; + +//#ifdef TESTDBT + ui->tabMainWindow->CheckStatus(pulse_300ms); // +//#endif + /*----------------------------------界面更新状态---------------------------------------*/ + //ui->tabOtherInfo->phaseDetectResultRecord(); + if(pulse_300ms){ + sysPara->devOp->readCalandarDat(); //务必读一下此数据 +#ifdef RANDDEBUG + if(sysPara->status.RandomNum>0) + sysPara->devOp->Read_RanddomFromFpga(); +#endif +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + cnt1GroupCheck();//分段计米 +#endif +#ifdef DEBUG_CNT + sysPara->status.calandar_and_dat.cnt1CurrValue = (times/10)*16+(times%10) ; + sysPara->status.calandar_and_dat.cnt2CurrValue = (times/10)*16+(times%10) ; + +#endif + QWidget *widget = this->currentWidget(); + + + //无墨水或溶剂3小时,自动关机 + if(sysPara->status.InkOrSOLVEmptyCnt>MAX_INK_SOLV_EMTYTIME-10) + { + if(!sysPara->status.powerOffAfterInkOrSOLVEmptyAppending){ + sysPara->status.powerOffAfterInkOrSOLVEmptyAppending = 1; + ui->tabMainWindow->_on_pushButtonPowerOff_pressed(false); + LogInfo::setRunStatusText(tr("墨水或溶剂空,准备关机")); + ui->tabMainWindow->setRunStatus(tr("墨水或溶剂空,准备关机")); + //qDebug()<<"InkOrSOLVEmptyCnt"<< sysPara->status.InkOrSOLVEmptyCnt; + } + } + + static bool read_flag = false; + if(widget == ui->tabMainWindow) { +//#ifdef TESTDBT + ui->tabMainWindow->updateSysStatusToUI(); +//#endif + } + else if(widget == ui->tabTriggerMode){ + ui->tabTriggerMode->updateSysStatusToUI(); + if(sysPara->status.build_dat.builTime ==0) sysPara->devOp->readbuilDat(); + else + { + QString strFPGADate; + if(sysPara->status.build_dat.year!=0xff && sysPara->status.build_dat.month!=0xff && sysPara->status.build_dat.day!=0xff) + { + strFPGADate = QString("(%1-%2-%3)").arg(sysPara->status.build_dat.year).arg(sysPara->status.build_dat.month).arg(sysPara->status.build_dat.day); + } + if(sysPara->status.flagOfNo67FPGA && sysPara->para.flagOfFastMode) + ui->tabTriggerMode->setBuildTime(QString(" No66") + "_" + strFPGADate); + else if(sysPara->status.flagOfNo67FPGA && !sysPara->para.flagOfFastMode) + ui->tabTriggerMode->setBuildTime(QString(" No67") + "_" +strFPGADate); + else + ui->tabTriggerMode->setBuildTime(QString(" No%1").arg(sysPara->status.build_dat.builTime) + "_"+ strFPGADate); + } + } + else if(widget == ui->tabPrintSetting) + { + ui->tabPrintSetting->updateSysStatusToUI(); + if(!read_flag) + { + emit sendPicScene(ui->tabMainWindow->getPicScene()); + } + read_flag = true; + } + else if(widget == ui->tabSystemSetting){ + + ui->tabSystemSetting->updateSysStatusToUI(); + } + else if(widget == ui->tabSystemManage){ + ui->tabSystemManage->updateSysStatusToUI(); + } + else if(widget == ui->tabOtherInfo){ + ui->tabOtherInfo->updateSysStatusToUI(); + } + else if(widget == ui->tabNetworkManager){ + //qDebug()<<"ui->tabNetworkManager->updateSysStatusToUI" ; + if(!sysPara->status.bLanConfigManual) + { + ui->tabNetworkManager->updateSysStatusToUI(); + } + } + if(widget != ui->tabPrintSetting) + { +// if(sysPara->para.EditMode==SCENE &&read_flag) +// { +// ui->tabMainWindow->timerShowItem->start(); +// } + read_flag = false; + } + +// if(sysPara->para.FullColFixVal) { +// if(sysPara->para.FullColFixVal){ + +// } +// } +// else if () { + +// } + // 20140306 + static int last_lesslen_warn=0,lesslen_cnt=0; + if(sysPara->status.lesslen_warn && (sysPara->para.printTriggerMode != PRINT_TRIGGER_TIME)) + { + //qDebug()<status.lesslen_warn ; + if(last_lesslen_warn==0) + { + last_lesslen_warn =lesslen_cnt; + if(lesslen_cnt<60)lesslen_cnt +=6; + if(lesslen_cnt>40) sysPara->devOp->resumeFault(); + + if(sysPara->para.speedoverPaushPrint) { + ui->tabMainWindow->on_pushButtonPausePrint_pressed();// 2014-03-19 + emit OnSpeedOver(2);//QMessageBox::warning(NULL,tr("警告"),tr("喷印速度过快!无法喷印完全,自动暂停喷印!!!")); + ui->tabMainWindow->setRunStatus(tr("喷印速度过快!无法喷印完全,自动暂停喷印!!!")); + + } + else { + emit OnSpeedOver(1);//QMessageBox::warning(NULL,tr("警告"),tr("喷印速度过快!无法喷印完全!!!")); + ui->tabMainWindow->setRunStatus(tr("喷印速度过快!无法喷印完全!!!")); + } + + } + } + else { last_lesslen_warn=0;lesslen_cnt=30;} + + if(last_lesslen_warn) last_lesslen_warn--; + + } + + if(pulse_100ms){ + detectAndcontrolReclaimTank(); //控制回收槽 + } + + /*---------------------------------处理警告--------------------------------------------*/ + if(pulse_1s){ + if(sysPara->para.gearPumpEnable && sysPara->status.selfCheckDone && gearPumpRunNormalFlag) + { + if((sysPara->status.PRESSURE < (sysPara->para.pressure -8)) || (sysPara->status.PRESSURE > (sysPara->para.pressure +8))) + { + LogInfo::setRunStatusText(tr("压力波动超过设定的5个值.")); + } + } + + //if(sysPara->status.statWarn &(WARN_STATUS_INK_WARN|WARN_STATUS_SOLV_WARN )) + if(sysPara->status.statWarn &WARN_STATUS_INK_WARN ) + { + if(sysPara->status.InkOrSOLVEmptyCntstatus.InkOrSOLVEmptyCnt=t1.elapsed()/1000 ;// + } + else { + sysPara->status.InkOrSOLVEmptyCnt=0; + t1.start();// + } + + static bool resumeFlag = false; + if(lostCommuFlag || ui->tabMainWindow->updatePhaseIndicatorLight() || (sysPara->status.statWarn & (WARN_STATUS_POWER_MON|WARN_STATUS_INK_WARN|WARN_STATUS_SUMP_WARN + |WARN_STATUS_SOLV_WARN|WARN_STATUS_POWER_MON)) || (sysPara->status.gearPumpRunStopFlag && pushButtonStartFlag) ||sysPara->status.lastHighVoltageFault) + { //updatePhaseIndicatorLight()务必放前面 + sysPara->status.beeperOnFlag = true; + if(sysPara->status.gearPumpRunStopFlag && pushButtonStartFlag) + { + ui->tabMainWindow->setRunStatus(tr("压力泄漏或压力传感器故障!")); + } + if(!resumeFlag) + { + resumeFlag = true; + pulse_4s = 0; + if(!sysPara->status.lastHighVoltageFault) + { + ui->tabMainWindow->onLabelFaultRusumePressed(); + } + } + } + else { + sysPara->status.beeperOnFlag = false; + sysPara->devOp->controlBeeper(false); + if(pulse_4s >= 20) + { + pulse_4s = 0; + resumeFlag = false; + } + } + + if(sysPara->status.beeperOnFlag){ //报警会时有时无 + sysPara->devOp->controlBeeper(!sysPara->devOp->isBeeperEnable()); + } + + if((sysPara->status.statWarn & (WARN_STATUS_POWER_MON)) + ||sysPara->status.lastwarmInkPump||sysPara->status.lastwarmInkPump||sysPara->status.mainInkPumpError + ||sysPara->status.compressPumpError||sysPara->status.lastPhaseFault||sysPara->status.lastRecycleWarn + ||sysPara->status.lastHighVoltageFault||(sysPara->devOp->color_flag == 2)||(sysPara->devOp->color_flag == 4)) + { //2013-12-12故障报警灯 杨 + sysPara->status.RedLightOnFlag = true; + } + else { + sysPara->status.RedLightOnFlag = false; + sysPara->devOp->controlRedLight(false); + //sysPara->devOp->controlRedLight(true); + } + if(sysPara->status.RedLightOnFlag){ //报警会时有时无 + sysPara->devOp->controlRedLight(!sysPara->devOp->isRedLightEnable()); + } + if((sysPara->status.statWarn & (WARN_STATUS_INK_WARN|WARN_STATUS_SOLV_WARN |WARN_STATUS_RECYCLE_FAULT|WARN_STATUS_SUMP_WARN)) + && !sysPara->status.RedLightOnFlag){ + //if(!sysPara->status.RedLightOnFlag){ + sysPara->status.YellowLightOnFlag = true; + } + else { + sysPara->status.YellowLightOnFlag = false; + sysPara->devOp->controlYellowLight(false); + //sysPara->devOp->controlYellowLight(true); + } + if(sysPara->status.YellowLightOnFlag){ //报警会时有时无 + sysPara->devOp->controlYellowLight(!sysPara->devOp->isYellowLightEnable()); + } + + if(sysPara->status.waitHightVolOff>0){ + sysPara->status.waitHightVolOff--; + if(sysPara->status.waitHightVolOff==0){ + sysPara->devOp->highVoltageCtrl(0); + ui->tabMainWindow->setRunStatus(tr("停止打印,自动关闭高压.")); + } + } + + }// 1s + +#ifdef WARNING + static int pre_pressed=0,pre_hvcurrent=0,press_err_cnt=0; + if(pulse_1s) + { + if((pre_pressed > sysPara->status.PRESSURE+70)) + { + if(++press_err_cnt>3) + { + LogInfo::setRunStatusText(tr("压力异常:上次压力值%1,当前压力值%2").arg(pre_pressed).arg(sysPara->status.PRESSURE)); + } + } + else + { + press_err_cnt = 0; + } + pre_pressed = sysPara->status.PRESSURE; + + + } + + if(pulse_100ms) + { + if(pre_hvcurrent>150 && ( sysPara->status.HV_DETOUT> pre_hvcurrent+20) && (sysPara->status.waitHightVolOn==8 || sysPara->status.waitHightVolOff==1) && sysPara->status.isPrinting ) + LogInfo::setRunStatusText(tr("高压异常:上次电流值%1,当前电流值%2").arg(pre_hvcurrent).arg(sysPara->status.HV_DETOUT)); + pre_hvcurrent = sysPara->status.HV_DETOUT; + + if(sysPara->status.waitHightVolOn<8)sysPara->status.waitHightVolOn++; + if(sysPara->status.isPrinting==0) sysPara->status.waitHightVolOn=0; + } +#endif + if(sysPara->devOp->color_flag ==3){ + sysPara->devOp->color_flag = 0; + pulse_30s = 0; + } + else if(pulse_1s && sysPara->para.gearPumpEnable && sysPara->status.selfCheckDone + && (!sysPara->status.statWarn) && !sysPara->status.powerOffAppending){ + if((!sysPara->para.flagOfReclaimPumEnable && sysPara->status.gearPumpRunSpeed <= 2000) + ||(sysPara->para.flagOfReclaimPumEnable && sysPara->status.gearPumpRunSpeed <= sysPara->para.gearPumpSpeedAlarm)) + { + pulse_30s = 0; + } + else{ + pulse_30s++; + if(pulse_30s >= 5){ + if((sysPara->status.gearPumpRunSpeed >= 3000)||(sysPara->devOp->color_flag == 2) + ||(sysPara->para.flagOfReclaimPumEnable && sysPara->status.gearPumpRunSpeed > sysPara->para.gearPumpSpeedAlarm)) + { + sysPara->status.flagOfSpeedAlarm = true; + sysPara->devOp->color_flag = 2; + if(pulse_30s % 500 == 0) + LogInfo::setRunStatusText(tr("齿轮泵转速过高,请立即停机并联系供应商!")); + ui->tabMainWindow->setRunStatus(tr("齿轮泵转速过高,请立即停机并联系供应商!")); + sysPara->devOp->controlRedLight(true); + } + else{ + sysPara->devOp->color_flag = 1; + if(pulse_30s % 500 == 0) + LogInfo::setRunStatusText(tr("齿轮泵转速过高,请清理过滤器或者检查是否泄露!")); + ui->tabMainWindow->setRunStatus(tr("齿轮泵转速过高,请清理过滤器或者检查是否泄露!")); + sysPara->devOp->controlYellowLight(true); + } + } + } + } + else if(sysPara->status.statWarn & 0xFE){ + sysPara->devOp->color_flag = 3; + pulse_30s = 0; + } + } +} + +void InkJetPrinter::autoControlHeater(){ + //100ms + static int tempDly=1830; + if(tempDly) tempDly--; + if(tempDly>=1800) + { + if(tempDly==1800) + { + sysPara->status.indoorTemperature = sysPara->status.TEMP_ADIN/4; + sysPara->devOp->pumpValveCtrl(1); + if(sysPara->status.indoorTemperature-35>0) + ui->tabSystemSetting->updateViscosityAdjust((sysPara->status.indoorTemperature-35)); + else + ui->tabSystemSetting->updateViscosityAdjust(0); + } + return; + } + if(sysPara->status.TEMP_ADIN/4 < sysPara->para.temperature && sysPara->status.heaterONTimeCnt < MAX_HEATER_TIME){ + if(tempDly==0) sysPara->status.heaterONTimeCnt ++; + if(!sysPara->devOp->isHearterEnable()) + sysPara->devOp->controlHeater(true); + + if(sysPara->status.heaterONTimeCnt == MAX_HEATER_TIME){ + LogInfo::setRunStatusText(tr("警告:加热器长时间无法达到预期温度,故障或设置错误!")); + ui->tabMainWindow->setRunStatus("加热器长时间无法达到预期温度,故障或设置错误!");//20150105 no check + sysPara->devOp->controlHeater(false); + } + } + else { + if(sysPara->status.heaterONTimeCnt < MAX_HEATER_TIME) + { + sysPara->status.heaterONTimeCnt = 0; + } + if(sysPara->devOp->isHearterEnable()) + sysPara->devOp->controlHeater(false); + } +} + +void InkJetPrinter::cnt1GroupCheck(void) +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + static unsigned char lastGroupRunningIndex = 0; + if(sysPara->para.cnt1ByGroupEnalbe) + { + + + sysPara->devOp->ReadCnt1GroupStatus(); + if(lastGroupRunningIndex == sysPara->status.cnt1GroupRunningIndex) + return; + lastGroupRunningIndex = sysPara->status.cnt1GroupRunningIndex; + + emit updateCnt1GroupDisp(1); + } +#endif +} + +void InkJetPrinter::autoControlValvePump(void) + +{ + if(sysPara){ + if(!sysPara->status.isPumpValveControledByHand){ + + /*---------------------------------供墨阀--------------------------------------------*/ + bool enableFlag = ((sysPara->status.statWarn & WARN_STATUS_INK_SWINT) + || (sysPara->status.lastRecycleWarn && sysPara->para.RecycleWarnAction) // 2017.8.15版本回收故障关供墨阀问题 + || ( sysPara->status.HVFaultCloseEn ) //高压故障关闭墨线 + )?false:true; //墨线开关 +// if(enableFlag != sysPara->devOp->isInkValveOpen()){ +// sysPara->devOp->controlInkValve(enableFlag); //供墨阀 +// if(enableFlag == false){ //关闭 +// sysPara->status.cycleValveOpenCntAfterSWintOff = MAX_CYCLEVALVE_OPEN_TIME_AFTER_SWITN_OFF; +// } +// } + + if(enableFlag != sysPara->devOp->isInkValveOpen()){ + if(enableFlag == false) { //关闭供墨阀的顺序 先开循环阀后关闭供墨阀 +//#ifdef __AIR_RELEASE_OLD__ // 旧管路关闭墨线后 开粘度泵和循环阀一段时间 + if (sysPara->status.cycleValveOpenCntAfterSWintOff == 0) { + sysPara->status.cycleValveOpenCntAfterSWintOff = MAX_CYCLEVALVE_OPEN_TIME_AFTER_SWITN_OFF; + } + if (sysPara->status.cycleValveOpenCntAfterSWintOff < 60) { //在准备关闭循环阀的时候关闭供墨阀 + sysPara->devOp->controlInkValve(enableFlag); //关供墨 + } +//#else +// // 新管路直接关闭墨线 +// sysPara->devOp->controlInkValve(enableFlag); //关供墨 +//#endif + } + else { //开供墨阀 + if(!sysPara->devOp->isReclaimPumpOpen()) //开供墨阀之前要判断回收泵有没有开,没开就提前打开 + { + sysPara->devOp->controlReclaimPump(true, false); // 回收泵开 + } + if(!ui->tabMainWindow->m_2sFlag) + { + sysPara->devOp->controlInkValve(enableFlag); + } + } + } + + /*----------------------------------循环阀-------------------------------------------*/ + if(!sysPara->status.selfCheckDone || (sysPara->status.needPowerOffTimerout && sysPara->para.gearPumpEnable)){ +// if(!sysPara->devOp->isCycleValveOpen()){ //循环阀 //定时开机循环时隔膜泵不开关循环阀 +// sysPara->devOp->controlCycleValve(true); +// } + cycleValveRunForSelfCheck(); + if(sysPara->status.needPowerOffTimerout) + { + if(sysPara->devOp->isMixValveOpen()) { // + sysPara->devOp->controlMixValve(false); + } + } + } + else { + if(sysPara->status.cycleValveOpenCntAfterSWintOff){ // 开循环阀 + if(!sysPara->devOp->isCycleValveOpen()){ + sysPara->devOp->controlCycleValve(true); + } + sysPara->status.cycleValveOpenCntAfterSWintOff --; + } + else if(sysPara->devOp->isCycleValveOpen()){ // 关循环阀 + sysPara->devOp->controlCycleValve(false); + } + } + + /*----------------------------------泄压阀-------------------------------------------*/ + //===================================================================================================== + if(sysPara->status.PRESSURE - sysPara->para.pressure > MAX_PRESSURE_RELEASE_DIFF) + sysPara->status.pressureOverFlowCnt ++; + else + sysPara->status.pressureOverFlowCnt = 0; + + if(( + sysPara->status.releaseValveOpenApending || + sysPara->status.pressureOverFlowCnt > 2 + ) //防止干扰和误动作 + && !sysPara->status.releaseValveDelayCnt) + { + if(!sysPara->devOp->isReleaseValveOpen()) + { //泄压阀 + sysPara->devOp->controlReleaseValve(true); + } + sysPara->status.releaseValveDelayCnt = MAX_RELEASE_VALVE_DELAY_CNT; + sysPara->status.releaseValveOpenApending = true; + } + else + { + if(sysPara->devOp->isReleaseValveOpen()) + { // + //sysPara->devOp->controlReleaseValve(false); + } + + if(sysPara->status.releaseValveDelayCnt) + sysPara->status.releaseValveDelayCnt --; + if(sysPara->status.PRESSURE < sysPara->para.pressure) + { + sysPara->status.releaseValveOpenApending = false; + if(sysPara->devOp->isReleaseValveOpen()){ sysPara->devOp->controlReleaseValve(false); + + } + } + } +//======================================================================= +/* + if(sysPara->status.PRESSURE - sysPara->para.pressure > MAX_PRESSURE_RELEASE_DIFF) + sysPara->status.pressureOverFlowCnt ++; + else + sysPara->status.pressureOverFlowCnt = 0; + + if((sysPara->status.releaseValveOpenApending || + sysPara->status.pressureOverFlowCnt > 2) //防止干扰和误动作 + && !sysPara->status.releaseValveDelayCnt){ + if(!sysPara->devOp->isReleaseValveOpen()){ //泄压阀 + sysPara->devOp->controlReleaseValve(true); + } + sysPara->status.releaseValveDelayCnt = MAX_RELEASE_VALVE_DELAY_CNT; + sysPara->status.releaseValveOpenApending = true; + } + else { + if(sysPara->devOp->isReleaseValveOpen()){ // + sysPara->devOp->controlReleaseValve(false); + } + if(sysPara->status.releaseValveDelayCnt) + sysPara->status.releaseValveDelayCnt --; + if(sysPara->status.PRESSURE < sysPara->para.pressure){ + sysPara->status.releaseValveOpenApending = false; + } + } + + * */ + /*----------------------------------混合阀-------------------------------------------*/ + + /*备忘内容:主板的型号与软件版本 + `define JETV3 // EP4F15 V3板子 + `define JETV32 // EP3C10 V4板子 + `define JETV23 // V23板子 EP3C25 + */ + + /*-----------------------------------主墨泵------------------------------------------*/ + if(PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV3 || PRODUCT_VERSION(sysPara->status.fpgaVersionNum) >= JETV23 ){ + //20170830修改主板硬件版本号,以便与主板硬件版本编号对应, V7主板编号为7 + if(sysPara->status.warm_InkPump){ + if(!sysPara->status.lastwarmInkPump){ + if(!sysPara->para.gearPumpEnable) + { + LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!主墨泵故障")); + ui->tabMainWindow->setRunStatus(tr("主墨泵故障!!!")); + sysPara->status.lastwarmInkPump = 1; + } + } + } + } + else + { + if(sysPara->status.SEPTAL_POSITION < (sysPara->para.septalPostion - DIFF_SEPTAL_POSITION)) + sysPara->status.septalPositionOverFlowCnt ++; + else + sysPara->status.septalPositionOverFlowCnt = 0; + if(sysPara->status.septalPositionOverFlowCnt > 2 && !sysPara->status.mainInkPumpError){ //主墨泵 + if(!sysPara->devOp->isMainInkPumpOpen()){ + sysPara->devOp->controlMainInkPump(true); + sysPara->status.mainInkPumpRunTmCnt = 0; + /*备忘内容:主板的型号与软件版本 + `define JETV3 // EP4F15 V3板子 + `define JETV32 // EP3C10 V4板子 + `define JETV23 // V23板子 EP3C25 + */ + /*-----------------------------------老管路的溶剂随主墨泵一起动作---------------------------*/ + if(sysPara->status.selfCheckDone && !sysPara->para.mixValveisNewVersion && PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1){ + if(sysPara->devOp->isMixValveOpen()) + checkMixValveClose(); + else + checkMixValveOpen(); + } + /*--------------------------------------------------------------------------------------*/ + } + else if(sysPara->status.selfCheckDone){ + if(sysPara->status.mainInkPumpRunTmCnt < MAX_MAIN_INK_PUMP_RUN_TIME){ // + sysPara->status.mainInkPumpRunTmCnt ++; + } + else { + if(!sysPara->para.gearPumpEnable) + { + sysPara->status.mainInkPumpError = true; + sysPara->devOp->controlMainInkPump(false); + LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!主墨泵故障")); + ui->tabMainWindow->setRunStatus(tr("主墨泵故障!!!")); + } + } + } + } + else if(sysPara->status.SEPTAL_POSITION > sysPara->para.septalPostion){ + if(sysPara->devOp->isMainInkPumpOpen()) + sysPara->devOp->controlMainInkPump(false); + } + } + /*-----------------------------------压缩机------------------------------------------*/ + + if((sysPara->para.pressure - sysPara->status.PRESSURE > MAX_PRESSURE_DIFF) && !sysPara->status.compressPumpError){ //压缩机 + if(!sysPara->devOp->isCompressPumpOpen()){ + sysPara->devOp->controlCompressPump(true); + sysPara->status.compressPumpRunTmCnt = 0; + } + else if(sysPara->status.selfCheckDone){ + if(sysPara->status.compressPumpRunTmCnt < MAX_COMPRESS_PUMP_RUN_TIME){ //如果长时间开压缩机,考虑设备故障 + sysPara->status.compressPumpRunTmCnt ++; + } + else { + sysPara->status.compressPumpError = true; + sysPara->devOp->controlCompressPump(false); + if(!sysPara->para.gearPumpEnable) + { + LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!压缩机故障")); + ui->tabMainWindow->setRunStatus(tr("压缩机故障!!!")); + } + + } + } + } + else if(sysPara->para.pressure <= sysPara->status.PRESSURE){ //压力到达预期的压力 + if(sysPara->devOp->isCompressPumpOpen()) + sysPara->devOp->controlCompressPump(false); + } + + /*------------------------------------粘度泵,混合阀-----------------------------------------*/ + if(!sysPara->status.selfCheckDone){ +#ifdef __AIR_RELEASE_OLD__ + // 开机自检过程, 粘度泵跟随循环阀动作 + if ((sysPara->devOp->isCycleValveOpen() ^ sysPara->devOp->isViscosityPumpOpen()) && !sysPara->status.ink_Ctrl) { + sysPara->devOp->controlViscosityPump(sysPara->devOp->isCycleValveOpen()); + } +#endif + } +#if 0 + else if(!sysPara->devOp->isViscosityPumpOpen()) + { //粘度泵 +#ifdef __AIR_RELEASE_OLD__ + if(sysPara->status.cycleValveOpenCntAfterSWintOff) { //关闭墨线的时候要提前开粘度泵 + sysPara->status.viscosityDelayCnt = sysPara->para.viscosityPumpInterval*100 + 10; + } +#endif + if(sysPara->status.viscosityDelayCnt > sysPara->para.viscosityPumpInterval*100){ //换成10m为单位 + if( sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY) + { + if(sysPara->status.rWarnViscoReady>=3){ + //sysPara->status.rWarnViscoReady=0; + sysPara->status.viscosityFault = 1; + sysPara->status.viscosity=0; + LogInfo::setRunStatusText(tr("错误!粘度计下位灯故障.")); + } + else sysPara->status.rWarnViscoReady++; + } + else sysPara->status.rWarnViscoReady=0; + + if( sysPara->status.viscosityFaultCnt ) sysPara->status.viscosity=0;//sysPara->status.rWarnViscoReady + + sysPara->status.viscosityDelayCnt = 0; + sysPara->devOp->controlViscosityPump(true); + if(sysPara->para.mixValveisNewVersion || PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1){ + checkMixValveOpen(); + } + /*备忘内容:主板的型号与软件版本 + `define JETV3 // EP4F15 V3板子 + `define JETV32 // EP3C10 V4板子 + `define JETV23 // V23板子 EP3C25 + */ + //qDebug()<<"V1"<devOp->isViscosityPumpOpen(); + } + else + sysPara->status.viscosityDelayCnt ++; + } + else if((sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY) || + sysPara->status.viscosityDelayCnt > MAX_VISCOSITY_WORK_TIME) + { + if( sysPara->status.rWarnViscoReady ){ + if(((sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY) && (sysPara->status.viscosityDelayCnt >= 210) ) + || sysPara->status.viscosityDelayCnt > MAX_VISCOSITY_WORK_TIME) + { + sysPara->devOp->controlViscosityPump(false); + } + + if(sysPara->status.viscosityDelayCnt == MIX_VALVE_OPEN_DELAY){ + // 为了提前关闭混合阀,不需要打开那么久 + if(sysPara->para.mixValveisNewVersion || PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1){ + checkMixValveClose(); + } + } + } + else { + sysPara->devOp->controlViscosityPump(false); + if(sysPara->para.mixValveisNewVersion || PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1){ + checkMixValveClose(); + } + } + + if(!(sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY)){ + //LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!粘度计故障")); + if(sysPara->status.viscosityDelayCnt > MAX_VISCOSITY_WORK_TIME) + { + if(sysPara->status.viscosityFaultCnt>3){ + LogInfo::setRunStatusText(tr("错误!粘度计故障:检测不到上位灯.")); + sysPara->status.viscosityFault = 1; + sysPara->status.viscosity=0; + //sysPara->status.viscosityFaultCnt=0; + } + else sysPara->status.viscosityFaultCnt++; + } + } // + else { + sysPara->status.viscosityFaultCnt=0; + } + + sysPara->status.viscosityDelayCnt ++;// 10ms+1 + } + else + { + if(sysPara->status.viscosityDelayCnt == MIX_VALVE_OPEN_DELAY){ + // 为了提前关闭混合阀,不需要打开那么久 + if(sysPara->para.mixValveisNewVersion || PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1){ + checkMixValveClose(); + } + } + sysPara->status.viscosityDelayCnt ++; + } + + static int r_viscosityDelayCnt; + if(sysPara->status.viscosityDelayCnt != r_viscosityDelayCnt) + { // qDebug()<<"sysPara->status.viscosityDelayCnt"<status.viscosityDelayCnt; + r_viscosityDelayCnt=sysPara->status.viscosityDelayCnt; + } +#else + /*-----------------------------每30s打开一次粘度泵以及相关处理--------------------------------------*/ + else { + // static int viscosity_flag = 0; + static bool hasDetectedBellow = false; // 检测到下位灯 + static bool hasDetectedTop = false; // 检测到上位灯 + static int viscosity_low = 0; //统计粘度连续偏低10%次数 + static unsigned char Mixing_valve_open = 0; //统计粘度连续偏高5%次数 + static unsigned char viscosity_faulty_num = 0; //统计粘度连续偏高13%次数 + static bool flag = 0; + + if(sysPara->status.cycleValveOpenCntAfterSWintOff) { //关闭墨线的时候要提前开粘度泵 + sysPara->status.viscosityDelayCnt = sysPara->para.viscosityPumpInterval*100 + 100; + } + ++sysPara->status.viscosityDelayCnt; + int mixer_open_threshold = (105*sysPara->para.viscosity)/100; + int viscosity_faulty_threshold =(113*sysPara->para.viscosity)/100; + if(sysPara->status.viscosityDelayCnt >= sysPara->para.viscosityPumpInterval*100 && flag == 0) + { + flag=1; + if (!sysPara->devOp->isViscosityPumpOpen()) + { + sysPara->devOp->controlViscosityPump(true); + viscosity_timer->start(10000); + qDebug()<<"粘度: "<status.viscosity); + } + if((sysPara->status.viscosity >= 90*sysPara->para.viscosity/100) && (sysPara->status.viscosity <= mixer_open_threshold)) + { + sysPara->status.viscosityFault = 0; + viscosity_low=0; + Mixing_valve_open = 0; + viscosity_faulty_num = 0; + } + if(sysPara->status.viscosity < 90*sysPara->para.viscosity/100) + { + viscosity_low++; + viscosity_faulty_num = 0; + Mixing_valve_open = 0; + } + if(sysPara->status.viscosity > mixer_open_threshold && sysPara->status.viscosity <= viscosity_faulty_threshold) + { + Mixing_valve_open++; + viscosity_low = 0; + viscosity_faulty_num = 0; + } + if(sysPara->status.viscosity > viscosity_faulty_threshold){ + Mixing_valve_open++; + viscosity_faulty_num++; + viscosity_low = 0; + } + + if((!sysPara->devOp->isMixValveOpen()) && (((Mixing_valve_open > 1) && (!sysPara->para.gearPumpEnable)) || ((Mixing_valve_open > 4) && sysPara->para.gearPumpEnable))) { // + sysPara->devOp->controlMixValve(true); + Mixing_valve_open = 0; + LogInfo::setRunStatusText(tr("添加溶剂:")+QString::number(sysPara->status.viscosity)); + qDebug()<<"添加溶剂"; + } + + if(viscosity_low >= 60) + { + LogInfo::setRunStatusText(tr("警告!!!!!!!!!!!粘度值偏低")+QString::number(sysPara->status.viscosity)); + qDebug()<<"粘度值偏低"; + sysPara->status.viscosityFault = 2; + } + if(viscosity_faulty_num >= 5) + { + LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!粘度偏大故障")+QString::number(sysPara->status.viscosity)); + qDebug()<<"粘度偏大故障"; + sysPara->status.viscosityFault = 1; + } + + } + if((sysPara->status.viscosityDelayCnt >= (sysPara->para.viscosityPumpInterval*100+120)) && flag==1) + { + if(sysPara->devOp->isMixValveOpen()) { + sysPara->devOp->controlMixValve(false); + } + } + + if((sysPara->status.viscosityDelayCnt >= (sysPara->para.viscosityPumpInterval*100+130)) && flag==1) + { + if (sysPara->devOp->isViscosityPumpOpen()) { + sysPara->devOp->controlViscosityPump(false); + } + sysPara->status.viscosityDelayCnt = 0; + flag=0; + } + + if(sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY){ //上位灯检测标志位 + viscosity_timer->stop(); + } + + if(sysPara->status.viscosityDelayCnt < sysPara->para.viscosityPumpInterval*100) { + static int detectBelow = 0; + if (++detectBelow%400 == 0) { + if(sysPara->status.statWarn & WARN_STATUS_VISCOTITY_MEASURE_READY) + { + if(sysPara->status.rWarnViscoReady>=15){ + sysPara->status.viscosityFault = 1; + sysPara->status.viscosity=0; + if(!firstTime) + qDebug()<<"错误!粘度计下位灯故障."+QString::number(sysPara->status.viscosity); + // LogInfo::setRunStatusText(tr("错误!粘度计下位灯故障.")+QString::number(sysPara->status.viscosity)); + hasDetectedBellow = true; + } + else sysPara->status.rWarnViscoReady++; + } + else { + sysPara->status.rWarnViscoReady = 0; + sysPara->status.viscosityFault = 0; + } + } + } + if(hasDetectedBellow && hasDetectedTop) + { + if(sysPara->devOp->isMixValveOpen()) { // + sysPara->devOp->controlMixValve(false); //如果检测不到上下位灯就关掉混合阀 + } + } + if(sysPara->status.viscosityFault==0) + { + hasDetectedBellow = false; + hasDetectedTop = false; + } + } +#endif + /*-----------------------------------回收泵------------------------------------------*/ + + if(!sysPara->status.autoCtlReclaimAfterSWintOff) + { + if(!sysPara->devOp->isReclaimPumpOpen() ){ //回收泵 + // ui->tabMainWindow->setRunStatus(tr("全速回收泵!!!")); + sysPara->status.reclaimPumpFullSpeedCnt = 0; + sysPara->devOp->controlReclaimPump(true,true); //先全速,后降速 + } + else if(sysPara->status.reclaimPumpFullSpeedCnt <= RECLAIM_PUMP_FULL_SPEED_CNT){ + sysPara->status.reclaimPumpFullSpeedCnt ++; + if(sysPara->status.reclaimPumpFullSpeedCnt == RECLAIM_PUMP_FULL_SPEED_CNT){ //降速 + // ui->tabMainWindow->setRunStatus(tr("降速回收泵!!!")); + sysPara->devOp->controlReclaimPump(true,false); + } + } + } + /*-----------------------------------------------------------------------------*/ + } + } +} +//========================== +// 放在10ms的定时器运行,但和粘度泵工作周期一致 +void InkJetPrinter::checkMixValveOpen(){ + //混合阀 + if(sysPara->status.viscosity>40000){ + sysPara->status.viscosityMaxFaultCnt++; + if(sysPara->status.viscosityMaxFaultCnt>5) + { + sysPara->status.viscosityMaxFaultCnt=0; + if(sysPara->status.viscosityFault ==0 ) LogInfo::setRunStatusText(tr("粘度检测异常,粘度值太大!!!")); + sysPara->status.viscosityFault=1; + } + sysPara->status.viscosity=0; + } + int mixer_open_threshold = MAX_VISICOSITY_RATIO*sysPara->para.viscosity/100; + int mixer_open_threshold_high = (MAX_VISICOSITY_RATIO + 11)*sysPara->para.viscosity/100; + if(sysPara->status.viscosity > mixer_open_threshold) + {// 粘度值高报警: 条件@高于设定值的1.05,时间:120个测量周期 + sysPara->status.visocityValueOverflowNum ++; + if(sysPara->status.visocityValueOverflowNum >= (MAX_VISICOSITY_VALUE_OVERFLOW_NUM/3)){ + if((sysPara->status.viscosity >= mixer_open_threshold_high)//超出太多加得快,否则隔三下,加一下 + || ((sysPara->status.visocityValueOverflowNum % 3) == 0)){ + if(!sysPara->devOp->isMixValveOpen()){ // + sysPara->devOp->controlMixValve(true); + LogInfo::setRunStatusText(tr("混合阀打开2:")+QString::number(sysPara->status.viscosity)); + } + } + } + if(sysPara->status.visocityValueOverflowNum > MAX_ALLOW_VISICOSITY_OVERFLOW_NUM){ + if(sysPara->status.viscosityFault ==0 ) + LogInfo::setRunStatusText(tr("错误!!!!!!!!!!!粘度偏大故障")); + + sysPara->status.viscosityFault = 1; + } + } + else if(sysPara->status.viscosity > 90*sysPara->para.viscosity/100){ + // 粘度值正常 + sysPara->status.visocityValueOverflowNum = 0; + sysPara->status.viscosityFault = 0; // 20160922 粘度低报警不能复位问题 + } + else {// 粘度值低报警: 条件@ 低于设定值的0.9,时间:60个测量周期 + sysPara->status.visocityValueOverflowNum ++; + if(sysPara->status.visocityValueOverflowNum > (MAX_ALLOW_VISICOSITY_OVERFLOW_NUM/2)){ + + if(sysPara->status.viscosityFault ==0 ) LogInfo::setRunStatusText(tr("警告!!!!!!!!!!!粘度值偏低")); + sysPara->status.viscosityFault = 2; + sysPara->status.visocityValueOverflowNum=MAX_ALLOW_VISICOSITY_OVERFLOW_NUM-10; + } + } +} + + +void InkJetPrinter::checkMixValveClose(){ + if(sysPara->devOp->isMixValveOpen()){ // 关闭混合阀 + sysPara->devOp->controlMixValve(false); + } +} + +//在开机自检过程中交替打开和关闭循环阀 +void InkJetPrinter::cycleValveRunForSelfCheck(){ + static int cycleValveOpenCnt = 0; + if (++cycleValveOpenCnt%300 > 150) { + if(!sysPara->devOp->isCycleValveOpen()){ //循环阀 开 + sysPara->devOp->controlCycleValve(true); + } + } + else { + if(sysPara->devOp->isCycleValveOpen()){ //循环阀 关 + sysPara->devOp->controlCycleValve(false); + } + } +} + +void InkJetPrinter::onReclaimTankBlock(){ + if(sysPara){ + ui->tabMainWindow->enableReclaimCtrlButton(true); + sysPara->status.reclaimTankBlockedAppending = true; + if(sysPara->status.powerOffAppending && sysPara->status.powerOffAfterPhaseFaultAppending) + ui->tabMainWindow->checkForPowerOff(); + sysPara->status.powerOffAppending = false; //如果有关机动作,终止 + + } + +} +/* + * + * 控制回收槽 + * + * */ + +void InkJetPrinter::detectAndcontrolReclaimTank(){ + sysPara->status.currReclaimTankPos =10*sysPara->status.curr_reclaimTankTime; + sysPara->status.reclaimTankBlockedAppending =0; + //qDebug()<status.reclaimTankstatus; + + if(sysPara->status.reclaimTankstatus == 0x10 ) //7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + if(sysPara->devOp->isReclaimTankCloseEnable()) + { + LogInfo::setRunStatusText(tr("电机故障")); + ui->tabMainWindow->setRunStatus(tr("电机故障")); + sysPara->devOp->controlReclaimTankClose(false); + ui->tabMainWindow->resetReclaimCtrlButtonText(); + emit reclaimTankBlock(); + } + else { + LogInfo::setRunStatusText(tr("电机故障")); + ui->tabMainWindow->setRunStatus(tr("电机故障!!!")); + sysPara->devOp->controlReclaimTankOpen(false); + ui->tabMainWindow->resetReclaimCtrlButtonText(); + emit reclaimTankBlock(); + } + + } + else if(sysPara->status.reclaimTankstatus == 5 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + sysPara->devOp->controlReclaimTankOpen(false); //到头,关闭 + sysPara->status.reclainTankReachEnd = true; + /*应要求去掉多余到信息 LogInfo::setRunStatusText(tr("回收槽到头"));*/ + ui->tabMainWindow->setRunStatus(tr("回收槽到头")); + ui->tabMainWindow->enablePrintButton(true); //仅仅在此时能使能打印按钮 + ui->tabMainWindow->resetReclaimCtrlButtonText(); + emit reclaimTankOpenDone(); + /*回收槽开关时间校正*/ + sysPara->para.reclaimTankTime =( sysPara->status.currReclaimTankPos>120 )? sysPara->status.currReclaimTankPos/10-1:12; + ui->tabSystemSetting->updateReclaimTime( sysPara->para.reclaimTankTime ); + } + else if(sysPara->status.reclaimTankstatus == 0x11 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + sysPara->devOp->controlReclaimTankOpen(false); //卡住,关闭 + ui->tabMainWindow->resetReclaimCtrlButtonText(); + LogInfo::setRunStatusText(tr("回收槽卡住或者回收槽开关时间设置错误")); + ui->tabMainWindow->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误")); + emit reclaimTankBlock(); + } + else if(sysPara->status.reclaimTankstatus == 1 || sysPara->status.reclaimTankstatus == 2)//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + emit setReclaimTankCurrentPos(sysPara->status.currReclaimTankPos); + sysPara->status.reclaimBlockedCnt = 0; + + } + else if(sysPara->status.reclaimTankstatus == 6 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + sysPara->devOp->controlReclaimTankClose(false); //到头,关闭 + /*应要求去掉多余到信息 LogInfo::setRunStatusText(tr("回收槽到头"));*/ + ui->tabMainWindow->setRunStatus(tr("回收槽到头")); + //sysPara->status.currReclaimTankPos = 0; //将回收槽的时间置为零 + ui->tabMainWindow->resetReclaimCtrlButtonText(); + emit reclaimTankCloseDone(); + sysPara->status.lastRecycleWarn = 0; + sysPara->status.HVFaultCloseEn=0; + sysPara->status.reclainCloseAppending=false; + sysPara->status.canRunAirPushing = true; //下次开回收槽就执行排气程序 + //emit reclaimTankBlock(); + } + else if(sysPara->status.reclaimTankstatus == 0x12 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + sysPara->devOp->controlReclaimTankOpen(false); //到头,关闭 + LogInfo::setRunStatusText(tr("回收槽卡住或者回收槽开关时间设置错误")); + ui->tabMainWindow->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误")); + ui->tabMainWindow->resetReclaimCtrlButtonText(); + emit reclaimTankBlock(); + } + else // if(sysPara->status.reclaimTankstatus == 7 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作 + { + emit setReclaimTankCurrentPos(sysPara->status.currReclaimTankPos); + } +} + +static void controlTabDisplay(QTabWidget *tab,QWidget *page,QString name,int enable){ + if(enable){ + if(tab->indexOf(page) == -1){ + tab->addTab(page,name); + + } + } + else { + int index = tab->indexOf(page); + if(index != -1) + tab->removeTab(index); + } + +} + +static void controlTabDisplay(QTabWidget *tab,QWidget *page,QString name,int enable,int Pos){ + if(enable){ + if(tab->indexOf(page) == -1){ + tab->insertTab(Pos,page,name); + } + } + else { + int index = tab->indexOf(page); + if(index != -1) + tab->removeTab(index); + } + +} +void InkJetPrinter::onAuthChanged(int auth){ + + controlTabDisplay(this,ui->tabSystemSetting,tr("系统设置"),auth&AUTH_DISPLAY_SYSTEM_SETTING); + controlTabDisplay(this,ui->tabSystemManage,tr("系统管理"),auth&AUTH_DISPLAY_SYSTEM_MANAGE); + controlTabDisplay(this,ui->tabOtherInfo,tr("其他信息"),auth& AUTH_DISPLAY_OTHER_INFO); + controlTabDisplay(this,ui->tabLogInfo,tr("日志信息"),auth&AUTH_DISPLAY_LOG_INFO); + controlTabDisplay(this,ui->tabNetworkManager,tr("网络管理"),auth&AUTH_SUPER_USER1); + + // controlTabDisplay(this,ui->tabZkEdit,tr("图案编辑"),auth); + ui->tabPrintSetting->updateAuthorization(auth); + ui->tabSystemSetting->updateAuthorization(auth); + ui->tabNetworkManager->updateAuthorization(auth); +} + +void InkJetPrinter::onConfigChanged(void){ + + sysPara->loadParaFromFile(); +} + +/* + * 这个方法的主要目的是在切换tab时不要弹出输入法 + * + */ + +void InkJetPrinter::onInkJetPrinterCurrentChanged(int index) +{ + QWidget *w = widget(index); + if(w){ + QWidget *subWidget = w->focusWidget(); + if(subWidget) + subWidget->clearFocus(); + } + //if(index == 3||index == 3) //刷新打印设置这个界面 + { + ui->tabPrintSetting->update(); + } +} + +void InkJetPrinter::closeEvent(QCloseEvent *event) +{ +#ifdef SYS_LINUX + event->ignore(); +#else + exit(1); +#endif +} +void InkJetPrinter::resizeEvent(QResizeEvent *event){ + + event->ignore(); +} + +void InkJetPrinter::onChangeTab(QString) +{ + this->setCurrentIndex (indexOf( ui->tabPicEdit)); +} +void InkJetPrinter::onchangeEditMode(int) +{ + if(sysPara){ + if(sysPara->para.EditMode == PICFILE) { + insertTab(1,ui->tabPicEdit,tr("信息编辑")); + // controlTabDisplay(this,ui->tabZkEdit,tr("图案编辑"),0); + } + else if(sysPara->para.EditMode == TXTFILE|| sysPara->para.EditMode == SCENE){ + controlTabDisplay(this,ui->tabPicEdit,tr("信息编辑"),0); + // controlTabDisplay(this,ui->tabZkEdit,tr("图案编辑"),1,1); + } + ui->tabMainWindow->changeEditMode(sysPara->para.EditMode); + } + else{ + + } +} + + +void InkJetPrinter::OnSpeedOver(int mode) +{ + if(mode==2){ + //emit QMessageBox::warning(NULL,tr("警告"),tr("喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!!")); + msgtest->setText(tr("喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!!")); + msgtest->show(); + } + else if(mode==1){ + //emit QMessageBox::warning(NULL,tr("警告"),tr("喷印速度过快或间隔太短!无法喷印完全!!!")); + msgtest->setText(tr("喷印速度过快或间隔太短!无法喷印完全!!!")); + msgtest->show(); + } +} + +void InkJetPrinter::onPrintErrorStatus(QString s,unsigned int res) +{ + if(res==1 || sysPara->status.WorkTimeOut ){ + sysPara->status.WorkTimeOut =1; + sysPara->devOp->printCtrl( PRINT_CTRL_STOP); + //emit QMessageBox::warning(NULL,tr("警告"),s); + msgtest->setText(s); + msgtest->show(); + } + else if(res==2) { + //emit QMessageBox::warning(NULL,tr("警告"),s); + msgtest->setText(s); + msgtest->show(); + } + else if(res==3) { sysPara->status.WorkTimeOut =0; } +} +void InkJetPrinter::OnFinished(int event){ + //msgtest->setText(" ");msgtest->show(); + Q_UNUSED(event); + msgtest->hide(); + +} +unsigned char BCDtoHEX(unsigned char BCD) +{ + unsigned char tempData; + + tempData = (BCD >> 4) * 10 + (BCD & 0x0F); + return (tempData); +} +void InkJetPrinter::refreshModbusStatus(void) +{ +#ifdef MODBUS + if (modbus->getModbusStatus() != 1) { + qDebug()<<"refresh get modbus error"; + return; + } + + qint16 fileNameSize = QFileInfo(sysPara->para.lastOpenedFileName).fileName().size(); + if (fileNameSize) { + if (fileNameSize > 100) { + fileNameSize = 100; + } + } + QString str = QFileInfo(sysPara->para.lastOpenedFileName).fileName(); + snprintf((char *)sysPara->modbusStatus.usedFileName, sizeof(sysPara->modbusStatus.usedFileName), "%s",(char *)str.toAscii().constData()); + sysPara->modbusStatus.printStatus = ui->tabMainWindow->getCurrPrintStatus(); + memcpy(&sysPara->modbusStatus.curCalendarAndDate, &sysPara->status.calandar_and_dat, sizeof(sysPara->status.calandar_and_dat)); + + unsigned char tmp[4]; + memcpy(&tmp,&sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue,4); + tmp[0] = BCDtoHEX(tmp[0]); + tmp[1] = BCDtoHEX(tmp[1]); + tmp[2] = BCDtoHEX(tmp[2]); + tmp[3] = BCDtoHEX(tmp[3]); + //memcpy(&sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue,&tmp,4); + sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue = tmp[3]*1000000 + tmp[2]*10000+ tmp[1]*100 + tmp[0] ; + //sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue = QString::number(sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue).toUInt(0,16); + sysPara->modbusStatus.curCalendarAndDate.cnt1CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + sysPara->modbusStatus.curCalendarAndDate.cnt2CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); + sysPara->modbusStatus.curCalendarAndDate.cnt1End = sysPara->para.cnt1EndValue; + sysPara->modbusStatus.curCalendarAndDate.cnt2End = sysPara->para.cnt2EndValue; + sysPara->modbusStatus.curCalendarAndDate.cnt2Repeat = sysPara->para.cnt2RepeateValue; + sysPara->modbusStatus.curCalendarAndDate.cnt2InitValue = sysPara->para.cnt2StartValue; + sysPara->modbusStatus.productCnt = sysPara->status.productCnt; + + + sysPara->modbusStatus.statWarn = sysPara->status.RedLightOnFlag ; + // 显示正在打印内容的行数和列数 + int wmax = sysPara->status.currPrintRow; + if (sysPara->para.AlterMode) { + wmax = sysPara->status.currAlterPrintRow; + } + sysPara->modbusStatus.mbCurrPrintRow = wmax; + sysPara->modbusStatus.mbCurrPrintCol = sysPara->status.currPrintCol; +#endif +} + +void InkJetPrinter::onModbusWriteCalendar() +{ +#ifdef MODBUS + if (modbus->getModbusStatus() == -1) { + qDebug()<<"get modbus error"; + return; + } + + sysPara->para.cnt1StartValue = sysPara->modbusParas.setCalendar.cnt1CurrValue; + sysPara->para.cnt1EndValue = sysPara->modbusParas.setCalendar.cnt1End; + sysPara->para.cnt1CurrValue = sysPara->modbusParas.setCalendar.cnt1Repeat; + sysPara->para.cnt1StepValue = sysPara->modbusParas.setCalendar.cnt1Step; + + sysPara->para.cnt2StartValue = sysPara->modbusParas.setCalendar.cnt2InitValue; + sysPara->para.cnt2EndValue = sysPara->modbusParas.setCalendar.cnt2End; + sysPara->para.cnt2StepValue = sysPara->modbusParas.setCalendar.cnt2Repeat; + sysPara->para.cnt2RepeateValue = sysPara->modbusParas.setCalendar.cnt2Step; + + if (sysPara->modbusParas.setCalendar.cntCurrValueInitEnable & 0x02) { + sysPara->status.cnt2CurrentValueInitDoneFlag = 0; + } + if (sysPara->modbusParas.setCalendar.cntCurrValueInitEnable & 0x01) { + sysPara->status.cnt1CurrentValueInitDoneFlag = 0; + } + sysPara->para.cnt1CurrValue = sysPara->modbusParas.setCalendar.cnt1CurrValue; + sysPara->para.cnt2CurrValue = sysPara->modbusParas.setCalendar.cnt2CurrValue; + sysPara->devOp->writeFpgaCalandar(0); + emit updataPara2UI(); +#endif +} + +void InkJetPrinter::close_jd_timer() +{ + jd_timer->stop(); + timer->stop(); +} + +void InkJetPrinter::handlePushButtonStartPressed(bool flag) +{ + pushButtonStartFlag = flag; + + if(flag) + { + PID_init(); + } + sysPara->status.gearPumpRunStopFlag = !flag;//齿轮泵开关 +} + +void InkJetPrinter::handleInitedPID() +{ + PID_init(); +} + +void InkJetPrinter::fpgaDebugWriteByte() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaByteAddrSpinBox->value(); + unsigned char fpgaValue = ui->fpgaByteValueSpinBox->value(); + sysPara->devOp->fpgaWr(fpgaAddr, &fpgaValue, 1); +#endif +} + +void InkJetPrinter::fpgaDebugReadByte() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaByteAddrSpinBox->value(); + unsigned char fpgaValue; + sysPara->devOp->fpgaRd(fpgaAddr, &fpgaValue, 1); + ui->fpgaByteValueSpinBox->setValue(fpgaValue); + +#endif +} + +void InkJetPrinter::fpgaDebugWriteWord() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaWordAddrSpinBox->value(); + unsigned int fpgaValue = ui->fpgaWorldValueSpinBox->value(); + unsigned char buff[2]; + buff[0] = fpgaValue & 0xFF; + buff[1] = (fpgaValue >> 8) & 0xFF; + sysPara->devOp->fpgaWr(fpgaAddr, buff, 2); +#endif +} + +void InkJetPrinter::fpgaDebugReadWord() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaWordAddrSpinBox->value(); + unsigned int fpgaValue; + unsigned char buff[2]; + sysPara->devOp->fpgaRd(fpgaAddr, buff, 2); + fpgaValue = buff[1]<<8|buff[0]; + ui->fpgaWorldValueSpinBox->setValue(fpgaValue); +#endif +} + +void InkJetPrinter::fpgaDebugWriteDWord() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaDWordAddrSpinBox->value(); + unsigned int fpgaValueH = ui->fpgaDWorldValueHSpinBox->value(); + unsigned int fpgaValueL = ui->fpgaDWorldValueLSpinBox->value(); + unsigned char buff[4]; + buff[0] = fpgaValueL & 0xFF; + buff[1] = (fpgaValueL >> 8) & 0xFF; + buff[2] = fpgaValueH & 0xFF; + buff[3] = (fpgaValueH >> 8) & 0xFF; + sysPara->devOp->fpgaWr(fpgaAddr, buff, 4); +#endif +} + +void InkJetPrinter::fpgaDebugReadDWord() +{ +#ifdef __FPGA_DEBUG__ + if(sysPara == NULL) { + return; + } + int fpgaAddr = ui->fpgaDWordAddrSpinBox->value(); + unsigned char buff[4]; + sysPara->devOp->fpgaRd(fpgaAddr, buff, 4); + unsigned int fpgaValueL = buff[1]<<8|buff[0]; + unsigned int fpgaValueH = buff[3]<<8|buff[2]; + ui->fpgaDWorldValueHSpinBox->setValue(fpgaValueH); + ui->fpgaDWorldValueLSpinBox->setValue(fpgaValueL); +#endif +} + +void InkJetPrinter::recievedFile2Save(QString fileName) +{ + //qDebug() << "recieveFile2Save:"<exists(saveName); + if (exist) + { + createfile->remove(saveName); + }//end if + QFile::copy ( sourceName,saveName ); + emit openFile(saveName,false); + //emit startPrint();确认接收到消息立即打印 + //ui->tabMainWindow->getTexteditOption()->onFileOpen(saveName,false); + //ui->tabMainWindow->on_pushButtonStartPrint_pressed(); + } + else { + + } +} + +void InkJetPrinter::viscosity_timerHandler() +{ + if(!firstTime) + qDebug()<<"错误!粘度计故障:检测不到上位灯"; + // LogInfo::setRunStatusText(tr("错误!粘度计故障:检测不到上位灯")); + viscosity_timer->stop(); + firstTime = 0; +} +void InkJetPrinter::disableTabClick(){ + this->setDisabled(true); + this->setCurrentIndex(0); +} +unsigned int InkJetPrinter::getModbusPort(){ +// return sysPara->para.ModbusTCPPort; + return 5022; +} + + +static int highPressureCnt = 0; +static unsigned int logCnt = 0; +void InkJetPrinter::checkPressureControl(){ //1s + unsigned int alarmPressure = 0; + if(sysPara->para.pressure <= 700) + alarmPressure = 800; + else + alarmPressure = 900; + + if(sysPara->status.PRESSURE > alarmPressure) + highPressureCnt++; + else + highPressureCnt = 0; + + if(highPressureCnt >= 4 && sysPara->status.PRESSURE > 1000){ + QString str = tr("压力过高,请检查管路是否堵塞,然后点击故障恢复按钮"); + showMessage(str); + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + sysPara->status.isPumpValveControledByHand = true; + sysPara->devOp->mainInkCtrl(); + sysPara->status.flagOfPressureFault = true; + } +} + +void InkJetPrinter::showMessage(QString str){ + if(logCnt++ % 30 == 0){ + LogInfo::setRunStatusText(str); + qDebug()<devOp->color_flag = 2; + ui->tabMainWindow->setRunStatus(str); +} + +void InkJetPrinter::resetPressureCnt(){ + logCnt = 0; + highPressureCnt = 0; + sysPara->status.isPumpValveControledByHand = false; +} + +void InkJetPrinter::pressureAdjustForsystemseeting(){ + pressureAdj(1); +} diff --git a/InkJetPrinter.h b/InkJetPrinter.h new file mode 100644 index 0000000..6d8f8ed --- /dev/null +++ b/InkJetPrinter.h @@ -0,0 +1,136 @@ +/* + * + * + * DIFF_SEPTAL_POSITION 隔膜位置由20改为50的主泵动作时间 + */ +#ifndef INKJETPRINTER_H +#define INKJETPRINTER_H + +#define SPEEDOVER //超速停止 + + +#include +#include +#include +#include "Tftp/filetranseceiver.h" +#include "ParaSettingUI.h" +#include "modbus/modbustcp.h" +#include +#include "dlgshowmsg.h" +#include +#include + +namespace Ui { +class InkJetPrinter; +} + + +#define MAX_PRESSURE_RELEASE_DIFF 25 +#define MAX_PRESSURE_DIFF 50 +#define MAX_VISICOSITY_RATIO 110 //105% +#define DIFF_SEPTAL_POSITION 50 +#define MAX_VISICOSITY_VALUE_OVERFLOW_NUM 3 //连续超过此值会进行粘度调整 +#define MAX_ALLOW_VISICOSITY_OVERFLOW_NUM 120 //连续超那么多次,会被认为粘度故障 + +class PicScene; + +class InkJetPrinter : public QTabWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit InkJetPrinter(QWidget *parent = 0); + ~InkJetPrinter(); + void pressureAdj(int); + FileTranseceiver* fileTransceiv; +// void processCommands(); +#ifdef MODBUS +// class ModbusSerial *modbus; + class ModbusTcp *modbus; + QThread m_thread; + unsigned int getModbusPort(); +#endif + +public slots: + void onchangeEditMode(int); + void onChangeTab(QString); + //void onPrintErrorStatus(QString s); + void onPrintErrorStatus(QString s, unsigned int res); + + void close_jd_timer(); + void handlePushButtonStartPressed(bool); + void handleInitedPID(); + + void onModbusWriteCalendar(); + void resetPressureCnt(); + void pressureAdjustForsystemseeting(); + +private: + Ui::InkJetPrinter *ui; + DlgShowMsg *dlgShowMsg; + QTimer* viscosity_timer; + QTimer* timer; + QTimer* jd_timer; + QTime t1; + void autoControlHeater(); + void autoControlValvePump(); + void detectAndcontrolReclaimTank(); + void refreshModbusStatus(void); + void checkPressureControl(); + void showMessage(QString); + +Q_SIGNALS: + +// void updateQRcode(); +// void startPrint(); +// void pausePrint(); +// void stopPrint(); + + void setReclaimTankCurrentPos(int); + void reclaimTankOpenDone(); + void reclaimTankCloseDone(); + void reclaimTankBlock(); //回收槽卡住 + //void changeEditMode(int); + void SpeedOver(int mode); + void updateCnt1GroupDisp(bool); + void updataPara2UI(); + void sendPicScene(PicScene* pPicScene); + void openFile(QString filePath,bool insertFlag); + +private slots: + void OnSpeedOver(int mode); + void jd_timerHandler(); + void timerHandler(); + void onInkJetPrinterCurrentChanged(int index); + void onReclaimTankBlock(); + void onAuthChanged(int auth); + void onConfigChanged(); + void OnFinished(int event); + void DacAdjustStore(); + void fpgaDebugWriteByte(); + void fpgaDebugReadByte(); + void fpgaDebugWriteWord(); + void fpgaDebugReadWord(); + void fpgaDebugWriteDWord(); + void fpgaDebugReadDWord(); + void recievedFile2Save(QString fileName); + void viscosity_timerHandler(); + void disableTabClick(); +private: + + QLabel *t_label; + QMessageBox *msgtest; + void closeEvent(QCloseEvent *event); + void resizeEvent(QResizeEvent *); + void checkMixValveOpen(); + void checkMixValveClose(); + void cycleValveRunForSelfCheck(); + void cnt1GroupCheck(void); + void loadVoltageValue(); + char jd_res; + bool pushButtonStartFlag; + + unsigned char rWarnViscoReady; +}; + +#endif // INKJETPRINTER_H diff --git a/InputMethod.cpp b/InputMethod.cpp new file mode 100644 index 0000000..b577b35 --- /dev/null +++ b/InputMethod.cpp @@ -0,0 +1,1419 @@ +/* +* +*2013.9.12 括号错位修复 为了节约cpu最好改用映射方式 &仍未能显示出来 中文模式下小括号还是错位 +*/ +/* + Key_Backspace1 = 0x01001003, + Key_Return1 = 0x01001004, + Key_Enter1 = 0x01001005, + Key_Insert1 = 0x01001006, + Key_Delete1 = 0x01001007, + Key_Clear1 = 0x0100100b, + Key_Home1 = 0x01001010, // cursor movement + Key_End1 = 0x01001011, + Key_Left1 = 0x01001012, + Key_Up1 = 0x01001013, + Key_Right1 = 0x01001014, + Key_Down1 = 0x01001015, + Key_PageUp1 = 0x01001016, + + */ +#include +#include +#include +#include +#include +#include +#include +#include "MyInputMethod.h" +#include "InputMethod.h" +#include "ui_InputMethod.h" +#include "Public.h" +#include +#include +#include +#include + +QHash *> *InputMethod::pinyinHash = NULL; +QList InputMethod::pinyinHashKeys; +QStringList InputMethod::pinyinHashQStringList; + + +InputMethod::InputMethod(MyInputMethod *myInputMethod,QWidget *parent) : + QWidget(parent,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)),//(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)如果不设置标志,会抢焦点 + ui(new Ui::InputMethod),spaceTimer(this) +{ + + //setWindowOpacity(0.9); + + this->myInputMethod = myInputMethod; + ui->setupUi(this); + currentInputMethodType = INPUT_METHOD_TYPE_ENGLISH; + shiftFlag = false; + pinyinPage = 0; + /*---------------------------------------------------*/ + labelInputTip.setParent(0,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)); + //QFont font(Public::getFontFamily(24)); + //font.setPixelSize(20); + //labelInputTip.setFont(font); + labelInputTip.setAlignment(Qt::AlignCenter); + labelInputTip.setFrameShape(QFrame::Box); + labelInputTip.setFrameShadow(QFrame::Sunken); + labelInputTip.hide(); + /*---------------------------------------------------*/ + + + buttonConnect(ui->Key_QuoteLeft,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_one,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_two,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_three,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_four,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_five,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_six,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_seven,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_eight,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_nine,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_zero,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Minus,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Equal,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_BracketLeft,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_BracketRight,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_BackSlash,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Semicolon,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Apostrophe,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Comma,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Period,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Slash,this,SLOT(onDigitalPunctuationClicked())); + buttonConnect(ui->Key_Space,this,SLOT(onDigitalPunctuationClicked())); + connect(ui->Key_Space, SIGNAL(pressed()), this, SLOT(spaceKeyPressed())); + connect(ui->Key_Space, SIGNAL(released()), this, SLOT(spaceKeyRelease())); + connect(&spaceTimer, SIGNAL(timeout()), this, SLOT(spaceKeyLongPressed())); + connect(&backtimer, SIGNAL(timeout()), this, SLOT(backKeyLongPressed())); + connect(&insertSpaceNumDialog,SIGNAL(accepted()),this,SLOT(onInsertSpaceNumDialogAccepted())); + buttonConnect(ui->Key_A,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_B,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_C,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_D,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_E,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_F,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_G,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_H,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_I,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_J,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_K,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_L,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_M,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_N,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_O,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_P,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_Q,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_R,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_S,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_T,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_U,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_V,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_W,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_X,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_Y,this,SLOT(onCharClicked())); + buttonConnect(ui->Key_Z,this,SLOT(onCharClicked())); + + buttonConnect(ui->Key_ShiftLeft,this,SLOT(onShiftClicked())); + + //buttonConnect(ui->Key_InputMethodSelect,this,SLOT(onInputMethodClicked())); + connect(ui->Key_InputMethodSelect,SIGNAL(released()),this,SLOT(onInputMethodClicked())); + buttonConnect(ui->Key_Backspace,this,SLOT(onBackspaceClicked())); + buttonConnect(ui->Key_Last,this,SLOT(onKeyLastClicked())); + buttonConnect(ui->Key_Next,this,SLOT(onKeyNextClicked())); + buttonConnect(ui->Key_Enter,this,SLOT(onEnterClicked())); + buttonConnect(ui->Key_Left,this,SLOT(onKeyLeftpressed())); + buttonConnect(ui->Key_Down,this,SLOT(onKeyDownpressed())); + buttonConnect(ui->Key_Up,this,SLOT(onKeyUppressed())); + buttonConnect(ui->Key_Right,this,SLOT(onKeyRightpressed())); + buttonConnect(ui->Key_Home,this,SLOT(onKeyHomepressed())); + buttonConnect(ui->Key_End,this,SLOT(onKeyEndpressed())); + buttonConnect(ui->Key_delete,this,SLOT(onKeydeletepressed())); + buttonConnect(ui->Key_SpecialChar,this,SLOT(onKeySpecialCharpressed())); + //connect(ui->Key_SpecialChar,SIGNAL(pressed()),this,SLOT(onInputMethodClicked())); + buttonConnect(ui->Key_Ctrl,this,SLOT(onKeyCtrlpressed())); + buttonConnect(ui->pushButtonCaps,this,SLOT(onpushButtonCapspressed())); + /*----------------------------------------------------------------------------------------------*/ + hanziDisplayLabels[0] = ui->hanzi_1ch; + hanziDisplayLabels[1] = ui->hanzi_2ch; + hanziDisplayLabels[2] = ui->hanzi_3ch; + hanziDisplayLabels[3] = ui->hanzi_4ch; + hanziDisplayLabels[4] = ui->hanzi_5ch; + for(int i = 0; i < HANZI_SELECT_NUM; i++){ //担心用户改动HANZI_SELECT_NUM却没改动上面 + if(!hanziDisplayLabels[i]) + QMessageBox::critical((QWidget *)0,tr("错误"),tr("hanziDisplayLabels缺少初始化")); + else{ + hanziDisplayLabels[i]->setText(""); + connect(hanziDisplayLabels[i],SIGNAL(pressed()),this,SLOT(onHanziLabelClicked())); + } + } + + userPinyinInputAppending = false; + currPinyinList = 0; + hide(); + + hanZiLabelVisibleEnable = true; + ctrlAppending = false; + setHanziLabelVisible(false); + //keyMap.insert("(","("); + //keyMap.insert(")",")"); + keyMap.insert("(","("); + keyMap.insert(")",")"); + keyMap.insert("[","["); + keyMap.insert("]","]"); + keyMap.insert("{","{"); + keyMap.insert("}","}"); + keyMap.insert("【","【"); + keyMap.insert("】","】"); + keyMap.insert("『","『"); + keyMap.insert("』","』"); + //keyMap.insert("《","《"); + //keyMap.insert("》","》"); + keyMap.insert("《","《"); + keyMap.insert("》","》"); + //keyMap.insert("<","<"); + //keyMap.insert(">",">"); + keyMap.insert("<","<"); + keyMap.insert(">",">"); + keyMap.insert("&","&&"); + keyMap.insert("&&","&"); + //keyMap.insert("(","("); + //keyMap.insert(")",")"); + keyMap.insert("(","("); + keyMap.insert(")",")"); + keyMap.insert("1","1"); + keyMap.insert("2","2"); + keyMap.insert("3","3"); + keyMap.insert("4","4"); + keyMap.insert("5","5"); + keyMap.insert("6","6"); + keyMap.insert("7","7"); + keyMap.insert("8","8"); + keyMap.insert("9","9"); + keyMap.insert("0","0"); + + keyMap.insert("`","`"); + keyMap.insert("~","~"); + keyMap.insert("·","·"); + keyMap.insert("~","~");//中文 + keyMap.insert("!","!"); + keyMap.insert("!","!");//中文 + keyMap.insert("@","@"); + keyMap.insert("#","#"); + keyMap.insert("$","$"); + keyMap.insert("¥","¥"); + keyMap.insert("%","%"); + keyMap.insert("^","^"); + keyMap.insert("…","…"); + keyMap.insert("*","*"); + keyMap.insert("-","-"); + keyMap.insert("_","_"); + keyMap.insert("—","—");//中文 + keyMap.insert("+","+"); + keyMap.insert("=","="); + keyMap.insert("\\","\\"); + keyMap.insert("|","|"); + keyMap.insert("、","、");//中文 + keyMap.insert(";",";"); + keyMap.insert(":",":"); + keyMap.insert(":",":");//中文 + keyMap.insert("'","'"); + keyMap.insert("\"","\""); + keyMap.insert("‘","‘"); + keyMap.insert("“","“"); + keyMap.insert(",",","); + keyMap.insert(",",",");//中文 + keyMap.insert(".","."); + keyMap.insert("。","。");//中文 + keyMap.insert("/","/"); + keyMap.insert("?","?"); + keyMap.insert("?","?");//中文 + + keyMap.insert("1","1"); + keyMap.insert("2","2"); + keyMap.insert("3","3"); + keyMap.insert("4","4"); + keyMap.insert("5","5"); + keyMap.insert("6","6"); + keyMap.insert("7","7"); + keyMap.insert("8","8"); + keyMap.insert("9","9"); + keyMap.insert("0","0"); + + keyMap.insert("a","a"); + keyMap.insert("b","b"); + keyMap.insert("c","c"); + keyMap.insert("d","d"); + keyMap.insert("e","e"); + keyMap.insert("f","f"); + keyMap.insert("g","g"); + keyMap.insert("h","h"); + keyMap.insert("i","i"); + keyMap.insert("j","j"); + keyMap.insert("k","k"); + keyMap.insert("l","l"); + keyMap.insert("m","m"); + keyMap.insert("n","n"); + keyMap.insert("o","o"); + keyMap.insert("p","p"); + keyMap.insert("q","q"); + keyMap.insert("r","r"); + keyMap.insert("s","s"); + keyMap.insert("t","t"); + keyMap.insert("u","u"); + keyMap.insert("v","v"); + keyMap.insert("w","w"); + keyMap.insert("x","x"); + keyMap.insert("y","y"); + keyMap.insert("z","z"); + + keyMap.insert("a","A"); + keyMap.insert("b","B"); + keyMap.insert("c","C"); + keyMap.insert("d","D"); + keyMap.insert("e","E"); + keyMap.insert("f","F"); + keyMap.insert("g","G"); + keyMap.insert("h","H"); + keyMap.insert("i","I"); + keyMap.insert("j","J"); + keyMap.insert("k","K"); + keyMap.insert("l","L"); + keyMap.insert("m","M"); + keyMap.insert("n","N"); + keyMap.insert("o","O"); + keyMap.insert("p","P"); + keyMap.insert("q","Q"); + keyMap.insert("r","R"); + keyMap.insert("s","S"); + keyMap.insert("t","T"); + keyMap.insert("u","U"); + keyMap.insert("v","V"); + keyMap.insert("w","W"); + keyMap.insert("x","X"); + keyMap.insert("y","Y"); + keyMap.insert("z","Z"); +} + + + +InputMethod::~InputMethod() +{ + delete ui; + if(InputMethod::pinyinHash != NULL){ /**/ + QHash *>::const_iterator i = InputMethod::pinyinHash->constBegin(); + while (i != InputMethod::pinyinHash->constEnd()) { + delete (QList *)i.value(); + } + delete InputMethod::pinyinHash; + } + +} + +void InputMethod::buttonConnect( QPushButton *sender, + const QObject *receiver, const char *member){ + sender->setObjectName(sender->text()); + connect(sender, SIGNAL(pressed()),receiver, member); + connect(sender, SIGNAL(pressed()),this, SLOT(onKeyPressed())); + connect(sender, SIGNAL(released()),this, SLOT(onKeyReleased())); + +} + +void InputMethod::spaceKeyPressed(){ + spaceTimer.start(700); +} +void InputMethod::spaceKeyRelease(){ + spaceTimer.stop(); +} + +void InputMethod::spaceKeyLongPressed(){ + spaceTimer.stop(); + insertSpaceNumDialog.show(); +} + +void InputMethod::onInsertSpaceNumDialogAccepted(){ + int spaceNum = insertSpaceNumDialog.getSpinBoxSpaceNum()->value() - 1; + for(int i = 0; i < spaceNum; i++){ + userInputed(" "); + } +} + +void InputMethod::userInputed(QString str){ + if(myInputMethod){ + myInputMethod->sendString (str); + + } + else{ + QMessageBox::warning(this,tr("warning"),tr("myInputMethod is null\n")); + } +} +/* + 用来初始化拼音表 +*/ +bool InputMethod::initInputMethod(QString &filename){ + QFile file(filename); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::critical((QWidget *)0,tr("错误"),tr("找不到输入法初始化文件") + filename); + return false; + } + QTextStream in(&file); + if(InputMethod::pinyinHash != NULL){ /*先删除,在添加*/ + QHash *>::const_iterator i = InputMethod::pinyinHash->constBegin(); + /* + while (i != InputMethod::pinyinHash->constEnd()) { + QList *pQList = i.value(); + if(pQList != NULL) + { + delete pQList; + } + }*/ // 是否会有问题呢? + delete InputMethod::pinyinHash; + + } + InputMethod::pinyinHash = new QHash *> (); + while (!in.atEnd()) { + QString line = in.readLine(); + QChar *ch = line.data(); + QString pinyin = ""; + QString hanzi = ""; + if(line.size()){ + for(int i = 0; i < line.size(); i++){ + if(ch[i].unicode() < 0x80) + pinyin.append(ch[i]); + else + hanzi.append(ch[i]); + } + + if(!InputMethod::pinyinHash->contains(pinyin)) + InputMethod::pinyinHash->insert(pinyin,new QList()); + } + + QList * list = (QList *)InputMethod::pinyinHash->value(pinyin); + list->append(hanzi); + + //qDebug() << pinyin << ":" << hanzi; + } + InputMethod::pinyinHashKeys = pinyinHash->keys(); + InputMethod::pinyinHashQStringList = QStringList(InputMethod::pinyinHashKeys); + InputMethod::pinyinHashQStringList.sort(); + + file.close(); + return true; +} + +/* + 用来调试时使用,打印拼音及相关汉字 +*/ +void InputMethod::showPinyinHash(void){ + if(!InputMethod::pinyinHash) + qDebug() << "拼音哈希表为空\n"; + else { + QHash *>::const_iterator i = InputMethod::pinyinHash->constBegin(); + while (i != InputMethod::pinyinHash->constEnd()) { + QList *list = (QList *)i.value(); + qDebug() << i.key() << ": "; + for (int j = 0; j < list->size(); ++j) { + qDebug() << list->at(j) << " "; + } + qDebug() << endl; + ++i; + } + } +} + + +void InputMethod::onDigitalPunctuationClicked(){ + + QPushButton * button = qobject_cast(sender()); + QString text = keyMap[button->text()]; + //QString text = specialKeyMap(button->text()); + if(text.isNull()) + text = " "; //处理space +// if(text == "(") +// { +// text = ")"; +// }else +// if(text == ")") +// { +// text = "("; +// } + +// if(text == "<") +// { +// text = ">"; +// }else +// if(text == ">") +// { +// text = "<"; +// } + +// if(text == "{") +// { +// text = "}"; +// }else +// if(text == "}") +// { +// text = "{"; +// } + +// if(text == "[") +// { +// text = "]"; +// }else +// if(text == "]") +// { +// text = "["; +// } + + userInputed(text); + +} + +void InputMethod::fillPinyinLabel(bool bActFromCharInput){ + + currPinyins.clear(); + matchStartIndex=0; + matchEndIndex=0; + if(!currPinyinStr.isEmpty()){ + QString Fisrt=currPinyinStr.left(1); + if(Fisrt=="u"|| Fisrt=="v"|| Fisrt=="i") + { + //bNotFound=true; + ui->pinyin->setText(currPinyinStr); + return; + } + if(currPinyinStr.size() == 1)//首字母,如果只有一个字母,只需要从出现的第一个开始 + { + QRegExp exp("^" + currPinyinStr); + matchStartIndex = InputMethod::pinyinHashQStringList.indexOf(exp); + if(matchStartIndex!=-1) + { + matchEndIndex = InputMethod::pinyinHashQStringList.size()-matchStartIndex-1; + } + bNotFound=false; + ui->pinyin->setText(currPinyinStr); + return; + } + if(!(bNotFound && bActFromCharInput))//如果不是从有拼音输入或者还没确定找不到相应的key,就往下检索 + { + //if(!pinyinHash->contains(currPinyinStr)) + { + QRegExp exp("^" + currPinyinStr); + //currPinyins = InputMethod::pinyinHashQStringList.filter(exp); + matchStartIndex = InputMethod::pinyinHashQStringList.indexOf(exp); + if(matchStartIndex!=-1) + { + bNotFound=false;//此时确定找不到相应的key + matchEndIndex = InputMethod::pinyinHashQStringList.lastIndexOf(exp, matchStartIndex); + } + else + { + bNotFound=true; + } + //qDebug()<<"currPinyins size is "<pinyin->setText(currPinyinStr);/*如果没右找到匹配,也要显示出当前的拼音*/ + + } + else{ + ui->pinyin->setText(""); + } +} + +void InputMethod::onCharClicked(){ + QPushButton * button = qobject_cast(sender()); + QString text = button->text(); + if(ctrlAppending){ + qDebug()<<"control append"; +#ifndef Q_OS_WIN32 + + if(button == ui->Key_A){ //似乎进入界面后,要全选两次才生效 + //static int init = 0; + QWSServer::sendKeyEvent(0,Qt::Key_A,Qt::ControlModifier,true,false); + //if(!init) + QWSServer::sendKeyEvent(0,Qt::Key_A,Qt::ControlModifier,true,false); + //init = 1; + } + else if(button == ui->Key_C){ + QWSServer::sendKeyEvent(0,Qt::Key_C,Qt::ControlModifier,true,false); + } + else if(button == ui->Key_V){ + QWSServer::sendKeyEvent(0,Qt::Key_V,Qt::ControlModifier,true,false); + } + else if(button == ui->Key_X){ + QWSServer::sendKeyEvent(0,Qt::Key_X,Qt::ControlModifier,true,false); + } + else if(button == ui->Key_Z){ + QWSServer::sendKeyEvent(0,Qt::Key_Z,Qt::ControlModifier,true,false); + } +#endif + switchKeyboardDisplay(); + } + else if((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH) || (CapsFlag /* && (currentInputMethodType != INPUT_METHOD_TYPE_VIETNAM)*/)) + { + userInputed(text); + } + else { + if(!userPinyinInputAppending) + currPinyinStr = text; + else + currPinyinStr.append(text); + fillPinyinLabel(true); + currPinyinList = 0; //initial it + pinyinPage = 0; + displayHanziToLabel(); + userPinyinInputAppending = true; + } + +} + +void InputMethod::onBackspaceClicked(void){ + if(userPinyinInputAppending){ + currPinyinList = 0; + if(currPinyinStr.size()){ + currPinyinStr = currPinyinStr.remove(currPinyinStr.size() - 1, 1); + fillPinyinLabel(false); + } + userPinyinInputAppending = currPinyinStr.size(); + displayHanziToLabel(); + } + else { +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Backspace,Qt::NoModifier,true,false); //向系统发送键盘事件 + QWSServer::sendKeyEvent(0,Qt::Key_Backspace1,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif + } + +} +/* + 调用此函数前,设置好currPinyinStr,currPinyinList,pinyinPage +*/ +void InputMethod::displayHanziToLabel(void){ + + static QList s_list; + QList *list; + bool candicate = false; + + for(int i = 0; i < HANZI_SELECT_NUM; i++){ + hanziDisplayLabels[i]->setText(""); + } + + if(!currPinyinList && pinyinHash && currPinyinStr.size()){ //currPinyinList被置为空,说明需要重新找list + if(pinyinHash->contains(currPinyinStr)) + currPinyinList = (QList *)pinyinHash->value(currPinyinStr); + else { /*如果当前拼音无法找到,找其他备份的词*/ + //qDebug()<<"display currPinyins size is "<contains(str)){ + list = (QList *)pinyinHash->value(str); + for(int k = 0; k < list->size();k++){ + s_list.append(list->value(k)); + if(s_list.size() >= HANZI_SELECT_NUM) + break; + } + if(s_list.size() >= HANZI_SELECT_NUM) + break; + } + + } + } + candicate = true; + } + pinyinPage = 0; + } + + if(currPinyinList && currPinyinList->size()){ + + int begin = MIN(currPinyinList->size() - 1,pinyinPage*HANZI_SELECT_NUM); + int end = MIN(currPinyinList->size(),(pinyinPage + 1)*HANZI_SELECT_NUM); + //qDebug() << begin << end << currPinyinList->size(); + for(int i = begin; i < end; i++){ + hanziDisplayLabels[i%HANZI_SELECT_NUM]->setText(currPinyinList->value(i)); + //qDebug() << currPinyinList->value(i); + } + + } + else if(candicate){ + for(int i = 0; i < s_list.size() && i < HANZI_SELECT_NUM; i++){ + hanziDisplayLabels[i]->setText(s_list.value(i)); + } + } + + +} + +void InputMethod::onHanziLabelClicked(){ + + ClickLabel * label = qobject_cast(sender()); + QString text = label->text(); + if(text.size()) + userInputed(label->text()); + currPinyinStr = ""; + userPinyinInputAppending = false; + for(int i = 0; i < HANZI_SELECT_NUM; i++){ + hanziDisplayLabels[i]->setText(""); + } + matchStartIndex=0; + matchEndIndex=0; + //bNotFound=false; + currPinyins.clear(); + ui->pinyin->setText(""); + + //setHanziLabelVisible(currentInputMethodType == INPUT_METHOD_TYPE_CHINESE); + setHanziLabelVisible(currentInputMethodType != INPUT_METHOD_TYPE_ENGLISH); +} + + + +void InputMethod::switchKeyboardDisplay(void){ + ctrlAppending = false; +#if 0 + ui->Key_QuoteLeft->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"`":"~"):(!shiftFlag?"·":"~"))); + ui->Key_one->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"1":"!"):(!shiftFlag?"1":"!"))); + ui->Key_two->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"2":"@"):(!shiftFlag?"2":"@"))); + ui->Key_three->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"3":"#"):(!shiftFlag?"3":"#"))); + ui->Key_four->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"4":"$"):(!shiftFlag?"4":"¥"))); + ui->Key_five->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"5":"%"):(!shiftFlag?"5":"%"))); + ui->Key_six->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"6":"^"):(!shiftFlag?"6":"…"))); + ui->Key_seven->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"7":"&"):(!shiftFlag?"7":"&"))); + ui->Key_eight->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"8":"*"):(!shiftFlag?"8":"*"))); + ui->Key_nine->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"9":"("):(!shiftFlag?"9":"("))); + ui->Key_zero->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"0":")"):(!shiftFlag?"0":")"))); + ui->Key_Minus->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"-":"_"):(!shiftFlag?"-":"—"))); + ui->Key_Equal->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"=":"+"):(!shiftFlag?"=":"+"))); + ui->Key_BracketLeft->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"[":"{"):(!shiftFlag?"【":"『"))); + ui->Key_BracketRight->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"]":"}"):(!shiftFlag?"】":"』"))); + ui->Key_BackSlash->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"\\":"|"):(!shiftFlag?"、":"|"))); + ui->Key_Semicolon->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?";":":"):(!shiftFlag?";":":"))); + ui->Key_Apostrophe->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"'":"\""):(!shiftFlag?"‘":"“"))); + ui->Key_Comma->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?",":"<"):(!shiftFlag?",":"《"))); + ui->Key_Period->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?".":">"):(!shiftFlag?"。":"》"))); + ui->Key_Slash->setText(specialKeyMap((currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?(!shiftFlag?"/":"?"):(!shiftFlag?"/":"?"))); + ui->Key_Space->setText(" "); + ui->Key_A->setText(!CapsFlag?"a":"A"); + ui->Key_B->setText(!CapsFlag?"b":"B"); + ui->Key_C->setText(!CapsFlag?"c":"C"); + ui->Key_D->setText(!CapsFlag?"d":"D"); + ui->Key_E->setText(!CapsFlag?"e":"E"); + ui->Key_F->setText(!CapsFlag?"f":"F"); + ui->Key_G->setText(!CapsFlag?"g":"G"); + ui->Key_H->setText(!CapsFlag?"h":"H"); + ui->Key_I->setText(!CapsFlag?"i":"I"); + ui->Key_J->setText(!CapsFlag?"j":"J"); + ui->Key_K->setText(!CapsFlag?"k":"K"); + ui->Key_L->setText(!CapsFlag?"l":"L"); + ui->Key_M->setText(!CapsFlag?"m":"M"); + ui->Key_N->setText(!CapsFlag?"n":"N"); + ui->Key_O->setText(!CapsFlag?"o":"O"); + ui->Key_P->setText(!CapsFlag?"p":"P"); + ui->Key_Q->setText(!CapsFlag?"q":"Q"); + ui->Key_R->setText(!CapsFlag?"r":"R"); + ui->Key_S->setText(!CapsFlag?"s":"S"); + ui->Key_T->setText(!CapsFlag?"t":"T"); + ui->Key_U->setText(!CapsFlag?"u":"U"); + ui->Key_V->setText(!CapsFlag?"v":"V"); + ui->Key_W->setText(!CapsFlag?"w":"W"); + ui->Key_X->setText(!CapsFlag?"x":"X"); + ui->Key_Y->setText(!CapsFlag?"y":"Y"); + ui->Key_Z->setText(!CapsFlag?"z":"Z"); +#elif 1 + if(currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH) + { + if(!shiftFlag) + { + ui->Key_QuoteLeft->setText(keyMap["`"]); + ui->Key_one->setText(keyMap["1"]); + ui->Key_two->setText(keyMap["2"]); + ui->Key_three->setText(keyMap["3"]); + ui->Key_four->setText(keyMap["4"]); + ui->Key_five->setText(keyMap["5"]); + ui->Key_six->setText(keyMap["6"]); + ui->Key_seven->setText(keyMap["7"]); + ui->Key_eight->setText(keyMap["8"]); + ui->Key_nine->setText(keyMap["9"]); + ui->Key_zero->setText(keyMap["0"]); + ui->Key_Minus->setText(keyMap["-"]); + ui->Key_Equal->setText(keyMap["="]); + ui->Key_BracketLeft->setText(keyMap["["]); + ui->Key_BracketRight->setText(keyMap["]"]); + ui->Key_BackSlash->setText(keyMap["\\"]); + ui->Key_Semicolon->setText(keyMap[";"]); + ui->Key_Apostrophe->setText(keyMap["'"]); + ui->Key_Comma->setText(keyMap[","]); + ui->Key_Period->setText(keyMap["."]); + ui->Key_Slash->setText(keyMap["/"]); + } + else + { + ui->Key_QuoteLeft->setText("~"); + ui->Key_one->setText(keyMap["!"]); + ui->Key_two->setText(keyMap["@"]); + ui->Key_three->setText(keyMap["#"]); + ui->Key_four->setText(keyMap["$"]); + ui->Key_five->setText(keyMap["%"]); + ui->Key_six->setText(keyMap["^"]); + ui->Key_seven->setText(keyMap["&"]); + ui->Key_eight->setText(keyMap["*"]); + ui->Key_nine->setText(keyMap["("]); + ui->Key_zero->setText(keyMap[")"]); + ui->Key_Minus->setText(keyMap["_"]); + ui->Key_Equal->setText(keyMap["+"]); + ui->Key_BracketLeft->setText(keyMap["{"]); + ui->Key_BracketRight->setText(keyMap["}"]); + ui->Key_BackSlash->setText(keyMap["|"]); + ui->Key_Semicolon->setText(keyMap[":"]); + ui->Key_Apostrophe->setText(keyMap["\""]); + ui->Key_Comma->setText(keyMap["<"]); + ui->Key_Period->setText(keyMap[">"]); + ui->Key_Slash->setText(keyMap["?"]); + } + + } + else + { + if(!shiftFlag) + { + ui->Key_QuoteLeft->setText(keyMap["·"]); + ui->Key_one->setText(keyMap["1"]); + ui->Key_two->setText(keyMap["2"]); + ui->Key_three->setText(keyMap["3"]); + ui->Key_four->setText(keyMap["4"]); + ui->Key_five->setText(keyMap["5"]); + ui->Key_six->setText(keyMap["6"]); + ui->Key_seven->setText(keyMap["7"]); + ui->Key_eight->setText(keyMap["8"]); + ui->Key_nine->setText(keyMap["9"]); + ui->Key_zero->setText(keyMap["0"]); + ui->Key_Minus->setText(keyMap["-"]); + ui->Key_Equal->setText(keyMap["="]); + ui->Key_BracketLeft->setText(keyMap["【"]); + ui->Key_BracketRight->setText(keyMap["】"]); + ui->Key_BackSlash->setText(keyMap["、"]); + ui->Key_Semicolon->setText(keyMap[";"]); + ui->Key_Apostrophe->setText(keyMap["‘"]); + ui->Key_Comma->setText(keyMap[","]); + ui->Key_Period->setText(keyMap["。"]); + ui->Key_Slash->setText(keyMap["/"]); + } + else + { + ui->Key_QuoteLeft->setText("~"); + ui->Key_one->setText(keyMap["!"]); + ui->Key_two->setText(keyMap["@"]); + ui->Key_three->setText(keyMap["#"]); + ui->Key_four->setText(keyMap["¥"]); + ui->Key_five->setText(keyMap["%"]); + ui->Key_six->setText(keyMap["…"]); + ui->Key_seven->setText(keyMap["&"]); + ui->Key_eight->setText(keyMap["*"]); + ui->Key_nine->setText(keyMap["("]); + ui->Key_zero->setText(keyMap[")"]); + //ui->Key_nine->setText(keyMap["("]); + //ui->Key_zero->setText(keyMap[")"]); + ui->Key_Minus->setText(keyMap["—"]); + ui->Key_Equal->setText(keyMap["+"]); + ui->Key_BracketLeft->setText(keyMap["『"]); + ui->Key_BracketRight->setText(keyMap["』"]); + ui->Key_BackSlash->setText(keyMap["|"]); + ui->Key_Semicolon->setText(keyMap[":"]); + ui->Key_Apostrophe->setText(keyMap["“"]); + ui->Key_Comma->setText(keyMap["《"]); + ui->Key_Period->setText(keyMap["》"]); + //ui->Key_Comma->setText(keyMap["》"]); + //ui->Key_Period->setText(keyMap["《"]); + ui->Key_Slash->setText(keyMap["?"]); + } + } + ui->Key_Space->setText(" "); + if(CapsFlag) + { + ui->Key_A->setText("A"); + ui->Key_B->setText("B"); + ui->Key_C->setText("C"); + ui->Key_D->setText("D"); + ui->Key_E->setText("E"); + ui->Key_F->setText("F"); + ui->Key_G->setText("G"); + ui->Key_H->setText("H"); + ui->Key_I->setText("I"); + ui->Key_J->setText("J"); + ui->Key_K->setText("K"); + ui->Key_L->setText("L"); + ui->Key_M->setText("M"); + ui->Key_N->setText("N"); + ui->Key_O->setText("O"); + ui->Key_P->setText("P"); + ui->Key_Q->setText("Q"); + ui->Key_R->setText("R"); + ui->Key_S->setText("S"); + ui->Key_T->setText("T"); + ui->Key_U->setText("U"); + ui->Key_V->setText("V"); + ui->Key_W->setText("W"); + ui->Key_X->setText("X"); + ui->Key_Y->setText("Y"); + ui->Key_Z->setText("Z"); + } + else + { + ui->Key_A->setText("a"); + ui->Key_B->setText("b"); + ui->Key_C->setText("c"); + ui->Key_D->setText("d"); + ui->Key_E->setText("e"); + ui->Key_F->setText("f"); + ui->Key_G->setText("g"); + ui->Key_H->setText("h"); + ui->Key_I->setText("i"); + ui->Key_J->setText("j"); + ui->Key_K->setText("k"); + ui->Key_L->setText("l"); + ui->Key_M->setText("m"); + ui->Key_N->setText("n"); + ui->Key_O->setText("o"); + ui->Key_P->setText("p"); + ui->Key_Q->setText("q"); + ui->Key_R->setText("r"); + ui->Key_S->setText("s"); + ui->Key_T->setText("t"); + ui->Key_U->setText("u"); + ui->Key_V->setText("v"); + ui->Key_W->setText("w"); + ui->Key_X->setText("x"); + ui->Key_Y->setText("y"); + ui->Key_Z->setText("z"); + } +#else + if(currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH) + { + if(!shiftFlag) + { + ui->Key_QuoteLeft->setText(specialKeyMap("`")); + ui->Key_one->setText(specialKeyMap("1")); + ui->Key_two->setText(specialKeyMap("2")); + ui->Key_three->setText(specialKeyMap("3")); + ui->Key_four->setText(specialKeyMap("4")); + ui->Key_five->setText(specialKeyMap("5")); + ui->Key_six->setText(specialKeyMap("6")); + ui->Key_seven->setText(specialKeyMap("7")); + ui->Key_eight->setText(specialKeyMap("8")); + ui->Key_nine->setText(specialKeyMap("9")); + ui->Key_zero->setText(specialKeyMap("0")); + ui->Key_Minus->setText(specialKeyMap("-")); + ui->Key_Equal->setText(specialKeyMap("=")); + ui->Key_BracketLeft->setText(specialKeyMap("[")); + ui->Key_BracketRight->setText(specialKeyMap("]")); + ui->Key_BackSlash->setText(specialKeyMap("\\")); + ui->Key_Semicolon->setText(specialKeyMap(";")); + ui->Key_Apostrophe->setText(specialKeyMap("'")); + ui->Key_Comma->setText(specialKeyMap(",")); + ui->Key_Period->setText(specialKeyMap(".")); + ui->Key_Slash->setText(specialKeyMap("/")); + } + else + { + ui->Key_QuoteLeft->setText("~"); + ui->Key_one->setText(specialKeyMap("!")); + ui->Key_two->setText(specialKeyMap("@")); + ui->Key_three->setText(specialKeyMap("#")); + ui->Key_four->setText(specialKeyMap("$")); + ui->Key_five->setText(specialKeyMap("%")); + ui->Key_six->setText(specialKeyMap("^")); + ui->Key_seven->setText(specialKeyMap("&")); + ui->Key_eight->setText(specialKeyMap("*")); + ui->Key_nine->setText(specialKeyMap("(")); + ui->Key_zero->setText(specialKeyMap(")")); + ui->Key_Minus->setText(specialKeyMap("_")); + ui->Key_Equal->setText(specialKeyMap("+")); + ui->Key_BracketLeft->setText(specialKeyMap("{")); + ui->Key_BracketRight->setText(specialKeyMap("}")); + ui->Key_BackSlash->setText(specialKeyMap("|")); + ui->Key_Semicolon->setText(specialKeyMap(":")); + ui->Key_Apostrophe->setText(specialKeyMap("\"")); + ui->Key_Comma->setText(specialKeyMap("<")); + ui->Key_Period->setText(specialKeyMap(">")); + ui->Key_Slash->setText(specialKeyMap("?")); + } + + } + else + { + if(!shiftFlag) + { + ui->Key_QuoteLeft->setText(specialKeyMap("·")); + ui->Key_one->setText(specialKeyMap("1")); + ui->Key_two->setText(specialKeyMap("2")); + ui->Key_three->setText(specialKeyMap("3")); + ui->Key_four->setText(specialKeyMap("4")); + ui->Key_five->setText(specialKeyMap("5")); + ui->Key_six->setText(specialKeyMap("6")); + ui->Key_seven->setText(specialKeyMap("7")); + ui->Key_eight->setText(specialKeyMap("8")); + ui->Key_nine->setText(specialKeyMap("9")); + ui->Key_zero->setText(specialKeyMap("0")); + ui->Key_Minus->setText(specialKeyMap("-")); + ui->Key_Equal->setText(specialKeyMap("=")); + ui->Key_BracketLeft->setText(specialKeyMap("【")); + ui->Key_BracketRight->setText(specialKeyMap("】")); + ui->Key_BackSlash->setText(specialKeyMap("、")); + ui->Key_Semicolon->setText(specialKeyMap(";")); + ui->Key_Apostrophe->setText(specialKeyMap("‘")); + ui->Key_Comma->setText(specialKeyMap(",")); + ui->Key_Period->setText(specialKeyMap("。")); + ui->Key_Slash->setText(specialKeyMap("/")); + } + else + { + ui->Key_QuoteLeft->setText("~"); + ui->Key_one->setText(specialKeyMap("!")); + ui->Key_two->setText(specialKeyMap("@")); + ui->Key_three->setText(specialKeyMap("#")); + ui->Key_four->setText(specialKeyMap("¥")); + ui->Key_five->setText(specialKeyMap("%")); + ui->Key_six->setText(specialKeyMap("…")); + ui->Key_seven->setText(specialKeyMap("&")); + ui->Key_eight->setText(specialKeyMap("*")); + ui->Key_nine->setText(specialKeyMap("(")); + ui->Key_zero->setText(specialKeyMap(")")); + ui->Key_Minus->setText(specialKeyMap("—")); + ui->Key_Equal->setText(specialKeyMap("+")); + ui->Key_BracketLeft->setText(specialKeyMap("『")); + ui->Key_BracketRight->setText(specialKeyMap("』")); + ui->Key_BackSlash->setText(specialKeyMap("|")); + ui->Key_Semicolon->setText(specialKeyMap(":")); + ui->Key_Apostrophe->setText(specialKeyMap("“")); + ui->Key_Comma->setText(specialKeyMap("《")); + ui->Key_Period->setText(specialKeyMap("》")); + ui->Key_Slash->setText(specialKeyMap("?")); + } + } + ui->Key_Space->setText(" "); + if(CapsFlag) + { + ui->Key_A->setText("A"); + ui->Key_B->setText("B"); + ui->Key_C->setText("C"); + ui->Key_D->setText("D"); + ui->Key_E->setText("E"); + ui->Key_F->setText("F"); + ui->Key_G->setText("G"); + ui->Key_H->setText("H"); + ui->Key_I->setText("I"); + ui->Key_J->setText("J"); + ui->Key_K->setText("K"); + ui->Key_L->setText("L"); + ui->Key_M->setText("M"); + ui->Key_N->setText("N"); + ui->Key_O->setText("O"); + ui->Key_P->setText("P"); + ui->Key_Q->setText("Q"); + ui->Key_R->setText("R"); + ui->Key_S->setText("S"); + ui->Key_T->setText("T"); + ui->Key_U->setText("U"); + ui->Key_V->setText("V"); + ui->Key_W->setText("W"); + ui->Key_X->setText("X"); + ui->Key_Y->setText("Y"); + ui->Key_Z->setText("Z"); + } + else + { + ui->Key_A->setText("a"); + ui->Key_B->setText("b"); + ui->Key_C->setText("c"); + ui->Key_D->setText("d"); + ui->Key_E->setText("e"); + ui->Key_F->setText("f"); + ui->Key_G->setText("g"); + ui->Key_H->setText("h"); + ui->Key_I->setText("i"); + ui->Key_J->setText("j"); + ui->Key_K->setText("k"); + ui->Key_L->setText("l"); + ui->Key_M->setText("m"); + ui->Key_N->setText("n"); + ui->Key_O->setText("o"); + ui->Key_P->setText("p"); + ui->Key_Q->setText("q"); + ui->Key_R->setText("r"); + ui->Key_S->setText("s"); + ui->Key_T->setText("t"); + ui->Key_U->setText("u"); + ui->Key_V->setText("v"); + ui->Key_W->setText("w"); + ui->Key_X->setText("x"); + ui->Key_Y->setText("y"); + ui->Key_Z->setText("z"); + } +#endif + +} + +void InputMethod::onShiftClicked(){ + shiftFlag = shiftFlag?false:true; + userPinyinInputAppending = false; + switchKeyboardDisplay(); +} +void InputMethod::onpushButtonCapspressed(){ + CapsFlag = CapsFlag?false:true; + userPinyinInputAppending = false; + ui->pushButtonCaps->setText( CapsFlag?tr("小写"):tr("大写")); + switchKeyboardDisplay(); +} + +void InputMethod::setHanziLabelVisible(bool enable){ + /*---------------------------隐藏掉一些没用的东西---------------------------------------*/ + if(hanZiLabelVisibleEnable != enable){ + ui->pinyin->setVisible(enable); + for(int i = 0; i < HANZI_SELECT_NUM; i++){ + hanziDisplayLabels[i]->setVisible(enable); + } + ui->Key_Last->setVisible(enable); + ui->Key_Next->setVisible(enable); + } + hanZiLabelVisibleEnable = enable; + /*------------------------------------------------------------------*/ +} +#include "dlgselectinputlanguage.h" + +void InputMethod::onInputMethodClicked(){ + +/// + currentInputMethodType = (currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?INPUT_METHOD_TYPE_CHINESE: + //(currentInputMethodType == INPUT_METHOD_TYPE_CHINESE)?INPUT_METHOD_TYPE_VIETNAM: + INPUT_METHOD_TYPE_ENGLISH; + +/// + +#if 0 + DlgSelectInputLanguage dlg; + dlg.exec(); + currentInputMethodType = dlg.selectIndex; + //qDebug()<<"currentInputMethodType"<(sender()); +// button->autoDefault(); + /* + button->setText( + (currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH)?tr("英文"): + (currentInputMethodType == INPUT_METHOD_TYPE_VIETNAM)?tr("越南文"): + tr("中文") + ); +*/ + + QString filename; + if(currentInputMethodType == INPUT_METHOD_TYPE_ENGLISH){ + button->setText(tr("英文")); + filename = INPUT_FILE_ENGLISH; + } + else if(currentInputMethodType == INPUT_METHOD_TYPE_VIETNAM){ + button->setText(tr("Tiếng Việt")); + filename = INPUT_FILE_VIETNAM; + } + else if(currentInputMethodType == INPUT_METHOD_TYPE_RUSSIAN){ + button->setText(tr("Russian")); + filename = INPUT_FILE_RUSSIAN; + } + else if(currentInputMethodType == INPUT_METHOD_TYPE_JAPANESE){ + button->setText(tr("Japanese")); + filename = INPUT_FILE_JAPANESE; + } + else{ + button->setText("中文"); + filename = INPUT_FILE_CHINESE; //INPUT_FILE_ENGLISH WINPY_utf8.txt + } + //qDebug()<SetInputFile(filename); + //SetInputFile(filename); + userPinyinInputAppending = false; + switchKeyboardDisplay(); + currPinyinStr = ""; + currPinyinList = 0; + fillPinyinLabel(false); + +// chữ thường 小写字母 + + //setHanziLabelVisible(currentInputMethodType == INPUT_METHOD_TYPE_CHINESE || currentInputMethodType == INPUT_METHOD_TYPE_VIETNAM ); + setHanziLabelVisible(currentInputMethodType != INPUT_METHOD_TYPE_ENGLISH); + +} + +void InputMethod::onEnterClicked(){ + userInputed("\n"); +} + + +void InputMethod::onKeyLastClicked(){ + if(currPinyinList){ + if(pinyinPage) + pinyinPage --; + displayHanziToLabel(); + } +} + +void InputMethod::onKeyNextClicked(){ + if(currPinyinList){ + if(pinyinPage < (currPinyinList->size()/HANZI_SELECT_NUM)){ + pinyinPage ++; + } + displayHanziToLabel(); + } +} + + + +void InputMethod::onKeyLeftpressed() +{ +#ifndef Q_OS_WIN32 + //emit PicEditKey_Press(1); + QWSServer::sendKeyEvent(0,Qt::Key_Left1,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Left,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} + +void InputMethod::onKeyDownpressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Down,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Down1,Qt::NoModifier,true,false); +#endif +} + +void InputMethod::onKeyUppressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Up1,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Up,Qt::NoModifier,true,false); +#endif +} + +void InputMethod::onKeyRightpressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Right1,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Right,Qt::NoModifier,true,false); +#endif +} + + +void InputMethod::onKeyHomepressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Home,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Home1,Qt::NoModifier,true,false); +#endif +} + +void InputMethod::onKeyEndpressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_End,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_End1,Qt::NoModifier,true,false); +#endif +} + +void InputMethod::onKeydeletepressed() +{ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Delete,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Delete1,Qt::NoModifier,true,false); +#endif +#if 0 + QTextCursor cursor_ = textCursor(); + if( cursor_.hasSelection() ) + { + // Delete selection + cursor_.removeSelectedText(); + } + else + { + // Delete right char + cursor_.deleteChar(); + } + + setTextCursor( cursor_ ); +#endif +} +// /usr/local/Trolltech/QtEmbedded-4.6.3/lib/fonts/BAK/WenQuanYi Zen Hei.ttf +/* + 注意:生成图片文件请使用X86版本软件,生成字库文件请使用PC版本软件。 + PC版本直接运行。 + X86版本需要虚拟环境 + */ +// ℃℉㎡±ΦφΩ◆✪@☢*✿❧ +//° ¥ ℃ ℉ ㎡ ± Φ φ Ω ◆ ✪ @ ☢ * ✿ ❧ Δ δ ζ θ Ψ Σ ι ³ ® +static QList specialChars; +void InputMethod::onKeySpecialCharpressed() +{ + static bool specialCharsInit = false; + if(!specialCharsInit){ + specialChars << "²"<<"°"<<"Ω"<<"Φ"<<"¥"<<"φ"<<"㎡"<<"℃"<<"℉"<<"®"<<"±"<<"Σ"<<"Δ"<<"@"<<"Ψ"<<"³"<<"θ"<<"◆"; + specialCharsInit = true; + } + currPinyinList = &specialChars; + displayHanziToLabel(); + if(currentInputMethodType != INPUT_METHOD_TYPE_CHINESE){ + setHanziLabelVisible(!hanZiLabelVisibleEnable); + } +} + +void InputMethod::onKeyCtrlpressed(){ + + if(!ctrlAppending){ + ui->Key_A->setText(tr("全选")); + ui->Key_C->setText(tr("复制")); + ui->Key_V->setText(tr("粘贴")); + ui->Key_X->setText(tr("剪切")); + ui->Key_Z->setText(tr("后退")); + ctrlAppending = true; + } + else { + switchKeyboardDisplay(); + } +} + +/* + + 2013.9.12 括号错位修复 为了节约cpu最好改用映射方式 +*/ +QString InputMethod::specialKeyMap(QString ch){ +#if 1 + if(ch == "(") + return ")"; + else if(ch == ")") + return "("; + else if(ch == "[") + return "]"; + else if(ch == "]") + return "["; + else if(ch == "{") + return "}"; + else if(ch == "}") + return "{"; + else if(ch == "【") + return "】"; + else if(ch == "】") + return "【"; + else if(ch == "『") + return "』"; + else if(ch == "』") + return "『"; + else if(ch == "《") + return "《"; + else if(ch == "》") + return "》"; + else if(ch == "<") + return "<"; + else if(ch == ">") + return ">"; + else if(ch == "&") + return "&&"; + else if(ch == "&&") + return "&"; + else if(ch == "(") + return ")"; + else if(ch == ")") + return "("; + else + return ch; +#else + +#endif +} + +void InputMethod::onKeyPressed(){ + QPushButton * button = qobject_cast(sender()); + QPoint point = button->mapToGlobal (QPoint(0,0)); + QRect buttonGeometry = button->geometry(); + + int x = point.x() + buttonGeometry.width()/2; + int y = point.y() + buttonGeometry.height()/2; + QRect rec = QApplication::desktop()->screenGeometry(); + x = (x>30)?(x-30):0; + x = (x > rec.width() - 60)?(rec.width() - 60):x; + y = (y > 80)?(y - 80):(y + 20); + labelInputTip.setGeometry(x,y,60,60); + QString text=button->text(); + labelInputTip.setText(keyMap[button->text()]); + //labelInputTip.setText(specialKeyMap(button->text())); + //labelInputTip.show(); + +} + +void InputMethod::onKeyReleased(){ + //QPushButton * button = qobject_cast(sender()); + labelInputTip.hide(); + +} +void InputMethod::on_pushBottonHide_pressed() +{ + hide(); +} + +void InputMethod::onHiden(){ + if(!labelInputTip.isHidden()) + labelInputTip.hide(); + if(spaceTimer.isActive()) + spaceTimer.stop(); +} + + + +void InputMethod::on_Key_Backspace_pressed() +{ + backtimer.start(50); +} + +void InputMethod::on_Key_Backspace_released() +{ + backtimer.stop(); + back_count_timeout = 0; +} + +void InputMethod::backKeyLongPressed() +{ + if(back_count_timeout > 14) + { + if(userPinyinInputAppending){ + currPinyinList = 0; + if(currPinyinStr.size()){ + currPinyinStr = currPinyinStr.remove(currPinyinStr.size() - 1, 1); + fillPinyinLabel(false); + } + userPinyinInputAppending = currPinyinStr.size(); + displayHanziToLabel(); + } + else { + #ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Backspace,Qt::NoModifier,true,false); //向系统发送键盘事件 + QWSServer::sendKeyEvent(0,Qt::Key_Backspace1,Qt::NoModifier,true,false); //向系统发送键盘事件 + #endif + } + + }else + { + back_count_timeout++; + } +} + + diff --git a/InputMethod.h b/InputMethod.h new file mode 100644 index 0000000..eac57ce --- /dev/null +++ b/InputMethod.h @@ -0,0 +1,143 @@ +#ifndef INPUTMETHOD_H +#define INPUTMETHOD_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "InsertSpaceNumDialog.h" +class MyInputMethod; + + +namespace Ui { + class InputMethod; +} + +#define HANZI_SELECT_NUM 5 //显示汉字的个数,由UI文件决定 +#define INPUT_METHOD_TYPE_ENGLISH 0 +#define INPUT_METHOD_TYPE_CHINESE 1 +#define INPUT_METHOD_TYPE_VIETNAM 2 +#define INPUT_METHOD_TYPE_RUSSIAN 3 // Russian +#define INPUT_METHOD_TYPE_JAPANESE 4 //Japanese +#define INPUT_METHOD_TYPE_KOREAN 5 // Korean +#define INPUT_METHOD_TYPE_SPANISH 6 // Korean +#define INPUT_METHOD_TYPE_THAI 7 // Thai +#define INPUT_FILE_CHINESE "WINPY_utf8.txt" +#define INPUT_FILE_ENGLISH "WINPY_utf8.txt" +#define INPUT_FILE_VIETNAM "YN_utf8.txt" +#define INPUT_FILE_RUSSIAN "WINPY_utf8.txt" +#define INPUT_FILE_JAPANESE "WINPY_utf8.txt" +#define INPUT_FILE_KOREAN "WINPY_utf8.txt" + +#define MIN(a,b) (((a) < (b))?(a):(b)) +#define MAX(a,b) (((a) > (b))?(a):(b)) + +class InputMethod : public QWidget +{ + Q_OBJECT + +public: + explicit InputMethod(MyInputMethod *myInputMethod,QWidget *parent = 0); + static bool initInputMethod(QString &filename); /*用文件初始化输入法的字库*/ + static void showPinyinHash(void); + ~InputMethod(); + +public slots: + void onpushButtonCapspressed(); + void onDigitalPunctuationClicked(); + void onCharClicked(); + void onShiftClicked(); + void onInputMethodClicked(); + void onBackspaceClicked(); + void onHanziLabelClicked(); + void onKeyLastClicked(); + void onKeyNextClicked(); + void onEnterClicked(); + + void userInputed(QString str); //用户输入一个字符 + void onHiden(); + void on_Key_Backspace_released(); +private slots: + + + void onKeyLeftpressed(); + + void onKeyDownpressed(); + + void onKeyUppressed(); + + void onKeyRightpressed(); + + void onKeyHomepressed(); + + void onKeyEndpressed(); + + void onKeydeletepressed(); + + void onKeySpecialCharpressed(); + void onKeyCtrlpressed(); + void onKeyReleased(); + void onKeyPressed(); + + void spaceKeyPressed(); + void spaceKeyRelease(); + void spaceKeyLongPressed(); + void backKeyLongPressed(); + void onInsertSpaceNumDialogAccepted(); + + void on_pushBottonHide_pressed(); + + void on_Key_Backspace_pressed(); + + //void on_Key_Backspace_released(); + +private: + + MyInputMethod *myInputMethod; + QMap keyMap; + + Ui::InputMethod *ui; + + static QHash *> *pinyinHash; //用来存放哈拼音的哈希表,所有都共用一份 + static QList pinyinHashKeys; + static QStringList pinyinHashQStringList; + + QList *currPinyinList; + + QStringList currPinyins; //自动侯选的拼音 + + ClickLabel *hanziDisplayLabels[HANZI_SELECT_NUM]; + int currentInputMethodType; + int matchStartIndex; + int matchEndIndex; + int bNotFound; + bool shiftFlag; //是否按过shift键 + bool CapsFlag; + bool userPinyinInputAppending; //是否用户已经在拼音输入法下完成输入 + QString currPinyinStr; //记录当前用户已经输入的字符 + int pinyinPage; /*当一个拼音有很多汉字时,分多页存放,记录当前的页数*/ + int back_count_timeout; //回退键超时处理 + + void switchKeyboardDisplay(void); //当按shift,输入法时,切换键盘显示 + void displayHanziToLabel(); //显示汉字到label + void fillPinyinLabel(bool bActFromCharInput); + void asciiTyped(int ascii); + void digitalTyped(int ascii); + void buttonConnect(QPushButton *sender, + const QObject *receiver, const char *member); + void setHanziLabelVisible(bool enable); + QLabel labelInputTip; //输入提示 + QTimer spaceTimer; + QTimer backtimer; + InsertSpaceNumDialog insertSpaceNumDialog; + bool hanZiLabelVisibleEnable; + bool ctrlAppending;//Ctrl+C ..之类的 + QString specialKeyMap(QString ch); +}; + +#endif // INPUTMETHOD_H diff --git a/InputMethod.ui b/InputMethod.ui new file mode 100644 index 0000000..7752209 --- /dev/null +++ b/InputMethod.ui @@ -0,0 +1,2608 @@ + + + InputMethod + + + true + + + + 0 + 0 + 650 + 251 + + + + + 0 + 0 + + + + + 640 + 200 + + + + + + + + + 255 + 255 + 255 + + + + + + + 209 + 209 + 209 + + + + + + + + + 255 + 255 + 255 + + + + + + + 209 + 209 + 209 + + + + + + + + + 209 + 209 + 209 + + + + + + + 209 + 209 + 209 + + + + + + + + Form + + + + 0 + + + + + 1 + + + QLayout::SetDefaultConstraint + + + 0 + + + 0 + + + + + 1 + + + 4 + + + 0 + + + 0 + + + 0 + + + + + + 75 + 30 + + + + + 75 + 16777215 + + + + QFrame::Box + + + QFrame::Sunken + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 35 + 5 + + + + + + + + + 0 + 30 + + + + + 63 + 16777215 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::Box + + + 1 书 + + + Qt::AlignCenter + + + + + + + + 0 + 30 + + + + + 63 + 16777215 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::Box + + + 2 输 + + + Qt::AlignCenter + + + + + + + + 0 + 30 + + + + + 63 + 16777215 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::Box + + + 3 数 + + + Qt::AlignCenter + + + + + + + + 0 + 30 + + + + + 63 + 16777215 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::Box + + + 4 属 + + + Qt::AlignCenter + + + + + + + + 0 + 30 + + + + + 63 + 16777215 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 0 + 0 + 52 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::Box + + + 5 熟 + + + Qt::AlignCenter + + + + + + + + 0 + 30 + + + + + 70 + 16777215 + + + + Qt::LeftToRight + + + 上一页 + + + + :/icon/lastpage.png:/icon/lastpage.png + + + + + + + + 0 + 30 + + + + + 70 + 16777215 + + + + Qt::LeftToRight + + + 下一页 + + + + :/icon/nextpage.png:/icon/nextpage.png + + + + + + + + + 1 + + + QLayout::SetFixedSize + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + ` + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 1 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 2 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 3 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 4 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 5 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 6 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 7 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 8 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 9 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + - + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + = + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 80 + 16777215 + + + + Qt::LeftToRight + + + false + + + 退格 + + + + :/icon/keybackspace.png:/icon/keybackspace.png + + + + + + + + + 1 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 66 + 16777215 + + + + Qt::LeftToRight + + + false + + + 英文 + + + + :/icon/keyinput.png:/icon/keyinput.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + q + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + w + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + e + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + r + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + t + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + y + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + u + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + i + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + o + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + p + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + [ + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + ] + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + + 70 + 16777215 + + + + Qt::RightToLeft + + + false + + + \ + + + + + + + + + 1 + + + + + + 0 + 0 + + + + + 65 + 0 + + + + + 66 + 16777215 + + + + 大写 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + a + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + s + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + d + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + f + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + g + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + h + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + j + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + k + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + l + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + ; + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 41 + 16777215 + + + + Qt::RightToLeft + + + false + + + ' + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 85 + 16777215 + + + + Qt::LeftToRight + + + false + + + Enter + + + + :/icon/keyenter.png:/icon/keyenter.png + + + + + + + + + 1 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 58 + 16777215 + + + + Qt::LeftToRight + + + false + + + Shift + + + + :/icon/keyshift.png:/icon/keyshift.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + z + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + x + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + c + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + v + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + b + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + n + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + m + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + + 文泉驿正黑 + + + + Qt::RightToLeft + + + false + + + , + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + . + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 42 + 16777215 + + + + Qt::RightToLeft + + + false + + + / + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 67 + 16777215 + + + + Qt::LeftToRight + + + false + + + 上 + + + + :/icon/arrowup.png:/icon/arrowup.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 80 + 16777215 + + + + Qt::LeftToRight + + + false + + + 特殊字 + + + + :/icon/specialchar.png:/icon/specialchar.png + + + + + + + + + 1 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 65 + 16777215 + + + + Qt::LeftToRight + + + false + + + 隐藏 + + + + :/icon/keyhide.png:/icon/keyhide.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 65 + 16777215 + + + + Qt::LeftToRight + + + false + + + Ctrl + + + + :/icon/controlbyhand.png:/icon/controlbyhand.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 75 + 16777215 + + + + Qt::LeftToRight + + + false + + + 删除 + + + + :/icon/keydelete.png:/icon/keydelete.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 280 + 16777215 + + + + Qt::RightToLeft + + + false + + + + + + false + + + false + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 65 + 16777215 + + + + Qt::LeftToRight + + + false + + + 行首 + + + + :/icon/keyhome.png:/icon/keyhome.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 65 + 16777215 + + + + Qt::LeftToRight + + + false + + + 行尾 + + + + :/icon/keyend.png:/icon/keyend.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 67 + 16777215 + + + + Qt::LeftToRight + + + false + + + 左 + + + + :/icon/arrowleft.png:/icon/arrowleft.png + + + false + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 67 + 16777215 + + + + Qt::LeftToRight + + + false + + + 下 + + + + :/icon/arrowdown.png:/icon/arrowdown.png + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 75 + 16777215 + + + + Qt::LeftToRight + + + false + + + 右 + + + + :/icon/arrowright.png:/icon/arrowright.png + + + + + + + + + + + + ClickLabel + QLabel +
ClickLabel.h
+
+
+ + + + +
diff --git a/InsertSpaceNumDialog.cpp b/InsertSpaceNumDialog.cpp new file mode 100644 index 0000000..eea4a95 --- /dev/null +++ b/InsertSpaceNumDialog.cpp @@ -0,0 +1,19 @@ +#include "InsertSpaceNumDialog.h" +#include "ui_insertspacenumdialog.h" + +InsertSpaceNumDialog::InsertSpaceNumDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::InsertSpaceNumDialog) +{ + ui->setupUi(this); + this->setFixedSize(this->geometry().width(),this->geometry().height()); +} + +InsertSpaceNumDialog::~InsertSpaceNumDialog() +{ + delete ui; +} + +QSpinBox *InsertSpaceNumDialog::getSpinBoxSpaceNum(){ + return ui->spinBoxSpaceNum; +} diff --git a/InsertSpaceNumDialog.h b/InsertSpaceNumDialog.h new file mode 100644 index 0000000..68bf00f --- /dev/null +++ b/InsertSpaceNumDialog.h @@ -0,0 +1,22 @@ +#ifndef INSERTSPACENUMDIALOG_H +#define INSERTSPACENUMDIALOG_H + +#include +#include +namespace Ui { +class InsertSpaceNumDialog; +} + +class InsertSpaceNumDialog : public QDialog +{ + Q_OBJECT + +public: + explicit InsertSpaceNumDialog(QWidget *parent = 0); + ~InsertSpaceNumDialog(); + QSpinBox *getSpinBoxSpaceNum(); +private: + Ui::InsertSpaceNumDialog *ui; +}; + +#endif // INSERTSPACENUMDIALOG_H diff --git a/K(bypm0718wx) b/K(bypm0718wx) new file mode 100644 index 0000000..31e1c5a Binary files /dev/null and b/K(bypm0718wx) differ diff --git a/LicenseManger/LicenseManger.cpp b/LicenseManger/LicenseManger.cpp new file mode 100644 index 0000000..b4c410e --- /dev/null +++ b/LicenseManger/LicenseManger.cpp @@ -0,0 +1,438 @@ +#include "LicenseManger.h" +#include "dlginputaddr.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qnamespace.h" +#include +#include + + + +MACHINE_INFO_t machine_info; +LICENSE_DATA_t license_data; +QMutex machine_info_mutex; +QMutex license_data_mutex; + + + +void adjustDateAndTime(int year, int mon, int mday, int hour, int min, int sec); +LicenseManger::LicenseManger() +{ +#if 1 + UCHAR e_key[1024] = "dangerous IOP 0908 "; + pAes = new TAesClass; + pAes->InitializePrivateKey(16, e_key); //进行初始化 + //setMachineInfo(16); +#endif +} +//set machine info +qint32 LicenseManger::setMachineInfo(quint32 serial_num) +{ + //check serial number size + if(serial_num>999999) + { + return -1; + } + machine_info_mutex.lock(); + QString serial; + serial.sprintf("VB%06d", serial_num); + + QByteArray hash_data; + hash_data = QCryptographicHash::hash(serial.toAscii(),QCryptographicHash::Md5 ); + //MACHINE_INFO_t machine_info; + machine_info.serial_number=serial_num; + memcpy(&machine_info.md5[0],hash_data.data(),MD5_LENGTH); + //qDebug()<<"org sn info"<OnAesEncrypt((LPVOID)&machine_info, sizeof(machine_info), (LPVOID)encrypt_buff); //进行加密 + //qDebug()<<"sn jiami:"<OnAesUncrypt((LPVOID)encrypt_buff, (DWORD)sizeof(encrypt_buff),(LPVOID)decrypt_buff); //进行解密 + //qDebug()<<"jiemi:"<OnAesEncrypt((LPVOID)&license_data, sizeof(license_data), (LPVOID)encrypt_buff); //进行加密 + //qDebug()<<"jiami:"<OnAesUncrypt((LPVOID)encrypt_buff, (DWORD)sizeof(encrypt_buff),(LPVOID)decrypt_buff); //进行解密 + //qDebug()<<"jiemi:"< +void adjustDateAndTime(int year, int mon, int mday, int hour, int min, int sec) { + time_t t; + struct tm nowtime; + nowtime.tm_sec = sec; // Seconds.[0-60] (1 leap second) + nowtime.tm_min = min; // Minutes.[0-59] + nowtime.tm_hour = hour; // Hours. [0-23] + nowtime.tm_mday = mday; // Day.[1-31] + nowtime.tm_mon = mon - 1; // Month. [0-11] + nowtime.tm_year = year - 1900; // Year- 1900. + nowtime.tm_isdst = -1; // DST.[-1/0/1] + t = mktime(&nowtime); + // qDebug()<= 6*60*18*367) + { + qDebug()<<"license file was invalid"; + return 0; + } + if(license_data.vernon_bach_version != VERNONBACH_VERSION_CODE) + { + qDebug()<<"license file was invalid"; + return 0; + } +qDebug()<<"license serial number"<= 6*60*18*367) + { + qDebug()<<"license file was invalid"; + return 0; + } + if(license_data.remainingTime) + license_data.remainingTime--; + if(license_data.remainingTime<=0) + { + license_data.workout = 1; + } + SaveLicData2File(); + //license_data.remainingTime=0; + return license_data.remainingTime; + +} + +quint32 LicenseManger::CheckUpdateFileState() +{ + QFile file(UPDATE_LIC_FILE); + LICENSE_DATA_t update_license_data; + quint32 state = UPDATE_LICENSE_FILE_OK; + if(!file.exists()) + { + state = -UPDATE_LICENSE_FILE_NOT_EXIT; + } + else + { + if(!file.open(QIODevice::ReadOnly | QIODevice::Truncate)){ + QMessageBox::warning(0,"警告",QString("无法打开license文件") ); + state = -UPDATE_LICENSE_FILE_OPEN_FAILED; + } + else + { + //license_data_mutex.lock(); + char encrypt_buff[1024]; + char decrypt_buff[1024]; + file.read((char *)encrypt_buff,(qint64)sizeof(encrypt_buff)); + pAes->OnAesUncrypt((LPVOID)encrypt_buff, (DWORD)sizeof(encrypt_buff),(LPVOID)decrypt_buff); //进行解密 + //qDebug()<<"jiemi:"<= (license_data.printer_active_count+3) ) + { + state = -UPDATE_LICENSE_FILE_ACTIVE_NUMBER_ERR; + } + else if(update_license_data.vernon_bach_version != VERNONBACH_VERSION_CODE) + { + state = -UPDATE_LICENSE_FILE_SW_VERSION_ERR; + } + } + } + return state; +} +quint32 LicenseManger::UpdateLicenseFileData() +{ + QFile file(UPDATE_LIC_FILE); + LICENSE_DATA_t update_license_data; + quint32 state = UPDATE_LICENSE_FILE_OK; + if(!file.exists()) + { + state = -UPDATE_LICENSE_FILE_NOT_EXIT; + } + else + { + if(!file.open(QIODevice::ReadOnly | QIODevice::Truncate)){ + QMessageBox::warning(0,"警告",QString("无法打开更新license文件") ); + state = -UPDATE_LICENSE_FILE_OPEN_FAILED; + } + else + { + //license_data_mutex.lock(); + char encrypt_buff[1024]; + char decrypt_buff[1024]; + file.read((char *)encrypt_buff,(qint64)sizeof(encrypt_buff)); + pAes->OnAesUncrypt((LPVOID)encrypt_buff, (DWORD)sizeof(encrypt_buff),(LPVOID)decrypt_buff); //进行解密 + //qDebug()<<"jiemi:"< +#include +#include +#include "Aes/TAesClass.h" +#include "VerBVersion.h" + +#define LIC_FILE "/etc/licenseData" +#define UPDATE_LIC_FILE "/udisk/lic_update_file" +//#define MACH_INFO_FILE "/home/student/mini2440/UP/QtUI/machine_info" +#define MACH_INFO_FILE "/etc/appdata/machine_info" + +#define LICENSE_STATE_OK 0 +#define LICENSE_STATE_MACH_INFO_DAMAGED 1 +#define LICENSE_STATE_LIC_DATA_DAMAGED 2 +#define LICENSE_STATE_REMAIN_TIME_WARNING 3 //提前提示维护码到期 +#define LICENSE_STATE_REMAIN_TIME_REARCH 4 + +#define UPDATE_LICENSE_FILE_OK 0 +#define UPDATE_LICENSE_FILE_NOT_EXIT 1 +#define UPDATE_LICENSE_FILE_OPEN_FAILED 2 +#define UPDATE_LICENSE_FILE_SERIAL_NUMBER_ERR 3 //提前提示维护码到期 +#define UPDATE_LICENSE_FILE_ACTIVE_NUMBER_ERR 4 +#define UPDATE_LICENSE_FILE_SW_VERSION_ERR 5 +#define UPDATE_LICENSE_FILE_MD5_VALUE_ERR 66 + +#define LIC_DATA_MD5_LEN 16 + +typedef struct { + unsigned int serial_number; + unsigned char md5[LIC_DATA_MD5_LEN]; +}MACHINE_INFO_t; + +typedef struct { + unsigned int serial_number; + unsigned char enable; //1Byte + unsigned char powerEn; // 1Byte + unsigned char printEn; // 1Byte + + unsigned int powerMinuteMax; + unsigned int powerMinuteCnt; + unsigned int printMax; + unsigned int printCnt; // printDot/1024 + + unsigned int start;// yyyymmdd + unsigned int end; // yyyymmdd + unsigned int nDate; + unsigned int workout; + unsigned int remainingTime;//10 second count: 1 day = 6x60x24=8640; 1 week = 7x8640 = 60480; 1 year=8640 x 365 = 3153600 + unsigned int printer_bworkout; + unsigned int printer_active_count; + unsigned int printer_auth_flag; + unsigned int vernon_bach_version; + unsigned char md5[LIC_DATA_MD5_LEN]; +}LICENSE_DATA_t; + + + +typedef enum { + LicenseState_eLicAvailable, + LicenseState_eLicTimeOut, + LicenseState_eMachineError +}LicenseState_e; + + + +class LicenseManger +{ +private: + +public: + LicenseManger(); + + qint32 setMachineInfo(quint32 serial_num); + qint32 checkMachineInfoAvailable(); + qint8 getLicState(); + void SaveLicData2File(); + void ReadLicDataFromFile(); + void ResetLicDataFile(); + int CheckLicDataValid(); + quint32 CheckRemainingTime(); + quint32 CheckUpdateFileState(); + quint32 UpdateLicenseFileData(); +private: + QDate curDate; + TAesClass *pAes; +}; + +extern MACHINE_INFO_t machine_info; +extern LICENSE_DATA_t license_data; +#endif // LICENSEMANGER_H diff --git a/Log/dualfilelogger.cpp b/Log/dualfilelogger.cpp new file mode 100644 index 0000000..c03364d --- /dev/null +++ b/Log/dualfilelogger.cpp @@ -0,0 +1,21 @@ + +#include "dualfilelogger.h" + +DualFileLogger::DualFileLogger(QSettings *firstSettings, QSettings* secondSettings, const int refreshInterval, QObject* parent) + :Logger(parent) +{ + firstLogger=new FileLogger(firstSettings, refreshInterval, this); + secondLogger=new FileLogger(secondSettings, refreshInterval, this); +} + +void DualFileLogger::log(const QtMsgType type, const QString& message, const QString &file, const QString &function, const int line) +{ + firstLogger->log(type,message,file,function,line); + secondLogger->log(type,message,file,function,line); +} + +void DualFileLogger::clear(const bool buffer, const bool variables) +{ + firstLogger->clear(buffer,variables); + secondLogger->clear(buffer,variables); +} diff --git a/Log/dualfilelogger.h b/Log/dualfilelogger.h new file mode 100644 index 0000000..e1de33e --- /dev/null +++ b/Log/dualfilelogger.h @@ -0,0 +1,35 @@ + +#ifndef DUALFILELOGGER_H +#define DUALFILELOGGER_H + +#include +#include +#include +#include "logglobal.h" +#include "logger.h" +#include "filelogger.h" + +class DECLSPEC DualFileLogger : public Logger { + Q_OBJECT + Q_DISABLE_COPY(DualFileLogger) +public: + + + DualFileLogger(QSettings* firstSettings, QSettings* secondSettings, + const int refreshInterval=10000, QObject *parent = nullptr); + + + virtual void log(const QtMsgType type, const QString& message, const QString &file="", + const QString &function="", const int line=0); + + virtual void clear(const bool buffer=true, const bool variables=true); + +private: + + FileLogger* firstLogger; + + FileLogger* secondLogger; + +}; + +#endif // DUALFILELOGGER_H diff --git a/Log/filelogger.cpp b/Log/filelogger.cpp new file mode 100644 index 0000000..45ebf1b --- /dev/null +++ b/Log/filelogger.cpp @@ -0,0 +1,276 @@ + +#include "filelogger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "LogInfo.h" +#define LOG_FILE_PATH "/home/plg/loginfo/" + +void FileLogger::refreshSettings() +{ + mutex.lock(); + QString oldFileName=fileName; + + settings->sync(); + fileName = LOG_FILE_PATH; +// fileName=settings->value("fileName").toString(); +// LogInfo::setRunStatusText(tr("fileName: %1").arg(fileName)); + QDate today = QDate::currentDate(); + QString todayString=today.toString(Qt::ISODate); + // 计算前七天的日期 + //QDate oneWeekAgo = today.addDays(-7); + fileName+=today.toString(Qt::ISODate); + fileName+="/"; + fileName+="log.txt"; + static QString lastDay = ""; + if(lastDay!=todayString) + { + TimerDel->start(30000); + lastDay=todayString; + } + + +#ifdef Q_OS_WIN32 + if (QDir::isRelativePath(fileName) && settings->format()!=QSettings::NativeFormat) +#else + // std::cout<<"QDir::isRelativePath:"<fileName()); + fileName=QFileInfo(configFile.absolutePath(),fileName).absoluteFilePath(); + } + maxSize=settings->value("maxSize",0).toLongLong(); + maxBackups=settings->value("maxBackups",0).toInt(); + msgFormat=settings->value("msgFormat","{timestamp} {type} {msg}").toString(); + timestampFormat=settings->value("timestampFormat","yyyy-MM-dd hh:mm:ss.zzz").toString(); + bufferSize=settings->value("bufferSize",0).toInt(); + + QByteArray minLevelStr = settings->value("minLevel","ALL").toByteArray(); + if (minLevelStr=="ALL" || minLevelStr=="DEBUG" || minLevelStr=="0") + { + minLevel=QtDebugMsg; + } + else if (minLevelStr=="WARNING" || minLevelStr=="WARN" || minLevelStr=="1") + { + minLevel=QtWarningMsg; + } + else if (minLevelStr=="ERROR" || minLevelStr=="CRITICAL" || minLevelStr=="2") + { + minLevel=QtCriticalMsg; + } + else if (minLevelStr=="FATAL" || minLevelStr=="3") + { + // minLevel=QtMsgType::QtFatalMsg; + minLevel=QtFatalMsg; + } +// else if (minLevelStr=="INFO" || minLevelStr=="4") +// { +// minLevel=QtMsgType::QtInfoMsg; +// } + + if (oldFileName!=fileName) + { + fprintf(stderr,"Logging to %s\n",qPrintable(fileName)); + close(); + open(); + } + mutex.unlock(); +} + + +FileLogger::FileLogger(QSettings *settings, const int refreshInterval, QObject* parent) + : Logger(parent) +{ + TimerDel = new QTimer(this); + connect(TimerDel,SIGNAL(timeout()),this,SLOT(timeOutToDelete())); + Q_ASSERT(settings!=nullptr); + Q_ASSERT(refreshInterval>=0); + this->settings=settings; + file=nullptr; + if (refreshInterval>0) + { + refreshTimer.start(refreshInterval,this); + } + flushTimer.start(1000,this); + refreshSettings(); +} + + +FileLogger::~FileLogger() +{ + close(); +} + + +void FileLogger::write(const LogMessage* logMessage) +{ + if (file) + { +// qDebug()<<"Critical message output test\n"; +// qCritical("This is a critical message of test\n"); + file->write(qPrintable(logMessage->toString(msgFormat,timestampFormat))); + + if (logMessage->getType()>=QtCriticalMsg) + { + file->flush(); + } + + if (file->error()) + { + qWarning("Cannot write to log file %s: %s",qPrintable(fileName),qPrintable(file->errorString())); + close(); + } + + } + + if (!file) + { + Logger::write(logMessage); + } + +} + +void FileLogger::open() +{ + if (fileName.isEmpty()) + { + qWarning("Name of logFile is empty"); + } + else { + file=new QFile(fileName); + QFileInfo fileInfo(fileName); + //std::cout<<"fileInfo.exists:"<open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) + { + std::cout<<"file is is open faile fileName:"<errorString())); + file=nullptr; + } + } +} + + +void FileLogger::close() +{ + if (file) + { + file->close(); + delete file; + file=nullptr; + } +} + +void FileLogger::rotate() { + int count=0; + forever + { + QFile bakFile(QString("%1.%2").arg(fileName).arg(count+1)); + if (bakFile.exists()) + { + ++count; + } + else + { + break; + } + } + + while (maxBackups>0 && count>=maxBackups) + { + QFile::remove(QString("%1.%2").arg(fileName).arg(count)); + --count; + } + + for (int i=count; i>0; --i) { + QFile::rename(QString("%1.%2").arg(fileName).arg(i),QString("%1.%2").arg(fileName).arg(i+1)); + } + + QFile::rename(fileName,fileName+".1"); + +} + + +void FileLogger::timerEvent(QTimerEvent* event) +{ + if (!event) + { + return; + } + else if (event->timerId()==refreshTimer.timerId()) + { + refreshSettings(); + } + else if (event->timerId()==flushTimer.timerId() && file) + { + mutex.lock(); + + file->flush(); + + if (maxSize>0 && file->size()>=maxSize) + { + close(); + rotate(); + open(); + } + + mutex.unlock(); + } +} + +bool FileLogger::removeDirectory(const QString &directoryPath) { + // 检查目录是否存在 + QDir dir(directoryPath); + if (dir.exists()) { + system((char *)((QString("rm -r %1").arg(directoryPath)).toAscii().data())); + return true; + } + return false; +} + +void FileLogger::timeOutToDelete(){ + QDate today = QDate::currentDate(); + for(int daysAgo=14;daysAgo>=7;--daysAgo){ + QString needToDelFoldPath=LOG_FILE_PATH; + QDate pastDate=today.addDays(-daysAgo); + needToDelFoldPath+=pastDate.toString(Qt::ISODate); + needToDelFoldPath+="/"; + if (QDir(needToDelFoldPath).exists()) { + bool result= removeDirectory(needToDelFoldPath); + if(result){ + qDebug()<<"The directory and all its contents have been removed"; + LogInfo::setRunStatusText(tr("The directory and all its contents have been removed")); + }else{ + qDebug() << "Failed to remove the directory"; + LogInfo::setRunStatusText(tr("Failed to remove the directory")); + } + } + } + TimerDel->stop(); +} diff --git a/Log/filelogger.h b/Log/filelogger.h new file mode 100644 index 0000000..1310d8b --- /dev/null +++ b/Log/filelogger.h @@ -0,0 +1,62 @@ + +#ifndef FILELOGGER_H +#define FILELOGGER_H + +#include +#include +#include +#include +#include +#include "logglobal.h" +#include "logger.h" +#include + +class DECLSPEC FileLogger : public Logger { + Q_OBJECT + Q_DISABLE_COPY(FileLogger) +public: + + FileLogger(QSettings* settings, const int refreshInterval=10000, QObject* parent = nullptr); + + virtual ~FileLogger(); + + virtual void write(const LogMessage* logMessage); + + public slots: + void timeOutToDelete(); + +protected: + + void timerEvent(QTimerEvent* event); + +private: + + + QString fileName; + + + long maxSize; + + int maxBackups; + + QSettings* settings; + + QFile* file; + + QBasicTimer refreshTimer; + + QBasicTimer flushTimer; + QTimer *TimerDel; + + void open(); + + void close(); + + void rotate(); + + void refreshSettings(); + + bool removeDirectory(const QString &directoryPath); +}; + +#endif // FILELOGGER_H diff --git a/Log/logger.cpp b/Log/logger.cpp new file mode 100644 index 0000000..7b782e9 --- /dev/null +++ b/Log/logger.cpp @@ -0,0 +1,240 @@ + +#include "logger.h" +#include +#include +#include +#include +#include + +Logger* Logger::defaultLogger=nullptr; + + +QThreadStorage*> Logger::logVars; + + +QMutex Logger::mutex; + + +Logger::Logger(QObject* parent) + : QObject(parent), + msgFormat("{timestamp} {type} {msg}"), + timestampFormat("dd.MM.yyyy hh:mm:ss.zzz"), + minLevel(QtDebugMsg), + bufferSize(0) + {} + + +Logger::Logger(const QString msgFormat, const QString timestampFormat, const QtMsgType minLevel, const int bufferSize, QObject* parent) + :QObject(parent) +{ + this->msgFormat=msgFormat; + this->timestampFormat=timestampFormat; + this->minLevel=minLevel; + this->bufferSize=bufferSize; +} + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + static QRecursiveMutex recursiveMutex; + static QMutex nonRecursiveMutex; +#else + static QMutex recursiveMutex(QMutex::Recursive); + static QMutex nonRecursiveMutex(QMutex::NonRecursive); +#endif + +void Logger::msgHandler(const QtMsgType type, const QString &message, const QString &file, const QString &function, const int line) +{ + + recursiveMutex.lock(); + + if (defaultLogger && nonRecursiveMutex.tryLock()) + { + defaultLogger->log(type, message, file, function, line); + nonRecursiveMutex.unlock(); + } + else + { + fputs(qPrintable(message),stderr); + fflush(stderr); + } + + if (type==QtFatalMsg) + { + abort(); + } + + recursiveMutex.unlock(); +} + + +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + void Logger::msgHandler5(const QtMsgType type, const QMessageLogContext &context, const QString &message) + { + (void)(context); + msgHandler(type,message,context.file,context.function,context.line); + } +#else + void Logger::msgHandler4(const QtMsgType type, const char* message) + { + msgHandler(type,message); + } +#endif + + +Logger::~Logger() +{ + if (defaultLogger==this) + { +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + qInstallMessageHandler(nullptr); +#else + qInstallMsgHandler(nullptr); +#endif + defaultLogger=nullptr; + } +} + + +void Logger::write(const LogMessage* logMessage) +{ + fputs(qPrintable(logMessage->toString(msgFormat,timestampFormat)),stderr); + fflush(stderr); +} + + +void Logger::installMsgHandler() +{ + defaultLogger=this; +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + qInstallMessageHandler(msgHandler5); +#else + qInstallMsgHandler(msgHandler4); +#endif +} + + +void Logger::set(const QString& name, const QString& value) +{ + mutex.lock(); + if (!logVars.hasLocalData()) + { + logVars.setLocalData(new QHash); + } + logVars.localData()->insert(name,value); + mutex.unlock(); +} + + +void Logger::clear(const bool buffer, const bool variables) +{ + mutex.lock(); + if (buffer && buffers.hasLocalData()) + { + QList* buffer=buffers.localData(); + while (buffer && !buffer->isEmpty()) + { + LogMessage* logMessage=buffer->takeLast(); + delete logMessage; + } + } + if (variables && logVars.hasLocalData()) + { + logVars.localData()->clear(); + } + mutex.unlock(); +} + + +void Logger::log(const QtMsgType type, const QString& message, const QString &file, const QString &function, const int line) +{ + bool toPrint=false; + switch (type) + { + case QtDebugMsg: + if (minLevel==QtDebugMsg) + { + toPrint=true; + } + break; + + #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) + case QtInfoMsg: + if (minLevel==QtDebugMsg || + minLevel==QtInfoMsg) + { + toPrint=true; + } + break; + #endif + + case QtWarningMsg: + if (minLevel==QtDebugMsg || + #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) + minLevel==QtInfoMsg || + #endif + minLevel==QtWarningMsg) + { + toPrint=true; + } + break; + + case QtCriticalMsg: + if (minLevel==QtDebugMsg || + #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) + minLevel==QtInfoMsg || + #endif + minLevel==QtWarningMsg || + minLevel==QtCriticalMsg) + { + toPrint=true; + } + break; + + case QtFatalMsg: + toPrint=true; + break; + + default: + toPrint=true; + } + + mutex.lock(); + + if (bufferSize>0) + { + + if (!buffers.hasLocalData()) + { + buffers.setLocalData(new QList()); + } + QList* buffer=buffers.localData(); + + LogMessage* logMessage=new LogMessage(type,message,logVars.localData(),file,function,line); + buffer->append(logMessage); + + if (buffer->size()>bufferSize) + { + delete buffer->takeFirst(); + } + + if (toPrint) + { + + while (!buffer->isEmpty()) + { + LogMessage* logMessage=buffer->takeFirst(); + write(logMessage); + delete logMessage; + } + } + } + + else + { + if (toPrint) + { + LogMessage logMessage(type,message,logVars.localData(),file,function,line); + write(&logMessage); + } + } + mutex.unlock(); +} diff --git a/Log/logger.h b/Log/logger.h new file mode 100644 index 0000000..cea439c --- /dev/null +++ b/Log/logger.h @@ -0,0 +1,76 @@ + +#ifndef LOGGER_H +#define LOGGER_H + +#include +#include +#include +#include +#include +#include +#include "logglobal.h" +#include "logmessage.h" +#include + +class DECLSPEC Logger : public QObject { + Q_OBJECT + Q_DISABLE_COPY(Logger) +public: + + Logger(QObject* parent); + + Logger(const QString msgFormat="{timestamp} {type} {msg}", + const QString timestampFormat="dd.MM.yyyy hh:mm:ss.zzz", + const QtMsgType minLevel=QtDebugMsg, const int bufferSize=0, + QObject* parent = nullptr); + + virtual ~Logger(); + + virtual void log(const QtMsgType type, const QString& message, const QString &file="", + const QString &function="", const int line=0); + + void installMsgHandler(); + static void set(const QString& name, const QString& value); + + virtual void clear(const bool buffer=true, const bool variables=true); + +protected: + + + QString msgFormat; + + + QString timestampFormat; + + QtMsgType minLevel; + + int bufferSize; + + static QMutex mutex; + + virtual void write(const LogMessage* logMessage); + +private: + + static Logger* defaultLogger; + + static void msgHandler(const QtMsgType type, const QString &message, const QString &file="", + const QString &function="", const int line=0); + + +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + + static void msgHandler5(const QtMsgType type, const QMessageLogContext& context, const QString &message); + +#else + + static void msgHandler4(const QtMsgType type, const char * message); + +#endif + + static QThreadStorage*> logVars; + + QThreadStorage*> buffers; +}; + +#endif // LOGGER_H diff --git a/Log/logglobal.h b/Log/logglobal.h new file mode 100644 index 0000000..1e2fc58 --- /dev/null +++ b/Log/logglobal.h @@ -0,0 +1,23 @@ + +#ifndef LOGGLOBAL_H +#define LOGGLOBAL_H + +#include + +#if defined(Q_OS_WIN) + #if defined(QTWEBAPPLIB_EXPORT) + #define DECLSPEC Q_DECL_EXPORT + #elif defined(QTWEBAPPLIB_IMPORT) + #define DECLSPEC Q_DECL_IMPORT + #endif +#endif +#if !defined(DECLSPEC) + #define DECLSPEC +#endif + +#if __cplusplus < 201103L + #define nullptr 0 +#endif + +#endif // LOGGLOBAL_H + diff --git a/Log/logmessage.cpp b/Log/logmessage.cpp new file mode 100644 index 0000000..34e95aa --- /dev/null +++ b/Log/logmessage.cpp @@ -0,0 +1,78 @@ + +#include "logmessage.h" +#include + +LogMessage::LogMessage(const QtMsgType type, const QString& message, const QHash *logVars, const QString &file, const QString &function, const int line) +{ + this->type=type; + this->message=message; + this->file=file; + this->function=function; + this->line=line; + timestamp=QDateTime::currentDateTime(); + threadId=QThread::currentThreadId(); + + if (logVars) + { + this->logVars=*logVars; + } +} + +QString LogMessage::toString(const QString& msgFormat, const QString& timestampFormat) const +{ + QString decorated=msgFormat+"\n"; + decorated.replace("{msg}",message); + + if (decorated.contains("{timestamp}")) + { + decorated.replace("{timestamp}",timestamp.toString(timestampFormat)); + } + + QString typeNr; + typeNr.setNum(type); + decorated.replace("{typeNr}",typeNr); + + switch (type) + { + case QtDebugMsg: + decorated.replace("{type}","DEBUG "); + break; + case QtWarningMsg: + decorated.replace("{type}","WARNING "); + break; + case QtCriticalMsg: + decorated.replace("{type}","CRITICAL"); + break; + case QtFatalMsg: + decorated.replace("{type}","FATAL "); + break; + #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) + case QtInfoMsg: + decorated.replace("{type}","INFO "); + break; + #endif + } + + decorated.replace("{file}",file); + decorated.replace("{function}",function); + decorated.replace("{line}",QString::number(line)); + + QString threadId = QString("0x%1").arg(qulonglong(QThread::currentThreadId()), 8, 16, QLatin1Char('0')); + decorated.replace("{thread}",threadId); + + if (decorated.contains("{") && !logVars.isEmpty()) + { + QList keys=logVars.keys(); + foreach (QString key, keys) + { + decorated.replace("{"+key+"}",logVars.value(key)); + } + } + + return decorated; +} + +QtMsgType LogMessage::getType() const +{ + return type; +} diff --git a/Log/logmessage.h b/Log/logmessage.h new file mode 100644 index 0000000..d2ee785 --- /dev/null +++ b/Log/logmessage.h @@ -0,0 +1,44 @@ + +#ifndef LOGMESSAGE_H +#define LOGMESSAGE_H + +#include +#include +#include +#include "logglobal.h" + +class DECLSPEC LogMessage +{ + Q_DISABLE_COPY(LogMessage) +public: + + LogMessage(const QtMsgType type, const QString& message, const QHash* logVars, + const QString &file, const QString &function, const int line); + + QString toString(const QString& msgFormat, const QString& timestampFormat) const; + + QtMsgType getType() const; + +private: + + + QHash logVars; + + QDateTime timestamp; + + QtMsgType type; + + + Qt::HANDLE threadId; + + QString message; + + QString file; + + QString function; + + int line; + +}; + +#endif // LOGMESSAGE_H diff --git a/LogInfo.cpp b/LogInfo.cpp new file mode 100644 index 0000000..f729d56 --- /dev/null +++ b/LogInfo.cpp @@ -0,0 +1,476 @@ +#include "LogInfo.h" +#include "ui_loginfo.h" +#include +#include +#include +#include +#include +#include +#include +#include "DevOp.h" +#include +#include "myinclude.h" +#include +#include + +#ifndef LOGINFOFILE_DIR + #define LOGINFOFILE_DIR "/home/plg/loginfo/" +#endif +#define UDISK_LOGINFO_ROOT_DIR "/udisk/log/" + +LogInfo::LogInfo(QWidget *parent) : + QWidget(parent), + ui(new Ui::LogInfo) +{ + ui->setupUi(this); + ui->textEditRunStatus->setReadOnly(true); + ui->textEditRunStatus_2->setReadOnly(true); + textEdit = ui->textEditRunStatus; + textEdit->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }"); + textEdit2 = ui->textEditRunStatus_2; + //textEdit2->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }"); + textEdit2->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }"); + + + textEditMachInfo = ui->machinInformation; + runStatusTextIndex = 0; + openFileName =""; + ui->labelPreFileName->setText(""); + //currenDate=""; + //r_CurrentDate=QDate::currentDate().toString("yyyyMMdd"); + + textEdit2->append(tr("请先打开历史状态文件!")); + if(!QDir("/home/plg").exists()) + QDir("/home/plg").mkdir("/home/plg"); + readRunStatusText(); + runStatusTextIndex = textEdit->document()->lineCount(); + //ui->pushButtonClear->hide(); + fileDialog=0; // 先初始化为0 ,否则会死机 + + // LOGINFOFILE_DIR "/home/plg/loginfo/" +#ifdef DEBUG1 + ; +#else + QFile file(SYS_ROOT_DIR"UseEn"); + if(file.exists()) //ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tab_3)); + ; + else { + //ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tab_3)); + onReadRecorder( ); + } +#endif + //ui->textEditRunStatus_3->setText(tr("测试变量加粗,可能会影响其它内容")); + //showMachineInformation(" "," "," "," "); + timerLogdel=new QTimer(this); + connect(timerLogdel, SIGNAL(timeout()), this, SLOT(deleteOldLog())); + //延时60秒删除日志文件 + timerLogdel->start(60000); +} + +LogInfo::~LogInfo() +{ + textEdit = 0; + textEdit2 = 0; + textEditMachInfo = 0; + if(fileDialog) + delete fileDialog; + delete ui; + + disconnect(timerLogdel, SIGNAL(timeout()), this, SLOT(deleteOldLog())); + timerLogdel->stop(); +} + +QTextEdit *LogInfo::textEdit = 0; +QTextEdit *LogInfo::textEdit2 = 0; +QTextEdit *LogInfo::textEditMachInfo = 0; + +int LogInfo::runStatusTextIndex = 0; + +void LogInfo::showMachineInformation(QString Mac,QString SerialNum, QString VernonBachVer, QString FpgaVer) +{ + QString machInfo; + machInfo = "Mac:" + Mac + "\n"; + machInfo += "Serial Number:" + SerialNum + "\n"; + machInfo += "VernonBach Ver:" + VernonBachVer + "\n"; + machInfo += "FPGA Ver:" + FpgaVer + "\n"; + QFile kernelVer("/proc/version"); + if (kernelVer.open(QFile::ReadOnly | QFile::Text)) { + QTextStream in(&kernelVer); + QString kernelVer=in.readLine(); + QStringList list=kernelVer.split(" "); + QStringList list2=kernelVer.split("#"); + machInfo = machInfo + "Kernel: "; + machInfo = machInfo + list.at(2); + machInfo = machInfo + "(" + list2.at(1) + ")" + "\n"; + } + textEditMachInfo->setText(machInfo); +} +void LogInfo::showRemoteControll(QString SuperNode, QString edgeIP) +{ + QString machInfo = textEditMachInfo->toPlainText(); + machInfo += "SuperNode:" + SuperNode + "\n"; + machInfo += "edgeIP:" + edgeIP + "\n"; + textEditMachInfo->setText(machInfo); +} +//void LogInfo::setRunStatusText(QString str){ +// if(!textEdit){ +// return; +// } +// const int maxTextEditHeight = 2000; +// if(textEdit->document()->size().height() > maxTextEditHeight){ +// const QString fileNameL=QString(LOGINFOFILE_DIR)+QDate::currentDate().toString("yyyyMMdd") +"_test.txt"; +// QFile file(fileNameL); +// if(file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)){ +// QTextStream out(&file); +// out<toPlainText()<clear(); //显示今天全部信息,加载太多可能会死机 +// } +// str.prepend(QString("%1. %2:").arg(QString::number(runStatusTextIndex ++ )).arg(QTime::currentTime().toString("hh:mm:ss"))); +// textEdit->append(str); +// saveRunStatusText(); +//} + +//edit@01-11 +void LogInfo::setRunStatusText(QString str){ + if(!textEdit){ + return; + } + const int maxTextEditHeight = 2000; + if(textEdit->document()->size().height() > maxTextEditHeight) + { + textEdit->clear(); //显示今天全部信息,加载太多可能会死机 + } + str.prepend(QString("%1. %2:").arg(QString::number(runStatusTextIndex ++ )).arg(QTime::currentTime().toString("hh:mm:ss"))); + textEdit->append(str); + saveRunStatusText(); + + { + const QString dts=QDate::currentDate().toString("yyyyMMdd") ; + QString fileNameL=QString(LOGINFOFILE_DIR)+dts +"_1.txt"; + QFile file(fileNameL); + if(file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)){ + QTextStream out(&file); + out<document()->size(); + if(size.height() > 500){ + textEdit3->clear(); + } + //str.prepend(QString("%1. %2: ").arg(QString::number(runStatusTextIndex ++ )).arg(QTime::currentTime().toString("hh:mm:ss"))); + textEdit3->append(str); + } +#else + str; +#endif +} +QString LogInfo::getRunStatusText(void){ + return ""; +} + +void LogInfo::saveRunStatusText() +{ +// QString fileName; +// static QString r_fileName=""; +// QDir dir1; +// dir1.setPath(LOGINFOFILE_DIR); + +// if(textEdit){ +// if(!dir1.exists()) +// { +// dir1.mkdir(QString ("/home/plg/loginfo/")); +// } +// //currenDate=QDate::currentDate().toString("yyyyMMdd"); // +// fileName=QString("/home/plg/loginfo/")+QDate::currentDate().toString("yyyyMMdd") +".txt"; +//#ifdef DEBUG1 +// // qDebug()<document()); +// if(r_fileName!="" && (r_fileName!=fileName)) textEdit->clear(); +// r_fileName=fileName; +// } +} +void LogInfo::readRunStatusText() +{ + QString fileName; + if(textEdit){ + QDir dir1; + dir1.setPath(LOGINFOFILE_DIR); + if(!dir1.exists()) + dir1.mkdir(QString ("/home/plg/loginfo/")); + fileName=QString("/home/plg/loginfo/")+QDate::currentDate().toString("yyyyMMdd")+"_1.txt"; + QFile file(fileName); + if(file.exists()){ + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + file.fileName()); + } + else{ + QTextStream in (&file); + textEdit->setText(in.readAll()); + } + file.close(); + ui->tabWidget->setCurrentWidget(ui->tab); + } + + QDate date1 = QDate::currentDate(); + for(int i=0;i<8;i++) + { + fileName=QString("/home/plg/loginfo/")+date1.addDays(-i-5).toString("yyyyMMdd")+".txt"; + file.setFileName(fileName); + if(file.exists()){ + file.remove(); + } + } + } +} + + +void LogInfo::on_pushButtonExportFile_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("提示"), + tr("是否确认将所有日志文件导出到U盘?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + //QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_LOGINFO_ROOT_DIR; + QDir dir(UDISK_LOGINFO_ROOT_DIR); + if(!dir.exists()){ + system((char *)((QString("mkdir -p %1").arg(UDISK_LOGINFO_ROOT_DIR)).toAscii().data())); + } + + //插入U盘后,检测目录usb-storage是否存在 + if(!QDir("/proc/scsi/usb-storage/").exists()){ + QMessageBox::warning(0,tr("警告"),tr("U盘未插入或无法识别,请重新插拔设备!")); + return; + } + + system((char *)((QString("cp -r %1/* %2/").arg(LOGINFOFILE_DIR).arg(UDISK_LOGINFO_ROOT_DIR)).toAscii().data())); + //refreshListView(EditMode); + QMessageBox::information(this, tr("提示"), + tr("成功导出到U盘")); + } +} + +void LogInfo::on_pushButtonPreState_pressed(){ + + if(textEdit2){ + //setRunStatusText(QString("FILE COUNT:%1").arg( QDir("/home/plg/loginfo/").count())); + //if( QDir("/home/plg/loginfo/").count()<4) { + if( QDir("/home/plg/loginfo/").count()<1) { + //QMessageBox::warning(this,"警告","没有历史文件"); + textEdit2->setText( "目前历史文件数量为0个"); + return; + } + //qDebug()<<"3333"; + if(openFileName.isEmpty()) textEdit2->clear(); + if(fileDialog) { + // qDebug()<<"4444"; + disconnect(fileDialog,SIGNAL(accepted()),0,0); // 如果对话框已经定义,则删除控件关联,否则也会出错。 + + } + else {//qDebug()<<"5"; + fileDialog = new MyFileDialog(0); + //qDebug()<<"6"; + } + //qDebug()<<"7"; + QDir dir1; + dir1.setPath(QString ("/home/plg/loginfo/")); + + if(!dir1.exists()) + {dir1.mkdir(QString ("/home/plg/loginfo/"));} + if(fileDialog){ + //qDebug()<<"8"; + + if(fileDialog->directory().path()!="/home/plg/loginfo") + fileDialog->setDirectory(QDir("/home/plg/loginfo")); + + + //qDebug()<<"read File 3.2"<showFileDialog(tr("选择历史记录文件"),dir1.path(),QString("Txt files (*.txt)")); + //qDebug()<<"read File 5"; + } + //else qDebug()<<"read File:"<selectedFiles(); + if( files.size()==0) return ; + if(QString(files[0]).isNull()) return; + QString fileName = files[0]; + + if(!fileName.endsWith(".txt",Qt::CaseInsensitive)) return ; + + openFileName = fileName; + QFile file(openFileName); + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + openFileName); + } + else{ + QTextStream in (&file); + textEdit2->setText(in.readAll()); + textEdit2->moveCursor(QTextCursor::End);//滚动条移到底部 + //ui->labelPreFileName->setText(file.fileName()); + QFileInfo info(file.fileName()); + ui->labelPreFileName->setText(info.fileName()); + } + file.close(); + ui->tabWidget->setCurrentWidget(ui->tab_2); + +} + +void LogInfo::on_pushButtonClear_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("提示"), + tr("是否确认将历史日志文件全部清除?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QDir dir1(QString("/home/plg/loginfo/")); + if(dir1.exists()) + { + system((char *)QString("rm /home/plg/loginfo/*.*").toAscii().data()); + deleteDirectoryContents(dir1); + } + else system((char *)QString("mkdir /home/plg/loginfo/").toAscii().data()); + + saveRunStatusText(); + } + +} + +void LogInfo::on_pushButtonClearCurrent_pressed() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("提示"), + tr("是否确认将当前日志全部清除?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ +// QString fileNameL=QString("/home/plg/loginfo/")+QDate::currentDate().toString("yyyyMMdd") +"test.txt"; +// QFile file(fileNameL); +// if(!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)){ +// ; +// } +// else{ +// QTextStream out(&file); +// out<toPlainText()<clear(); + runStatusTextIndex=0; + saveRunStatusText(); + } + //setRunStatusText(QString("FILE COUNT:%1").arg( QDir("/home/plg/loginfo/").count())); +} +void LogInfo::onReadRecorder() +{ + QString fileName = ":/buge_record.txt"; + + if(!fileName.endsWith(".txt",Qt::CaseInsensitive)) return ; + QFile file(fileName); + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + openFileName); + } + else{ + QTextStream in (&file); + textEditMachInfo->setText(in.readAll()); + } +} + + +void LogInfo::deleteDirectoryContents(const QDir &directory) { + QList entries = directory.entryInfoList( + QDir::NoDotAndDotDot | QDir::AllEntries); + QString today = QDate::currentDate().toString(Qt::ISODate); + // 使用传统的 for 循环遍历所有条目 + for (int i = 0; i < entries.size(); ++i) { + QFileInfo entryInfo = entries.at(i); + QString dirName=entryInfo.baseName(); + if(today==dirName) + continue; + QString fullPath = entryInfo.absoluteFilePath(); + + if (entryInfo.isFile() || entryInfo.isSymLink()) { + // 如果是文件或符号链接,尝试删除 + if (!QFile::remove(fullPath)) { + qDebug() << "Failed to remove file or symlink:" << fullPath; + } + } else if (entryInfo.isDir()) { + // 如果是目录,递归调用以删除其内容 + QDir subDir(fullPath); + deleteDirectoryContents(subDir); + + // 目录现在应该是空的,尝试删除它 + if (!QDir().rmdir(fullPath)) { + qDebug() << "Failed to remove directory:" << fullPath; + } + } + } +} + +// 删除指定文件夹超过七天的文件 +void LogInfo::deleteOldLog(const QString folderPath,int days){ + QDir dir(folderPath); // 创建一个QDir对象用于操作传入的文件夹路径 + if (!dir.exists()) { // 判断传入文件夹是否存在 + qDebug() << "文件夹不存在"; + return; + } + QDateTime currentDateTime = QDateTime::currentDateTime(); // 获取当前时间 + QDateTime sevenDaysAgo = currentDateTime.addDays(-days); // 计算days天前的日期时间 + // 目录下的文件和子目录的信息列表,列出所有文件和子目录并按照最后修改时间排序 + QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time); + foreach (QFileInfo fileInfo ,fileInfoList) { + if (!fileInfo.isDir()){ + QString fileExtension = fileInfo.suffix().toLower(); // 获取文件的扩展名并确保它是小写的 + // 选择删除那种图片类型 + if (fileExtension == "txt") { + if (fileInfo.lastModified() < sevenDaysAgo && fileInfo.fileName().indexOf('_')!=-1) { // 获取最后一个文件夹修改时间和days传入的时间最对比 + if (QFile::remove(fileInfo.absoluteFilePath())) { // 删除满足条件的文件的绝对路径 + qDebug() << "删除成功" << fileInfo.absoluteFilePath(); + } else { + qDebug() << "文件删除失败" << fileInfo.absoluteFilePath(); + } + } + } + } + } +} + +void LogInfo::deleteOldLog() +{ + qDebug()<<"延时60秒删除过期日志"; + deleteOldLog(LOGINFOFILE_DIR,7);//删除一周前的日志 +} + +void LogInfo::truncatelog() +{ + const QString dts=QDate::currentDate().toString("yyyyMMdd") ; + const QString fileNameL=QString(LOGINFOFILE_DIR)+dts +"_1.txt"; + QFile file(fileNameL); + + if(file.size()>204800)//文件大小 + { + QSettings settings("MySoft", "MyApp"); + int filenum=settings.value(dts,2).toInt(); + if(filenum==2) + settings.clear(); + settings.setValue(dts,filenum+1); + + qDebug()<<"rename="< +#include +#include "MyFileDialog.h" +#include +#include +namespace Ui { +class LogInfo; +} + +class LogInfo : public QWidget +{ + Q_OBJECT + +public: + explicit LogInfo(QWidget *parent = 0); + ~LogInfo(); + static QString getRunStatusText(void); + + static void setRunStatusText(QString str); + static void saveRunStatusText(); + void setDebugText(QString str); // debug + static void showMachineInformation(QString Mac,QString SerialNum, QString VernonBachVer, QString FpgaVer); + static void showRemoteControll(QString SuperNode, QString edgeIP); + + void onReadRecorder(); + void deleteDirectoryContents(const QDir &directory); + static void truncatelog(); +protected slots: + void deleteOldLog(const QString folderPath, int days); + void deleteOldLog(); +private slots: + void on_pushButtonClear_pressed(); + void on_pushButtonPreState_pressed(); + void on_pushButtonExportFile_pressed(); + + void on_pushButtonClearCurrent_pressed(); + void onOpen_FIle_select(); + void readRunStatusText(); + +private: + Ui::LogInfo *ui; + static QTextEdit *textEdit; + static QTextEdit *textEdit2; + static QTextEdit *textEditMachInfo; + static int runStatusTextIndex; + MyFileDialog *fileDialog; + QString openFileName; + static QString currenDate; + static QString r_CurrentDate; + QTimer *timerLogdel; +}; + +#endif // LOGINFO_H diff --git a/Matrix/common.cpp b/Matrix/common.cpp new file mode 100644 index 0000000..e7ed58a --- /dev/null +++ b/Matrix/common.cpp @@ -0,0 +1,397 @@ +/* common.c - Contains functions needed for a number of barcodes */ + +/* + libzint - the open source barcode library + Copyright (C) 2008 Robin Stuart + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include +#include +#include +#include "common.h" + +int ustrlen(unsigned char data[]) { + /* Local replacement for strlen() with unsigned char strings */ + int i; + for (i=0;data[i];i++); + + return i; +} + +void ustrcpy(unsigned char target[], unsigned char source[]) { + /* Local replacement for strcpy() with unsigned char strings */ + int i, len; + + len = ustrlen(source); + for(i = 0; i < len; i++) { + target[i] = source[i]; + } + target[i] = '\0'; +} + +void concat(char dest[], char source[]) +{ /* Concatinates dest[] with the contents of source[], copying /0 as well */ + unsigned int i, j, n; + + j = strlen(dest); + n = strlen(source); + for(i = 0; i <= n; i++) { + dest[i + j] = source[i]; } +} + +void uconcat(unsigned char dest[], unsigned char source[]) +{ /* Concatinates dest[] with the contents of source[], copying /0 as well */ + unsigned int i, j; + + j = ustrlen(dest); + for(i = 0; i <= ustrlen(source); i++) { + dest[i + j] = source[i]; } +} + + +int ctoi(char source) +{ /* Converts a character 0-9 to its equivalent integer value */ + if((source >= '0') && (source <= '9')) + return (source - '0'); + return(source - 'A' + 10); +} + +char itoc(int source) +{ /* Converts an integer value to its hexadecimal character */ + if ((source >= 0) && (source <= 9)) { + return ('0' + source); } + else { + return ('A' + (source - 10)); } +} + +void to_upper(unsigned char source[]) +{ /* Converts lower case characters to upper case in a string source[] */ + unsigned int i, src_len = ustrlen(source); + + for (i = 0; i < src_len; i++) { + if ((source[i] >= 'a') && (source[i] <= 'z')) { + source [i] = (source[i] - 'a') + 'A'; } + } +} + +int is_sane(char test_string[], unsigned char source[], int length) +{ /* Verifies that a string only uses valid characters */ + unsigned int i, j, latch; + unsigned int lt = strlen(test_string); + + for(i = 0; i < length; i++) { + latch = FALSE; + for(j = 0; j < lt; j++) { + if (source[i] == test_string[j]) { + latch = TRUE; + break; + } + } + if (!(latch)) { + return ERROR_INVALID_DATA; + } + } + + return 0; +} + +int posn(char set_string[], char data) +{ /* Returns the position of data in set_string */ + unsigned int i, n = strlen(set_string); + + for(i = 0; i < n; i++) { + if (data == set_string[i]) { return i; } } + return 0; +} + +void lookup(char set_string[], char *table[], char data, char dest[]) +{ /* Replaces huge switch statements for looking up in tables */ + unsigned int i, n = strlen(set_string); + + for(i = 0; i < n; i++) { + if (data == set_string[i]) { concat(dest, table[i]); } } +} + +int module_is_set(struct zint_symbol *symbol, int y_coord, int x_coord) +{ + return (symbol->encoded_data[y_coord][x_coord / 7] & (1 << (x_coord % 7))) ? 1 : 0; +#if 0 + switch(x_sub) { + case 0: if((symbol->encoded_data[y_coord][x_char] & 0x01) != 0) { result = 1; } break; + case 1: if((symbol->encoded_data[y_coord][x_char] & 0x02) != 0) { result = 1; } break; + case 2: if((symbol->encoded_data[y_coord][x_char] & 0x04) != 0) { result = 1; } break; + case 3: if((symbol->encoded_data[y_coord][x_char] & 0x08) != 0) { result = 1; } break; + case 4: if((symbol->encoded_data[y_coord][x_char] & 0x10) != 0) { result = 1; } break; + case 5: if((symbol->encoded_data[y_coord][x_char] & 0x20) != 0) { result = 1; } break; + case 6: if((symbol->encoded_data[y_coord][x_char] & 0x40) != 0) { result = 1; } break; + } + + return result; +#endif +} + +void set_module(struct zint_symbol *symbol, int y_coord, int x_coord) +{ + if(module_is_set(symbol, y_coord, x_coord)) { return; } + symbol->encoded_data[y_coord][x_coord / 7] += 1 << (x_coord % 7); +#if 0 + int x_char, x_sub; + + + x_char = x_coord / 7; + x_sub = x_coord % 7; + + switch(x_sub) { + case 0: symbol->encoded_data[y_coord][x_char] += 0x01; break; + case 1: symbol->encoded_data[y_coord][x_char] += 0x02; break; + case 2: symbol->encoded_data[y_coord][x_char] += 0x04; break; + case 3: symbol->encoded_data[y_coord][x_char] += 0x08; break; + case 4: symbol->encoded_data[y_coord][x_char] += 0x10; break; + case 5: symbol->encoded_data[y_coord][x_char] += 0x20; break; + case 6: symbol->encoded_data[y_coord][x_char] += 0x40; break; + } /* The last binary digit is reserved for colour barcodes */ +#endif +} + +void unset_module(struct zint_symbol *symbol, int y_coord, int x_coord) +{ + if(!(module_is_set(symbol, y_coord, x_coord))) { return; } + symbol->encoded_data[y_coord][x_coord / 7] -= 1 << (x_coord % 7); +#if 0 + int x_char, x_sub; + + x_char = x_coord / 7; + x_sub = x_coord % 7; + + switch(x_sub) { + case 0: symbol->encoded_data[y_coord][x_char] -= 0x01; break; + case 1: symbol->encoded_data[y_coord][x_char] -= 0x02; break; + case 2: symbol->encoded_data[y_coord][x_char] -= 0x04; break; + case 3: symbol->encoded_data[y_coord][x_char] -= 0x08; break; + case 4: symbol->encoded_data[y_coord][x_char] -= 0x10; break; + case 5: symbol->encoded_data[y_coord][x_char] -= 0x20; break; + case 6: symbol->encoded_data[y_coord][x_char] -= 0x40; break; + } /* The last binary digit is reserved for colour barcodes */ +#endif +} + +void expand(struct zint_symbol *symbol, char data[]) +{ /* Expands from a width pattern to a bit pattern */ + + unsigned int reader, n = strlen(data); + int writer, i; + char latch; + + writer = 0; + latch = '1'; + + for(reader = 0; reader < n; reader++) { + for(i = 0; i < ctoi(data[reader]); i++) { + if(latch == '1') { set_module(symbol, symbol->rows, writer); } + writer++; + } + if(latch == '1') { + latch = '0'; + } else { + latch = '1'; + } + } + + if(symbol->symbology != BARCODE_PHARMA) { + if(writer > symbol->width) { + symbol->width = writer; + } + } else { + /* Pharmacode One ends with a space - adjust for this */ + if(writer > symbol->width + 2) { + symbol->width = writer - 2; + } + } + symbol->rows = symbol->rows + 1; +} + +int is_stackable(int symbology) { + /* Indicates which symbologies can have row binding */ + if(symbology < BARCODE_PDF417) { return 1; } + if(symbology == BARCODE_CODE128B) { return 1; } + if(symbology == BARCODE_ISBNX) { return 1; } + if(symbology == BARCODE_EAN14) { return 1; } + if(symbology == BARCODE_NVE18) { return 1; } + if(symbology == BARCODE_KOREAPOST) { return 1; } + if(symbology == BARCODE_PLESSEY) { return 1; } + if(symbology == BARCODE_TELEPEN_NUM) { return 1; } + if(symbology == BARCODE_ITF14) { return 1; } + if(symbology == BARCODE_CODE32) { return 1; } + + return 0; +} + +int is_extendable(int symbology) { + /* Indicates which symbols can have addon */ + if(symbology == BARCODE_EANX) { return 1; } + if(symbology == BARCODE_UPCA) { return 1; } + if(symbology == BARCODE_UPCE) { return 1; } + if(symbology == BARCODE_ISBNX) { return 1; } + if(symbology == BARCODE_UPCA_CC) { return 1; } + if(symbology == BARCODE_UPCE_CC) { return 1; } + if(symbology == BARCODE_EANX_CC) { return 1; } + + return 0; +} + +int roundup(float input) +{ + float remainder; + int integer_part; + + integer_part = (int)input; + remainder = input - integer_part; + + if(remainder > 0.1) { + integer_part++; + } + + return integer_part; +} + +int istwodigits(unsigned char source[], int position) +{ + if((source[position] >= '0') && (source[position] <= '9')) { + if((source[position + 1] >= '0') && (source[position + 1] <= '9')) { + return 1; + } + } + + return 0; +} + +float froundup(float input) +{ + float fraction, output = 0.0; + + fraction = input - (int)input; + if(fraction > 0.01) { output = (input - fraction) + 1.0; } else { output = input; } + + return output; +} + +int latin1_process(struct zint_symbol *symbol, unsigned char source[], unsigned char preprocessed[], int *length) +{ + int j, i, next; + + /* Convert Unicode to Latin-1 for those symbologies which only support Latin-1 */ + j = 0; + i = 0; + do { + next = -1; + if(source[i] < 128) { + preprocessed[j] = source[i]; + j++; + next = i + 1; + } else { + if(source[i] == 0xC2) { + preprocessed[j] = source[i + 1]; + j++; + next = i + 2; + } + if(source[i] == 0xC3) { + preprocessed[j] = source[i + 1] + 64; + j++; + next = i + 2; + } + } + if(next == -1) { + strcpy(symbol->errtxt, "error: Invalid character in input string (only Latin-1 characters supported)"); + return ERROR_INVALID_DATA; + } + i = next; + } while(i < *length); + preprocessed[j] = '\0'; + *length = j; + + return 0; +} + +int utf8toutf16(struct zint_symbol *symbol, unsigned char source[], int vals[], int *length) +{ + int bpos, jpos, error_number, done; + int next; + + bpos = 0; + jpos = 0; + error_number = 0; + next = 0; + + do { + done = 0; + + if(source[bpos] <= 0x7f) { + /* 1 byte mode (7-bit ASCII) */ + vals[jpos] = source[bpos]; + next = bpos + 1; + jpos++; + done = 1; + } + + if(done == 0) { + if((source[bpos] >= 0x80) && (source[bpos] <= 0xbf)) { + strcpy(symbol->errtxt, "Corrupt Unicode data"); + return ERROR_INVALID_DATA; + } + } + + if(done == 0) { + if((source[bpos] >= 0xc0) && (source[bpos] <= 0xc1)) { + strcpy(symbol->errtxt, "Overlong encoding not supported"); + return ERROR_INVALID_DATA; + } + } + + if(done == 0) { + if((source[bpos] >= 0xc2) && (source[bpos] <= 0xdf)) { + /* 2 byte mode */ + vals[jpos] = ((source[bpos] & 0x1f) << 6) + (source[bpos + 1] & 0x3f); + next = bpos + 2; + jpos++; + done = 1; + } + } + + if(done == 0) { + if((source[bpos] >= 0xe0) && (source[bpos] <= 0xef)) { + /* 3 byte mode */ + vals[jpos] = ((source[bpos] & 0x0f) << 12) + ((source[bpos + 1] & 0x3f) << 6) + (source[bpos + 2] & 0x3f); + next = bpos + 3; + jpos ++; + done = 1; + } + } + + if(done == 0) { + if(source[bpos] >= 0xf0) { + strcpy(symbol->errtxt, "Unicode sequences of more than 3 bytes not supported"); + return ERROR_INVALID_DATA; + } + } + + bpos = next; + + } while(bpos < *length); + *length = jpos; + + return error_number; +} + diff --git a/Matrix/common.h b/Matrix/common.h new file mode 100644 index 0000000..dbcb017 --- /dev/null +++ b/Matrix/common.h @@ -0,0 +1,53 @@ +/* Used in some logic */ +#ifndef __COMMON_H +#define __COMMON_H + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +/* The most commonly used set */ +#define NEON "0123456789" + +#include "zint.h" + +#define U08 unsigned char +#define U16 unsigned short +#define U32 unsigned int + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +extern int ustrlen(unsigned char source[]); +extern void ustrcpy(unsigned char target[], unsigned char source[]); +extern void concat(char dest[], char source[]); +extern void uconcat(unsigned char dest[], unsigned char source[]); +extern int ctoi(char source); +extern char itoc(int source); +extern void to_upper(unsigned char source[]); +extern int is_sane(char test_string[], unsigned char source[], int length); +extern void lookup(char set_string[], char *table[], char data, char dest[]); +extern int posn(char set_string[], char data); +extern void expand(struct zint_symbol *symbol, char data[]); +extern int is_stackable(int symbology); +extern int is_extendable(int symbology); +extern int roundup(float input); +extern int module_is_set(struct zint_symbol *symbol, int y_coord, int x_coord); +extern void set_module(struct zint_symbol *symbol, int y_coord, int x_coord); +extern void unset_module(struct zint_symbol *symbol, int y_coord, int x_coord); +extern int istwodigits(unsigned char source[], int position); +extern float froundup(float input); +extern int parunmodd(unsigned char llyth); +extern int latin1_process(struct zint_symbol *symbol, unsigned char source[], unsigned char preprocessed[], int *length); +extern int utf8toutf16(struct zint_symbol *symbol, unsigned char source[], int vals[], int *length); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __COMMON_H */ diff --git a/Matrix/dm200.cpp b/Matrix/dm200.cpp new file mode 100644 index 0000000..491c858 --- /dev/null +++ b/Matrix/dm200.cpp @@ -0,0 +1,959 @@ +#include +#include +#include +#include +#ifdef _MSC_VER +#include +#endif +#include "reedsol.h" +#include "common.h" +#include "dm200.h" + +#include + +//#define QTDEBUG + +// simple checked response malloc +static void *safemalloc(int n) +{ + void *p = malloc(n); + return p; +} + +// Annex M placement alorithm low level +static void ecc200placementbit(int *array, int NR, int NC, int r, int c, int p, char b) +{ + if (r < 0) { + r += NR; + c += 4 - ((NR + 4) % 8); + } + if (c < 0) { + c += NC; + r += 4 - ((NC + 4) % 8); + } + array[r * NC + c] = (p << 3) + b; +} + +static void ecc200placementblock(int *array, int NR, int NC, int r, + int c, int p) +{ + ecc200placementbit(array, NR, NC, r - 2, c - 2, p, 7); + ecc200placementbit(array, NR, NC, r - 2, c - 1, p, 6); + ecc200placementbit(array, NR, NC, r - 1, c - 2, p, 5); + ecc200placementbit(array, NR, NC, r - 1, c - 1, p, 4); + ecc200placementbit(array, NR, NC, r - 1, c - 0, p, 3); + ecc200placementbit(array, NR, NC, r - 0, c - 2, p, 2); + ecc200placementbit(array, NR, NC, r - 0, c - 1, p, 1); + ecc200placementbit(array, NR, NC, r - 0, c - 0, p, 0); +} + +static void ecc200placementcornerA(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 1, 1, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 2, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); + ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); +} + +static void ecc200placementcornerB(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 4, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 3, p, 3); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 2); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); +} + +static void ecc200placementcornerC(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); + ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); +} + +static void ecc200placementcornerD(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 1, NC - 1, p, 6); + ecc200placementbit(array, NR, NC, 0, NC - 3, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 3, p, 2); + ecc200placementbit(array, NR, NC, 1, NC - 2, p, 1); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); +} + +// Annex M placement alorithm main function +static void ecc200placement(int *array, int NR, int NC) +{ + int r, c, p; + // invalidate + for (r = 0; r < NR; r++) + for (c = 0; c < NC; c++) + array[r * NC + c] = 0; + // start + p = 1; + r = 4; + c = 0; + do { + // check corner + if (r == NR && !c) + ecc200placementcornerA(array, NR, NC, p++); + if (r == NR - 2 && !c && NC % 4) + ecc200placementcornerB(array, NR, NC, p++); + if (r == NR - 2 && !c && (NC % 8) == 4) + ecc200placementcornerC(array, NR, NC, p++); + if (r == NR + 4 && c == 2 && !(NC % 8)) + ecc200placementcornerD(array, NR, NC, p++); + // up/right + do { + if (r < NR && c >= 0 && !array[r * NC + c]) + ecc200placementblock(array, NR, NC, r, c, p++); + r -= 2; + c += 2; + } + while (r >= 0 && c < NC); + r++; + c += 3; + // down/left + do { + if (r >= 0 && c < NC && !array[r * NC + c]) + ecc200placementblock(array, NR, NC, r, c, p++); + r += 2; + c -= 2; + } + while (r < NR && c >= 0); + r += 3; + c++; + } + while (r < NR || c < NC); + // unfilled corner + if (!array[NR * NC - 1]) + array[NR * NC - 1] = array[NR * NC - NC - 2] = 1; +} + +// calculate and append ecc code, and if necessary interleave +static void ecc200(unsigned char *binary, int bytes, int datablock, int rsblock) +{ + int blocks, b; + + blocks = (bytes + 2) / datablock; + + rs_init_gf(0x12d); + rs_init_code(rsblock, 1); + for (b = 0; b < blocks; b++) { + unsigned char buf[256], ecc[256]; + int n, p = 0; + for (n = b; n < bytes; n += blocks) + buf[p++] = binary[n]; + rs_encode(p, buf, ecc); + p = rsblock - 1; // comes back reversed + for (n = b; n < rsblock * blocks; n += blocks) + binary[bytes + n] = ecc[p--]; + } + rs_free(); +} + +float dmroundup(float input) +{ + float fraction, output = 0.0; + + fraction = input - (int)input; + if(fraction > 0.01) { output = (input - fraction) + 1.0; } else { output = input; } + + return output; +} + +/*int istwodigits(unsigned char source[], int position) +{ + if((source[position] >= '0') && (source[position] <= '9')) { + if((source[position + 1] >= '0') && (source[position + 1] <= '9')) { + return 1; + } + } + + return 0; +} */ + +int isx12(unsigned char source) +{ + if(source == 13) { return 1; } + if(source == 42) { return 1; } + if(source == 62) { return 1; } + if(source == 32) { return 1; } + if((source >= '0') && (source <= '9')) { return 1; } + if((source >= 'A') && (source <= 'Z')) { return 1; } + + return 0; +} + +void dminsert(char binary_string[], int posn, char newbit) +{ /* Insert a character into the middle of a string at position posn */ + int i, end; + + end = strlen(binary_string); + for(i = end; i > posn; i--) { + binary_string[i] = binary_string[i - 1]; + } + binary_string[posn] = newbit; +} + +void insert_value(unsigned char binary_stream[], int posn, int streamlen, char newbit) +{ + int i; + + for(i = streamlen; i > posn; i--) { + binary_stream[i] = binary_stream[i - 1]; + } + binary_stream[posn] = newbit; +} + +int look_ahead_test(unsigned char source[], int sourcelen, int position, int current_mode, int gs1) +{ + /* A custom version of the 'look ahead test' from Annex P */ + /* This version is deliberately very reluctant to end a data stream with EDIFACT encoding */ + + float ascii_count, c40_count, text_count, x12_count, edf_count, b256_count, best_count; + int sp, done, best_scheme; + char reduced_char; + + /* step (j) */ + if(current_mode == DM_ASCII) { + ascii_count = 0.0; + c40_count = 1.0; + text_count = 1.0; + x12_count = 1.0; + edf_count = 1.0; + b256_count = 1.25; + } else { + ascii_count = 1.0; + c40_count = 2.0; + text_count = 2.0; + x12_count = 2.0; + edf_count = 2.0; + b256_count = 2.25; + } + + switch(current_mode) { + case DM_C40: c40_count = 0.0; break; + case DM_TEXT: text_count = 0.0; break; + case DM_X12: x12_count = 0.0; break; + case DM_EDIFACT: edf_count = 0.0; break; + case DM_BASE256: b256_count = 0.0; break; + } + + for(sp = position; (sp < sourcelen) && (sp <= (position + 8)); sp++) { + + if(source[sp] <= 127) { reduced_char = source[sp]; } else { reduced_char = source[sp] - 127; } + + if((source[sp] >= '0') && (source[sp] <= '9')) { ascii_count += 0.5; } else { ascii_count += 1.0; } + if(source[sp] > 127) { ascii_count += 1.0; } + + done = 0; + if(reduced_char == ' ') { c40_count += (2.0 / 3.0); done = 1; } + if((reduced_char >= '0') && (reduced_char <= '9')) { c40_count += (2.0 / 3.0); done = 1; } + if((reduced_char >= 'A') && (reduced_char <= 'Z')) { c40_count += (2.0 / 3.0); done = 1; } + if(source[sp] > 127) { c40_count += (4.0 / 3.0); } + if(done == 0) { c40_count += (4.0 / 3.0); } + + done = 0; + if(reduced_char == ' ') { text_count += (2.0 / 3.0); done = 1; } + if((reduced_char >= '0') && (reduced_char <= '9')) { text_count += (2.0 / 3.0); done = 1; } + if((reduced_char >= 'a') && (reduced_char <= 'z')) { text_count += (2.0 / 3.0); done = 1; } + if(source[sp] > 127) { text_count += (4.0 / 3.0); } + if(done == 0) { text_count += (4.0 / 3.0); } + + if(isx12(source[sp])) { x12_count += (2.0 / 3.0); } else { x12_count += 4.0; } + + /* step (p) */ + done = 0; + if((source[sp] >= ' ') && (source[sp] <= '^')) { edf_count += (3.0 / 4.0); } else { edf_count += 6.0; } + if(gs1 && (source[sp] == '[')) { edf_count += 6.0; } + if(sp >= (sourcelen - 5)) { edf_count += 6.0; } /* MMmmm fudge! */ + + /* step (q) */ + if(gs1 && (source[sp] == '[')) { b256_count += 4.0; } else { b256_count += 1.0; } + + /*printf("lat a%.2f c%.2f t%.2f x%.2f e%.2f b%.2f\n", ascii_count, c40_count, text_count, x12_count, edf_count, b256_count);*/ + + } + + /* Round up all the counts to round numbers */ + + best_count = ascii_count; + best_scheme = DM_ASCII; + + if(b256_count <= best_count) { + best_count = b256_count; + best_scheme = DM_BASE256; + } + + if(edf_count <= best_count) { + best_count = edf_count; + best_scheme = DM_EDIFACT; + } + + if(text_count <= best_count) { + best_count = text_count; + best_scheme = DM_TEXT; + } + + if(x12_count <= best_count) { + best_count = x12_count; + best_scheme = DM_X12; + } + + if(c40_count <= best_count) { + best_count = c40_count; + best_scheme = DM_C40; + } + + return best_scheme; +} + +int dm200encode(unsigned char source[], unsigned char target[], int *last_mode) +{ + /* Encodes data using ASCII, C40, Text, X12, EDIFACT or Base 256 modes as appropriate */ + /* Supports encoding FNC1 in supporting systems */ + + int sp, tp, i, gs1; + int current_mode, next_mode; + int c40_buffer[6], c40_p; + int text_buffer[6], text_p; + int x12_buffer[6], x12_p; + int edifact_buffer[8], edifact_p; + int inputlen; + char *binary; + + + inputlen = ustrlen(source); + + binary = (char *)malloc(2 * inputlen); +// binary = (char *)QRcode_malloc(2 * inputlen); + memset(binary, 0x00, 2*inputlen); + + sp = 0; + tp = 0; + memset(c40_buffer, 0, 6); + c40_p = 0; + memset(text_buffer, 0, 6); + text_p = 0; + memset(x12_buffer, 0, 6); + x12_p = 0; + memset(edifact_buffer, 0, 8); + edifact_p = 0; + strcpy(binary, ""); + + /* step (a) */ + current_mode = DM_ASCII; + next_mode = DM_ASCII; + + gs1 = 0; + + if(gs1) { target[tp] = 232; tp++; concat(binary, " "); } /* FNC1 */ + + while (sp < inputlen) { + + current_mode = next_mode; + + /* step (b) - ASCII encodation */ + if(current_mode == DM_ASCII) { + next_mode = DM_ASCII; + + if(istwodigits(source, sp) && ((sp + 1) != inputlen)) { + target[tp] = (10 * ctoi(source[sp])) + ctoi(source[sp + 1]) + 130; + tp++; concat(binary, " "); + sp += 2; + } else { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + + if(next_mode != DM_ASCII) { + switch(next_mode) { + case DM_C40: target[tp] = 230; tp++; concat(binary, " "); break; + case DM_TEXT: target[tp] = 239; tp++; concat(binary, " "); break; + case DM_X12: target[tp] = 238; tp++; concat(binary, " "); break; + case DM_EDIFACT: target[tp] = 240; tp++; concat(binary, " "); break; + case DM_BASE256: target[tp] = 231; tp++; concat(binary, " "); break; + } + } else { + if(source[sp] > 127) { + target[tp] = 235; + tp++; + target[tp] = (source[sp] - 128) + 1; + tp++; concat(binary, " "); + } else { + if(gs1 && (source[sp] == '[')) { + target[tp] = 232; /* FNC1 */ + } else { + target[tp] = source[sp] + 1; + } + tp++; + concat(binary, " "); + } + sp++; + } + } + + } + + /* step (c) C40 encodation */ + if(current_mode == DM_C40) { + int shift_set, value; + + next_mode = DM_C40; + if(c40_p == 0) { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + } + + if(next_mode != DM_C40) { + target[tp] = 254; tp++; concat(binary, " ");/* Unlatch */ + next_mode = DM_ASCII; + } else { + if(source[sp] > 127) { + c40_buffer[c40_p] = 1; c40_p++; + c40_buffer[c40_p] = 30; c40_p++; /* Upper Shift */ + shift_set = c40_shift[source[sp] - 128]; + value = c40_value[source[sp] - 128]; + } else { + shift_set = c40_shift[source[sp]]; + value = c40_value[source[sp]]; + } + + if(gs1 && (source[sp] == '[')) { + shift_set = 2; + value = 27; /* FNC1 */ + } + + if(shift_set != 0) { + c40_buffer[c40_p] = shift_set - 1; c40_p++; + } + c40_buffer[c40_p] = value; c40_p++; + + if(c40_p >= 3) { + int iv; + + iv = (1600 * c40_buffer[0]) + (40 * c40_buffer[1]) + (c40_buffer[2]) + 1; + target[tp] = iv / 256; tp++; + target[tp] = iv % 256; tp++; + concat(binary, " "); + + c40_buffer[0] = c40_buffer[3]; + c40_buffer[1] = c40_buffer[4]; + c40_buffer[2] = c40_buffer[5]; + c40_buffer[3] = 0; + c40_buffer[4] = 0; + c40_buffer[5] = 0; + c40_p -= 3; + } + sp++; + } + } + + /* step (d) Text encodation */ + if(current_mode == DM_TEXT) { + int shift_set, value; + + next_mode = DM_TEXT; + if(text_p == 0) { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + } + + if(next_mode != DM_TEXT) { + target[tp] = 254; tp++; concat(binary, " ");/* Unlatch */ + next_mode = DM_ASCII; + + } else { + if(source[sp] > 127) { + text_buffer[text_p] = 1; text_p++; + text_buffer[text_p] = 30; text_p++; /* Upper Shift */ + shift_set = text_shift[source[sp] - 128]; + value = text_value[source[sp] - 128]; + } else { + shift_set = text_shift[source[sp]]; + value = text_value[source[sp]]; + } + + if(gs1 && (source[sp] == '[')) { + shift_set = 2; + value = 27; /* FNC1 */ + } + + if(shift_set != 0) { + text_buffer[text_p] = shift_set - 1; text_p++; + } + text_buffer[text_p] = value; text_p++; + + if(text_p >= 3) { + int iv; + + iv = (1600 * text_buffer[0]) + (40 * text_buffer[1]) + (text_buffer[2]) + 1; + target[tp] = iv / 256; tp++; + target[tp] = iv % 256; tp++; + concat(binary, " "); + + text_buffer[0] = text_buffer[3]; + text_buffer[1] = text_buffer[4]; + text_buffer[2] = text_buffer[5]; + text_buffer[3] = 0; + text_buffer[4] = 0; + text_buffer[5] = 0; + text_p -= 3; + } + sp++; + } + } + + /* step (e) X12 encodation */ + if(current_mode == DM_X12) { + int value = 0; + + next_mode = DM_X12; + if(text_p == 0) { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + } + + if(next_mode != DM_X12) { + target[tp] = 254; tp++; concat(binary, " ");/* Unlatch */ + } else { + if(source[sp] == 13) { value = 0; } + if(source[sp] == '*') { value = 1; } + if(source[sp] == '>') { value = 2; } + if(source[sp] == ' ') { value = 3; } + if((source[sp] >= '0') && (source[sp] <= '9')) { value = (source[sp] - '0') + 4; } + if((source[sp] >= 'A') && (source[sp] <= 'Z')) { value = (source[sp] - 'A') + 14; } + + x12_buffer[x12_p] = value; x12_p++; + + if(x12_p >= 3) { + int iv; + + iv = (1600 * x12_buffer[0]) + (40 * x12_buffer[1]) + (x12_buffer[2]) + 1; + target[tp] = iv / 256; tp++; + target[tp] = iv % 256; tp++; + concat(binary, " "); + + x12_buffer[0] = x12_buffer[3]; + x12_buffer[1] = x12_buffer[4]; + x12_buffer[2] = x12_buffer[5]; + x12_buffer[3] = 0; + x12_buffer[4] = 0; + x12_buffer[5] = 0; + x12_p -= 3; + } + sp++; + } + } + + /* step (f) EDIFACT encodation */ + if(current_mode == DM_EDIFACT) { + int value = 0; + + next_mode = DM_EDIFACT; + if(edifact_p == 3) { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + } + + if(next_mode != DM_EDIFACT) { + edifact_buffer[edifact_p] = 31; edifact_p++; + next_mode = DM_ASCII; + } else { + if((source[sp] >= '@') && (source[sp] <= '^')) { value = source[sp] - '@'; } + if((source[sp] >= ' ') && (source[sp] <= '?')) { value = source[sp]; } + + edifact_buffer[edifact_p] = value; edifact_p++; + sp++; + } + + if(edifact_p >= 4) { + target[tp] = (edifact_buffer[0] << 2) + ((edifact_buffer[1] & 0x30) >> 4); tp++; + target[tp] = ((edifact_buffer[1] & 0x0f) << 4) + ((edifact_buffer[2] & 0x3c) >> 2); tp++; + target[tp] = ((edifact_buffer[2] & 0x03) << 6) + edifact_buffer[3]; tp++; + concat(binary, " "); + + edifact_buffer[0] = edifact_buffer[4]; + edifact_buffer[1] = edifact_buffer[5]; + edifact_buffer[2] = edifact_buffer[6]; + edifact_buffer[3] = edifact_buffer[7]; + edifact_buffer[4] = 0; + edifact_buffer[5] = 0; + edifact_buffer[6] = 0; + edifact_buffer[7] = 0; + edifact_p -= 4; + } + } + + /* step (g) Base 256 encodation */ + if(current_mode == DM_BASE256) { + next_mode = look_ahead_test(source, inputlen, sp, current_mode, gs1); + + if(next_mode == DM_BASE256) { + target[tp] = source[sp]; + tp++; + sp++; + concat(binary, "b"); + } else { + next_mode = DM_ASCII; + } + } + + if(tp > 1558) { + free(binary); + return 0; + } + + } /* while */ + + /* Empty buffers */ + if(c40_p == 2) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + if(c40_p == 1) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + + if(text_p == 2) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + if(text_p == 1) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + + if(x12_p == 2) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + if(x12_p == 1) { + target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 1] + 1; tp++; + concat(binary, " "); + current_mode = DM_ASCII; + } + + /* Add length and randomising algorithm to b256 */ + i = 0; + while (i < tp) { + if(binary[i] == 'b') { + if((i == 0) || ((i != 0) && (binary[i - 1] != 'b'))) { + /* start of binary data */ + int binary_count; /* length of b256 data */ + + for(binary_count = 0; binary[binary_count + i] == 'b'; binary_count++); + + if(binary_count <= 249) { + dminsert(binary, i, 'b'); + insert_value(target, i, tp, binary_count); tp++; + } else { + dminsert(binary, i, 'b'); + dminsert(binary, i + 1, 'b'); + insert_value(target, i, tp, (binary_count / 250) + 249); tp++; + insert_value(target, i + 1, tp, binary_count % 250); tp++; + } + } + } + i++; + } + + for(i = 0; i < tp; i++) { + if(binary[i] == 'b') { + int prn, temp; + + prn = ((149 * (i + 1)) % 255) + 1; + temp = target[i] + prn; + if (temp <= 255) { target[i] = temp; } else { target[i] = temp - 256; } + } + } + +// QString s,s1; +// s=""; +// for(i = 0; i < tp; i++){ +// s1.sprintf("%02X ", target[i]); +// s+=s1; +// } + //qDebug()<<"bin:"< 0; i--) { + if(i == tail_length) { + target[tp] = 129; tp++; /* Pad */ + } else { + prn = ((149 * (tp + 1)) % 253) + 1; + temp = 129 + prn; + if(temp <= 254) { + target[tp] = temp; tp++; + } else { + target[tp] = temp - 254; tp++; + } + } + } +} + +unsigned char *iec16022ecc200(short *Wptr, short *Hptr, unsigned char *barcode, short* type) + +{ + int inputlen, i; + int binlen; + int symbolsize, optionsize, calcsize; + int taillength, error_number = 0; + int H, W, FH, FW, datablock, bytes, rsblock; + int last_mode; + unsigned char *grid = 0; + unsigned char *source; + +// unsigned char binary[100]; + unsigned char *binary; + binary = (unsigned char *)malloc(2000+10); +// binary = (unsigned char *)QRcode_malloc(2000+10); + +#ifdef WIN32 + printf("New Lib Routine !!! \n"); +#endif + + source = barcode; + + inputlen = ustrlen(source); + + binlen = dm200encode(barcode, binary, &last_mode); + + if(binlen == 0) { + free(binary); + return 0; + } + + calcsize = 29; + for(i = 29; i > -1; i--) { + if(matrixbytes[i] > binlen) { + calcsize = i; + } + } +#ifdef QTDEBUG + qDebug()<<"binlen"< 2) + { + *type = -1; + } + else + { + calcsize = 2; + } + }break; + case 2: + { + if(calcsize > 4) + { + *type = -1; + } + else + { + calcsize = 4; + } + }break; + case 3: + { + if(calcsize > 6) + { + *type = -1; + } + else + { + calcsize = 6; + } + }break; + case 4: + { + if(calcsize > 9) + { + *type = -1; + } + else + { + calcsize = 9; + } + }break; + case 5: + { + if(calcsize > 11) + { + *type = -1; + } + else + { + calcsize = 11; + } + }break; + case 6: + { + if(calcsize > 14) + { + *type = -1; + } + else + { + calcsize = 14; + } + }break; + } + } + else + { + switch(calcsize) { + case 2: + case 4: + case 6: + case 9: + case 11: + case 14: + calcsize++; + } + } + + //optionsize = -1; + optionsize = 10; + + symbolsize = optionsize; + + if(calcsize <= optionsize) { + symbolsize = optionsize; + } else + { + symbolsize = calcsize; + } + +#ifdef QTDEBUG + + qDebug()<<"symbolsize ="< 7 && (binary[(v >> 3) - 1] & (1 << (v & 7))))) + grid[(1 + y + 2 * (y / (FH - 2))) * W + 1 + x + 2 * (x / (FW - 2))] = 1; + } + //fprintf (stderr, "\n"); + } + + for(y = H - 1; y >= 0; y--) { + int x; + for(x = 0; x < W; x++) { + if(grid[W * y + x]) + { +#ifdef WIN32 + printf("X"); +#endif + } +#ifdef WIN32 + else + printf(" "); +#endif + + } +#ifdef WIN32 + printf("\n"); +#endif + } + + free(places); + } + *Wptr = (short)W; + *Hptr = (short)H; + free(binary); + return grid; +} + + + diff --git a/Matrix/dm200.h b/Matrix/dm200.h new file mode 100644 index 0000000..1a7f1e2 --- /dev/null +++ b/Matrix/dm200.h @@ -0,0 +1,162 @@ +/* dm200.h - Handles Data Matrix ECC 200 */ + +/* + libzint - the open source barcode library + Copyright (C) 2009 Robin Stuart + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "common.h" + +#ifndef __IEC16022ECC200_H +#define __IEC16022ECC200_H +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +//void MatrixEnCode(unsigned char *intext); +//extern int data_matrix_200(struct zint_symbol *symbol, unsigned char source[]); +extern unsigned char *iec16022ecc200(short *Wptr, short *Hptr, unsigned char *barcode, short* type); +void Draw_Matrix(unsigned char *buffer); +//char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize); +//char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize,QImage *pImg); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#define MAXBARCODE 3116 + +#define DM_ASCII 1 +#define DM_C40 2 +#define DM_TEXT 3 +#define DM_X12 4 +#define DM_EDIFACT 5 +#define DM_BASE256 6 + + +static int c40_shift[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; + +static int c40_value[] = { + 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, + 3,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,4,5,6,7,8,9,10,11,12,13, + 15,16,17,18,19,20,21,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39, + 22,23,24,25,26,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; + +static int text_shift[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3 }; + +static int text_value[] = { + 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, + 3,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,4,5,6,7,8,9,10,11,12,13, + 15,16,17,18,19,20,21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, + 22,23,24,25,26,0,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,27,28,29,30,31 }; + +static int intsymbol[] = { + 0,1,3,5,7,8,10,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,2,4,6,9,11,14 }; + +static int matrixH[] = { + 10, 12, 8, 14, 8, 16, 12, 18, 20, 12, 22, 16, 24, 26, 16, 32, 36, 40, 44, 48, + 52, 64, 72, 80, 88, 96, 104, 120, 132, 144 }; + +static int matrixW[] = { + 10, 12, 18, 14, 32, 16, 26, 18, 20, 36, 22, 36, 24, 26, 48, 32, 36, 40, 44, + 48, 52, 64, 72, 80, 88, 96, 104, 120, 132, 144 }; + +static int matrixFH[] = { + 10, 12, 8, 14, 8, 16, 12, 18, 20, 12, 22, 16, 24, 26, 16, 16, 18, 20, 22, 24, + 26, 16, 18, 20, 22, 24, 26, 20, 22, 24 }; + +static int matrixFW[] = { + 10, 12, 18, 14, 16, 16, 26, 18, 20, 18, 22, 18, 24, 26, 24, 16, 18, 20, 22, + 24, 26, 16, 18, 20, 22, 24, 26, 20, 22, 24 }; + +static int matrixbytes[] = { + 3, 5, 5, 8, 10, 12, 16, 18, 22, 22, 30, 32, 36, 44, 49, 62, 86, 114, 144, + 174, 204, 280, 368, 456, 576, 696, 816, 1050, 1304, 1558 }; + +static int matrixdatablock[] = { + 3, 5, 5, 8, 10, 12, 16, 18, 22, 22, 30, 32, 36, 44, 49, 62, 86, 114, 144, + 174, 102, 140, 92, 114, 144, 174, 136, 175, 163, 156 }; + +static int matrixrsblock[] = { + 5, 7, 7, 10, 11, 12, 14, 14, 18, 18, 20, 24, 24, 28, 28, 36, 42, 48, 56, 68, + 42, 56, 36, 48, 56, 68, 56, 68, 62, 62 }; +/* + +static int c40_shift[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; + +static int c40_value[] = { + 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, + 3,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,4,5,6,7,8,9,10,11,12,13, + 15,16,17,18,19,20,21,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39, + 22,23,24,25,26,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; + +static int text_shift[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3 }; + +static int text_value[] = { + 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, + 3,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,4,5,6,7,8,9,10,11,12,13, + 15,16,17,18,19,20,21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, + 22,23,24,25,26,0,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,27,28,29,30,31 }; + +static int intsymbol[] = { + 0,1,3,5,7,8,10,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,2,4,6,9,11,14 }; + +static int matrixH[] = { + 10, 12, 8, 14, 8, 16, 12, 18, 20, 12, 22, 16, 24, 26, 16, 32, 36, 40, 44, 48, + 52, 64, 72, 80, 88, 96, 104, 120, 132, 144 }; + +static int matrixW[] = { + 10, 12, 18, 14, 32, 16, 26, 18, 20, 36, 22, 36, 24, 26, 48, 32, 36, 40, 44, + 48, 52, 64, 72, 80, 88, 96, 104, 120, 132, 144 }; + +static int matrixFH[] = { + 10, 12, 8, 14, 8, 16, 12, 18, 20, 12, 22, 16, 24, 26, 16, 16, 18, 20, 22, 24, + 26, 16, 18, 20, 22, 24, 26, 20, 22, 24 }; + +static int matrixFW[] = { + 10, 12, 18, 14, 16, 16, 26, 18, 20, 18, 22, 18, 24, 26, 24, 16, 18, 20, 22, + 24, 26, 16, 18, 20, 22, 24, 26, 20, 22, 24 }; + +static int matrixbytes[] = { + 3, 5, 5, 8, 10, 12, 16, 18, 22, 22, 30, 32, 36, 44, 49, 62, 86, 114, 144, + 174, 204, 280, 368, 456, 576, 696, 816, 1050, 1304, 1558 }; + +static int matrixdatablock[] = { + 3, 5, 5, 8, 10, 12, 16, 18, 22, 22, 30, 32, 36, 44, 49, 62, 86, 114, 144, + 174, 102, 140, 92, 114, 144, 174, 136, 175, 163, 156 }; + +static int matrixrsblock[] = { + 5, 7, 7, 10, 11, 12, 14, 14, 18, 18, 20, 24, 24, 28, 28, 36, 42, 48, 56, 68, + 42, 56, 36, 48, 56, 68, 56, 68, 62, 62 }; + + */ +#endif /* __IEC16022ECC200_H */ diff --git a/Matrix/drawmatrix.cpp b/Matrix/drawmatrix.cpp new file mode 100644 index 0000000..b074d7f --- /dev/null +++ b/Matrix/drawmatrix.cpp @@ -0,0 +1,68 @@ +#include +#include +// +// U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize +#include "dm200.h" + +#include "QImage" +#include "QDebug" + +#define MAX_WIDTH_BYTE 48 // 384/8 + +char DataMatrixdDraw(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize); +//char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize,QImage *pImg); + +void Draw_Matrix(unsigned char *buffer) +{ + U16 sColumns, sRows; + U08 *Grid; + sColumns = sRows = 0; + Grid = 0; + sColumns = sRows = 0; + short sizeType = 0; + Grid = iec16022ecc200((short*)&sRows, (short*)&sColumns, buffer, &sizeType); + DataMatrixdDraw(Grid,sRows,sColumns,2); +} + +char DataMatrixdDraw(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize) +{ + int Size=MSize; + int w = cColumns*Size; + int h = cRows*Size; + //qDebug()<fill(0x00ffffff); + /* data */ + int margin=0; + U08 *p = OutBuff; + int ypos=0;//margin * Size; + int xpos=0; + int x,y,xx,yy,bit; + for(y=0; ysetPixel(xpos,h-1-(ypos+yy),0xff000000); + } + } + xpos++; + } + p++; + bit--; + if(bit < 0) { + //q++; + bit = 7; + } + } + ypos+=Size; + } + img->save("Myqr.bmp"); + return 0; +} + diff --git a/Matrix/reedsol.cpp b/Matrix/reedsol.cpp new file mode 100644 index 0000000..76e37de --- /dev/null +++ b/Matrix/reedsol.cpp @@ -0,0 +1,173 @@ +/** + * + * This is a simple Reed-Solomon encoder + * (C) Cliff Hones 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +// It is not written with high efficiency in mind, so is probably +// not suitable for real-time encoding. The aim was to keep it +// simple, general and clear. +// +// + +// Usage: +// First call rs_init_gf(poly) to set up the Galois Field parameters. +// Then call rs_init_code(size, index) to set the encoding size +// Then call rs_encode(datasize, data, out) to encode the data. +// +// These can be called repeatedly as required - but note that +// rs_init_code must be called following any rs_init_gf call. +// +// If the parameters are fixed, some of the statics below can be +// replaced with constants in the obvious way, and additionally +// malloc/free can be avoided by using static arrays of a suitable +// size. + +#include // only needed for debug (main) +#include // only needed for malloc/free +#include "reedsol.h" + +//#pragma section data begin +//#pragma section _sdram +int gfpoly; +int symsize; // in bits +int logmod; // 2**symsize - 1 +int rlen; + +int *log = NULL, *alog = NULL, *rspoly = NULL; + +void rs_init_gf(int poly) +{ + int m, b, p, v; + + // Return storage from previous setup + if (log) { + free(log); + if (alog)free(alog); + if (rspoly)free(rspoly); + rspoly = NULL; + log =NULL; + alog = NULL; + } + + // Find the top bit, and hence the symbol size + for (b = 1, m = 0; b <= poly; b <<= 1) + m++; + b >>= 1; + m--; + gfpoly = poly; + symsize = m; + + // Calculate the log/alog tables + logmod = (1 << m) - 1; + log = (int *)malloc(sizeof(int) * (logmod + 1)); + alog = (int *)malloc(sizeof(int) * logmod); + +// log = (int *)QRcode_malloc(sizeof(int) * (logmod + 1)); +// alog = (int *)QRcode_malloc(sizeof(int) * logmod); + + for (p = 1, v = 0; v < logmod; v++) { + alog[v] = p; + log[p] = v; + p <<= 1; + if (p & b) + p ^= poly; + } +} + +// rs_init_code(nsym, index) initialises the Reed-Solomon encoder +// nsym is the number of symbols to be generated (to be appended +// to the input data). index is usually 1 - it is the index of +// the constant in the first term (i) of the RS generator polynomial: +// (x + 2**i)*(x + 2**(i+1))*... [nsym terms] +// For ECC200, index is 1. + +void rs_init_code(int nsym, int index) +{ + int i, k; + + if (rspoly) + free(rspoly); + rspoly = (int *)malloc(sizeof(int) * (nsym + 1)); + //rspoly = (int *)QRcode_malloc(sizeof(int) * (nsym + 1)); + + rlen = nsym; + + rspoly[0] = 1; + for (i = 1; i <= nsym; i++) { + rspoly[i] = 1; + for (k = i - 1; k > 0; k--) { + if (rspoly[k]) + rspoly[k] = alog[(log[rspoly[k]] + index) % logmod]; + rspoly[k] ^= rspoly[k - 1]; + } + rspoly[0] = alog[(log[rspoly[0]] + index) % logmod]; + index++; + } +} + +void rs_encode(int len, unsigned char *data, unsigned char *res) +{ + int i, k, m; + for (i = 0; i < rlen; i++) + res[i] = 0; + for (i = 0; i < len; i++) { + m = res[rlen - 1] ^ data[i]; + for (k = rlen - 1; k > 0; k--) { + if (m && rspoly[k]) + res[k] = res[k - 1] ^ alog[(log[m] + log[rspoly[k]]) % logmod]; + else + res[k] = res[k - 1]; + } + if (m && rspoly[0]) + res[0] = alog[(log[m] + log[rspoly[0]]) % logmod]; + else + res[0] = 0; + } +} + +void rs_encode_long(int len, unsigned int *data, unsigned int *res) +{ /* The same as above but for larger bitlengths - Aztec code compatible */ + int i, k, m; + for (i = 0; i < rlen; i++) + res[i] = 0; + for (i = 0; i < len; i++) { + m = res[rlen - 1] ^ data[i]; + for (k = rlen - 1; k > 0; k--) { + if (m && rspoly[k]) + res[k] = res[k - 1] ^ alog[(log[m] + log[rspoly[k]]) % logmod]; + else + res[k] = res[k - 1]; + } + + if (m && rspoly[0]) + res[0] = alog[(log[m] + log[rspoly[0]]) % logmod]; + else + res[0] = 0; + } +} + +void rs_free(void) +{ /* Free memory */ + free(log); + free(alog); + free(rspoly); + log =NULL; + alog = NULL; + rspoly = NULL; +} diff --git a/Matrix/reedsol.h b/Matrix/reedsol.h new file mode 100644 index 0000000..db4b2bc --- /dev/null +++ b/Matrix/reedsol.h @@ -0,0 +1,40 @@ +/** + * + * This is a simple Reed-Solomon encoder + * (C) Cliff Hones 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __REEDSOL_H +#define __REEDSOL_H + +/*#ifdef __cplusplus +extern "C" +{ +#endif */ /* __cplusplus */ + +extern void rs_init_gf(int poly); +extern void rs_init_code(int nsym, int index); +extern void rs_encode(int len, unsigned char *data, unsigned char *res); +extern void rs_encode_long(int len, unsigned int *data, unsigned int *res); +extern void rs_free(void); + +/*#ifdef __cplusplus +} +#endif */ /* __cplusplus */ + +#endif /* __REEDSOL_H */ diff --git a/Matrix/zint.h b/Matrix/zint.h new file mode 100644 index 0000000..3f8e2a3 --- /dev/null +++ b/Matrix/zint.h @@ -0,0 +1,209 @@ +/* zint.h - definitions for libzint + + libzint - the open source barcode library + Copyright (C) 2009 Robin Stuart + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef ZINT_H +#define ZINT_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +//#pragma section data begin +struct zint_symbol { + int symbology; + int height; + int whitespace_width; + int border_width; + int output_options; + char fgcolour[10]; + char bgcolour[10]; + char outfile[256]; + float scale; + int option_1; + int option_2; + int option_3; + int show_hrt; + int input_mode; + unsigned char text[128]; + int rows; + int width; + char primary[128]; + unsigned char encoded_data[178][143]; + int row_height[178]; /* Largest symbol is 177x177 QR Code */ + char errtxt[100]; + char *bitmap; + int bitmap_width; + int bitmap_height; +}; + +//#pragma section data end + +/* Tbarcode 7 codes */ +#define BARCODE_CODE11 1 +#define BARCODE_C25MATRIX 2 +#define BARCODE_C25INTER 3 +#define BARCODE_C25IATA 4 +#define BARCODE_C25LOGIC 6 +#define BARCODE_C25IND 7 +//#define BARCODE_CODE39 8 +#define BARCODE_EXCODE39 9 +#define BARCODE_EANX 13 +//#define BARCODE_EAN128 16 +//#define BARCODE_CODABAR 18 +//#define BARCODE_CODE128 20 +#define BARCODE_DPLEIT 21 +#define BARCODE_DPIDENT 22 +#define BARCODE_CODE16K 23 +#define BARCODE_CODE49 24 +//#define BARCODE_CODE93 25 +#define BARCODE_FLAT 28 +#define BARCODE_RSS14 29 +#define BARCODE_RSS_LTD 30 +#define BARCODE_RSS_EXP 31 +#define BARCODE_TELEPEN 32 +#define BARCODE_UPCA 34 +#define BARCODE_UPCE 37 +//#define BARCODE_POSTNET 40 +#define BARCODE_MSI_PLESSEY 47 +#define BARCODE_FIM 49 +#define BARCODE_LOGMARS 50 +#define BARCODE_PHARMA 51 +#define BARCODE_PZN 52 +#define BARCODE_PHARMA_TWO 53 +#define BARCODE_PDF417 55 +#define BARCODE_PDF417TRUNC 56 +#define BARCODE_MAXICODE 57 +#define BARCODE_QRCODE 58 +#define BARCODE_CODE128B 60 +#define BARCODE_AUSPOST 63 +#define BARCODE_AUSREPLY 66 +#define BARCODE_AUSROUTE 67 +#define BARCODE_AUSREDIRECT 68 +#define BARCODE_ISBNX 69 +#define BARCODE_RM4SCC 70 +#define BARCODE_DATAMATRIX 71 +#define BARCODE_EAN14 72 +#define BARCODE_CODABLOCKF 74 +#define BARCODE_NVE18 75 +#define BARCODE_JAPANPOST 76 +#define BARCODE_KOREAPOST 77 +#define BARCODE_RSS14STACK 79 +#define BARCODE_RSS14STACK_OMNI 80 +#define BARCODE_RSS_EXPSTACK 81 +//#define BARCODE_PLANET 82 +#define BARCODE_MICROPDF417 84 +#define BARCODE_ONECODE 85 +#define BARCODE_PLESSEY 86 + +/* Tbarcode 8 codes */ +#define BARCODE_TELEPEN_NUM 87 +#define BARCODE_ITF14 89 +#define BARCODE_KIX 90 +#define BARCODE_AZTEC 92 +#define BARCODE_DAFT 93 +#define BARCODE_MICROQR 97 + +/* Tbarcode 9 codes */ +#define BARCODE_HIBC_128 98 +#define BARCODE_HIBC_39 99 +#define BARCODE_HIBC_DM 102 +#define BARCODE_HIBC_QR 104 +#define BARCODE_HIBC_PDF 106 +#define BARCODE_HIBC_MICPDF 108 +#define BARCODE_HIBC_BLOCKF 110 +#define BARCODE_HIBC_AZTEC 112 + +/* Zint specific */ +#define BARCODE_AZRUNE 128 +#define BARCODE_CODE32 129 +#define BARCODE_EANX_CC 130 +#define BARCODE_EAN128_CC 131 +#define BARCODE_RSS14_CC 132 +#define BARCODE_RSS_LTD_CC 133 +#define BARCODE_RSS_EXP_CC 134 +#define BARCODE_UPCA_CC 135 +#define BARCODE_UPCE_CC 136 +#define BARCODE_RSS14STACK_CC 137 +#define BARCODE_RSS14_OMNI_CC 138 +#define BARCODE_RSS_EXPSTACK_CC 139 +#define BARCODE_CHANNEL 140 +#define BARCODE_CODEONE 141 +#define BARCODE_GRIDMATRIX 142 + +#define BARCODE_NO_ASCII 1 +#define BARCODE_BIND 2 +#define BARCODE_BOX 4 +#define BARCODE_STDOUT 8 +#define READER_INIT 16 + +#define DATA_MODE 0 +#define UNICODE_MODE 1 +#define GS1_MODE 2 +#define KANJI_MODE 3 +#define SJIS_MODE 4 + +#define DM_SQUARE 100 + +#define WARN_INVALID_OPTION 2 +#define ERROR_TOO_LONG 5 +#define ERROR_INVALID_DATA 6 +#define ERROR_INVALID_CHECK 7 +#define ERROR_INVALID_OPTION 8 +#define ERROR_ENCODING_PROBLEM 9 +#define ERROR_FILE_ACCESS 10 +#define ERROR_MEMORY 11 + +#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(_MSC_VER) +# if defined (DLL_EXPORT) || defined(PIC) || defined(_USRDLL) +# define ZINT_EXTERN __declspec(dllexport) +# elif defined(ZINT_DLL) +# define ZINT_EXTERN __declspec(dllimport) +# else +# define ZINT_EXTERN extern +# endif +#else +# define ZINT_EXTERN extern +#endif + +ZINT_EXTERN struct zint_symbol *ZBarcode_Create(void); +ZINT_EXTERN void ZBarcode_Clear(struct zint_symbol *symbol); +ZINT_EXTERN void ZBarcode_Delete(struct zint_symbol *symbol); + +ZINT_EXTERN int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *input, int length); +ZINT_EXTERN int ZBarcode_Encode_File(struct zint_symbol *symbol, char *filename); +ZINT_EXTERN int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle); +ZINT_EXTERN int ZBarcode_Encode_and_Print(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle); +ZINT_EXTERN int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol, char *filename, int rotate_angle); + +ZINT_EXTERN int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle); +ZINT_EXTERN int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle); +ZINT_EXTERN int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, int rotate_angle); + +ZINT_EXTERN int ZBarcode_ValidID(int symbol_id); + +/* Depreciated */ +ZINT_EXTERN int ZBarcode_Print_Rotated(struct zint_symbol *symbol, int rotate_angle); +ZINT_EXTERN int ZBarcode_Encode_and_Print_Rotated(struct zint_symbol *symbol, unsigned char *input, int rotate_angle); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* ZINT_H */ diff --git a/MemDisplayAndEdit.cpp b/MemDisplayAndEdit.cpp new file mode 100644 index 0000000..750da8e --- /dev/null +++ b/MemDisplayAndEdit.cpp @@ -0,0 +1,148 @@ +#include "MemDisplayAndEdit.h" +#include "ui_memdisplayandedit.h" +#include "QLatin1Char" +MemDisplayAndEdit::MemDisplayAndEdit(QWidget *parent) : + QWidget(parent), + ui(new Ui::MemDisplayAndEdit) +{ + ui->setupUi(this); + for(int i = 0; i < MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL; i++){ + memLineEdit[i] = new QLineEdit(this); + //memLineEdit[i]->setAccessibleName(QString::number(i)); + memLineEdit[i]->setEnabled(false); + ui->gridLayoutMem->addWidget(memLineEdit[i],(i/MEM_GRID_MAX_COL) + 1,(i%MEM_GRID_MAX_COL) + 1); + connect(memLineEdit[i],SIGNAL(editingFinished ()),this,SLOT(onLineEditEditingFinished())); + } + for(int i = 0; i < MEM_GRID_MAX_ROW; i++){ + rowLabel[i] = new QLabel(this); + ui->gridLayoutMem->addWidget(rowLabel[i],i + 1,0); + } + editFlag = false; + writeMemMode = false; + ui->radioButtonRead->setChecked(!writeMemMode); + ui->radioButtonWrite->setChecked(writeMemMode); + writeMemBaseAddr = 0; + readMemBaseAddr = 0; +} + +MemDisplayAndEdit::~MemDisplayAndEdit() +{ + delete ui; + + +} + +void MemDisplayAndEdit::updateSysStatusToUI(void){ + if(sysPara && !editFlag){ + for(int i = 0; i < MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL; i++){ + if(writeMemMode) + memLineEdit[i]->setText(QString("%1").arg(sysPara->devOp->memWrMap[(writeMemBaseAddr + i)&MAX_WR_MEM_SIZE_MASK],2,16,QLatin1Char('0'))); + else + memLineEdit[i]->setText(QString("%1").arg(sysPara->devOp->memRdMap[(readMemBaseAddr + i)&MAX_RD_MEM_SIZE_MASK],2,16,QLatin1Char('0'))); + } + for(int i = 0; i < MEM_GRID_MAX_ROW; i++){ + if(writeMemMode) + rowLabel[i]->setText(QString("%1").arg((writeMemBaseAddr + i*MEM_GRID_MAX_COL)&MAX_WR_MEM_SIZE_MASK,4,16,QLatin1Char('0'))); + else + rowLabel[i]->setText(QString("%1").arg((readMemBaseAddr + i*MEM_GRID_MAX_COL)&MAX_RD_MEM_SIZE_MASK,4,16,QLatin1Char('0'))); + } + } +} + + +void MemDisplayAndEdit::on_comboBoxBaseAddress_activated(const QString &str) +{ + bool ok; + if(writeMemMode){ + writeMemBaseAddr = str.toInt(&ok,0); + } + else + readMemBaseAddr = str.toInt(&ok,0); +} + +void MemDisplayAndEdit::on_radioButtonRead_pressed() +{ + writeMemMode = false; + if(sysPara){ + ui->pushButtonEdit->setEnabled(sysPara->devOp->fpgaDevOpenFlag?false:true); + } + if(editFlag) + on_pushButtonEdit_pressed(); + ui->comboBoxBaseAddress->setEditText(QString("0x%1").arg(readMemBaseAddr,4,16,QLatin1Char('0'))); +} + +void MemDisplayAndEdit::on_radioButtonWrite_pressed() +{ + writeMemMode = true; + ui->pushButtonEdit->setEnabled(true); + if(editFlag) + on_pushButtonEdit_pressed(); + ui->comboBoxBaseAddress->setEditText(QString("0x%1").arg(writeMemBaseAddr,4,16,QLatin1Char('0'))); +} + +void MemDisplayAndEdit::on_pushButtonEdit_pressed() +{ + editFlag = !editFlag; + for(int i = 0; i < MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL; i++){ + memLineEdit[i]->setEnabled(editFlag); + } + ui->pushButtonEdit->setText(editFlag?tr("完成"):tr("编辑")); +} + +void MemDisplayAndEdit::on_pushButtonLastPage_pressed() +{ + if(writeMemMode){ + writeMemBaseAddr = (writeMemBaseAddr - MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL)&MAX_WR_MEM_SIZE_MASK; + } + else + readMemBaseAddr = (readMemBaseAddr - MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL)&MAX_WR_MEM_SIZE_MASK; +} + +void MemDisplayAndEdit::on_pushButtonNextPage_pressed() +{ + if(writeMemMode){ + writeMemBaseAddr = (writeMemBaseAddr + MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL)&MAX_WR_MEM_SIZE_MASK; + } + else + readMemBaseAddr = (readMemBaseAddr + MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL)&MAX_RD_MEM_SIZE_MASK; +} + +void MemDisplayAndEdit::onLineEditEditingFinished(){ + int val,addr; + bool ok; + QLineEdit * edit = qobject_cast(sender()); + QString name ="" ;// edit->accessibleName(); + val = edit->text().toInt(&ok,16); + if(sysPara){ + if(writeMemMode){ + addr = writeMemBaseAddr + name.toInt(&ok); + sysPara->devOp->fpgaWrD(addr,(unsigned int )val,1); + } + else { + if(!sysPara->devOp->fpgaDevOpenFlag){ + addr = readMemBaseAddr + name.toInt(&ok); + sysPara->devOp->memRdMap[(addr)&MAX_RD_MEM_SIZE_MASK] = (unsigned char)val; + } + } + } + +} + + + + +void MemDisplayAndEdit::on_lineEditDec_editingFinished() +{ + bool ok; + QLineEdit * edit = qobject_cast(sender()); + unsigned int val = edit->text().toUInt(&ok,10); + ui->lineEditHex->setText(QString("%1").arg(val,0,16)); +} + +void MemDisplayAndEdit::on_lineEditHex_editingFinished() +{ + bool ok; + QLineEdit * edit = qobject_cast(sender()); + unsigned int val = edit->text().toUInt(&ok,16); + ui->lineEditDec->setText(QString("%1").arg(val,0,10)); +} diff --git a/MemDisplayAndEdit.h b/MemDisplayAndEdit.h new file mode 100644 index 0000000..20f8de2 --- /dev/null +++ b/MemDisplayAndEdit.h @@ -0,0 +1,56 @@ +#ifndef MEMDISPLAYANDEDIT_H +#define MEMDISPLAYANDEDIT_H + +#include +#include +#include +#include +#define MEM_GRID_MAX_ROW 5 +#define MEM_GRID_MAX_COL 16 +namespace Ui { +class MemDisplayAndEdit; +} + +class MemDisplayAndEdit : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit MemDisplayAndEdit(QWidget *parent = 0); + ~MemDisplayAndEdit(); + + void updateSysStatusToUI(void); + +private slots: + void on_comboBoxBaseAddress_activated(const QString &arg1); + + void on_radioButtonRead_pressed(); + + void on_radioButtonWrite_pressed(); + + void on_pushButtonEdit_pressed(); + + void on_pushButtonLastPage_pressed(); + + void on_pushButtonNextPage_pressed(); + void onLineEditEditingFinished(); + + + void on_lineEditDec_editingFinished(); + + void on_lineEditHex_editingFinished(); + +private: + Ui::MemDisplayAndEdit *ui; + + QLineEdit *memLineEdit[MEM_GRID_MAX_ROW*MEM_GRID_MAX_COL]; + QLabel *rowLabel[MEM_GRID_MAX_ROW]; + + bool editFlag; //是否当前处于编辑模式 + bool writeMemMode; //是否当前处于写地址模式 + int writeMemBaseAddr; + int readMemBaseAddr; + +}; + +#endif // MEMDISPLAYANDEDIT_H diff --git a/MyFileDialog.cpp b/MyFileDialog.cpp new file mode 100644 index 0000000..ec42dd0 --- /dev/null +++ b/MyFileDialog.cpp @@ -0,0 +1,57 @@ +/* + * MyFileDialog.cpp + * + * Created on: Jul 14, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "MyFileDialog.h" +#include "SysPara.h" +#include +#include +#include + +MyFileDialog::MyFileDialog(QWidget *parent):QFileDialog(parent){ + setFileMode(QFileDialog::AnyFile); + //setLabelText(QFileDialog::LookIn,tr("文件夹")); +// setLabelText(QFileDialog::FileName,tr("文件名")); +// setLabelText(QFileDialog::FileType,tr("文件类型")); + setLabelText(QFileDialog::Accept,tr("确定")); +// setLabelText(QFileDialog::Reject,tr("取消")); + setViewMode(QFileDialog::Detail); + setOption(QFileDialog::ReadOnly,true); + //setOption(QFileDialog::DontUseNativeDialog,true); + + QList urls; + urls << QUrl::fromLocalFile(DOC_ROOT_DIR) ;//<< QUrl::fromLocalFile(UDISK_DOC_ROOT_DIR) ; + setSidebarUrls (urls ); + this->setFixedSize(this->geometry().width(),this->geometry().height()); +} + +MyFileDialog::~MyFileDialog(){ + +} + +void MyFileDialog::showFileDialog(QString title,QString dir,QString filter){ + setNameFilter(filter); + setDirectory (dir); + setWindowTitle(title); + //autoCompleteFileName("dfdfs"); + + setViewMode(QFileDialog::Detail); + //setOption(QFileDialog::ReadOnly,true); + //setOption(QFileDialog::DontUseSheet,true); + //setOption(QFileDialog::HideNameFilterDetails,true); + //setResolveSymlinks(0); + if(isMinimized()){ + setWindowState(Qt::WindowMaximized); + } + show(); + QWidget *widget = focusWidget () ; + if(widget){ + widget->clearFocus(); //默认不要弹出输入法 + } +} diff --git a/MyFileDialog.h b/MyFileDialog.h new file mode 100644 index 0000000..37f45c7 --- /dev/null +++ b/MyFileDialog.h @@ -0,0 +1,28 @@ +/* + * MyFileDialog.h + * + * Created on: Jul 14, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef MYFILEDIALOG_H_ +#define MYFILEDIALOG_H_ + + +#include + +class MyFileDialog:public QFileDialog{ + + Q_OBJECT + +public: + MyFileDialog(QWidget *parent = 0); + ~MyFileDialog(); + + void showFileDialog(QString title,QString filter,QString dir); +}; + +#endif /* MYFILEDIALOG_H_ */ diff --git a/MyInputMethod.cpp b/MyInputMethod.cpp new file mode 100644 index 0000000..d7d2062 --- /dev/null +++ b/MyInputMethod.cpp @@ -0,0 +1,110 @@ +/* + * MyInputMethod.cpp + * + * Created on: Jun 23, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + + +#include "MyInputMethod.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "Public.h" + +MyInputMethod::MyInputMethod(QWidget *parent){ + InputMethod *input = new InputMethod(this,parent); + //QString filename = "WINPY_utf8.txt"; + //qDebug()<<"File1:MyInputMethod";//; + QString filename = Public::readLanguageType(); + //qDebug()<<"File2:"<initInputMethod(filename); + //qDebug()<<"File3:"<initInputMethod(filename); + //qDebug()<<"SetInputFile:"<sendCommitString(str); +#endif +} + +void MyInputMethod::updateHandler ( int type ){ + QWidget *widget = QApplication::focusWidget(); + +#ifndef Q_OS_WIN32 + switch(type){ + case QWSInputMethod::Update: + case QWSInputMethod::FocusIn: + if(widget && dynamic_cast(widget)){ + if(digitalInput->isHidden()){ + QRect rec = QApplication::desktop()->screenGeometry(); + QPoint point = widget->mapToGlobal (QPoint(0,0)); //全局坐标 + QRect myRec = digitalInput->geometry(); + digitalInput->setGeometry((point.x() > rec.width()/2)?(point.x() - myRec.width() - 20):(point.x() + 20), + (point.y() > rec.height()/2)?(point.y() - myRec.height() - 20):(point.y() + 20), + myRec.width(),myRec.height()); + digitalInput->show(); + } + } + else { + if(inputMethod->isHidden()){ + //QCursor cursor(Qt::PointingHandCursor); + //inputMethod->setCursor(cursor); + QRect rec = QApplication::desktop()->screenGeometry(); + QRect myRec = inputMethod->geometry(); + if(widget){ + QPoint point = widget->mapToGlobal (QPoint(0,0)); //全局坐标 + if(point.y() < rec.height()/2) /*如果组件在上,则将输入法放在上面,否则放在下面*/ + inputMethod->setGeometry(0,rec.height() - myRec.height(),myRec.width(),myRec.height()); +// inputMethod->setGeometry(0,rec.height() - myRec.height()-12,myRec.width(),myRec.height()); + else + inputMethod->setGeometry(0,0,myRec.width(),myRec.height()); + inputMethod->show(); + } + } + } + break; + case QWSInputMethod::FocusOut: + inputMethod->hide(); + digitalInput->hide(); + inputMethod->onHiden(); + break; + } +#endif + +} + diff --git a/MyInputMethod.h b/MyInputMethod.h new file mode 100644 index 0000000..0452eb9 --- /dev/null +++ b/MyInputMethod.h @@ -0,0 +1,44 @@ +/* + * MyInputMethod.h + * + * Created on: Jun 23, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef MYINPUTMETHOD_H_ +#define MYINPUTMETHOD_H_ + +#include "InputMethod.h" +#include "DigitalInput.h" + +#ifndef Q_OS_WIN32 +#include +#include +class MyInputMethod:public QWSInputMethod +{ + Q_OBJECT +#else +class MyInputMethod +{ +#endif + +public: + MyInputMethod(QWidget *parent = 0); + ~MyInputMethod(); + + void updateHandler ( int type ); + void sendString(QString &str); + void SetInputFile(QString filename="WINPY_utf8.txt"); + InputMethod* getInputMethod(); +private slots: + + +private: + InputMethod *inputMethod; + DigitalInput *digitalInput; +}; + +#endif /* MYINPUTMETHOD_H_ */ diff --git a/MyTextEdit.cpp b/MyTextEdit.cpp new file mode 100644 index 0000000..edd8fb0 --- /dev/null +++ b/MyTextEdit.cpp @@ -0,0 +1,143 @@ +/* + * MyTextEdit.cpp + * + * Created on: Aug 7, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + + + + +#include +#include "SysPara.h" +#include +#include +#include +#include +#include +#include +#include + +MyTextEdit::MyTextEdit(QWidget *parent):QTextEdit(parent){ + + this->document()->setDocumentMargin(0); +// QTextDocument *doc = this->document(); //获取文档对象 + +// QTextFrame *rootFrame = doc->rootFrame(); //获取根框架 + +// QTextFrameFormat frameFormat; //创建框架格式 + +// frameFormat.setBorderBrush(Qt::red); //设置边界颜色 + +// frameFormat.setBorder(0); //设置边界宽度 + +// rootFrame->setFrameFormat(frameFormat); //给框架使用格式 + + + //this->setTextInteractionFlags(Qt::TextEditable);//不能选中 + this->setLineWrapMode(QTextEdit::NoWrap); + for(QTextBlock textBlock = this->document()->begin(); + textBlock != this->document()->end(); + textBlock = textBlock.next()){ + QTextBlockFormat textBlockFormat = textBlock.blockFormat(); + textBlockFormat.setBottomMargin(0); + QTextCursor textCursor = this->textCursor(); + textCursor.setBlockFormat(textBlockFormat); + this->setTextCursor(textCursor); + } +} + + +void MyTextEdit::dragEnterEvent ( QDragEnterEvent * e ){ + e->ignore(); +} +void MyTextEdit::dragLeaveEvent ( QDragLeaveEvent * e ){ + e->ignore(); +} +void MyTextEdit::dragMoveEvent ( QDragMoveEvent * e ){ + e->ignore(); +} +void MyTextEdit::mouseDoubleClickEvent ( QMouseEvent * e ){ + e->ignore(); +} + + void MyTextEdit::mousePressEvent(QMouseEvent * e) + { + //获取点击的下标 + //qDebug() << e->x() << ":" << e->y(); + + if(this->toPlainText().length()>1 && cursorForPosition(e->pos()).atEnd()) + { + int textHeight=this->height(); + QPoint currentPt=e->pos(); + QTextCursor textCursor=cursorForPosition(currentPt); + while(textCursor.atEnd() && 0<--textHeight && 0width(); + currentPt.setX(e->pos().x()); + currentPt.setY(currentPt.y()-5); + textCursor=cursorForPosition(currentPt); + while(textCursor.atEnd() && 0<--textWidth && 0pos().x()+8); + this->setTextCursor(cursorForPosition(currentPt)); + return; + } + } + + if(e->button() == Qt::LeftButton) + { + QWSServer::sendKeyEvent(0,Qt::Key_Left1,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Left,Qt::NoModifier,true,false); //向系统发送键盘事件 + QWSServer::sendKeyEvent(0,Qt::Key_Right1,Qt::NoModifier,true,false); + QWSServer::sendKeyEvent(0,Qt::Key_Right,Qt::NoModifier,true,false); + + //setCursor(); + //QTextCursor textCursor = this->textCursor(); + //textCursor.clearSelection(); + //textCursor.setPosition(e->x()); + //textCursor.setBlockFormat(textBlockFormat); + //this->setTextCursor(textCursor); + + } +// if(e->button() == Qt::RightButton) +// { +// e->ignore(); +// } +// else + { + QTextEdit::mousePressEvent(e); + } + } + + +//bool MyTextEdit::qwsEvent ( QWSEvent * event ){ +//} +//void MyTextEdit::mouseMoveEvent ( QMouseEvent * e ){ +// e->ignore(); +//} +// +//void MyTextEdit::changeEvent ( QEvent * event ){ +// if(event->type()==QEvent::FontChange) +// { +// } +// QTextEdit::changeEvent(event); +//} + +//void MyTextEdit::mouseReleaseEvent(QMouseEvent * e) +//{ +// QTextCursor textCursor = this->textCursor(); +// textCursor.clearSelection(); +// QTextEdit::mouseReleaseEvent(e); +//} + diff --git a/MyTextEdit.h b/MyTextEdit.h new file mode 100644 index 0000000..ee1a135 --- /dev/null +++ b/MyTextEdit.h @@ -0,0 +1,40 @@ +/* + * MyTextEdit.h + * + * Created on: Aug 7, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef MYTEXTEDIT_H_ +#define MYTEXTEDIT_H_ + +#include +#include +#include + +class MyTextEdit:public QTextEdit{ + + Q_OBJECT + +public: + explicit MyTextEdit(QWidget *parent = 0); + +protected: + void dragEnterEvent ( QDragEnterEvent * e ); + void dragLeaveEvent ( QDragLeaveEvent * e ); + void dragMoveEvent ( QDragMoveEvent * e ); + void mouseDoubleClickEvent ( QMouseEvent * e ); + void mousePressEvent(QMouseEvent * e); +// void mouseReleaseEvent(QMouseEvent *e); +// void changeEvent ( QEvent * event ); +// void mouseMoveEvent ( QMouseEvent * e ); +// void keyPressEvent(QKeyEvent * event); +// bool qwsEvent ( QWSEvent * event ); +}; + + + +#endif /* MYTEXTEDIT_H_ */ diff --git a/Network/IPEdit/IPEdit.cpp b/Network/IPEdit/IPEdit.cpp new file mode 100644 index 0000000..9163c37 --- /dev/null +++ b/Network/IPEdit/IPEdit.cpp @@ -0,0 +1,160 @@ +#include "IPEdit.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +IPEdit::IPEdit(QWidget *parent) : QWidget(parent) +{ + init(); +} + +IPEdit::~IPEdit() +{ + +} + +void IPEdit::init() +{ + m_layout = new QHBoxLayout(this); + m_layout->setSpacing(3); + m_layout->setContentsMargins(2, 0, 2, 0); + + m_edit1 = new QLineEdit(this); + m_edit2 = new QLineEdit(this); + m_edit3 = new QLineEdit(this); + m_edit4 = new QLineEdit(this); + + initForEdit(m_edit1); + initForEdit(m_edit2); + initForEdit(m_edit3); + initForEdit(m_edit4); + + m_dot1 = new QLabel(".", this); + m_dot2 = new QLabel(".", this); + m_dot3 = new QLabel(".", this); + + m_layout->addWidget(m_edit1, 1); + m_layout->addWidget(m_dot1); + m_layout->addWidget(m_edit2, 1); + m_layout->addWidget(m_dot2); + m_layout->addWidget(m_edit3, 1); + m_layout->addWidget(m_dot3); + m_layout->addWidget(m_edit4, 1); +} + +void IPEdit::initForEdit(QLineEdit* edit) +{ + edit->setFrame(false); + edit->setAlignment(Qt::AlignCenter); + edit->installEventFilter(this); + + QRegExpValidator* validator = new QRegExpValidator(QRegExp("^(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)$"), this); + edit->setValidator(validator); + + connect(edit, SIGNAL(textChanged(const QString&)), this, SLOT(editTextChanged(const QString&))); +} + +QLineEdit* IPEdit::nextEdit(QLineEdit* curEdit) +{ + if (curEdit == m_edit1) + return m_edit2; + else if (curEdit == m_edit2) + return m_edit3; + else if (curEdit == m_edit3) + return m_edit4; + else + return NULL; +} + +bool IPEdit::isEdit(QObject* object) +{ + return (object == m_edit1 || + object == m_edit2 || + object == m_edit3 || + object == m_edit4); +} + +QString IPEdit::text() +{ + QString sec1 = m_edit1->text().isEmpty() ? "0" : m_edit1->text(); + QString sec2 = m_edit2->text().isEmpty() ? "0" : m_edit2->text(); + QString sec3 = m_edit3->text().isEmpty() ? "0" : m_edit3->text(); + QString sec4 = m_edit4->text().isEmpty() ? "0" : m_edit4->text(); + return QString("%1.%2.%3.%4").arg(sec1).arg(sec2).arg(sec3).arg(sec4); +} + +void IPEdit::setText(const QString& text) +{ + QRegExp reg("^((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)$"); + if (!reg.exactMatch(text)) + return; + + QStringList ips = text.split("."); + m_edit1->setText(ips.at(0)); + m_edit2->setText(ips.at(1)); + m_edit3->setText(ips.at(2)); + m_edit4->setText(ips.at(3)); +} + +void IPEdit::paintEvent(QPaintEvent* event) +{ + QPainter painter(this); + + QStyleOptionFrame option; + option.initFrom(this); + option.lineWidth = 1; + style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, &painter, this); + QWidget::paintEvent(event); +} + +bool IPEdit::eventFilter(QObject* object, QEvent* event) +{ + if (isEdit(object)) + { + if (event->type() == QEvent::KeyPress) + { + QKeyEvent* keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Period) + { + QLineEdit* next = nextEdit(qobject_cast(object)); + if (next) + { + next->setFocus(); + next->selectAll(); + } + } + else if (keyEvent->matches(QKeySequence::Paste)) + { + QString clip = QApplication::clipboard()->text(QClipboard::Clipboard); + if (clip.split(".").size() == 4) + { + setText(clip); + return true; + } + } + } + } + + return QWidget::eventFilter(object, event); +} + +void IPEdit::editTextChanged(const QString& text) +{ + QLineEdit* curEdit = qobject_cast(sender()); + if (text.size() == 3) + { + QLineEdit* next = nextEdit(curEdit); + if (next) + { + next->setFocus(); + next->selectAll(); + } + } +} diff --git a/Network/IPEdit/IPEdit.h b/Network/IPEdit/IPEdit.h new file mode 100644 index 0000000..6753ef4 --- /dev/null +++ b/Network/IPEdit/IPEdit.h @@ -0,0 +1,44 @@ +#ifndef IPEDIT_H +#define IPEDIT_H + +#include +#include +#include +#include +#include +#include + +class IPEdit : public QWidget +{ + Q_OBJECT +public: + explicit IPEdit(QWidget *parent = 0); + ~IPEdit(); + + QString text(); + void setText(const QString& text); + +protected: + void init(); + void initForEdit(QLineEdit* edit); + QLineEdit* nextEdit(QLineEdit* curEdit); + bool isEdit(QObject* object); + + virtual void paintEvent(QPaintEvent* event); + virtual bool eventFilter(QObject* object, QEvent* event); + +protected slots: + void editTextChanged(const QString& text); + +private: + QBoxLayout* m_layout; + QLineEdit* m_edit1; + QLineEdit* m_edit2; + QLineEdit* m_edit3; + QLineEdit* m_edit4; + QLabel* m_dot1; + QLabel* m_dot2; + QLabel* m_dot3; +}; + +#endif // IPEDIT_H diff --git a/Network/IPEdit/README.md b/Network/IPEdit/README.md new file mode 100644 index 0000000..fc861c1 --- /dev/null +++ b/Network/IPEdit/README.md @@ -0,0 +1,9 @@ +# 用法 +``` cpp + IPEdit* ipEdit = new IPEdit(this); + ipEdit->setGeometry(10, 10, 130, 25); + ipEdit->show(); + + ipEdit->setText("255.255.255.0"); + QString text = ipEdit->text(); +``` \ No newline at end of file diff --git a/Network/NetworkManager.cpp b/Network/NetworkManager.cpp new file mode 100644 index 0000000..1a93a78 --- /dev/null +++ b/Network/NetworkManager.cpp @@ -0,0 +1,1929 @@ +#include "NetworkManager.h" +#include "ui_NetworkManager.h" +#include +#include +#include +#include +#include "myinclude.h" +#include "dirent.h" +#include "common/wpa_ctrl.h" +#define LANINTERFACE_NAME "eth0" + +#ifdef Q_OS_WIN +#include +#include +#include +#pragma comment(lib, "ws2_32.lib") +#pragma comment(lib, "Wbemuuid.lib") +#else +#define BUFSIZE 8192 +#include +#include +#include +#include +#include + +struct route_info { + in_addr dstAddr; + in_addr srcAddr; + in_addr gateWay; + char ifName[IF_NAMESIZE]; +}; + +int readNlSock(int sockFd, char *bufPtr, unsigned int seqNum, int pId) { + struct nlmsghdr *nlHdr; + int readLen = 0, msgLen = 0; + do { + if ((readLen = recv(sockFd, bufPtr, BUFSIZE - msgLen, 0)) < 0) { + perror("SOCK READ: "); + return -1; + } + nlHdr = (struct nlmsghdr *)bufPtr; + if ((NLMSG_OK(nlHdr, readLen) == 0) || (nlHdr->nlmsg_type == NLMSG_ERROR)) { + perror("Error in received packet"); + return -1; + } + if (nlHdr->nlmsg_type == NLMSG_DONE) + break; + + bufPtr += readLen; + msgLen += readLen; + + if ((nlHdr->nlmsg_flags & NLM_F_MULTI) == 0) + break; + + } while ((nlHdr->nlmsg_seq != seqNum) || (nlHdr->nlmsg_pid != (unsigned)pId)); + return msgLen; +} + +void parseRoutes(struct nlmsghdr *nlHdr, struct route_info *rtInfo) { + struct rtmsg *rtMsg = (struct rtmsg *)NLMSG_DATA(nlHdr); + + if ((rtMsg->rtm_family != AF_INET) || (rtMsg->rtm_table != RT_TABLE_MAIN)) + return; + + struct rtattr *rtAttr = (struct rtattr *)RTM_RTA(rtMsg); + int rtLen = RTM_PAYLOAD(nlHdr); + for (; RTA_OK(rtAttr, rtLen); rtAttr = RTA_NEXT(rtAttr, rtLen)) { + switch (rtAttr->rta_type) { + case RTA_OIF: + if_indextoname(*(int *)RTA_DATA(rtAttr), rtInfo->ifName); + break; + case RTA_GATEWAY: + rtInfo->gateWay = *(in_addr *)RTA_DATA(rtAttr); + break; + case RTA_PREFSRC: + rtInfo->srcAddr = *(in_addr *)RTA_DATA(rtAttr); + break; + case RTA_DST: + rtInfo->dstAddr = *(in_addr *)RTA_DATA(rtAttr); + break; + } + } +} +#endif + +class NetworkHelper { +public: + static QString DefaultGateway() { + QString ret; +#ifdef Q_OS_WIN + CoInitialize(NULL); + if (CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, 0) != S_OK) + return ret; + + IWbemLocator *pLoc = NULL; + if (CoCreateInstance(CLSID_WbemAdministrativeLocator, NULL, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_IUnknown, (void **)&pLoc) != S_OK) + return ret; + + IWbemServices *pSvc = NULL; + if (pLoc->ConnectServer(L"root\\cimv2", NULL, NULL, NULL, 0, NULL, NULL, &pSvc) != S_OK) + return ret; + + IEnumWbemClassObject *pEnumerator = NULL; + HRESULT hr = pSvc->ExecQuery(L"WQL", L"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'", WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); + if (FAILED(hr)) { + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return ret; + } + + IWbemClassObject *pclsObj = NULL; + while (pEnumerator && ret.isEmpty()) { + _variant_t vaDefaultIPGateway; + ULONG uReturn; + hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn); + if (!uReturn) + break; + + hr = pclsObj->Get(L"DefaultIPGateway", 0, &vaDefaultIPGateway, NULL, NULL); + if (hr == WBEM_S_NO_ERROR && vaDefaultIPGateway.vt != VT_NULL) { + LONG lLow = 0; + LONG lUp = 0; + ::SafeArrayGetLBound(vaDefaultIPGateway.parray, 1, &lLow); + ::SafeArrayGetUBound(vaDefaultIPGateway.parray, 1, &lUp); + for (LONG i = lLow; i <= lUp; i++) { + BSTR bsDefaultIPGateway; + if (::SafeArrayGetElement(vaDefaultIPGateway.parray, &i, &bsDefaultIPGateway) == S_OK) { + ret = QString::fromUtf16(reinterpret_cast(bsDefaultIPGateway)); + ::SysFreeString(bsDefaultIPGateway); + break; + } + } + } + VariantClear(&vaDefaultIPGateway); + } + + if (pclsObj) + pclsObj->Release(); + if (pEnumerator) + pEnumerator->Release(); + if (pSvc) + pSvc->Release(); + if (pLoc) + pLoc->Release(); + CoUninitialize(); +#else + int sock, msgSeq = 0; + if ((sock = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) < 0) { + perror("Socket Creation: "); + return ret; + } + + char msgBuf[BUFSIZE]; + memset(msgBuf, 0, BUFSIZE); + struct nlmsghdr *nlMsg = (struct nlmsghdr *)msgBuf; + + nlMsg->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); + nlMsg->nlmsg_type = RTM_GETROUTE; + + nlMsg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + nlMsg->nlmsg_seq = msgSeq++; + nlMsg->nlmsg_pid = getpid(); + + if (send(sock, nlMsg, nlMsg->nlmsg_len, 0) < 0) + return ret; + + int len; + if ((len = readNlSock(sock, msgBuf, msgSeq, getpid())) < 0) + return ret; + + struct route_info *rtInfo = (struct route_info *)malloc(sizeof(struct route_info)); + + for (; NLMSG_OK(nlMsg, len); nlMsg = NLMSG_NEXT(nlMsg, len)) { + memset(rtInfo, 0, sizeof(struct route_info)); + parseRoutes(nlMsg, rtInfo); + + if (strstr((char *)inet_ntoa(rtInfo->dstAddr), "0.0.0.0") && !strstr((char *)inet_ntoa(rtInfo->gateWay), "0.0.0.0")) { + char buf[64]; + inet_ntop(AF_INET, &rtInfo->gateWay, buf, sizeof(buf)); + ret = QString(buf); + break; + } + } + + free(rtInfo); + close(sock); +#endif + return ret; + } +}; + +NetworkManager::NetworkManager(QWidget *parent) : + QWidget(parent), + ui(new Ui::NetworkManager) +{ + ui->setupUi(this); + + Json_ip_init_done =false; + net_data = new PrintNet(); + + connect(net_data,SIGNAL(json_server_error()),this,SLOT(onjson_server_error())); + connect(net_data,SIGNAL(receiveJSONDatafinish()),this,SLOT(onfinish_get_json())); + connect(net_data,SIGNAL(showMessege()),this,SLOT(ShowNet_dataMessege())); + + QRegExp regExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"); + QRegExpValidator *pValidator = new QRegExpValidator(regExp, this); + +// ui->lineEditLanGW->setValidator(new QRegExpValidator(pValidator)); +// ui->lineEditLanGW->setInputMask("000.000.000.000;"); + + ui->spinBoxLanIP3->setDisabled(true); + ui->spinBoxLanIP2->setDisabled(true); + ui->spinBoxLanIP1->setDisabled(true); + ui->spinBoxLanIP0->setDisabled(true); + ui->spinBoxLanMask3->setDisabled(true); + ui->spinBoxLanMask2->setDisabled(true); + ui->spinBoxLanMask1->setDisabled(true); + ui->spinBoxLanMask0->setDisabled(true); +// ui->lineEditLanGW->setDisabled(true); + ui->spinBoxLanGW3->setDisabled(true); + ui->spinBoxLanGW2->setDisabled(true); + ui->spinBoxLanGW1->setDisabled(true); + ui->spinBoxLanGW0->setDisabled(true); + ui->pushButtonSetCancel->setDisabled(true); + + connect(ui->networkSelect, SIGNAL(activated(const QString&)), this, + SLOT(selectNetwork(const QString&))); + ctrl_iface = NULL; + ctrl_conn = NULL; + monitor_conn = NULL; + msgNotifier = NULL; + ctrl_iface_dir = strdup("/var/run/wpa_supplicant"); + + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), SLOT(ping())); + timer->setSingleShot(FALSE); + timer->start(3000); + + Json_timer = new QTimer(this); + connect(Json_timer, SIGNAL(timeout()), SLOT(onjson_timer_handler())); + Json_timer->stop(); + Jsom_timer_stop =true; +// Json_timer->start(1000); + + wlanStartUpFailed = false; + if (openCtrlConnection(ctrl_iface) < 0) { + qDebug()<<"Failed to open control connection to " + "wpa_supplicant."; + wlanStartUpFailed = true; + } + + if(wlanStartUpFailed) + return; + updateStatus(); + networkMayHaveChanged = true; + updateNetworks(); + updateSysStatusToUI(); +} + +NetworkManager::~NetworkManager() +{ + delete ui; + //delete processNetwork; +} + +void NetworkManager::onfinish_get_json() +{ + + net_data->getJson_data(&sysPara->Get_JSON_DATA); + + if(Jsom_timer_stop == true){ + + Json_timer->start(1000); + Jsom_timer_stop = false; + } + + + ui->messege_info_label->setText( net_data->getMessege() ); + + emit updateJSONData(); +} + +void NetworkManager::ShowNet_dataMessege() +{ + ui->messege_info_label->setText( net_data->getMessege()); +} + +void NetworkManager::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; +} + +void NetworkManager::updateSysStatusToUI() +{ + + if(sysPara){ + + if(!Json_ip_init_done){ + + Json_ip_init_done = true; + ui->deviceID_lineEdit->setText(QString(sysPara->para.Json_device_code)); + QString ip_str; + ip_str = QString::number(sysPara->para.Json_IP[0]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[1]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[2]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[3]); + ui->SeverIP_lineEdit->setText(ip_str); + ui->server_port_lineEdit->setText(QString::number(sysPara->para.Json_server_port)); + + } + + ui->checkBoxRemoveCode->setCheckState(sysPara->para.isRemoveCode ? Qt::Checked : Qt::Unchecked); + ui->checkBoxRemoveDigitCode->setCheckState(sysPara->para.isRemoveDigitCode ? Qt::Checked : Qt::Unchecked); + ui->radioButtonGetDataEnable->setChecked(sysPara->para.isEnableGetDataButton); +// ui->spinBox_ModbusPort->setValue(sysPara->para.ModbusTCPPort); + ui->spinBox_ModbusPort->setValue(5022); + + QList list = QNetworkInterface::allInterfaces(); //QNetworkInterface::interfaceFromName(LANINTERFACE_NAME); + //获取所有网络接口的列表 + foreach(QNetworkInterface interface,list) + { + #if 0 + //遍历每一个网络接口 + qDebug() << "Device: "< entryList = interface.addressEntries(); + //获取IP地址条目列表,每个条目中包含一个IP地址,一个子网掩码和一个广播地址 + foreach(QNetworkAddressEntry entry,entryList) + {//遍历每一个IP地址条目 + qDebug()<<"IP Address: "< entryList = interface.addressEntries(); + //获取IP地址条目列表,每个条目中包含一个IP地址,一个子网掩码和一个广播地址 + foreach(QNetworkAddressEntry entry,entryList) + { +#if 0 + //遍历每一个IP地址条目 + qDebug()<<"IP Address: "<lineEditLanIP->setText(entry.ip().toString()); + //ui->lineEditLanMask->setText(entry.netmask().toString()); + QStringList lanIpList = entry.ip().toString().split("."); + if (lanIpList.size() == 4) { + ui->spinBoxLanIP3->setValue(lanIpList.at(0).toInt()); + ui->spinBoxLanIP2->setValue(lanIpList.at(1).toInt()); + ui->spinBoxLanIP1->setValue(lanIpList.at(2).toInt()); + ui->spinBoxLanIP0->setValue(lanIpList.at(3).toInt()); + } + else if (lanIpList.size() == 0) { + ui->spinBoxLanIP3->setValue(0); + ui->spinBoxLanIP2->setValue(0); + ui->spinBoxLanIP1->setValue(0); + ui->spinBoxLanIP0->setValue(0); + } + QStringList lanMaskList = entry.netmask().toString().split("."); + if (lanMaskList.size() == 4) { + ui->spinBoxLanMask3->setValue(lanMaskList.at(0).toInt()); + ui->spinBoxLanMask2->setValue(lanMaskList.at(1).toInt()); + ui->spinBoxLanMask1->setValue(lanMaskList.at(2).toInt()); + ui->spinBoxLanMask0->setValue(lanMaskList.at(3).toInt()); + } + else if (lanMaskList.size() == 0) { + ui->spinBoxLanMask3->setValue(0); + ui->spinBoxLanMask2->setValue(0); + ui->spinBoxLanMask1->setValue(0); + ui->spinBoxLanMask0->setValue(0); + } + //ui->lineEditLanGW->setText(entry.netmask().toString()); + QString GatewayAddr = NetworkHelper::DefaultGateway(); + //ui->lineEditLanGW->setText(GatewayAddr); + QStringList lanGWList = GatewayAddr.split("."); + if (lanGWList.size() == 4) { + ui->spinBoxLanGW3->setValue(lanGWList.at(0).toInt()); + ui->spinBoxLanGW2->setValue(lanGWList.at(1).toInt()); + ui->spinBoxLanGW1->setValue(lanGWList.at(2).toInt()); + ui->spinBoxLanGW0->setValue(lanGWList.at(3).toInt()); + } + else if (lanGWList.size() == 0) { + ui->spinBoxLanGW3->setValue(0); + ui->spinBoxLanGW2->setValue(0); + ui->spinBoxLanGW1->setValue(0); + ui->spinBoxLanGW0->setValue(0); + } + return; + } + } + } + //ui->radioButtonGetDataEnable->setChecked(ui->radioButtonGetDataEnable ? true: false); + } + +} +#define INTERFACE_OTHERS "# The loopback interface \n\ + auto lo \n\ + iface lo inet loopback \n\ + \n \ + # Wireless interfaces \n\ + auto wlan0 \n\ + iface wlan0 inet dhcp \n\ + wireless_mode managed \n\ + wireless_essid any \n\ + wpa-driver wext \n\ + wpa-conf /etc/wpa_supplicant.conf\n" + +void NetworkManager::applyLanUIPara(void) +{ + + if(sysPara){ + QList list = QNetworkInterface::allInterfaces(); //QNetworkInterface::interfaceFromName(LANINTERFACE_NAME); + //获取所有网络接口的列表 + foreach(QNetworkInterface interface,list) { + if(QString::compare(interface.name(), LANINTERFACE_NAME)==0) + { + uint8_t ip3 = ui->spinBoxLanIP3->value(); + uint8_t ip2 = ui->spinBoxLanIP2->value(); + uint8_t ip1 = ui->spinBoxLanIP1->value(); + uint8_t ip0 = ui->spinBoxLanIP0->value(); + uint8_t lanMask3 = ui->spinBoxLanMask3->value(); + uint8_t lanMask2 = ui->spinBoxLanMask2->value(); + uint8_t lanMask1 = ui->spinBoxLanMask1->value(); + uint8_t lanMask0 = ui->spinBoxLanMask0->value(); + uint8_t lanGW0 = ui->spinBoxLanGW0->value(); + QString ipAddrStr(QString("%1.%2.%3.%4").arg(ip3).arg(ip2).arg(ip1).arg(ip0)); + QString netMaskStr(QString("%1.%2.%3.%4").arg(lanMask3).arg(lanMask2).arg(lanMask1).arg(lanMask0)); +// QHostAddress ipAddr(ipAddrStr); +// QHostAddress netMask(netMaskStr); + qDebug() << "set ip:"<start("ifconfig", QStringList() << LANINTERFACE_NAME << "192.168.1.100"); + //startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, + // qint64 *pid = 0) + QStringList argrList; + if (!(ip3|ip2|ip1|ip0)) { + // 动态IP + //qDebug() << "set dhcp"; + QProcess dhcpProcess; + dhcpProcess.startDetached("/bin/cp /etc/network/interfaces_dhcp /etc/network/interfaces", argrList); + argrList<< LANINTERFACE_NAME << ipAddrStr; + + } + else { + // 静态IP + QFile netInterface("/etc/network/interfaces"); + netInterface.open(QIODevice::WriteOnly|QIODevice::Text|QIODevice::Truncate); + if (netInterface.isOpen()) { + QTextStream stream(&netInterface); + stream.seek(0); + stream << INTERFACE_OTHERS; + stream << " " <<"\n"; + stream << "# eth0 interfaces" <<"\n"; + stream << "auto eth0" <<"\n"; + stream << "iface eth0 inet static" <<"\n"; + stream << QString("address %1.%2.%3.%4").arg(ip3).arg(ip2).arg(ip1).arg(ip0) <<"\n"; + stream << QString("gateway %1.%2.%3.%4").arg(ip3).arg(ip2).arg(ip1).arg(lanGW0) <<"\n"; + stream << QString("netmask %1.%2.%3.%4").arg(lanMask3).arg(lanMask2).arg(lanMask1).arg(lanMask0) <<"\n"; + stream << " \n"; + netInterface.close(); + } + argrList<< LANINTERFACE_NAME << ipAddrStr << "netmask" << netMaskStr; + } + qDebug() << "set argu:" << argrList; + //processNetwork->start("ifconfig", argrList); + QProcess process; + process.startDetached("/sbin/ifconfig", argrList); + //processNetwork->startDetached("/sbin/ifconfig", argrList, "/sbin/"); + //char cmd[100]; + //sprintf(cmd,"ifconfig %s %s netmask %s",LANINTERFACE_NAME, ui->lineEditLanIP->text(), ui->lineEditLanMask->text()); + //system(cmd); + //system("ifconfig eth0 192.168.0.16"); + return; + } + } + } + +} + +qint32 NetworkManager::isIpv4Address(QString ip) +{ + QRegExp regExp("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"); + if( !regExp.exactMatch(ip) ) + { + return false; + } + return true; +} + +void NetworkManager::on_pushButtonSetIP_clicked(bool checked) +{ + + if(sysPara){ + if(sysPara->status.bLanConfigManual) + { + //qDebug()<spinBoxLanIP3->value()).arg(ui->spinBoxLanIP2->value()).arg(ui->spinBoxLanIP1->value()).arg(ui->spinBoxLanIP0->value()); + //if(isIpv4Address(ui->lineEditLanIP->text())&&isIpv4Address(ui->lineEditLanMask->text()))//检查IP地址是否有效 + if(1) + { + applyLanUIPara(); + ui->pushButtonSetIP->setText(QObject::tr("手动设定")); + + ui->spinBoxLanIP3->setDisabled(true); + ui->spinBoxLanIP2->setDisabled(true); + ui->spinBoxLanIP1->setDisabled(true); + ui->spinBoxLanIP0->setDisabled(true); + ui->spinBoxLanMask3->setDisabled(true); + ui->spinBoxLanMask2->setDisabled(true); + ui->spinBoxLanMask1->setDisabled(true); + ui->spinBoxLanMask0->setDisabled(true); + ui->spinBoxLanGW0->setDisabled(true); + + ui->pushButtonSetCancel->setDisabled(true); + sysPara->status.bLanConfigManual = false; + } + else + { + //QMessageBox::information(this, tr("错误"), tr("ip地址错误")); + } + } + else + { + sysPara->status.bLanConfigManual = true; + ui->spinBoxLanIP3->setDisabled(false); + ui->spinBoxLanIP2->setDisabled(false); + ui->spinBoxLanIP1->setDisabled(false); + ui->spinBoxLanIP0->setDisabled(false); + ui->spinBoxLanMask3->setDisabled(false); + ui->spinBoxLanMask2->setDisabled(false); + ui->spinBoxLanMask1->setDisabled(false); + ui->spinBoxLanMask0->setDisabled(false); + ui->spinBoxLanGW0->setDisabled(false); + ui->pushButtonSetIP->setText(QObject::tr("应用")); + ui->pushButtonSetCancel->setDisabled(false); + + } + } + // qDebug()<lineEditLanIP->text(); + +} + +void NetworkManager::on_pushButtonSetCancel_clicked(bool checked) +{ + + if(sysPara){ + if(sysPara->status.bLanConfigManual) + { + sysPara->status.bLanConfigManual = false; + ui->spinBoxLanIP3->setDisabled(true); + ui->spinBoxLanIP2->setDisabled(true); + ui->spinBoxLanIP1->setDisabled(true); + ui->spinBoxLanIP0->setDisabled(true); + ui->spinBoxLanMask3->setDisabled(true); + ui->spinBoxLanMask2->setDisabled(true); + ui->spinBoxLanMask1->setDisabled(true); + ui->spinBoxLanMask0->setDisabled(true); + ui->pushButtonSetCancel->setDisabled(true); + ui->pushButtonSetIP->setText(QObject::tr("手动设定")); + } + } + +} + +int NetworkManager::openCtrlConnection(const char *ifname) +{ + char *cfile; + int flen; +// char buf[2048], *pos, *pos2; +// size_t len; + + if (ifname) { + if (ifname != ctrl_iface) { + free(ctrl_iface); + ctrl_iface = strdup(ifname); + } + } else { +#ifdef CONFIG_CTRL_IFACE_UDP + free(ctrl_iface); + ctrl_iface = strdup("udp"); +#endif /* CONFIG_CTRL_IFACE_UDP */ +#ifdef CONFIG_CTRL_IFACE_UNIX + struct dirent *dent; + DIR *dir = opendir(ctrl_iface_dir); + free(ctrl_iface); + ctrl_iface = NULL; + if (dir) { + while ((dent = readdir(dir))) { +#ifdef _DIRENT_HAVE_D_TYPE + /* Skip the file if it is not a socket. + * Also accept DT_UNKNOWN (0) in case + * the C library or underlying file + * system does not support d_type. */ + if (dent->d_type != DT_SOCK && + dent->d_type != DT_UNKNOWN) + continue; +#endif /* _DIRENT_HAVE_D_TYPE */ + + if (strcmp(dent->d_name, ".") == 0 || + strcmp(dent->d_name, "..") == 0) + continue; + printf("Selected interface '%s'\n", + dent->d_name); + ctrl_iface = strdup(dent->d_name); + break; + } + closedir(dir); + } +#endif /* CONFIG_CTRL_IFACE_UNIX */ +#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE + struct wpa_ctrl *ctrl; + int ret; + + free(ctrl_iface); + ctrl_iface = NULL; + + ctrl = wpa_ctrl_open(NULL); + if (ctrl) { + len = sizeof(buf) - 1; + ret = wpa_ctrl_request(ctrl, "INTERFACES", 10, buf, + &len, NULL); + if (ret >= 0) { + connectedToService = true; + buf[len] = '\0'; + pos = strchr(buf, '\n'); + if (pos) + *pos = '\0'; + ctrl_iface = strdup(buf); + } + wpa_ctrl_close(ctrl); + } +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ + } + + if (ctrl_iface == NULL) { +#ifdef CONFIG_NATIVE_WINDOWS + static bool first = true; + if (first && !serviceRunning()) { + first = false; + if (QMessageBox::warning( + this, qAppName(), + tr("wpa_supplicant service is not " + "running.\n" + "Do you want to start it?"), + QMessageBox::Yes | QMessageBox::No) == + QMessageBox::Yes) + startService(); + } +#endif /* CONFIG_NATIVE_WINDOWS */ + return -1; + } + +#ifdef CONFIG_CTRL_IFACE_UNIX + flen = strlen(ctrl_iface_dir) + strlen(ctrl_iface) + 2; + cfile = (char *) malloc(flen); + if (cfile == NULL) + return -1; + snprintf(cfile, flen, "%s/%s", ctrl_iface_dir, ctrl_iface); +#else /* CONFIG_CTRL_IFACE_UNIX */ + flen = strlen(ctrl_iface) + 1; + cfile = (char *) malloc(flen); + if (cfile == NULL) + return -1; + snprintf(cfile, flen, "%s", ctrl_iface); +#endif /* CONFIG_CTRL_IFACE_UNIX */ + + if (ctrl_conn) { + wpa_ctrl_close(ctrl_conn); + ctrl_conn = NULL; + } + + if (monitor_conn) { + delete msgNotifier; + msgNotifier = NULL; + wpa_ctrl_detach(monitor_conn); + wpa_ctrl_close(monitor_conn); + monitor_conn = NULL; + } + + printf("Trying to connect to '%s'\n", cfile); + ctrl_conn = wpa_ctrl_open(cfile); + if (ctrl_conn == NULL) { + free(cfile); + return -1; + } + monitor_conn = wpa_ctrl_open(cfile); + free(cfile); + if (monitor_conn == NULL) { + wpa_ctrl_close(ctrl_conn); + return -1; + } + if (wpa_ctrl_attach(monitor_conn)) { + printf("Failed to attach to wpa_supplicant\n"); + wpa_ctrl_close(monitor_conn); + monitor_conn = NULL; + wpa_ctrl_close(ctrl_conn); + ctrl_conn = NULL; + return -1; + } + +#if defined(CONFIG_CTRL_IFACE_UNIX) || defined(CONFIG_CTRL_IFACE_UDP) + msgNotifier = new QSocketNotifier(wpa_ctrl_get_fd(monitor_conn), + QSocketNotifier::Read, this); + connect(msgNotifier, SIGNAL(activated(int)), SLOT(receiveMsgs())); +#endif + + //adapterSelect->clear(); + //adapterSelect->addItem(ctrl_iface); + //adapterSelect->setCurrentIndex(0); + #if 0 +printf("Trying to INTERFACES to '%s'\n", cfile); + len = sizeof(buf) - 1; + if (wpa_ctrl_request(ctrl_conn, "INTERFACES", 10, buf, &len, NULL) >= + 0) { + buf[len] = '\0'; + pos = buf; + while (*pos) { + pos2 = strchr(pos, '\n'); + if (pos2) + *pos2 = '\0'; + if (strcmp(pos, ctrl_iface) != 0) + //adapterSelect->addItem(pos); + if (pos2) + pos = pos2 + 1; + else + break; + } + } + + len = sizeof(buf) - 1; + if (wpa_ctrl_request(ctrl_conn, "GET_CAPABILITY eap", 18, buf, &len, + NULL) >= 0) { + buf[len] = '\0'; + + QString res(buf); + QStringList types = res.split(QChar(' ')); + bool wps = types.contains("WSC"); + actionWPS->setEnabled(wps); + wpsTab->setEnabled(wps); + wpaguiTab->setTabEnabled(wpaguiTab->indexOf(wpsTab), wps); + } +#endif + printf("network out to '%s'\n", cfile); + + return 0; +} + + +int NetworkManager::ctrlRequest(const char *cmd, char *buf, size_t *buflen) +{ + int ret; + + if (ctrl_conn == NULL) + return -3; + ret = wpa_ctrl_request(ctrl_conn, cmd, strlen(cmd), buf, buflen, NULL); + if (ret == -2) + printf("'%s' command timed out.\n", cmd); + else if (ret < 0) + printf("'%s' command failed.\n", cmd); + + return ret; +} +QString NetworkManager::wpaStateTranslate(char *state) +{ + + if (!strcmp(state, "DISCONNECTED")) + { + //QProcess process; + //process.startDetached("killall udhcpc"); + return tr("Disconnected"); + } + else if (!strcmp(state, "INACTIVE")) + return tr("Inactive"); + else if (!strcmp(state, "SCANNING")) + return tr("Scanning"); + else if (!strcmp(state, "AUTHENTICATING")) + return tr("Authenticating"); + else if (!strcmp(state, "ASSOCIATING")) + return tr("Associating"); + else if (!strcmp(state, "ASSOCIATED")) + return tr("Associated"); + else if (!strcmp(state, "4WAY_HANDSHAKE")) + return tr("4-Way Handshake"); + else if (!strcmp(state, "GROUP_HANDSHAKE")) + return tr("Group Handshake"); + else if (!strcmp(state, "COMPLETED")) + { + QProcess process; + process.startDetached("/home/plg/checkUdhcpcRun.sh"); + return tr("Completed"); + } + else + + return tr("Unknown"); +} +void NetworkManager::updateStatus() +{ + + char buf[2048], *start, *end, *pos; + size_t len; + + pingsToStatusUpdate = 10; + + len = sizeof(buf) - 1; + if (ctrl_conn == NULL || ctrlRequest("STATUS", buf, &len) < 0) { + ui->textStatus->setText(tr("Could not get status from " + "wpa_supplicant")); + //ui->textAuthentication->clear(); + //ui->textEncryption->clear(); + ui->textSSID->clear(); + //ui->textBssid->clear(); + ui->textIPAdrr->clear(); + + return; + } + + buf[len] = '\0'; + + bool auth_updated = false, ssid_updated = false; + bool bssid_updated = false, ipaddr_updated = false; + bool status_updated = false; + char *pairwise_cipher = NULL, *group_cipher = NULL; + char *mode = NULL; + + start = buf; + while (*start) { + bool last = false; + end = strchr(start, '\n'); + if (end == NULL) { + last = true; + end = start; + while (end[0] && end[1]) + end++; + } + *end = '\0'; + + pos = strchr(start, '='); + if (pos) { + *pos++ = '\0'; + if (strcmp(start, "bssid") == 0) { + bssid_updated = true; + //textBssid->setText(pos); + } else if (strcmp(start, "ssid") == 0) { + ssid_updated = true; + ui->textSSID->setText(pos); + } else if (strcmp(start, "ip_address") == 0) { + ipaddr_updated = true; + ui->textIPAdrr->setText(pos); + } else if (strcmp(start, "wpa_state") == 0) { + status_updated = true; + ui->textStatus->setText(wpaStateTranslate(pos)); + } else if (strcmp(start, "key_mgmt") == 0) { + auth_updated = true; + //textAuthentication->setText(pos); + /* TODO: could add EAP status to this */ + } else if (strcmp(start, "pairwise_cipher") == 0) { + pairwise_cipher = pos; + } else if (strcmp(start, "group_cipher") == 0) { + group_cipher = pos; + } else if (strcmp(start, "mode") == 0) { + mode = pos; + } + } + + if (last) + break; + start = end + 1; + } + if (status_updated && mode) + ui->textStatus->setText(ui->textStatus->text() + " (" + mode + ")"); + + if (pairwise_cipher || group_cipher) { + QString encr; + if (pairwise_cipher && group_cipher && + strcmp(pairwise_cipher, group_cipher) != 0) { + encr.append(pairwise_cipher); + encr.append(" + "); + encr.append(group_cipher); + } else if (pairwise_cipher) { + encr.append(pairwise_cipher); + } else { + encr.append(group_cipher); + encr.append(" [group key only]"); + } + //textEncryption->setText(encr); + } else + //textEncryption->clear(); + ; + + if (!status_updated) + ui->textStatus->clear(); + //if (!auth_updated) + // textAuthentication->clear(); + if (!ssid_updated) + ui->textSSID->clear(); + //if (!bssid_updated) + // textBssid->clear(); + if (!ipaddr_updated) + ui->textIPAdrr->clear(); + +} + +void NetworkManager::updateNetworks() +{ + + char buf[2048], *start, *end, *id, *ssid, *bssid, *flags; + size_t len; + int first_active = -1; + int was_selected = -1; + bool current = false; + if(wlanStartUpFailed) + return; + if (!networkMayHaveChanged) + return; + + //if (networkList->currentRow() >= 0) + // was_selected = networkList->currentRow(); + + ui->networkSelect->clear(); + //ui->scanSSIDSelect->clear(); + //networkList->clear(); + + if (ctrl_conn == NULL) + return; + + len = sizeof(buf) - 1; + if (ctrlRequest("LIST_NETWORKS", buf, &len) < 0) + return; + + buf[len] = '\0'; + start = strchr(buf, '\n'); + if (start == NULL) + return; + start++; + + while (*start) { + bool last = false; + end = strchr(start, '\n'); + if (end == NULL) { + last = true; + end = start; + while (end[0] && end[1]) + end++; + } + *end = '\0'; + + id = start; + ssid = strchr(id, '\t'); + if (ssid == NULL) + break; + *ssid++ = '\0'; + bssid = strchr(ssid, '\t'); + if (bssid == NULL) + break; + *bssid++ = '\0'; + flags = strchr(bssid, '\t'); + if (flags == NULL) + break; + *flags++ = '\0'; + + if (strstr(flags, "[DISABLED][P2P-PERSISTENT]")) { + if (last) + break; + start = end + 1; + continue; + } + + QString network(id); + network.append(": "); + network.append(ssid); + ui->networkSelect->addItem(network); + //networkList->addItem(network); +//scanSSIDSelect + if (strstr(flags, "[CURRENT]")) { + ui->networkSelect->setCurrentIndex(ui->networkSelect->count() - + 1); + current = true; + } else if (first_active < 0 && + strstr(flags, "[DISABLED]") == NULL) + first_active = ui->networkSelect->count() - 1; + + if (last) + break; + start = end + 1; + } + + if (ui->networkSelect->count() > 1) + ui->networkSelect->addItem(tr("Select any network")); + + if (!current && first_active >= 0) + ui->networkSelect->setCurrentIndex(first_active); +#if 0 + if (was_selected >= 0 && networkList->count() > 0) { + if (was_selected < networkList->count()) + networkList->setCurrentRow(was_selected); + else + networkList->setCurrentRow(networkList->count() - 1); + } + else + networkList->setCurrentRow(networkSelect->currentIndex()); +#endif + networkMayHaveChanged = false; + +} +static int str_match(const char *a, const char *b) +{ + return strncmp(a, b, strlen(b)) == 0; +} +void NetworkManager::scan() +{ +#if 0 + if (scanres) { + scanres->close(); + delete scanres; + } + + scanres = new ScanResults(); + if (scanres == NULL) + return; + scanres->setWpaGui(this); + scanres->show(); + scanres->exec(); +#endif +} +void NetworkManager::processMsg(char *msg) +{ + + char *pos = msg, *pos2; + int priority = 2; + + if (*pos == '<') { + /* skip priority */ + pos++; + priority = atoi(pos); + pos = strchr(pos, '>'); + if (pos) + pos++; + else + pos = msg; + } + + WpaMsg wm(pos, priority); + //if (eh) + // eh->addEvent(wm); + //if (peers) + // peers->event_notify(wm); + msgs.append(wm); + while (msgs.count() > 100) + msgs.pop_front(); + + /* Update last message with truncated version of the event */ + if (strncmp(pos, "CTRL-", 5) == 0) { + pos2 = strchr(pos, str_match(pos, WPA_CTRL_REQ) ? ':' : ' '); + if (pos2) + pos2++; + else + pos2 = pos; + } else + pos2 = pos; + QString lastmsg = pos2; + lastmsg.truncate(40); + //textLastMessage->setText(lastmsg); + + pingsToStatusUpdate = 0; + networkMayHaveChanged = true; + + if (str_match(pos, WPA_CTRL_REQ)) + //processCtrlReq(pos + strlen(WPA_CTRL_REQ)); + ; + else if (str_match(pos, WPA_EVENT_SCAN_RESULTS) && beSentScanCmd) + { + updateResults(); + beSentScanCmd = false; + } + else if (str_match(pos, WPA_EVENT_DISCONNECTED)) + //showTrayMessage(QSystemTrayIcon::Information, 3, + // tr("Disconnected from network.")); + ui->textStatus->setText("Disconnected"); + else if (str_match(pos, WPA_EVENT_CONNECTED)) { + //showTrayMessage(QSystemTrayIcon::Information, 3, + //tr("Connection to network established.")); + //QTimer::singleShot(5 * 1000, this, SLOT(showTrayStatus())); + //stopWpsRun(true); + ui->textStatus->setText("Connected"); + } +#if 0 + + else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_PBC)) { + wpsStatusText->setText(tr("WPS AP in active PBC mode found")); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + wpsInstructions->setText(tr("Press the PBC button on the " + "screen to start registration")); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_PIN)) { + wpsStatusText->setText(tr("WPS AP with recently selected " + "registrar")); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_AUTH)) { + showTrayMessage(QSystemTrayIcon::Information, 3, + "Wi-Fi Protected Setup (WPS) AP\n" + "indicating this client is authorized."); + wpsStatusText->setText("WPS AP indicating this client is " + "authorized"); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE)) { + wpsStatusText->setText(tr("WPS AP detected")); + } else if (str_match(pos, WPS_EVENT_OVERLAP)) { + wpsStatusText->setText(tr("PBC mode overlap detected")); + wpsInstructions->setText(tr("More than one AP is currently in " + "active WPS PBC mode. Wait couple " + "of minutes and try again")); + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_CRED_RECEIVED)) { + wpsStatusText->setText(tr("Network configuration received")); + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPA_EVENT_EAP_METHOD)) { + if (strstr(pos, "(WSC)")) + wpsStatusText->setText(tr("Registration started")); + } else if (str_match(pos, WPS_EVENT_M2D)) { + wpsStatusText->setText(tr("Registrar does not yet know PIN")); + } else if (str_match(pos, WPS_EVENT_FAIL)) { + wpsStatusText->setText(tr("Registration failed")); + } else if (str_match(pos, WPS_EVENT_SUCCESS)) { + wpsStatusText->setText(tr("Registration succeeded")); + } +#endif +} +void NetworkManager::receiveMsgs() +{ + char buf[256]; + size_t len; + qDebug()<<"receiveMsgs"; + while (monitor_conn && wpa_ctrl_pending(monitor_conn) > 0) { + len = sizeof(buf) - 1; + if (wpa_ctrl_recv(monitor_conn, buf, &len) == 0) { + buf[len] = '\0'; + processMsg(buf); + } + } +} + + +void NetworkManager::updateResults() +{ + char reply[2048]; + size_t reply_len; + int index; + char cmd[20]; + //qDebug()<<"updateResults"; + //ui->networkSelect->clear(); + ui->scanSSIDSelect->clear(); + scanResultMap.clear(); + + index = 0; + while (1) + { + snprintf(cmd, sizeof(cmd), "BSS %d", index++); + if (index > 1000) + break; + + reply_len = sizeof(reply) - 1; + if (ctrlRequest(cmd, reply, &reply_len) < 0) + break; + reply[reply_len] = '\0'; + + QString bss(reply); + if (bss.isEmpty() || bss.startsWith("FAIL")) + break; + + QString ssid, bssid, freq, signal, flags; + + QStringList lines = bss.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + int pos = (*it).indexOf('=') + 1; + if (pos < 1) + continue; + + if ((*it).startsWith("bssid=")) + bssid = (*it).mid(pos); + else if ((*it).startsWith("freq=")) + freq = (*it).mid(pos); + else if ((*it).startsWith("qual=")) + signal = (*it).mid(pos); + else if ((*it).startsWith("flags=")) + flags = (*it).mid(pos); + else if ((*it).startsWith("ssid=")) + ssid = (*it).mid(pos); + } +#if 0 + QTreeWidgetItem *item = new QTreeWidgetItem(scanResultsWidget); + if (item) { + item->setText(0, ssid); + item->setText(1, bssid); + item->setText(2, freq); + item->setText(3, signal); + item->setText(4, flags); + } +#endif + ui->scanSSIDSelect->addItem(ssid); + QStringList resultList; + resultList<pskEdit->text().length(); + int auth = ui->authSelect->currentIndex(); + + if (auth == AUTH_WPA_PSK || auth == AUTH_WPA2_PSK) { + if (psklen < 8 || psklen > 64) { + QMessageBox::warning( + this, + tr("WPA Pre-Shared Key Error"), + tr("WPA-PSK requires a passphrase of 8 to 63 " + "characters\n" + "or 64 hex digit PSK")); + ui->pskEdit->setFocus(); + return; + } + } +#if 0 + if (idstrEdit->isEnabled() && !idstrEdit->text().isEmpty()) { + QRegExp rx("^(\\w|-)+$"); + if (rx.indexIn(idstrEdit->text()) < 0) { + QMessageBox::warning( + this, tr("Network ID Error"), + tr("Network ID String contains non-word " + "characters.\n" + "It must be a simple string, " + "without spaces, containing\n" + "only characters in this range: " + "[A-Za-z0-9_-]\n")); + idstrEdit->setFocus(); + return; + } + } + + if (wpagui == NULL) + return; +#endif + memset(reply, 0, sizeof(reply)); + reply_len = sizeof(reply) - 1; + + if (1) { + ctrlRequest("ADD_NETWORK", reply, &reply_len); + if (reply[0] == 'F') { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to add " + "network to wpa_supplicant\n" + "configuration.")); + return; + } + id = atoi(reply); + } else + id = edit_network_id; + + //setNetworkParam(id, "ssid", ssidEdit->text().toAscii().constData(), + // true); + setNetworkParam(id, "ssid", ui->scanSSIDSelect->currentText().toAscii().constData(), + true); + const char *key_mgmt = NULL, *proto = NULL, *pairwise = NULL; + switch (auth) { + case AUTH_NONE_OPEN: + case AUTH_NONE_WEP: + case AUTH_NONE_WEP_SHARED: + key_mgmt = "NONE"; + break; + case AUTH_IEEE8021X: + key_mgmt = "IEEE8021X"; + break; + case AUTH_WPA_PSK: + key_mgmt = "WPA-PSK"; + proto = "WPA"; + break; + case AUTH_WPA_EAP: + key_mgmt = "WPA-EAP"; + proto = "WPA"; + break; + case AUTH_WPA2_PSK: + key_mgmt = "WPA-PSK"; + proto = "WPA2"; + break; + case AUTH_WPA2_EAP: + key_mgmt = "WPA-EAP"; + proto = "WPA2"; + break; + } + + if (auth == AUTH_NONE_WEP_SHARED) + setNetworkParam(id, "auth_alg", "SHARED", false); + else + setNetworkParam(id, "auth_alg", "OPEN", false); + + if (auth == AUTH_WPA_PSK || auth == AUTH_WPA_EAP || + auth == AUTH_WPA2_PSK || auth == AUTH_WPA2_EAP) { + int encr = ui->EncryptionSelect->currentIndex(); + if (encr == 0) + pairwise = "TKIP"; + else + pairwise = "CCMP"; + } + + if (proto) + setNetworkParam(id, "proto", proto, false); + if (key_mgmt) + setNetworkParam(id, "key_mgmt", key_mgmt, false); + if (pairwise) { + setNetworkParam(id, "pairwise", pairwise, false); + setNetworkParam(id, "group", "TKIP CCMP WEP104 WEP40", false); + } + if (ui->pskEdit->isEnabled() && + strcmp(ui->pskEdit->text().toAscii().constData(), + WPA_GUI_KEY_DATA) != 0) + setNetworkParam(id, "psk", + ui->pskEdit->text().toAscii().constData(), + psklen != 64); +#if 0 + if (eapSelect->isEnabled()) { + const char *eap = + eapSelect->currentText().toAscii().constData(); + setNetworkParam(id, "eap", eap, false); + if (strcmp(eap, "SIM") == 0 || strcmp(eap, "AKA") == 0) + setNetworkParam(id, "pcsc", "", true); + else + setNetworkParam(id, "pcsc", "NULL", false); + } + + if (phase2Select->isEnabled()) { + QString eap = eapSelect->currentText(); + QString inner = phase2Select->currentText(); + char phase2[32]; + phase2[0] = '\0'; + if (eap.compare("PEAP") == 0) { + if (inner.startsWith("EAP-")) + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + } else if (eap.compare("TTLS") == 0) { + if (inner.startsWith("EAP-")) + snprintf(phase2, sizeof(phase2), "autheap=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + else + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.toAscii().constData()); + } else if (eap.compare("FAST") == 0) { + const char *provisioning = NULL; + if (inner.startsWith("EAP-")) { + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + provisioning = "fast_provisioning=2"; + } else if (inner.compare("GTC(auth) + MSCHAPv2(prov)") + == 0) { + snprintf(phase2, sizeof(phase2), + "auth=GTC auth=MSCHAPV2"); + provisioning = "fast_provisioning=1"; + } else + provisioning = "fast_provisioning=3"; + if (provisioning) { + char blob[32]; + setNetworkParam(id, "phase1", provisioning, + true); + snprintf(blob, sizeof(blob), + "blob://fast-pac-%d", id); + setNetworkParam(id, "pac_file", blob, true); + } + } + if (phase2[0]) + setNetworkParam(id, "phase2", phase2, true); + else + setNetworkParam(id, "phase2", "NULL", false); + } else + setNetworkParam(id, "phase2", "NULL", false); +#endif + setNetworkParam(id, "phase2", "NULL", false); +#if 0 + if (identityEdit->isEnabled() && identityEdit->text().length() > 0) + setNetworkParam(id, "identity", + identityEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "identity", "NULL", false); +#endif + setNetworkParam(id, "identity", "NULL", false); + if (ui->passwordEdit->isEnabled() && ui->passwordEdit->text().length() > 0 && + strcmp(ui->passwordEdit->text().toAscii().constData(), + WPA_GUI_KEY_DATA) != 0) + setNetworkParam(id, "password", + ui->passwordEdit->text().toAscii().constData(), + true); + else if (ui->passwordEdit->text().length() == 0) + setNetworkParam(id, "password", "NULL", false); +#if 0 + if (cacertEdit->isEnabled() && cacertEdit->text().length() > 0) + setNetworkParam(id, "ca_cert", + cacertEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "ca_cert", "NULL", false); + + writeWepKey(id, wep0Edit, 0); + writeWepKey(id, wep1Edit, 1); + writeWepKey(id, wep2Edit, 2); + writeWepKey(id, wep3Edit, 3); +#endif + setNetworkParam(id, "ca_cert", "NULL", false); + +#if 0 + if (wep0Radio->isEnabled() && wep0Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "0", false); + else if (wep1Radio->isEnabled() && wep1Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "1", false); + else if (wep2Radio->isEnabled() && wep2Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "2", false); + else if (wep3Radio->isEnabled() && wep3Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "3", false); + + if (idstrEdit->isEnabled() && idstrEdit->text().length() > 0) + setNetworkParam(id, "id_str", + idstrEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "id_str", "NULL", false); +#endif + setNetworkParam(id, "id_str", "NULL", false); +#if 0 + if (prioritySpinBox->isEnabled()) { + QString prio; + prio = prio.setNum(prioritySpinBox->value()); + setNetworkParam(id, "priority", prio.toAscii().constData(), + false); + } +#endif + snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %d", id); + reply_len = sizeof(reply); + ctrlRequest(cmd, reply, &reply_len); + if (strncmp(reply, "OK", 2) != 0) { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to enable " + "network in wpa_supplicant\n" + "configuration.")); + /* Network was added, so continue anyway */ + } + triggerUpdate(); + ctrlRequest("SAVE_CONFIG", reply, &reply_len); + + //close(); +} +void NetworkManager::authChanged(int sel) +{ + + ui->EncryptionSelect->setEnabled(sel != AUTH_NONE_OPEN && sel != AUTH_NONE_WEP && + sel != AUTH_NONE_WEP_SHARED); + ui->pskEdit->setEnabled(sel == AUTH_WPA_PSK || sel == AUTH_WPA2_PSK); + bool eap = sel == AUTH_IEEE8021X || sel == AUTH_WPA_EAP || + sel == AUTH_WPA2_EAP; + //eapSelect->setEnabled(eap); + //identityEdit->setEnabled(eap); + ui->passwordEdit->setEnabled(eap); + //cacertEdit->setEnabled(eap); + //phase2Select->setEnabled(eap); + //if (eap) + // eapChanged(eapSelect->currentIndex()); + + while (ui->EncryptionSelect->count()) + ui->EncryptionSelect->removeItem(0); + + if (sel == AUTH_NONE_OPEN || sel == AUTH_NONE_WEP || + sel == AUTH_NONE_WEP_SHARED || sel == AUTH_IEEE8021X) { + ui->EncryptionSelect->addItem("None"); + ui->EncryptionSelect->addItem("WEP"); + ui->EncryptionSelect->setCurrentIndex(sel == AUTH_NONE_OPEN ? 0 : 1); + } else { + ui->EncryptionSelect->addItem("TKIP"); + ui->EncryptionSelect->addItem("CCMP"); + ui->EncryptionSelect->setCurrentIndex((sel == AUTH_WPA2_PSK || + sel == AUTH_WPA2_EAP) ? 1 : 0); + } + //wepEnabled(sel == AUTH_NONE_WEP || sel == AUTH_NONE_WEP_SHARED); +} +void NetworkManager::selectNetwork( const QString & sel ) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply); + + if (cmd.contains(QRegExp("^\\d+:"))) + cmd.truncate(cmd.indexOf(':')); + else + cmd = "any"; + cmd.prepend("SELECT_NETWORK "); + ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + triggerUpdate(); +} +void NetworkManager::triggerUpdate() +{ + updateStatus(); + networkMayHaveChanged = true; + updateNetworks(); +} +void NetworkManager::ping() +{ + char buf[10]; + size_t len; + + if(wlanStartUpFailed) + return; + len = sizeof(buf) - 1; + if (ctrlRequest("PING", buf, &len) < 0) { + qDebug()<<"PING failed - trying to reconnect"; + if (openCtrlConnection(ctrl_iface) >= 0) { + qDebug()<<"Reconnected successfully"; + pingsToStatusUpdate = 0; + } + } + + pingsToStatusUpdate--; + if (pingsToStatusUpdate <= 0) { + updateStatus(); + updateNetworks(); + } + +#ifndef CONFIG_CTRL_IFACE_NAMED_PIPE + /* Use less frequent pings and status updates when the main window is + * hidden (running in taskbar). */ + int interval = isHidden() ? 20000 : 3000; + if (timer->interval() != interval) + timer->setInterval(interval); +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ +} + +void NetworkManager::on_pushButtonConnect_pressed() +{ + on_pushButtonDisconnect_pressed(); + + char reply[10]; + size_t reply_len = sizeof(reply); + ctrlRequest("REASSOCIATE", reply, &reply_len); +} + +void NetworkManager::on_pushButtonDisconnect_pressed() +{ + char reply[10]; + size_t reply_len = sizeof(reply); + ctrlRequest("DISCONNECT", reply, &reply_len); +} + +void NetworkManager::on_scanSSIDSelect_activated(const QString &arg1) +{ + //if (openCtrlConnection(sel.toAscii().constData()) < 0) + // printf("Failed to open control connection to " + // "wpa_supplicant.\n"); + updateStatus(); + updateNetworks(); + QStringList networkString=scanResultMap[arg1]; + if(networkString.isEmpty()) + { + return; + } + // QString flags = sel->text(4); + QString flags = networkString.at(4); + int auth, encr = 0; + if (flags.indexOf("[WPA2-EAP") >= 0) + auth = AUTH_WPA2_EAP; + else if (flags.indexOf("[WPA-EAP") >= 0) + auth = AUTH_WPA_EAP; + else if (flags.indexOf("[WPA2-PSK") >= 0) + auth = AUTH_WPA2_PSK; + else if (flags.indexOf("[WPA-PSK") >= 0) + auth = AUTH_WPA_PSK; + else + auth = AUTH_NONE_OPEN; + + if (flags.indexOf("-CCMP") >= 0) + encr = 1; + else if (flags.indexOf("-TKIP") >= 0) + encr = 0; + else if (flags.indexOf("WEP") >= 0) { + encr = 1; + if (auth == AUTH_NONE_OPEN) + auth = AUTH_NONE_WEP; + } else + encr = 0; + + ui->authSelect->setCurrentIndex(auth); + authChanged(auth); + ui->EncryptionSelect->setCurrentIndex(encr); + + //wepEnabled(auth == AUTH_NONE_WEP); + + //getEapCapa(); + + //if (flags.indexOf("[WPS") >= 0) + // useWpsButton->setEnabled(true); + //bssid = sel.text(1); +} + + +void NetworkManager::on_pushButtonAddNetworkd_pressed() +{ + addNetwork(); +} + +void NetworkManager::removeNetwork() +{ + char reply[10], cmd[256]; + size_t reply_len; + int id; + if (QMessageBox::information( + this, "wpa_gui", + tr("This will permanently remove the network\n" + "from the configuration. Do you really want\n" + "to remove this network?"), + tr("Yes"), tr("No")) != 0) + return; + id = ui->networkSelect->currentIndex(); + snprintf(cmd, sizeof(cmd), "REMOVE_NETWORK %d", id); + reply_len = sizeof(reply); + ctrlRequest(cmd, reply, &reply_len); + if (strncmp(reply, "OK", 2) != 0) { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to remove network from " + "wpa_supplicant\n" + "configuration.")); + } else { + triggerUpdate(); + ctrlRequest("SAVE_CONFIG", reply, &reply_len); + } +} + +void NetworkManager::on_pushButtonRemove_pressed() +{ + removeNetwork(); +} + + +void NetworkManager::on_GetJsonpushButton_clicked() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::question(this, tr("提示"),tr("是否去获取数据!"), QMessageBox::Ok | QMessageBox::Cancel); + if(ret != QMessageBox::Ok) + { + return; + } + +// qDebug()<<"on_GetJsonpushButton_clicked"; + QString str = "http://"; + //str += ui->SeverIP_lineEdit->text(); + QString ip_str; + ip_str = QString::number(sysPara->para.Json_IP[0]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[1]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[2]); + ip_str += "."; + ip_str += QString::number(sysPara->para.Json_IP[3]); + str += ip_str; + + str += ":"; + //str += ui->server_port_lineEdit->text(); + str +=QString::number(sysPara->para.Json_server_port); + + if(ui->TestradioButton->isChecked()){ +// qDebug()<<"get test value"; + // str += "/KLAPS/APSServer/ECode/GetProductUniqueCodeTest"; + str = "http://www.anhuikinglan.top:63025/KLAPS/APSServer/ECode/GetProductUniqueCodeTest"; + }else{ + str += "/KLAPS/APSServer/ECode/GetProductUniqueCode"; + } + + + //net_data->PrintNetGetData(str, ui->deviceID_lineEdit->text()); + net_data->PrintNetGetData(str, QString(sysPara->para.Json_device_code)); + ui->messege_info_label->setText(tr("获取数据中...")); +} + +void NetworkManager::onjson_timer_handler() +{ + static int count_time = 0; + + count_time++; + + ui->messege_info_label->setText( net_data->getMessege() ); + +// qDebug()<<"on_json_timer_handler"; + if(sysPara->para.totalProductCnt != 0 && sysPara->para.totalProductCnt >= sysPara->Get_JSON_DATA.ProductPlanQty){ + QString str = "http://"; + str += ui->SeverIP_lineEdit->text(); + str += ":"; + str += ui->server_port_lineEdit->text(); + + if(ui->TestradioButton->isChecked()){ + str += "/KLAPS/APSServer/ECode/UsedProductUniqueCodeTest"; + }else{ + str += "/KLAPS/APSServer/ECode/UsedProductUniqueCode"; + } + + net_data->PrintNetPostFinish(str); + sysPara->devOp->clearProductCnt(1 | 0x10 );// [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt = 0; + emit net_stopPrint(); + ui->messege_info_label->setText(tr("上报数据中...")); + + if(sysPara->Get_JSON_DATA.TaskSwitchingMode == 1){ + on_GetJsonpushButton_clicked(); + } + } + + if(count_time == 20){ + + count_time = 0; + QString str = "http://"; + str += ui->SeverIP_lineEdit->text(); + str += ":"; + str += ui->server_port_lineEdit->text(); + if(ui->TestradioButton->isChecked()){ + str += "/KLAPS/APSServer/ECode/SubmitEquipmentCurrentStateTest"; + }else{ + str += "/KLAPS/APSServer/ECode/SubmitEquipmentCurrentState"; + } + net_data->PrintNetPostFinish(str); + +// qDebug()<<"upload data"; + ui->messege_info_label->setText(tr("上报数据中...")); + + } + +} + +void NetworkManager::onjson_server_error() +{ +// ui->net_state_label->setText(tr("通信失败")); +// qDebug()<<"on_json_server_error"; +} + + + + +void NetworkManager::on_applicate_pushButton_clicked() +{ + QString ip_str = ui->SeverIP_lineEdit->text(); + QStringList ip_list = ip_str.split("."); + QString ip1,ip2,ip3,ip4; + + if (ip_list.size() < 4){ + QMessageBox::information(this,tr("提示"),tr("IP设置错误!")); + return; + } + ip1 = ip_list.at(0); + ip2 = ip_list.at(1); + ip3 = ip_list.at(2); + ip4 = ip_list.at(3); + + sysPara->para.Json_IP[0] = ip1.toInt(); + sysPara->para.Json_IP[1] = ip2.toInt(); + sysPara->para.Json_IP[2] = ip3.toInt(); + sysPara->para.Json_IP[3] = ip4.toInt(); + + if(sysPara->para.Json_IP[0] > 255 || sysPara->para.Json_IP[1] > 255 + ||sysPara->para.Json_IP[2] > 255 ||sysPara->para.Json_IP[3] > 255){ + QMessageBox::information(this,tr("提示"),tr("IP设置错误!")); + return; + } + +// strcpy(sysPara->para.Json_IP, std_str); + + //sysPara->para.Json_device_code = ui->deviceID_lineEdit->text().toInt(); + strncpy(sysPara->para.Json_device_code, ui->deviceID_lineEdit->text().toStdString().data(),sizeof(sysPara->para.Json_device_code)-1); + sysPara->para.Json_server_port = ui->server_port_lineEdit->text().toInt(); + sysPara->para.ModbusTCPPort = 5022; + QMessageBox::information(this,tr("提示"),tr("应用成功")); +// qDebug()<<"Json_device_code="<para.Json_device_code +// <<"Json_server_port="<para.Json_server_port +// <<"sysPara->para.Json_IP="<para.Json_IP[0] << sysPara->para.Json_IP[1] +// <para.Json_IP[2]<para.Json_IP[3]; + + sysPara->saveParaToFile(); +} + +//void NetworkManager::on_checkBoxShortNet_clicked(bool checked) +//{ +// net_data->m_bShortNet = checked; +//} + +void NetworkManager::on_checkBoxRemoveDigitCode_clicked(bool checked) +{ + sysPara->para.isRemoveDigitCode = checked; + emit OpenNewFile(); +} + +void NetworkManager::on_checkBoxRemoveCode_clicked(bool checked) +{ + //emit VariablePositionChange(checked); + sysPara->para.isRemoveCode = checked; + //emit OpenNewFile(); +} + +void NetworkManager::on_radioButtonGetDataEnable_clicked(bool checked) +{ + sysPara->para.isEnableGetDataButton = checked; +} + +void NetworkManager::updateAuthorization(int auth) +{ + if(auth & AUTH_SUPER_USER2) + { + ui->GetJsonpushButton->show(); + ui->GetJsonpushButton->show(); + ui->messege_info_label->show(); + ui->label->show(); + ui->deviceID_lineEdit->show(); + ui->label_2->show(); + ui->SeverIP_lineEdit->show(); + ui->label_4->show(); + ui->server_port_lineEdit->show(); + ui->TestradioButton->show(); +// ui->checkBoxShortNet->show(); + ui->checkBoxRemoveDigitCode->show(); + ui->applicate_pushButton->show(); + ui->checkBoxRemoveCode->show(); + ui->radioButtonGetDataEnable->show(); + } + else + { + ui->GetJsonpushButton->hide(); + ui->GetJsonpushButton->hide(); + ui->messege_info_label->hide(); + ui->label->hide(); + ui->deviceID_lineEdit->hide(); + ui->label_2->hide(); + ui->SeverIP_lineEdit->hide(); + ui->label_4->hide(); + ui->server_port_lineEdit->hide(); + ui->TestradioButton->hide(); +// ui->checkBoxShortNet->hide(); + ui->checkBoxRemoveDigitCode->hide(); + ui->applicate_pushButton->hide(); + ui->checkBoxRemoveCode->hide(); + ui->radioButtonGetDataEnable->hide(); + //sysPara->para.isEnableGetDataButton = false; + } +} + +void NetworkManager::on_spinBox_ModbusPort_valueChanged(const QString &arg1) +{ +// sysPara->para.ModbusTCPPort = ui->spinBox_ModbusPort->value(); +} diff --git a/Network/NetworkManager.h b/Network/NetworkManager.h new file mode 100644 index 0000000..5e56ca5 --- /dev/null +++ b/Network/NetworkManager.h @@ -0,0 +1,140 @@ +#ifndef __NETWORKMANAGER_H__ +#define __NETWORKMANAGER_H__ +#include +#include +#include +#include +#include "ParaSettingUI.h" +#include "wpamsg.h" +#include +#include "myinclude.h" +#include "print_net.h" + +namespace Ui { +class NetworkManager; +} +enum { + AUTH_NONE_OPEN, + AUTH_NONE_WEP, + AUTH_NONE_WEP_SHARED, + AUTH_IEEE8021X, + AUTH_WPA_PSK, + AUTH_WPA_EAP, + AUTH_WPA2_PSK, + AUTH_WPA2_EAP +}; +struct ScanResult{ + char ssid[50]; + char bssid[50]; + char qual[20]; + char flags[80]; +}; + +#define WPA_GUI_KEY_DATA "[key is configured]" + +class NetworkManager : public QWidget,public ParaSettingUI +{ + Q_OBJECT +public: + explicit NetworkManager(QWidget *parent = 0); + ~NetworkManager(); + void bindSysPara(SysPara *sysPara); + void applyUIPara(); + void updateSysStatusToUI(); + void applyLanUIPara(void); + qint32 isIpv4Address(QString ip); + void updateAuthorization(int auth); +#if 1 +public slots: + virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen); + virtual void updateStatus(); + virtual void updateResults(); + virtual void updateNetworks(); + virtual void selectSSID( const QString & sel ); + virtual void selectNetwork( const QString & sel ); + virtual void scan(); + virtual void processMsg(char *msg); + //virtual void processCtrlReq(const char *req); + virtual void receiveMsgs(); + virtual int setNetworkParam(int id, const char *field, + const char *value, bool quote); + virtual void addNetwork(); + virtual void triggerUpdate(); + virtual void authChanged(int sel); + virtual void ping(); + virtual void removeNetwork(); +#endif + +Q_SIGNALS: + void updateJSONData(); + + void net_startPrint(); + void net_pausePrint(); + void net_stopPrint(); + void OpenNewFile(); +private slots: + void on_pushButtonSetIP_clicked(bool checked); + + void on_pushButtonSetCancel_clicked(bool checked); + + void on_pushButtonScan_pressed(); + + void on_pushButtonConnect_pressed(); + + void on_pushButtonDisconnect_pressed(); + + void on_scanSSIDSelect_activated(const QString &arg1); + + void on_pushButtonAddNetworkd_pressed(); + + void on_pushButtonRemove_pressed(); + + void on_GetJsonpushButton_clicked(); + + void onfinish_get_json(); + + void onjson_timer_handler(); + + void onjson_server_error(); + + void on_applicate_pushButton_clicked(); + void ShowNet_dataMessege(); + //void on_checkBoxShortNet_clicked(bool checked); + void on_checkBoxRemoveDigitCode_clicked(bool checked); + void on_checkBoxRemoveCode_clicked(bool checked); + void on_radioButtonGetDataEnable_clicked(bool checked); + void on_spinBox_ModbusPort_valueChanged(const QString &arg1); + +private: + Ui::NetworkManager *ui; + QProcess *processNetwork; + bool networkMayHaveChanged; + bool beSentScanCmd; + char *ctrl_iface; + int edit_network_id; + struct wpa_ctrl *ctrl_conn; + int pingsToStatusUpdate; + //WpaMsgList msgs; + char *ctrl_iface_dir; + struct wpa_ctrl *monitor_conn; + //UserDataRequest *udr; + QSocketNotifier *msgNotifier; + WpaMsgList msgs; + //struct ScanResult scanResult[30]; + QMap scanResultMap; + + PrintNet *net_data; + + int openCtrlConnection(const char *ifname); + QString wpaStateTranslate(char *state); + QString bssid; + QTimer *timer; + + QTimer *Json_timer; + bool Jsom_timer_stop; + + bool wlanStartUpFailed; + + bool Json_ip_init_done; +}; +#endif // __NETWORKMANAGER_H__ diff --git a/Network/NetworkManager.ui b/Network/NetworkManager.ui new file mode 100644 index 0000000..637f29d --- /dev/null +++ b/Network/NetworkManager.ui @@ -0,0 +1,621 @@ + + + NetworkManager + + + true + + + + 0 + 0 + 640 + 448 + + + + Form + + + + + 10 + 10 + 541 + 193 + + + + + QLayout::SetDefaultConstraint + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + + + 255 + + + 255 + + + + + + + 255 + + + 255 + + + + + + + 0 + + + 255 + + + 255 + + + + + + + 0 + + + 255 + + + 0 + + + + + + + + + WiFi: + + + + + + + Mask: + + + + + + + GW: + + + + + + + IP: + + + + + + + + + + + + + + IP: + + + + + + + Status: + + + + + + + 取消 + + + + + + + 主获取数据按钮 + + + + + + + + + 0 + + + 255 + + + 0 + + + + + + + 255 + + + 0 + + + + + + + 0 + + + 255 + + + 0 + + + + + + + 0 + + + 254 + + + 1 + + + 0 + + + + + + + + + SSID: + + + + + + + 有线LAN + + + + + + + + + + + + + + 手动设定 + + + + + + + 断开 + + + + + + + + + 255 + + + + + + + 255 + + + + + + + 255 + + + + + + + 255 + + + 1 + + + + + + + + + false + + + + 135 + 37 + + + + 1 + + + 9999 + + + 1 + + + 5022 + + + + + + + + + 10 + 180 + 536 + 260 + + + + + + + + 200 + 16777215 + + + + + Plaintext (open / no authentication) + + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + + + + + 200 + 16777215 + + + + QLineEdit::PasswordEchoOnEdit + + + + + + + 设备码: + + + + + + + Encryption: + + + + + + + 服务IP: + + + + + + + + 200 + 16777215 + + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + + + + 8754 + + + + + + + 服务端口: + + + + + + + PSK: + + + + + + + + 200 + 16777215 + + + + + + + + + 200 + 16777215 + + + + + + + + 连接 + + + + + + + Password: + + + + + + + 扫描 + + + + + + + 清除 + + + + + + + auth: + + + + + + + + 200 + 16777215 + + + + QLineEdit::PasswordEchoOnEdit + + + + + + + 获取数据 + + + + + + + ScanSSID + + + + + + + Network: + + + + + + + 1 + + + + + + + 47.111.170.144 + + + + + + + + 200 + 16777215 + + + + 添加网络 + + + + + + + + + + + + + + 测试 + + + + + + + 应用配置 + + + + + + + 去掉数字码 + + + + + + + 去掉QR码 + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/.gitignore b/Network/wpa_gui-qt4_/.gitignore new file mode 100644 index 0000000..da818cb --- /dev/null +++ b/Network/wpa_gui-qt4_/.gitignore @@ -0,0 +1,4 @@ +.moc +.obj +.ui +qrc_icons.cpp diff --git a/Network/wpa_gui-qt4_/addinterface.cpp b/Network/wpa_gui-qt4_/addinterface.cpp new file mode 100644 index 0000000..88d4603 --- /dev/null +++ b/Network/wpa_gui-qt4_/addinterface.cpp @@ -0,0 +1,245 @@ +/* + * wpa_gui - AddInterface class + * Copyright (c) 2008, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include "common/wpa_ctrl.h" + +#include + +#include "wpagui.h" +#include "addinterface.h" + +#ifdef CONFIG_NATIVE_WINDOWS +#include + +#ifndef WPA_KEY_ROOT +#define WPA_KEY_ROOT HKEY_LOCAL_MACHINE +#endif +#ifndef WPA_KEY_PREFIX +#define WPA_KEY_PREFIX TEXT("SOFTWARE\\wpa_supplicant") +#endif +#endif /* CONFIG_NATIVE_WINDOWS */ + + +AddInterface::AddInterface(WpaGui *_wpagui, QWidget *parent) + : QDialog(parent), wpagui(_wpagui) +{ + setWindowTitle(tr("Select network interface to add")); + resize(400, 200); + vboxLayout = new QVBoxLayout(this); + + interfaceWidget = new QTreeWidget(this); + interfaceWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + interfaceWidget->setUniformRowHeights(true); + interfaceWidget->setSortingEnabled(true); + interfaceWidget->setColumnCount(3); + interfaceWidget->headerItem()->setText(0, tr("driver")); + interfaceWidget->headerItem()->setText(1, tr("interface")); + interfaceWidget->headerItem()->setText(2, tr("description")); + interfaceWidget->setItemsExpandable(FALSE); + interfaceWidget->setRootIsDecorated(FALSE); + vboxLayout->addWidget(interfaceWidget); + + connect(interfaceWidget, + SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, + SLOT(interfaceSelected(QTreeWidgetItem *))); + + addInterfaces(); +} + + +void AddInterface::addInterfaces() +{ +#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE + struct wpa_ctrl *ctrl; + int ret; + char buf[2048]; + size_t len; + + ctrl = wpa_ctrl_open(NULL); + if (ctrl == NULL) + return; + + len = sizeof(buf) - 1; + ret = wpa_ctrl_request(ctrl, "INTERFACE_LIST", 14, buf, &len, NULL); + if (ret < 0) { + wpa_ctrl_close(ctrl); + return; + } + buf[len] = '\0'; + + wpa_ctrl_close(ctrl); + + QString ifaces(buf); + QStringList lines = ifaces.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + QStringList arg = (*it).split(QChar('\t')); + if (arg.size() < 3) + continue; + QTreeWidgetItem *item = new QTreeWidgetItem(interfaceWidget); + if (!item) + break; + + item->setText(0, arg[0]); + item->setText(1, arg[1]); + item->setText(2, arg[2]); + } + + interfaceWidget->resizeColumnToContents(0); + interfaceWidget->resizeColumnToContents(1); + interfaceWidget->resizeColumnToContents(2); +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ +} + + +#ifdef CONFIG_NATIVE_WINDOWS +bool AddInterface::addRegistryInterface(const QString &ifname) +{ + HKEY hk, ihk; + LONG ret; + int id, tmp; + TCHAR name[10]; + DWORD val, i; + + ret = RegOpenKeyEx(WPA_KEY_ROOT, WPA_KEY_PREFIX TEXT("\\interfaces"), + 0, KEY_ENUMERATE_SUB_KEYS | KEY_CREATE_SUB_KEY, + &hk); + if (ret != ERROR_SUCCESS) + return false; + + id = -1; + + for (i = 0; ; i++) { + TCHAR name[255]; + DWORD namelen; + + namelen = 255; + ret = RegEnumKeyEx(hk, i, name, &namelen, NULL, NULL, NULL, + NULL); + + if (ret == ERROR_NO_MORE_ITEMS) + break; + + if (ret != ERROR_SUCCESS) + break; + + if (namelen >= 255) + namelen = 255 - 1; + name[namelen] = '\0'; + +#ifdef UNICODE + QString s((QChar *) name, namelen); +#else /* UNICODE */ + QString s(name); +#endif /* UNICODE */ + tmp = s.toInt(); + if (tmp > id) + id = tmp; + } + + id += 1; + +#ifdef UNICODE + wsprintf(name, L"%04d", id); +#else /* UNICODE */ + os_snprintf(name, sizeof(name), "%04d", id); +#endif /* UNICODE */ + ret = RegCreateKeyEx(hk, name, 0, NULL, 0, KEY_WRITE, NULL, &ihk, + NULL); + RegCloseKey(hk); + if (ret != ERROR_SUCCESS) + return false; + +#ifdef UNICODE + RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ, + (LPBYTE) ifname.unicode(), + (ifname.length() + 1) * sizeof(TCHAR)); + +#else /* UNICODE */ + RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ, + (LPBYTE) ifname.toLocal8Bit(), ifname.length() + 1); +#endif /* UNICODE */ + RegSetValueEx(ihk, TEXT("config"), 0, REG_SZ, + (LPBYTE) TEXT("default"), 8 * sizeof(TCHAR)); + RegSetValueEx(ihk, TEXT("ctrl_interface"), 0, REG_SZ, + (LPBYTE) TEXT(""), 1 * sizeof(TCHAR)); + val = 1; + RegSetValueEx(ihk, TEXT("skip_on_error"), 0, REG_DWORD, (LPBYTE) &val, + sizeof(val)); + + RegCloseKey(ihk); + return true; +} +#endif /* CONFIG_NATIVE_WINDOWS */ + + +void AddInterface::interfaceSelected(QTreeWidgetItem *sel) +{ + if (!sel) + return; + +#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE + struct wpa_ctrl *ctrl; + int ret; + char buf[20], cmd[256]; + size_t len; + + /* + * INTERFACE_ADD TABTABTABTAB + * TAB + */ + snprintf(cmd, sizeof(cmd), + "INTERFACE_ADD %s\t%s\t%s\t%s\t%s\t%s", + sel->text(1).toAscii().constData(), + "default", + sel->text(0).toAscii().constData(), + "yes", "", ""); + cmd[sizeof(cmd) - 1] = '\0'; + + ctrl = wpa_ctrl_open(NULL); + if (ctrl == NULL) + return; + + len = sizeof(buf) - 1; + ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL); + wpa_ctrl_close(ctrl); + + if (ret < 0) { + QMessageBox::warning(this, "wpa_gui", + tr("Add interface command could not be " + "completed.")); + return; + } + + buf[len] = '\0'; + if (buf[0] != 'O' || buf[1] != 'K') { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to add the interface.")); + return; + } + +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ + +#ifdef CONFIG_NATIVE_WINDOWS + if (!addRegistryInterface(sel->text(1))) { + QMessageBox::information(this, "wpa_gui", + tr("Failed to add the interface into " + "registry.")); + } +#endif /* CONFIG_NATIVE_WINDOWS */ + + wpagui->selectAdapter(sel->text(1)); + close(); +} diff --git a/Network/wpa_gui-qt4_/addinterface.h b/Network/wpa_gui-qt4_/addinterface.h new file mode 100644 index 0000000..9d9476a --- /dev/null +++ b/Network/wpa_gui-qt4_/addinterface.h @@ -0,0 +1,45 @@ +/* + * wpa_gui - AddInterface class + * Copyright (c) 2008, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef ADDINTERFACE_H +#define ADDINTERFACE_H + +#include + +#include +#include +#include + +class WpaGui; + +class AddInterface : public QDialog +{ + Q_OBJECT + +public: + AddInterface(WpaGui *_wpagui, QWidget *parent = 0); + +public slots: + virtual void interfaceSelected(QTreeWidgetItem *sel); + +private: + void addInterfaces(); + bool addRegistryInterface(const QString &ifname); + + QVBoxLayout *vboxLayout; + QTreeWidget *interfaceWidget; + WpaGui *wpagui; +}; + +#endif /* ADDINTERFACE_H */ diff --git a/Network/wpa_gui-qt4_/eventhistory.cpp b/Network/wpa_gui-qt4_/eventhistory.cpp new file mode 100644 index 0000000..1eb0b7b --- /dev/null +++ b/Network/wpa_gui-qt4_/eventhistory.cpp @@ -0,0 +1,130 @@ +/* + * wpa_gui - EventHistory class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include + +#include "eventhistory.h" + + +int EventListModel::rowCount(const QModelIndex &) const +{ + return msgList.count(); +} + + +int EventListModel::columnCount(const QModelIndex &) const +{ + return 2; +} + + +QVariant EventListModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role == Qt::DisplayRole) + if (index.column() == 0) { + if (index.row() >= timeList.size()) + return QVariant(); + return timeList.at(index.row()); + } else { + if (index.row() >= msgList.size()) + return QVariant(); + return msgList.at(index.row()); + } + else + return QVariant(); +} + + +QVariant EventListModel::headerData(int section, Qt::Orientation orientation, + int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (orientation == Qt::Horizontal) { + switch (section) { + case 0: + return QString(tr("Timestamp")); + case 1: + return QString(tr("Message")); + default: + return QVariant(); + } + } else + return QString("%1").arg(section); +} + + +void EventListModel::addEvent(QString time, QString msg) +{ + beginInsertRows(QModelIndex(), msgList.size(), msgList.size() + 1); + timeList << time; + msgList << msg; + endInsertRows(); +} + + +EventHistory::EventHistory(QWidget *parent, const char *, bool, Qt::WFlags) + : QDialog(parent) +{ + setupUi(this); + + connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); + + eventListView->setItemsExpandable(FALSE); + eventListView->setRootIsDecorated(FALSE); + elm = new EventListModel(parent); + eventListView->setModel(elm); +} + + +EventHistory::~EventHistory() +{ + destroy(); + delete elm; +} + + +void EventHistory::languageChange() +{ + retranslateUi(this); +} + + +void EventHistory::addEvents(WpaMsgList msgs) +{ + WpaMsgList::iterator it; + for (it = msgs.begin(); it != msgs.end(); it++) + addEvent(*it); +} + + +void EventHistory::addEvent(WpaMsg msg) +{ + bool scroll = true; + + if (eventListView->verticalScrollBar()->value() < + eventListView->verticalScrollBar()->maximum()) + scroll = false; + + elm->addEvent(msg.getTimestamp().toString("yyyy-MM-dd hh:mm:ss.zzz"), + msg.getMsg()); + + if (scroll) + eventListView->scrollToBottom(); +} diff --git a/Network/wpa_gui-qt4_/eventhistory.h b/Network/wpa_gui-qt4_/eventhistory.h new file mode 100644 index 0000000..40dff6d --- /dev/null +++ b/Network/wpa_gui-qt4_/eventhistory.h @@ -0,0 +1,63 @@ +/* + * wpa_gui - EventHistory class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef EVENTHISTORY_H +#define EVENTHISTORY_H + +#include +#include "ui_eventhistory.h" + + +class EventListModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + EventListModel(QObject *parent = 0) + : QAbstractTableModel(parent) {} + + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + void addEvent(QString time, QString msg); + +private: + QStringList timeList; + QStringList msgList; +}; + + +class EventHistory : public QDialog, public Ui::EventHistory +{ + Q_OBJECT + +public: + EventHistory(QWidget *parent = 0, const char *name = 0, + bool modal = false, Qt::WFlags fl = 0); + ~EventHistory(); + +public slots: + virtual void addEvents(WpaMsgList msgs); + virtual void addEvent(WpaMsg msg); + +protected slots: + virtual void languageChange(); + +private: + EventListModel *elm; +}; + +#endif /* EVENTHISTORY_H */ diff --git a/Network/wpa_gui-qt4_/eventhistory.ui b/Network/wpa_gui-qt4_/eventhistory.ui new file mode 100644 index 0000000..afe9149 --- /dev/null +++ b/Network/wpa_gui-qt4_/eventhistory.ui @@ -0,0 +1,61 @@ + + EventHistory + + + + 0 + 0 + 533 + 285 + + + + Event history + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOn + + + QAbstractItemView::NoSelection + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + + + + + wpamsg.h + + + + diff --git a/Network/wpa_gui-qt4_/icons.qrc b/Network/wpa_gui-qt4_/icons.qrc new file mode 100644 index 0000000..dd72c7e --- /dev/null +++ b/Network/wpa_gui-qt4_/icons.qrc @@ -0,0 +1,9 @@ + + + icons/wpa_gui.svg + icons/ap.svg + icons/laptop.svg + icons/group.svg + icons/invitation.svg + + diff --git a/Network/wpa_gui-qt4_/icons/README b/Network/wpa_gui-qt4_/icons/README new file mode 100644 index 0000000..3953238 --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/README @@ -0,0 +1,74 @@ +wpa_gui icon files + +To convert the svg icons to other formats, make sure inkscape and imagemagick +are installed and use `make' to create various sized png and xpm icons. + + +wpa_gui.svg +----------- + +Copyright (c) 2008 Bernard Gray + +The wpa_gui icon is licensed under the GPL version 2. Alternatively, the icon +may be distributed under the terms of BSD license. + + +ap.svg +------ + +mystica_Wireless_Router.svg + +http://openclipart.org/media/files/mystica/8390 +Wireless Router +by: mystica +last change: April 20, 2008 10:32 pm (File added) +date: April 20, 2008 10:31 pm +license: PD + + +laptop.svg +---------- + +metalmarious_Laptop.svg + +http://openclipart.org/media/files/metalmarious/4056 +Laptop +by: metalmarious +last change: May 18, 2008 07:04 pm (File added) +date: August 27, 2007 04:44 am +license: PD + + +group.svg +--------- + +http://www.openclipart.org/detail/25428 +http://www.openclipart.org/people/Anonymous/Anonymous_Network.svg +Uploader: + Anonymous +Drawn by: + Andrew Fitzsimon / Anonymous +Created: + 2009-04-29 04:07:37 +Description: + A network icon by Andrew Fitzsimon. Etiquette Icon set. + From 0.18 OCAL database. + +Public Domain + + + +invitation.svg +-------------- + +http://www.openclipart.org/detail/974 +http://www.openclipart.org/people/jean_victor_balin/jean_victor_balin_unknown_green.svg +Uploader: + jean_victor_balin +Drawn by: + jean_victor_balin +Created: + 2006-10-27 02:12:13 +Description: + +Public Domain diff --git a/Network/wpa_gui-qt4_/icons/ap.svg b/Network/wpa_gui-qt4_/icons/ap.svg new file mode 100644 index 0000000..51cc8ce --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/ap.svg @@ -0,0 +1,832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/icons/group.svg b/Network/wpa_gui-qt4_/icons/group.svg new file mode 100644 index 0000000..4ea959b --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/group.svg @@ -0,0 +1,616 @@ + + + + + + + Etiquette Icons + + + + hash + + filesystem + computer + icons + + + + + Andy Fitzsimon + + + + + Andy Fitzsimon + + + + + Andy Fitzsimon + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/icons/invitation.svg b/Network/wpa_gui-qt4_/icons/invitation.svg new file mode 100644 index 0000000..1a02d13 --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/invitation.svg @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Green Unknown + 2005-11-01 + + + Jean-Victor Balin + + + jean.victor.balin@gmail.com + + + + icon + + + + + + + + + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/icons/laptop.svg b/Network/wpa_gui-qt4_/icons/laptop.svg new file mode 100644 index 0000000..06235f0 --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/laptop.svg @@ -0,0 +1,1568 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/icons/wpa_gui.svg b/Network/wpa_gui-qt4_/icons/wpa_gui.svg new file mode 100644 index 0000000..b3abf0a --- /dev/null +++ b/Network/wpa_gui-qt4_/icons/wpa_gui.svg @@ -0,0 +1,256 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/icons_png.qrc b/Network/wpa_gui-qt4_/icons_png.qrc new file mode 100644 index 0000000..9a30b7f --- /dev/null +++ b/Network/wpa_gui-qt4_/icons_png.qrc @@ -0,0 +1,9 @@ + + + icons/hicolor/16x16/apps/wpa_gui.png + icons/hicolor/32x32/apps/ap.png + icons/hicolor/32x32/apps/laptop.png + icons/hicolor/32x32/apps/group.png + icons/hicolor/32x32/apps/invitation.png + + diff --git a/Network/wpa_gui-qt4_/lang/.gitignore b/Network/wpa_gui-qt4_/lang/.gitignore new file mode 100644 index 0000000..8df47d5 --- /dev/null +++ b/Network/wpa_gui-qt4_/lang/.gitignore @@ -0,0 +1 @@ +*.qm diff --git a/Network/wpa_gui-qt4_/lang/wpa_gui_de.ts b/Network/wpa_gui-qt4_/lang/wpa_gui_de.ts new file mode 100644 index 0000000..d7a9c89 --- /dev/null +++ b/Network/wpa_gui-qt4_/lang/wpa_gui_de.ts @@ -0,0 +1,1262 @@ + + + + + AddInterface + + + Select network interface to add + Wähle die Netzwerkschnittstelle zum hinzufügen aus + + + + driver + Treiber + + + + interface + Schnittstelle + + + + description + Beschreibung + + + + Add interface command could not be completed. + Das Schnittstellen hinzufügen Kommando konnte nicht abgeschlossen werden. + + + + Failed to add the interface. + Fehler beim hinzufügen der Schnittstelle. + + + + Failed to add the interface into registry. + Fehler beim hinzufügen der Schnittstelle in die Registry. + + + + ErrorMsg + + + wpa_gui error + wpa_gui Fehler + + + + EventHistory + + + Event history + Ereignis Historie + + + + Close + Schließen + + + + EventListModel + + + Timestamp + Zeit + + + + Message + Meldung + + + + NetworkConfig + + + NetworkConfig + + + + + Cancel + Abbrechen + + + + SSID + SSID + + + + Network name (Service Set IDentifier) + Netzwerkname (Service Set IDentifier) + + + + Authentication + Authentifizierung + + + + Plaintext (open / no authentication) + Plaintext (offen / keine Authentifizierung) + + + + Static WEP (no authentication) + Static WEP (keine Authentifizierung) + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + Encryption + Verschlüsselung + + + + None + Keine + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + PSK + + + + + WPA/WPA2 pre-shared key or passphrase + WPA/WPA2 Pre-Shared Key oder Passphrase + + + + EAP method + EAP Verfahren + + + + Identity + Identität + + + + Username/Identity for EAP methods + Nutzername/Identitär für die EAP Verfahren + + + + Password + Passwort + + + + Password for EAP methods + Passwort für die EAP Verfahren + + + + CA certificate + CA Zertifikat + + + + WEP keys + WEP Schlüssel + + + + key 0 + Schlüssel 0 + + + + key 1 + Schlüssel 1 + + + + key 3 + Schlüssel 3 + + + + key 2 + Schlüssel 2 + + + + Optional Settings + Optionale Einstellungen + + + + Network Identification String + Netzwerk Indentifikations Zeichenfolge + + + + Network Priority + Netzwerk Priorität + + + + IDString + + + + + Priority + Priorität + + + + Inner auth + Geheime Auth + + + + Add + Hinzufügen + + + + Remove + Entfernen + + + + WPS + + + + + WPA Pre-Shared Key Error + WPA Pre Shared Key Fehler + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + WPA PSK benötigt ein Passphrase mit 8 bis 63 Zeichen +oder 64 hexadezimal stelligen PSK + + + + Network ID Error + Netzwerk ID Fehler + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + Netzwerk ID Zeichnfolge beinhaltet ungültige Zeichen. +Es muss eine einfache Zeichnfolge aus [A-Za-z0-9_] ohne +Leerzeichen sein + + + + + Failed to add network to wpa_supplicant +configuration. + Hinzufügen des Netzwerks in die wpa_supplicant +Konfiguration fehlgeschlagen. + + + + Failed to enable network in wpa_supplicant +configuration. + Aktivieren des Netzwerks in der wpa_supplicant +Konfiguration fehlgeschlagen. + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + Dies wird das Netzwerk permanent aus +der Konfiguration entfernen. Möchtest du +das Netzwerk wirklich entfernen? + + + + Yes + Ja + + + + No + Nein + + + + Failed to remove network from wpa_supplicant +configuration. + Entfernen des Netzwerks aus der wpa_supplicant +Konfiguration fehlgeschlagen. + + + + Peers + + + Peers + + + + + Associated station + Verbundene Stationen + + + + AP + + + + + WPS AP + + + + + WPS PIN needed + WPS PIN wird benötigt + + + + ER: WPS AP + + + + + ER: WPS AP (Unconfigured) + ER: WPS AP (nicht konfiguriert) + + + + ER: WPS Enrollee + + + + + WPS Enrollee + + + + + Enter WPS PIN + WPS PIN Eingabe + + + + Connect (PBC) + Verbinden (PBC) + + + + Enroll (PBC) + Anmelden (PBC) + + + + Learn Configuration + Konfiguration lernen + + + + Properties + Eigenschaften + + + + Refresh + Aktualisieren + + + + PIN: + + + + + PIN for + Pin für + + + + Failed to set the WPS PIN. + Setzten des WPS PIN fehlgeschlagen. + + + + Peer Properties + Peer Eigenschaften + + + + Name: + + + + + Address: + + + + + UUID: + + + + + Primary Device Type: + Primärer Geräte Typ: + + + + SSID: + + + + + Configuration Methods: + Konfigurationsverfahren: + + + + [USBA] + + + + + [Ethernet] + + + + + [Label] + + + + + [Display] + + + + + [Ext. NFC Token] + + + + + [Int. NFC Token] + + + + + [NFC Interface] + + + + + [Push Button] + + + + + [Keypad] + + + + + Device Password ID: + Geräte Passwort ID: + + + + (Default PIN) + + + + + (User-specified PIN) + + + + + (Machine-specified PIN) + + + + + (Rekey) + + + + + (Push Button) + + + + + (Registrar-specified) + + + + + Failed to start WPS PBC. + Starten von WPS PBC fehlgeschlagen. + + + + AP PIN: + + + + + AP PIN for + AP PIN für + + + + Failed to start learning AP configuration. + Fehler beim erkennen der AP Konfiguration. + + + + ScanResults + + + Scan results + Scan Ergebnisse + + + + SSID + + + + + BSSID + + + + + frequency + Frequenz + + + + signal + Signal + + + + flags + Flags + + + + Scan + Scannen + + + + Close + Schließen + + + + UserDataRequest + + + Authentication credentials required + Authentifzierungs Beglaubigung nötig + + + + &OK + + + + + &Cancel + + + + + Password: + Passwort: + + + + New password: + Neues Passwort: + + + + Identity: + Identität: + + + + Private key passphrase: + Privater Key Passphrase: + + + + WpaGui + + + wpa_gui + + + + + Adapter: + + + + + Network: + Netzwerk: + + + + Current Status + Aktueller Status + + + + + Status: + + + + + Last message: + Letzte Meldung: + + + + Authentication: + Authentifizierung: + + + + Encryption: + Verschlüsselung: + + + + SSID: + + + + + BSSID: + + + + + IP address: + IP Adresse: + + + + Connect + Verbinden + + + + Disconnect + Trennen + + + + + Scan + Scannen + + + + Manage Networks + Netzwerke verwalten + + + + Enabled + Aktiviert + + + + Edit + Bearbeiten + + + + Remove + Entfernen + + + + Disabled + Deaktiviert + + + + Add + Hinzufügen + + + + WPS + + + + + PBC - push button + PBC - Taste + + + + Generate PIN + PIN erzeugen + + + + PIN: + + + + + Use AP PIN + AP PIN verwenden + + + + AP PIN: + + + + + &File + &Datei + + + + &Network + &Netzwerk + + + + &Help + &Hilfe + + + + Event &History + Ereignis &Historie + + + + &Save Configuration + Konfiguration &Speichern + + + + Ctrl+S + + + + + E&xit + &Beenden + + + + Ctrl+Q + + + + + &Add + &Hinzufügen + + + + &Edit + &Bearbeiten + + + + &Remove + &Entfernen + + + + E&nable All + Alle &aktivieren + + + + &Disable All + Alle &deaktivieren + + + + Re&move All + Alle &entfernen + + + + &Contents... + &Inhalt... + + + + &Index... + + + + + &About + &Über + + + + &Wi-Fi Protected Setup + + + + + &Peers + + + + + Stop Service + Dienst stoppen + + + + Start Service + Dienst starten + + + + Add Interface + Schnittstelle hinzufügen + + + + connecting to wpa_supplicant + Verbindungsaufbau zu wpa_supplicant + + + + wpa_supplicant service is not running. +Do you want to start it? + wpa_supplicant ist nicht gestartet. +Möchtest du ihn starten? + + + + Disconnected + Getrennt + + + + Inactive + Inaktiv + + + + Scanning + Scannen + + + + Authenticating + Authentifizieren + + + + Associating + Assoziieren + + + + Associated + Assoziiert + + + + 4-Way Handshake + 4-Wege Handshake + + + + Group Handshake + Gruppen Handshake + + + + Completed + Abgeschlossen + + + + Unknown + Unbekannt + + + + Could not get status from wpa_supplicant + Status konnte nicht von wpa_supplicant abgerufen werden + + + + No network interfaces in use. +Would you like to add one? + Es ist keine Netzwerkschnittstelle in verwendung. +Möchtest du eine hinzufügen? + + + + + + + Select any network + Wähle beliebiges Netzwerk + + + + Disconnected from network. + Getrennt vom Netzwerk. + + + + Connection to network established. + Verbindung zum Netzwerk wurde aufgebaut. + + + + + WPS AP in active PBC mode found + WPS AP im aktiven PBC Modus gefunden + + + + Press the PBC button on the screen to start registration + Drücke den PBC Knopf auf dem Bildschirm um die Registrierung zu starten + + + + WPS AP with recently selected registrar + WPS AP mit kürzlich ausgewähltem Registrator + + + + WPS AP detected + WPS AP erkannt + + + + PBC mode overlap detected + PBC Modus Overlap erkannt + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + Mehr als ein AP ist momentan im aktiven WPS PBC Modus. Versuch es in ein paar Minuten nochmal + + + + Network configuration received + Netzwerk Konfiguration empfangen + + + + Registration started + Registrierung gestartet + + + + Registrar does not yet know PIN + Registrator kennt den PIN noch nicht + + + + Registration failed + Registrierung fehlgeschlagen + + + + Registration succeeded + Registrierung erfolgreich + + + + + No Networks + Keine Netzwerke + + + + There are no networks to edit. + + Keine Netzwerke zum bearbeiten. + + + + + + Select A Network + Wähle ein Netzwerk + + + + Select a network from the list to edit it. + + Wähle ein Netzwerk aus der Liste zum bearbeiten. + + + + + There are no networks to remove. + + Es sind keine Netzwerke zum entfernen vorhanden. + + + + + Select a network from the list to remove it. + + Wähle ein Netzwerk aus der Liste zum entfernen. + + + + + Failed to save configuration + Speichern der Konfiguration fehlgeschlagen + + + + The configuration could not be saved. + +The update_config=1 configuration option +must be used for configuration saving to +be permitted. + + Die Konfiguration konnte nicht gespeichert werden. + +Die Einstellung update_config=1 muss gesetzt sein, +damit Konfigurationen gespeichert werden können. + + + + + Saved configuration + Konfiguration gespeichert + + + + The current configuration was saved. + + Die aktuelle Konfiguration wurde gespeichert. + + + + + - wpa_supplicant user interface + - wpa_supplicant Benutzerschnittstelle + + + + &Disconnect + &Trennen + + + + Re&connect + &Wiederverbinden + + + + &Event History + &Ereignis Historie + + + + Scan &Results + Scan E&rgebnisse + + + + S&tatus + + + + + &Show Window + &Fenster anzeigen + + + + &Hide Window + &Fenster ausblenden + + + + &Quit + &Beenden + + + + will keep running in the system tray. + wird weiterhin in der System Ablage laufen. + + + + systray + System Ablage + + + + The program will keep running in the system tray. + Das Programm wird weiterhin in der System Ablage laufen. + + + + Press the push button on the AP to start the PBC mode. + Drücke die Taste am AP um den PBC Modus zu starten. + + + + If you have not yet done so, press the push button on the AP to start the PBC mode. + Wenn Sie es noch nicht getan haben, so drücken Sie die Taste am AP um den PBC Modus zu starten. + + + + + Waiting for Registrar + Warte auf Registrator + + + + Enter the generated PIN into the Registrar (either the internal one in the AP or an external one). + Geben Sie den generierten PIN in der Registrierungsstelle ein (entweder der interne oder der externe im AP). + + + + WPS AP selected from scan results + WPS AP ausgewählt aus Scan Ergebnissen + + + + If you want to use an AP device PIN, e.g., from a label in the device, enter the eight digit AP PIN and click Use AP PIN button. + Wenn Sie einen AP Geräte PIN verwenden möchten, z.B.: von einem Aufkleber am Gerät, geben Sie denn acht stelligen AP PIN ein und klicken Sie auf den AP PIN Knopf. + + + + Waiting for AP/Enrollee + Warte auf AP/Bewerber + + + + Connected to the network + Verbunden zum Netzwerk + + + + Stopped + Gestoppt + + + + + OpenSCManager failed + OpenSCManager fehlgeschlagen + + + + + OpenService failed + OpenService fehlgeschlagen + + + + Failed to start wpa_supplicant service + Starten des wpa_supplicant Dienstes fehlgeschlagen + + + + Failed to stop wpa_supplicant service + Stoppen des wpa_supplicant Dienstes fehlgeschlagen + + + OpenSCManager failed: %d + + OpenSCManager fehlgeschlagen: %d + + + + OpenService failed: %d + + + OpenService fehlgeschlagen: %d + + + + + diff --git a/Network/wpa_gui-qt4_/main.cpp b/Network/wpa_gui-qt4_/main.cpp new file mode 100644 index 0000000..6170b15 --- /dev/null +++ b/Network/wpa_gui-qt4_/main.cpp @@ -0,0 +1,82 @@ +/* + * wpa_gui - Application startup + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifdef CONFIG_NATIVE_WINDOWS +#include +#endif /* CONFIG_NATIVE_WINDOWS */ +#include +#include +#include +#include "wpagui.h" + + +class WpaGuiApp : public QApplication +{ +public: + WpaGuiApp(int &argc, char **argv); + +#ifndef QT_NO_SESSIONMANAGER + virtual void saveState(QSessionManager &manager); +#endif + + WpaGui *w; +}; + +WpaGuiApp::WpaGuiApp(int &argc, char **argv) : QApplication(argc, argv) +{ +} + +#ifndef QT_NO_SESSIONMANAGER +void WpaGuiApp::saveState(QSessionManager &manager) +{ + QApplication::saveState(manager); + w->saveState(); +} +#endif + + +int main(int argc, char *argv[]) +{ + WpaGuiApp app(argc, argv); + QTranslator translator; + QString locale; + QString resourceDir; + int ret; + + locale = QLocale::system().name(); + resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (!translator.load("wpa_gui_" + locale, resourceDir)) + translator.load("wpa_gui_" + locale, "lang"); + app.installTranslator(&translator); + + WpaGui w(&app); + +#ifdef CONFIG_NATIVE_WINDOWS + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2, 0), &wsaData)) { + /* printf("Could not find a usable WinSock.dll\n"); */ + return -1; + } +#endif /* CONFIG_NATIVE_WINDOWS */ + + app.w = &w; + + ret = app.exec(); + +#ifdef CONFIG_NATIVE_WINDOWS + WSACleanup(); +#endif /* CONFIG_NATIVE_WINDOWS */ + + return ret; +} diff --git a/Network/wpa_gui-qt4_/networkconfig.cpp b/Network/wpa_gui-qt4_/networkconfig.cpp new file mode 100644 index 0000000..fe50a8d --- /dev/null +++ b/Network/wpa_gui-qt4_/networkconfig.cpp @@ -0,0 +1,858 @@ +/* + * wpa_gui - NetworkConfig class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include + +#include "networkconfig.h" +#include "wpagui.h" + +enum { + AUTH_NONE_OPEN, + AUTH_NONE_WEP, + AUTH_NONE_WEP_SHARED, + AUTH_IEEE8021X, + AUTH_WPA_PSK, + AUTH_WPA_EAP, + AUTH_WPA2_PSK, + AUTH_WPA2_EAP +}; + +#define WPA_GUI_KEY_DATA "[key is configured]" + + +NetworkConfig::NetworkConfig(QWidget *parent, const char *, bool, Qt::WFlags) + : QDialog(parent) +{ + setupUi(this); + + encrSelect->setEnabled(false); + connect(authSelect, SIGNAL(activated(int)), this, + SLOT(authChanged(int))); + connect(cancelButton, SIGNAL(clicked()), this, SLOT(close())); + connect(addButton, SIGNAL(clicked()), this, SLOT(addNetwork())); + connect(encrSelect, SIGNAL(activated(const QString &)), this, + SLOT(encrChanged(const QString &))); + connect(removeButton, SIGNAL(clicked()), this, SLOT(removeNetwork())); + connect(eapSelect, SIGNAL(activated(int)), this, + SLOT(eapChanged(int))); + connect(useWpsButton, SIGNAL(clicked()), this, SLOT(useWps())); + + wpagui = NULL; + new_network = false; +} + + +NetworkConfig::~NetworkConfig() +{ +} + + +void NetworkConfig::languageChange() +{ + retranslateUi(this); +} + + +void NetworkConfig::paramsFromScanResults(QTreeWidgetItem *sel) +{ + new_network = true; + + /* SSID BSSID frequency signal flags */ + setWindowTitle(sel->text(0)); + ssidEdit->setText(sel->text(0)); + + QString flags = sel->text(4); + int auth, encr = 0; + if (flags.indexOf("[WPA2-EAP") >= 0) + auth = AUTH_WPA2_EAP; + else if (flags.indexOf("[WPA-EAP") >= 0) + auth = AUTH_WPA_EAP; + else if (flags.indexOf("[WPA2-PSK") >= 0) + auth = AUTH_WPA2_PSK; + else if (flags.indexOf("[WPA-PSK") >= 0) + auth = AUTH_WPA_PSK; + else + auth = AUTH_NONE_OPEN; + + if (flags.indexOf("-CCMP") >= 0) + encr = 1; + else if (flags.indexOf("-TKIP") >= 0) + encr = 0; + else if (flags.indexOf("WEP") >= 0) { + encr = 1; + if (auth == AUTH_NONE_OPEN) + auth = AUTH_NONE_WEP; + } else + encr = 0; + + authSelect->setCurrentIndex(auth); + authChanged(auth); + encrSelect->setCurrentIndex(encr); + + wepEnabled(auth == AUTH_NONE_WEP); + + getEapCapa(); + + if (flags.indexOf("[WPS") >= 0) + useWpsButton->setEnabled(true); + bssid = sel->text(1); +} + + +void NetworkConfig::authChanged(int sel) +{ + encrSelect->setEnabled(sel != AUTH_NONE_OPEN && sel != AUTH_NONE_WEP && + sel != AUTH_NONE_WEP_SHARED); + pskEdit->setEnabled(sel == AUTH_WPA_PSK || sel == AUTH_WPA2_PSK); + bool eap = sel == AUTH_IEEE8021X || sel == AUTH_WPA_EAP || + sel == AUTH_WPA2_EAP; + eapSelect->setEnabled(eap); + identityEdit->setEnabled(eap); + passwordEdit->setEnabled(eap); + cacertEdit->setEnabled(eap); + phase2Select->setEnabled(eap); + if (eap) + eapChanged(eapSelect->currentIndex()); + + while (encrSelect->count()) + encrSelect->removeItem(0); + + if (sel == AUTH_NONE_OPEN || sel == AUTH_NONE_WEP || + sel == AUTH_NONE_WEP_SHARED || sel == AUTH_IEEE8021X) { + encrSelect->addItem("None"); + encrSelect->addItem("WEP"); + encrSelect->setCurrentIndex(sel == AUTH_NONE_OPEN ? 0 : 1); + } else { + encrSelect->addItem("TKIP"); + encrSelect->addItem("CCMP"); + encrSelect->setCurrentIndex((sel == AUTH_WPA2_PSK || + sel == AUTH_WPA2_EAP) ? 1 : 0); + } + + wepEnabled(sel == AUTH_NONE_WEP || sel == AUTH_NONE_WEP_SHARED); +} + + +void NetworkConfig::eapChanged(int sel) +{ + QString prev_val = phase2Select->currentText(); + while (phase2Select->count()) + phase2Select->removeItem(0); + + QStringList inner; + inner << "PEAP" << "TTLS" << "FAST"; + if (!inner.contains(eapSelect->itemText(sel))) + return; + + phase2Select->addItem("[ any ]"); + + /* Add special cases based on outer method */ + if (eapSelect->currentText().compare("TTLS") == 0) { + phase2Select->addItem("PAP"); + phase2Select->addItem("CHAP"); + phase2Select->addItem("MSCHAP"); + phase2Select->addItem("MSCHAPv2"); + } else if (eapSelect->currentText().compare("FAST") == 0) + phase2Select->addItem("GTC(auth) + MSCHAPv2(prov)"); + + /* Add all enabled EAP methods that can be used in the tunnel */ + int i; + QStringList allowed; + allowed << "MSCHAPV2" << "MD5" << "GTC" << "TLS" << "OTP" << "SIM" + << "AKA"; + for (i = 0; i < eapSelect->count(); i++) { + if (allowed.contains(eapSelect->itemText(i))) { + phase2Select->addItem("EAP-" + eapSelect->itemText(i)); + } + } + + for (i = 0; i < phase2Select->count(); i++) { + if (phase2Select->itemText(i).compare(prev_val) == 0) { + phase2Select->setCurrentIndex(i); + break; + } + } +} + + +void NetworkConfig::addNetwork() +{ + char reply[10], cmd[256]; + size_t reply_len; + int id; + int psklen = pskEdit->text().length(); + int auth = authSelect->currentIndex(); + + if (auth == AUTH_WPA_PSK || auth == AUTH_WPA2_PSK) { + if (psklen < 8 || psklen > 64) { + QMessageBox::warning( + this, + tr("WPA Pre-Shared Key Error"), + tr("WPA-PSK requires a passphrase of 8 to 63 " + "characters\n" + "or 64 hex digit PSK")); + pskEdit->setFocus(); + return; + } + } + + if (idstrEdit->isEnabled() && !idstrEdit->text().isEmpty()) { + QRegExp rx("^(\\w|-)+$"); + if (rx.indexIn(idstrEdit->text()) < 0) { + QMessageBox::warning( + this, tr("Network ID Error"), + tr("Network ID String contains non-word " + "characters.\n" + "It must be a simple string, " + "without spaces, containing\n" + "only characters in this range: " + "[A-Za-z0-9_-]\n")); + idstrEdit->setFocus(); + return; + } + } + + if (wpagui == NULL) + return; + + memset(reply, 0, sizeof(reply)); + reply_len = sizeof(reply) - 1; + + if (new_network) { + wpagui->ctrlRequest("ADD_NETWORK", reply, &reply_len); + if (reply[0] == 'F') { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to add " + "network to wpa_supplicant\n" + "configuration.")); + return; + } + id = atoi(reply); + } else + id = edit_network_id; + + setNetworkParam(id, "ssid", ssidEdit->text().toAscii().constData(), + true); + + const char *key_mgmt = NULL, *proto = NULL, *pairwise = NULL; + switch (auth) { + case AUTH_NONE_OPEN: + case AUTH_NONE_WEP: + case AUTH_NONE_WEP_SHARED: + key_mgmt = "NONE"; + break; + case AUTH_IEEE8021X: + key_mgmt = "IEEE8021X"; + break; + case AUTH_WPA_PSK: + key_mgmt = "WPA-PSK"; + proto = "WPA"; + break; + case AUTH_WPA_EAP: + key_mgmt = "WPA-EAP"; + proto = "WPA"; + break; + case AUTH_WPA2_PSK: + key_mgmt = "WPA-PSK"; + proto = "WPA2"; + break; + case AUTH_WPA2_EAP: + key_mgmt = "WPA-EAP"; + proto = "WPA2"; + break; + } + + if (auth == AUTH_NONE_WEP_SHARED) + setNetworkParam(id, "auth_alg", "SHARED", false); + else + setNetworkParam(id, "auth_alg", "OPEN", false); + + if (auth == AUTH_WPA_PSK || auth == AUTH_WPA_EAP || + auth == AUTH_WPA2_PSK || auth == AUTH_WPA2_EAP) { + int encr = encrSelect->currentIndex(); + if (encr == 0) + pairwise = "TKIP"; + else + pairwise = "CCMP"; + } + + if (proto) + setNetworkParam(id, "proto", proto, false); + if (key_mgmt) + setNetworkParam(id, "key_mgmt", key_mgmt, false); + if (pairwise) { + setNetworkParam(id, "pairwise", pairwise, false); + setNetworkParam(id, "group", "TKIP CCMP WEP104 WEP40", false); + } + if (pskEdit->isEnabled() && + strcmp(pskEdit->text().toAscii().constData(), + WPA_GUI_KEY_DATA) != 0) + setNetworkParam(id, "psk", + pskEdit->text().toAscii().constData(), + psklen != 64); + if (eapSelect->isEnabled()) { + const char *eap = + eapSelect->currentText().toAscii().constData(); + setNetworkParam(id, "eap", eap, false); + if (strcmp(eap, "SIM") == 0 || strcmp(eap, "AKA") == 0) + setNetworkParam(id, "pcsc", "", true); + else + setNetworkParam(id, "pcsc", "NULL", false); + } + if (phase2Select->isEnabled()) { + QString eap = eapSelect->currentText(); + QString inner = phase2Select->currentText(); + char phase2[32]; + phase2[0] = '\0'; + if (eap.compare("PEAP") == 0) { + if (inner.startsWith("EAP-")) + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + } else if (eap.compare("TTLS") == 0) { + if (inner.startsWith("EAP-")) + snprintf(phase2, sizeof(phase2), "autheap=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + else + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.toAscii().constData()); + } else if (eap.compare("FAST") == 0) { + const char *provisioning = NULL; + if (inner.startsWith("EAP-")) { + snprintf(phase2, sizeof(phase2), "auth=%s", + inner.right(inner.size() - 4). + toAscii().constData()); + provisioning = "fast_provisioning=2"; + } else if (inner.compare("GTC(auth) + MSCHAPv2(prov)") + == 0) { + snprintf(phase2, sizeof(phase2), + "auth=GTC auth=MSCHAPV2"); + provisioning = "fast_provisioning=1"; + } else + provisioning = "fast_provisioning=3"; + if (provisioning) { + char blob[32]; + setNetworkParam(id, "phase1", provisioning, + true); + snprintf(blob, sizeof(blob), + "blob://fast-pac-%d", id); + setNetworkParam(id, "pac_file", blob, true); + } + } + if (phase2[0]) + setNetworkParam(id, "phase2", phase2, true); + else + setNetworkParam(id, "phase2", "NULL", false); + } else + setNetworkParam(id, "phase2", "NULL", false); + if (identityEdit->isEnabled() && identityEdit->text().length() > 0) + setNetworkParam(id, "identity", + identityEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "identity", "NULL", false); + if (passwordEdit->isEnabled() && passwordEdit->text().length() > 0 && + strcmp(passwordEdit->text().toAscii().constData(), + WPA_GUI_KEY_DATA) != 0) + setNetworkParam(id, "password", + passwordEdit->text().toAscii().constData(), + true); + else if (passwordEdit->text().length() == 0) + setNetworkParam(id, "password", "NULL", false); + if (cacertEdit->isEnabled() && cacertEdit->text().length() > 0) + setNetworkParam(id, "ca_cert", + cacertEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "ca_cert", "NULL", false); + writeWepKey(id, wep0Edit, 0); + writeWepKey(id, wep1Edit, 1); + writeWepKey(id, wep2Edit, 2); + writeWepKey(id, wep3Edit, 3); + + if (wep0Radio->isEnabled() && wep0Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "0", false); + else if (wep1Radio->isEnabled() && wep1Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "1", false); + else if (wep2Radio->isEnabled() && wep2Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "2", false); + else if (wep3Radio->isEnabled() && wep3Radio->isChecked()) + setNetworkParam(id, "wep_tx_keyidx", "3", false); + + if (idstrEdit->isEnabled() && idstrEdit->text().length() > 0) + setNetworkParam(id, "id_str", + idstrEdit->text().toAscii().constData(), + true); + else + setNetworkParam(id, "id_str", "NULL", false); + + if (prioritySpinBox->isEnabled()) { + QString prio; + prio = prio.setNum(prioritySpinBox->value()); + setNetworkParam(id, "priority", prio.toAscii().constData(), + false); + } + + snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %d", id); + reply_len = sizeof(reply); + wpagui->ctrlRequest(cmd, reply, &reply_len); + if (strncmp(reply, "OK", 2) != 0) { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to enable " + "network in wpa_supplicant\n" + "configuration.")); + /* Network was added, so continue anyway */ + } + wpagui->triggerUpdate(); + wpagui->ctrlRequest("SAVE_CONFIG", reply, &reply_len); + + close(); +} + + +void NetworkConfig::setWpaGui(WpaGui *_wpagui) +{ + wpagui = _wpagui; +} + + +int NetworkConfig::setNetworkParam(int id, const char *field, + const char *value, bool quote) +{ + char reply[10], cmd[256]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "SET_NETWORK %d %s %s%s%s", + id, field, quote ? "\"" : "", value, quote ? "\"" : ""); + reply_len = sizeof(reply); + wpagui->ctrlRequest(cmd, reply, &reply_len); + return strncmp(reply, "OK", 2) == 0 ? 0 : -1; +} + + +void NetworkConfig::encrChanged(const QString &) +{ +} + + +void NetworkConfig::wepEnabled(bool enabled) +{ + wep0Edit->setEnabled(enabled); + wep1Edit->setEnabled(enabled); + wep2Edit->setEnabled(enabled); + wep3Edit->setEnabled(enabled); + wep0Radio->setEnabled(enabled); + wep1Radio->setEnabled(enabled); + wep2Radio->setEnabled(enabled); + wep3Radio->setEnabled(enabled); +} + + +void NetworkConfig::writeWepKey(int network_id, QLineEdit *edit, int id) +{ + char buf[10]; + bool hex; + const char *txt, *pos; + size_t len; + + if (!edit->isEnabled() || edit->text().isEmpty()) + return; + + /* + * Assume hex key if only hex characters are present and length matches + * with 40, 104, or 128-bit key + */ + txt = edit->text().toAscii().constData(); + if (strcmp(txt, WPA_GUI_KEY_DATA) == 0) + return; + len = strlen(txt); + if (len == 0) + return; + pos = txt; + hex = true; + while (*pos) { + if (!((*pos >= '0' && *pos <= '9') || + (*pos >= 'a' && *pos <= 'f') || + (*pos >= 'A' && *pos <= 'F'))) { + hex = false; + break; + } + pos++; + } + if (hex && len != 10 && len != 26 && len != 32) + hex = false; + snprintf(buf, sizeof(buf), "wep_key%d", id); + setNetworkParam(network_id, buf, txt, !hex); +} + + +static int key_value_isset(const char *reply, size_t reply_len) +{ + return reply_len > 0 && (reply_len < 4 || memcmp(reply, "FAIL", 4) != 0); +} + + +void NetworkConfig::paramsFromConfig(int network_id) +{ + int i, res; + + edit_network_id = network_id; + getEapCapa(); + + char reply[1024], cmd[256], *pos; + size_t reply_len; + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d ssid", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + ssidEdit->setText(reply + 1); + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d proto", network_id); + reply_len = sizeof(reply) - 1; + int wpa = 0; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) { + reply[reply_len] = '\0'; + if (strstr(reply, "RSN") || strstr(reply, "WPA2")) + wpa = 2; + else if (strstr(reply, "WPA")) + wpa = 1; + } + + int auth = AUTH_NONE_OPEN, encr = 0; + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d key_mgmt", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) { + reply[reply_len] = '\0'; + if (strstr(reply, "WPA-EAP")) + auth = wpa & 2 ? AUTH_WPA2_EAP : AUTH_WPA_EAP; + else if (strstr(reply, "WPA-PSK")) + auth = wpa & 2 ? AUTH_WPA2_PSK : AUTH_WPA_PSK; + else if (strstr(reply, "IEEE8021X")) { + auth = AUTH_IEEE8021X; + encr = 1; + } + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d pairwise", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) { + reply[reply_len] = '\0'; + if (strstr(reply, "CCMP") && auth != AUTH_NONE_OPEN && + auth != AUTH_NONE_WEP && auth != AUTH_NONE_WEP_SHARED) + encr = 1; + else if (strstr(reply, "TKIP")) + encr = 0; + else if (strstr(reply, "WEP")) + encr = 1; + else + encr = 0; + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d psk", network_id); + reply_len = sizeof(reply) - 1; + res = wpagui->ctrlRequest(cmd, reply, &reply_len); + if (res >= 0 && reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + pskEdit->setText(reply + 1); + } else if (res >= 0 && key_value_isset(reply, reply_len)) { + pskEdit->setText(WPA_GUI_KEY_DATA); + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d identity", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + identityEdit->setText(reply + 1); + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d password", network_id); + reply_len = sizeof(reply) - 1; + res = wpagui->ctrlRequest(cmd, reply, &reply_len); + if (res >= 0 && reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + passwordEdit->setText(reply + 1); + } else if (res >= 0 && key_value_isset(reply, reply_len)) { + passwordEdit->setText(WPA_GUI_KEY_DATA); + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d ca_cert", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + cacertEdit->setText(reply + 1); + } + + enum { NO_INNER, PEAP_INNER, TTLS_INNER, FAST_INNER } eap = NO_INNER; + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d eap", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 1) { + reply[reply_len] = '\0'; + for (i = 0; i < eapSelect->count(); i++) { + if (eapSelect->itemText(i).compare(reply) == 0) { + eapSelect->setCurrentIndex(i); + if (strcmp(reply, "PEAP") == 0) + eap = PEAP_INNER; + else if (strcmp(reply, "TTLS") == 0) + eap = TTLS_INNER; + else if (strcmp(reply, "FAST") == 0) + eap = FAST_INNER; + break; + } + } + } + + if (eap != NO_INNER) { + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d phase2", + network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 1) { + reply[reply_len] = '\0'; + eapChanged(eapSelect->currentIndex()); + } else + eap = NO_INNER; + } + + char *val; + val = reply + 1; + while (*(val + 1)) + val++; + if (*val == '"') + *val = '\0'; + + switch (eap) { + case PEAP_INNER: + if (strncmp(reply, "\"auth=", 6)) + break; + val = reply + 2; + memcpy(val, "EAP-", 4); + break; + case TTLS_INNER: + if (strncmp(reply, "\"autheap=", 9) == 0) { + val = reply + 5; + memcpy(val, "EAP-", 4); + } else if (strncmp(reply, "\"auth=", 6) == 0) + val = reply + 6; + break; + case FAST_INNER: + if (strncmp(reply, "\"auth=", 6)) + break; + if (strcmp(reply + 6, "GTC auth=MSCHAPV2") == 0) { + val = (char *) "GTC(auth) + MSCHAPv2(prov)"; + break; + } + val = reply + 2; + memcpy(val, "EAP-", 4); + break; + case NO_INNER: + break; + } + + for (i = 0; i < phase2Select->count(); i++) { + if (phase2Select->itemText(i).compare(val) == 0) { + phase2Select->setCurrentIndex(i); + break; + } + } + + for (i = 0; i < 4; i++) { + QLineEdit *wepEdit; + switch (i) { + default: + case 0: + wepEdit = wep0Edit; + break; + case 1: + wepEdit = wep1Edit; + break; + case 2: + wepEdit = wep2Edit; + break; + case 3: + wepEdit = wep3Edit; + break; + } + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d wep_key%d", + network_id, i); + reply_len = sizeof(reply) - 1; + res = wpagui->ctrlRequest(cmd, reply, &reply_len); + if (res >= 0 && reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + if (auth == AUTH_NONE_OPEN || auth == AUTH_IEEE8021X) { + if (auth == AUTH_NONE_OPEN) + auth = AUTH_NONE_WEP; + encr = 1; + } + + wepEdit->setText(reply + 1); + } else if (res >= 0 && key_value_isset(reply, reply_len)) { + if (auth == AUTH_NONE_OPEN || auth == AUTH_IEEE8021X) { + if (auth == AUTH_NONE_OPEN) + auth = AUTH_NONE_WEP; + encr = 1; + } + wepEdit->setText(WPA_GUI_KEY_DATA); + } + } + + if (auth == AUTH_NONE_WEP) { + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d auth_alg", + network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) { + reply[reply_len] = '\0'; + if (strcmp(reply, "SHARED") == 0) + auth = AUTH_NONE_WEP_SHARED; + } + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d wep_tx_keyidx", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && reply_len >= 1) + { + reply[reply_len] = '\0'; + switch (atoi(reply)) { + case 0: + wep0Radio->setChecked(true); + break; + case 1: + wep1Radio->setChecked(true); + break; + case 2: + wep2Radio->setChecked(true); + break; + case 3: + wep3Radio->setChecked(true); + break; + } + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d id_str", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && + reply_len >= 2 && reply[0] == '"') { + reply[reply_len] = '\0'; + pos = strchr(reply + 1, '"'); + if (pos) + *pos = '\0'; + idstrEdit->setText(reply + 1); + } + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d priority", network_id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && reply_len >= 1) + { + reply[reply_len] = '\0'; + prioritySpinBox->setValue(atoi(reply)); + } + + authSelect->setCurrentIndex(auth); + authChanged(auth); + encrSelect->setCurrentIndex(encr); + wepEnabled(auth == AUTH_NONE_WEP || auth == AUTH_NONE_WEP_SHARED); + + removeButton->setEnabled(true); + addButton->setText("Save"); +} + + +void NetworkConfig::removeNetwork() +{ + char reply[10], cmd[256]; + size_t reply_len; + + if (QMessageBox::information( + this, "wpa_gui", + tr("This will permanently remove the network\n" + "from the configuration. Do you really want\n" + "to remove this network?"), + tr("Yes"), tr("No")) != 0) + return; + + snprintf(cmd, sizeof(cmd), "REMOVE_NETWORK %d", edit_network_id); + reply_len = sizeof(reply); + wpagui->ctrlRequest(cmd, reply, &reply_len); + if (strncmp(reply, "OK", 2) != 0) { + QMessageBox::warning(this, "wpa_gui", + tr("Failed to remove network from " + "wpa_supplicant\n" + "configuration.")); + } else { + wpagui->triggerUpdate(); + wpagui->ctrlRequest("SAVE_CONFIG", reply, &reply_len); + } + + close(); +} + + +void NetworkConfig::newNetwork() +{ + new_network = true; + getEapCapa(); +} + + +void NetworkConfig::getEapCapa() +{ + char reply[256]; + size_t reply_len; + + if (wpagui == NULL) + return; + + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("GET_CAPABILITY eap", reply, &reply_len) < 0) + return; + reply[reply_len] = '\0'; + + QString res(reply); + QStringList types = res.split(QChar(' ')); + eapSelect->insertItems(-1, types); +} + + +void NetworkConfig::useWps() +{ + if (wpagui == NULL) + return; + wpagui->setBssFromScan(bssid); + wpagui->wpsDialog(); + close(); +} diff --git a/Network/wpa_gui-qt4_/networkconfig.h b/Network/wpa_gui-qt4_/networkconfig.h new file mode 100644 index 0000000..0ceeb41 --- /dev/null +++ b/Network/wpa_gui-qt4_/networkconfig.h @@ -0,0 +1,61 @@ +/* + * wpa_gui - NetworkConfig class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef NETWORKCONFIG_H +#define NETWORKCONFIG_H + +#include +#include "ui_networkconfig.h" + +class WpaGui; + +class NetworkConfig : public QDialog, public Ui::NetworkConfig +{ + Q_OBJECT + +public: + NetworkConfig(QWidget *parent = 0, const char *name = 0, + bool modal = false, Qt::WFlags fl = 0); + ~NetworkConfig(); + + virtual void paramsFromScanResults(QTreeWidgetItem *sel); + virtual void setWpaGui(WpaGui *_wpagui); + virtual int setNetworkParam(int id, const char *field, + const char *value, bool quote); + virtual void paramsFromConfig(int network_id); + virtual void newNetwork(); + +public slots: + virtual void authChanged(int sel); + virtual void addNetwork(); + virtual void encrChanged(const QString &sel); + virtual void writeWepKey(int network_id, QLineEdit *edit, int id); + virtual void removeNetwork(); + virtual void eapChanged(int sel); + virtual void useWps(); + +protected slots: + virtual void languageChange(); + +private: + WpaGui *wpagui; + int edit_network_id; + bool new_network; + QString bssid; + + virtual void wepEnabled(bool enabled); + virtual void getEapCapa(); +}; + +#endif /* NETWORKCONFIG_H */ diff --git a/Network/wpa_gui-qt4_/networkconfig.ui b/Network/wpa_gui-qt4_/networkconfig.ui new file mode 100644 index 0000000..217a8ff --- /dev/null +++ b/Network/wpa_gui-qt4_/networkconfig.ui @@ -0,0 +1,435 @@ + + NetworkConfig + + + + 0 + 0 + 410 + 534 + + + + NetworkConfig + + + + + + Cancel + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + SSID + + + + + + + Network name (Service Set IDentifier) + + + + + + + + + + Authentication + + + + + + + + Plaintext (open / no authentication) + + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + + + + Encryption + + + + + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + + + + PSK + + + + + + + false + + + WPA/WPA2 pre-shared key or passphrase + + + + + + QLineEdit::Password + + + + + + + EAP method + + + + + + + false + + + + + + + Identity + + + + + + + false + + + Username/Identity for EAP methods + + + + + + + Password + + + + + + + false + + + Password for EAP methods + + + QLineEdit::Password + + + + + + + CA certificate + + + + + + + false + + + + + + + true + + + WEP keys + + + + + + false + + + key 0 + + + + + + + false + + + key 1 + + + + + + + false + + + key 3 + + + + + + + false + + + key 2 + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + false + + + + + + + + + + true + + + Optional Settings + + + + + + Network Identification String + + + + + + + Network Priority + + + 10000 + + + 10 + + + + + + + IDString + + + + + + + Priority + + + + + + + Inner auth + + + + + + + false + + + + + + + + + + + + + Add + + + + + + + false + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + false + + + WPS + + + + + + + + + ssidEdit + authSelect + encrSelect + pskEdit + eapSelect + identityEdit + passwordEdit + cacertEdit + wep0Radio + wep0Edit + wep1Radio + wep1Edit + wep2Radio + wep2Edit + wep3Radio + wep3Edit + idstrEdit + prioritySpinBox + phase2Select + addButton + removeButton + cancelButton + + + qtreewidget.h + + + + diff --git a/Network/wpa_gui-qt4_/peers.cpp b/Network/wpa_gui-qt4_/peers.cpp new file mode 100644 index 0000000..65bb17d --- /dev/null +++ b/Network/wpa_gui-qt4_/peers.cpp @@ -0,0 +1,1889 @@ +/* + * wpa_gui - Peers class + * Copyright (c) 2009-2010, Atheros Communications + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include +#include + +#include "common/wpa_ctrl.h" +#include "wpagui.h" +#include "stringquery.h" +#include "peers.h" + + +enum { + peer_role_address = Qt::UserRole + 1, + peer_role_type, + peer_role_uuid, + peer_role_details, + peer_role_ifname, + peer_role_pri_dev_type, + peer_role_ssid, + peer_role_config_methods, + peer_role_dev_passwd_id, + peer_role_bss_id, + peer_role_selected_method, + peer_role_selected_pin, + peer_role_requested_method, + peer_role_network_id +}; + +enum selected_method { + SEL_METHOD_NONE, + SEL_METHOD_PIN_PEER_DISPLAY, + SEL_METHOD_PIN_LOCAL_DISPLAY +}; + +/* + * TODO: + * - add current AP info (e.g., from WPS) in station mode + */ + +enum peer_type { + PEER_TYPE_ASSOCIATED_STATION, + PEER_TYPE_AP, + PEER_TYPE_AP_WPS, + PEER_TYPE_WPS_PIN_NEEDED, + PEER_TYPE_P2P, + PEER_TYPE_P2P_CLIENT, + PEER_TYPE_P2P_GROUP, + PEER_TYPE_P2P_PERSISTENT_GROUP_GO, + PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT, + PEER_TYPE_P2P_INVITATION, + PEER_TYPE_WPS_ER_AP, + PEER_TYPE_WPS_ER_AP_UNCONFIGURED, + PEER_TYPE_WPS_ER_ENROLLEE, + PEER_TYPE_WPS_ENROLLEE +}; + + +Peers::Peers(QWidget *parent, const char *, bool, Qt::WFlags) + : QDialog(parent) +{ + setupUi(this); + + if (QImageReader::supportedImageFormats().contains(QByteArray("svg"))) + { + default_icon = new QIcon(":/icons/wpa_gui.svg"); + ap_icon = new QIcon(":/icons/ap.svg"); + laptop_icon = new QIcon(":/icons/laptop.svg"); + group_icon = new QIcon(":/icons/group.svg"); + invitation_icon = new QIcon(":/icons/invitation.svg"); + } else { + default_icon = new QIcon(":/icons/wpa_gui.png"); + ap_icon = new QIcon(":/icons/ap.png"); + laptop_icon = new QIcon(":/icons/laptop.png"); + group_icon = new QIcon(":/icons/group.png"); + invitation_icon = new QIcon(":/icons/invitation.png"); + } + + peers->setModel(&model); + peers->setResizeMode(QListView::Adjust); + peers->setDragEnabled(false); + peers->setSelectionMode(QAbstractItemView::NoSelection); + + peers->setContextMenuPolicy(Qt::CustomContextMenu); + connect(peers, SIGNAL(customContextMenuRequested(const QPoint &)), + this, SLOT(context_menu(const QPoint &))); + + wpagui = NULL; + hide_ap = false; +} + + +void Peers::setWpaGui(WpaGui *_wpagui) +{ + wpagui = _wpagui; + update_peers(); +} + + +Peers::~Peers() +{ + delete default_icon; + delete ap_icon; + delete laptop_icon; + delete group_icon; + delete invitation_icon; +} + + +void Peers::languageChange() +{ + retranslateUi(this); +} + + +QString Peers::ItemType(int type) +{ + QString title; + switch (type) { + case PEER_TYPE_ASSOCIATED_STATION: + title = tr("Associated station"); + break; + case PEER_TYPE_AP: + title = tr("AP"); + break; + case PEER_TYPE_AP_WPS: + title = tr("WPS AP"); + break; + case PEER_TYPE_WPS_PIN_NEEDED: + title = tr("WPS PIN needed"); + break; + case PEER_TYPE_P2P: + title = tr("P2P Device"); + break; + case PEER_TYPE_P2P_CLIENT: + title = tr("P2P Device (group client)"); + break; + case PEER_TYPE_P2P_GROUP: + title = tr("P2P Group"); + break; + case PEER_TYPE_P2P_PERSISTENT_GROUP_GO: + title = tr("P2P Persistent Group (GO)"); + break; + case PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT: + title = tr("P2P Persistent Group (client)"); + break; + case PEER_TYPE_P2P_INVITATION: + title = tr("P2P Invitation"); + break; + case PEER_TYPE_WPS_ER_AP: + title = tr("ER: WPS AP"); + break; + case PEER_TYPE_WPS_ER_AP_UNCONFIGURED: + title = tr("ER: WPS AP (Unconfigured)"); + break; + case PEER_TYPE_WPS_ER_ENROLLEE: + title = tr("ER: WPS Enrollee"); + break; + case PEER_TYPE_WPS_ENROLLEE: + title = tr("WPS Enrollee"); + break; + } + return title; +} + + +void Peers::context_menu(const QPoint &pos) +{ + QMenu *menu = new QMenu; + if (menu == NULL) + return; + + QModelIndex idx = peers->indexAt(pos); + if (idx.isValid()) { + ctx_item = model.itemFromIndex(idx); + int type = ctx_item->data(peer_role_type).toInt(); + menu->addAction(Peers::ItemType(type))->setEnabled(false); + menu->addSeparator(); + + int config_methods = -1; + QVariant var = ctx_item->data(peer_role_config_methods); + if (var.isValid()) + config_methods = var.toInt(); + + enum selected_method method = SEL_METHOD_NONE; + var = ctx_item->data(peer_role_selected_method); + if (var.isValid()) + method = (enum selected_method) var.toInt(); + + if ((type == PEER_TYPE_ASSOCIATED_STATION || + type == PEER_TYPE_AP_WPS || + type == PEER_TYPE_WPS_PIN_NEEDED || + type == PEER_TYPE_WPS_ER_ENROLLEE || + type == PEER_TYPE_WPS_ENROLLEE) && + (config_methods == -1 || (config_methods & 0x010c))) { + menu->addAction(tr("Enter WPS PIN"), this, + SLOT(enter_pin())); + } + + if (type == PEER_TYPE_P2P || type == PEER_TYPE_P2P_CLIENT) { + menu->addAction(tr("P2P Connect"), this, + SLOT(ctx_p2p_connect())); + if (method == SEL_METHOD_NONE && + config_methods > -1 && + config_methods & 0x0080 /* PBC */ && + config_methods != 0x0080) + menu->addAction(tr("P2P Connect (PBC)"), this, + SLOT(connect_pbc())); + if (method == SEL_METHOD_NONE) { + menu->addAction(tr("P2P Request PIN"), this, + SLOT(ctx_p2p_req_pin())); + menu->addAction(tr("P2P Show PIN"), this, + SLOT(ctx_p2p_show_pin())); + } + + if (config_methods > -1 && (config_methods & 0x0100)) { + /* Peer has Keypad */ + menu->addAction(tr("P2P Display PIN"), this, + SLOT(ctx_p2p_display_pin())); + } + + if (config_methods > -1 && (config_methods & 0x000c)) { + /* Peer has Label or Display */ + menu->addAction(tr("P2P Enter PIN"), this, + SLOT(ctx_p2p_enter_pin())); + } + } + + if (type == PEER_TYPE_P2P_GROUP) { + menu->addAction(tr("Show passphrase"), this, + SLOT(ctx_p2p_show_passphrase())); + menu->addAction(tr("Remove P2P Group"), this, + SLOT(ctx_p2p_remove_group())); + } + + if (type == PEER_TYPE_P2P_PERSISTENT_GROUP_GO || + type == PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT || + type == PEER_TYPE_P2P_INVITATION) { + menu->addAction(tr("Start group"), this, + SLOT(ctx_p2p_start_persistent())); + } + + if (type == PEER_TYPE_P2P_PERSISTENT_GROUP_GO || + type == PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT) { + menu->addAction(tr("Invite"), this, + SLOT(ctx_p2p_invite())); + } + + if (type == PEER_TYPE_P2P_INVITATION) { + menu->addAction(tr("Ignore"), this, + SLOT(ctx_p2p_delete())); + } + + if (type == PEER_TYPE_AP_WPS) { + menu->addAction(tr("Connect (PBC)"), this, + SLOT(connect_pbc())); + } + + if ((type == PEER_TYPE_ASSOCIATED_STATION || + type == PEER_TYPE_WPS_ER_ENROLLEE || + type == PEER_TYPE_WPS_ENROLLEE) && + config_methods >= 0 && (config_methods & 0x0080)) { + menu->addAction(tr("Enroll (PBC)"), this, + SLOT(connect_pbc())); + } + + if (type == PEER_TYPE_WPS_ER_AP) { + menu->addAction(tr("Learn Configuration"), this, + SLOT(learn_ap_config())); + } + + menu->addAction(tr("Properties"), this, SLOT(properties())); + } else { + ctx_item = NULL; + menu->addAction(QString(tr("Refresh")), this, + SLOT(ctx_refresh())); + menu->addAction(tr("Start P2P discovery"), this, + SLOT(ctx_p2p_start())); + menu->addAction(tr("Stop P2P discovery"), this, + SLOT(ctx_p2p_stop())); + menu->addAction(tr("P2P listen only"), this, + SLOT(ctx_p2p_listen())); + menu->addAction(tr("Start P2P group"), this, + SLOT(ctx_p2p_start_group())); + if (hide_ap) + menu->addAction(tr("Show AP entries"), this, + SLOT(ctx_show_ap())); + else + menu->addAction(tr("Hide AP entries"), this, + SLOT(ctx_hide_ap())); + } + + menu->exec(peers->mapToGlobal(pos)); +} + + +void Peers::enter_pin() +{ + if (ctx_item == NULL) + return; + + int peer_type = ctx_item->data(peer_role_type).toInt(); + QString uuid; + QString addr; + addr = ctx_item->data(peer_role_address).toString(); + if (peer_type == PEER_TYPE_WPS_ER_ENROLLEE) + uuid = ctx_item->data(peer_role_uuid).toString(); + + StringQuery input(tr("PIN:")); + input.setWindowTitle(tr("PIN for ") + ctx_item->text()); + if (input.exec() != QDialog::Accepted) + return; + + char cmd[100]; + char reply[100]; + size_t reply_len; + + if (peer_type == PEER_TYPE_WPS_ER_ENROLLEE) { + snprintf(cmd, sizeof(cmd), "WPS_ER_PIN %s %s %s", + uuid.toAscii().constData(), + input.get_string().toAscii().constData(), + addr.toAscii().constData()); + } else { + snprintf(cmd, sizeof(cmd), "WPS_PIN %s %s", + addr.toAscii().constData(), + input.get_string().toAscii().constData()); + } + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to set the WPS PIN.")); + msg.exec(); + } +} + + +void Peers::ctx_refresh() +{ + update_peers(); +} + + +void Peers::ctx_p2p_start() +{ + char reply[20]; + size_t reply_len; + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("P2P_FIND", reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to start P2P discovery."); + msg.exec(); + } +} + + +void Peers::ctx_p2p_stop() +{ + char reply[20]; + size_t reply_len; + reply_len = sizeof(reply) - 1; + wpagui->ctrlRequest("P2P_STOP_FIND", reply, &reply_len); +} + + +void Peers::ctx_p2p_listen() +{ + char reply[20]; + size_t reply_len; + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("P2P_LISTEN 3600", reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to start P2P listen."); + msg.exec(); + } +} + + +void Peers::ctx_p2p_start_group() +{ + char reply[20]; + size_t reply_len; + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("P2P_GROUP_ADD", reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to start P2P group."); + msg.exec(); + } +} + + +void Peers::add_station(QString info) +{ + QStringList lines = info.split(QRegExp("\\n")); + QString name; + + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + int pos = (*it).indexOf('=') + 1; + if (pos < 1) + continue; + + if ((*it).startsWith("wpsDeviceName=")) + name = (*it).mid(pos); + else if ((*it).startsWith("p2p_device_name=")) + name = (*it).mid(pos); + } + + if (name.isEmpty()) + name = lines[0]; + + QStandardItem *item = new QStandardItem(*laptop_icon, name); + if (item) { + /* Remove WPS enrollee entry if one is still pending */ + if (model.rowCount() > 0) { + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_address, + lines[0]); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item; + item = model.itemFromIndex(lst[i]); + if (item == NULL) + continue; + int type = item->data(peer_role_type).toInt(); + if (type == PEER_TYPE_WPS_ENROLLEE) { + model.removeRow(lst[i].row()); + break; + } + } + } + + item->setData(lines[0], peer_role_address); + item->setData(PEER_TYPE_ASSOCIATED_STATION, + peer_role_type); + item->setData(info, peer_role_details); + item->setToolTip(ItemType(PEER_TYPE_ASSOCIATED_STATION)); + model.appendRow(item); + } +} + + +void Peers::add_stations() +{ + char reply[2048]; + size_t reply_len; + char cmd[30]; + int res; + + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("STA-FIRST", reply, &reply_len) < 0) + return; + + do { + reply[reply_len] = '\0'; + QString info(reply); + char *txt = reply; + while (*txt != '\0' && *txt != '\n') + txt++; + *txt++ = '\0'; + if (strncmp(reply, "FAIL", 4) == 0 || + strncmp(reply, "UNKNOWN", 7) == 0) + break; + + add_station(info); + + reply_len = sizeof(reply) - 1; + snprintf(cmd, sizeof(cmd), "STA-NEXT %s", reply); + res = wpagui->ctrlRequest(cmd, reply, &reply_len); + } while (res >= 0); +} + + +void Peers::add_single_station(const char *addr) +{ + char reply[2048]; + size_t reply_len; + char cmd[30]; + + reply_len = sizeof(reply) - 1; + snprintf(cmd, sizeof(cmd), "STA %s", addr); + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) + return; + + reply[reply_len] = '\0'; + QString info(reply); + char *txt = reply; + while (*txt != '\0' && *txt != '\n') + txt++; + *txt++ = '\0'; + if (strncmp(reply, "FAIL", 4) == 0 || + strncmp(reply, "UNKNOWN", 7) == 0) + return; + + add_station(info); +} + + +void Peers::add_p2p_group_client(QStandardItem * /*parent*/, QString params) +{ + /* + * dev=02:b5:64:63:30:63 iface=02:b5:64:63:30:63 dev_capab=0x0 + * dev_type=1-0050f204-1 dev_name='Wireless Client' + * config_methods=0x8c + */ + + QStringList items = + params.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)")); + QString addr = ""; + QString name = ""; + int config_methods = 0; + QString dev_type; + + for (int i = 0; i < items.size(); i++) { + QString str = items.at(i); + int pos = str.indexOf('=') + 1; + if (str.startsWith("dev_name='")) + name = str.section('\'', 1, -2); + else if (str.startsWith("config_methods=")) + config_methods = + str.section('=', 1).toInt(0, 0); + else if (str.startsWith("dev=")) + addr = str.mid(pos); + else if (str.startsWith("dev_type=") && dev_type.isEmpty()) + dev_type = str.mid(pos); + } + + QStandardItem *item = find_addr(addr); + if (item) + return; + + item = new QStandardItem(*default_icon, name); + if (item) { + /* TODO: indicate somehow the relationship to the group owner + * (parent) */ + item->setData(addr, peer_role_address); + item->setData(config_methods, peer_role_config_methods); + item->setData(PEER_TYPE_P2P_CLIENT, peer_role_type); + if (!dev_type.isEmpty()) + item->setData(dev_type, peer_role_pri_dev_type); + item->setData(items.join(QString("\n")), peer_role_details); + item->setToolTip(ItemType(PEER_TYPE_P2P_CLIENT)); + model.appendRow(item); + } +} + + +void Peers::remove_bss(int id) +{ + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), peer_role_bss_id, + id); + if (lst.size() == 0) + return; + model.removeRow(lst[0].row()); +} + + +bool Peers::add_bss(const char *cmd) +{ + char reply[2048]; + size_t reply_len; + + if (hide_ap) + return false; + + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) + return false; + reply[reply_len] = '\0'; + + QString bss(reply); + if (bss.isEmpty() || bss.startsWith("FAIL")) + return false; + + QString ssid, bssid, flags, wps_name, pri_dev_type; + int id = -1; + + QStringList lines = bss.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + int pos = (*it).indexOf('=') + 1; + if (pos < 1) + continue; + + if ((*it).startsWith("bssid=")) + bssid = (*it).mid(pos); + else if ((*it).startsWith("id=")) + id = (*it).mid(pos).toInt(); + else if ((*it).startsWith("flags=")) + flags = (*it).mid(pos); + else if ((*it).startsWith("ssid=")) + ssid = (*it).mid(pos); + else if ((*it).startsWith("wps_device_name=")) + wps_name = (*it).mid(pos); + else if ((*it).startsWith("wps_primary_device_type=")) + pri_dev_type = (*it).mid(pos); + } + + QString name = wps_name; + if (name.isEmpty()) + name = ssid + "\n" + bssid; + + QStandardItem *item = new QStandardItem(*ap_icon, name); + if (item) { + item->setData(bssid, peer_role_address); + if (id >= 0) + item->setData(id, peer_role_bss_id); + int type; + if (flags.contains("[WPS")) + type = PEER_TYPE_AP_WPS; + else + type = PEER_TYPE_AP; + item->setData(type, peer_role_type); + + for (int i = 0; i < lines.size(); i++) { + if (lines[i].length() > 60) { + lines[i].remove(60, lines[i].length()); + lines[i] += ".."; + } + } + item->setToolTip(ItemType(type)); + item->setData(lines.join("\n"), peer_role_details); + if (!pri_dev_type.isEmpty()) + item->setData(pri_dev_type, + peer_role_pri_dev_type); + if (!ssid.isEmpty()) + item->setData(ssid, peer_role_ssid); + model.appendRow(item); + + lines = bss.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + if ((*it).startsWith("p2p_group_client:")) + add_p2p_group_client(item, + (*it).mid(18)); + } + } + + return true; +} + + +void Peers::add_scan_results() +{ + int index; + char cmd[20]; + + index = 0; + while (wpagui) { + snprintf(cmd, sizeof(cmd), "BSS %d", index++); + if (index > 1000) + break; + + if (!add_bss(cmd)) + break; + } +} + + +void Peers::add_persistent(int id, const char *ssid, const char *bssid) +{ + char cmd[100]; + char reply[100]; + size_t reply_len; + int mode; + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d mode", id); + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) + return; + reply[reply_len] = '\0'; + mode = atoi(reply); + + QString name = ssid; + name = '[' + name + ']'; + + QStandardItem *item = new QStandardItem(*group_icon, name); + if (!item) + return; + + int type; + if (mode == 3) + type = PEER_TYPE_P2P_PERSISTENT_GROUP_GO; + else + type = PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT; + item->setData(type, peer_role_type); + item->setToolTip(ItemType(type)); + item->setData(ssid, peer_role_ssid); + if (bssid && strcmp(bssid, "any") == 0) + bssid = NULL; + if (bssid) + item->setData(bssid, peer_role_address); + item->setData(id, peer_role_network_id); + item->setBackground(Qt::BDiagPattern); + + model.appendRow(item); +} + + +void Peers::add_persistent_groups() +{ + char buf[2048], *start, *end, *id, *ssid, *bssid, *flags; + size_t len; + + len = sizeof(buf) - 1; + if (wpagui->ctrlRequest("LIST_NETWORKS", buf, &len) < 0) + return; + + buf[len] = '\0'; + start = strchr(buf, '\n'); + if (start == NULL) + return; + start++; + + while (*start) { + bool last = false; + end = strchr(start, '\n'); + if (end == NULL) { + last = true; + end = start; + while (end[0] && end[1]) + end++; + } + *end = '\0'; + + id = start; + ssid = strchr(id, '\t'); + if (ssid == NULL) + break; + *ssid++ = '\0'; + bssid = strchr(ssid, '\t'); + if (bssid == NULL) + break; + *bssid++ = '\0'; + flags = strchr(bssid, '\t'); + if (flags == NULL) + break; + *flags++ = '\0'; + + if (strstr(flags, "[DISABLED][P2P-PERSISTENT]")) + add_persistent(atoi(id), ssid, bssid); + + if (last) + break; + start = end + 1; + } +} + + +void Peers::update_peers() +{ + model.clear(); + if (wpagui == NULL) + return; + + char reply[20]; + size_t replylen = sizeof(reply) - 1; + wpagui->ctrlRequest("WPS_ER_START", reply, &replylen); + + add_stations(); + add_scan_results(); + add_persistent_groups(); +} + + +QStandardItem * Peers::find_addr(QString addr) +{ + if (model.rowCount() == 0) + return NULL; + + QModelIndexList lst = model.match(model.index(0, 0), peer_role_address, + addr); + if (lst.size() == 0) + return NULL; + return model.itemFromIndex(lst[0]); +} + + +QStandardItem * Peers::find_addr_type(QString addr, int type) +{ + if (model.rowCount() == 0) + return NULL; + + QModelIndexList lst = model.match(model.index(0, 0), peer_role_address, + addr); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item = model.itemFromIndex(lst[i]); + if (item->data(peer_role_type).toInt() == type) + return item; + } + return NULL; +} + + +QStandardItem * Peers::find_uuid(QString uuid) +{ + if (model.rowCount() == 0) + return NULL; + + QModelIndexList lst = model.match(model.index(0, 0), peer_role_uuid, + uuid); + if (lst.size() == 0) + return NULL; + return model.itemFromIndex(lst[0]); +} + + +void Peers::event_notify(WpaMsg msg) +{ + QString text = msg.getMsg(); + + if (text.startsWith(WPS_EVENT_PIN_NEEDED)) { + /* + * WPS-PIN-NEEDED 5a02a5fa-9199-5e7c-bc46-e183d3cb32f7 + * 02:2a:c4:18:5b:f3 + * [Wireless Client|Company|cmodel|123|12345|1-0050F204-1] + */ + QStringList items = text.split(' '); + QString uuid = items[1]; + QString addr = items[2]; + QString name = ""; + + QStandardItem *item = find_addr(addr); + if (item) + return; + + int pos = text.indexOf('['); + if (pos >= 0) { + int pos2 = text.lastIndexOf(']'); + if (pos2 >= pos) { + items = text.mid(pos + 1, pos2 - pos - 1). + split('|'); + name = items[0]; + items.append(addr); + } + } + + item = new QStandardItem(*laptop_icon, name); + if (item) { + item->setData(addr, peer_role_address); + item->setData(PEER_TYPE_WPS_PIN_NEEDED, + peer_role_type); + item->setToolTip(ItemType(PEER_TYPE_WPS_PIN_NEEDED)); + item->setData(items.join("\n"), peer_role_details); + item->setData(items[5], peer_role_pri_dev_type); + model.appendRow(item); + } + return; + } + + if (text.startsWith(AP_STA_CONNECTED)) { + /* AP-STA-CONNECTED 02:2a:c4:18:5b:f3 */ + QStringList items = text.split(' '); + QString addr = items[1]; + QStandardItem *item = find_addr(addr); + if (item == NULL || item->data(peer_role_type).toInt() != + PEER_TYPE_ASSOCIATED_STATION) + add_single_station(addr.toAscii().constData()); + return; + } + + if (text.startsWith(AP_STA_DISCONNECTED)) { + /* AP-STA-DISCONNECTED 02:2a:c4:18:5b:f3 */ + QStringList items = text.split(' '); + QString addr = items[1]; + + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_address, addr, -1); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item = model.itemFromIndex(lst[i]); + if (item && item->data(peer_role_type).toInt() == + PEER_TYPE_ASSOCIATED_STATION) { + model.removeRow(lst[i].row()); + break; + } + } + return; + } + + if (text.startsWith(P2P_EVENT_DEVICE_FOUND)) { + /* + * P2P-DEVICE-FOUND 02:b5:64:63:30:63 + * p2p_dev_addr=02:b5:64:63:30:63 pri_dev_type=1-0050f204-1 + * name='Wireless Client' config_methods=0x84 dev_capab=0x21 + * group_capab=0x0 + */ + QStringList items = + text.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)")); + QString addr = items[1]; + QString name = ""; + QString pri_dev_type; + int config_methods = 0; + for (int i = 0; i < items.size(); i++) { + QString str = items.at(i); + if (str.startsWith("name='")) + name = str.section('\'', 1, -2); + else if (str.startsWith("config_methods=")) + config_methods = + str.section('=', 1).toInt(0, 0); + else if (str.startsWith("pri_dev_type=")) + pri_dev_type = str.section('=', 1); + } + + QStandardItem *item = find_addr(addr); + if (item) { + int type = item->data(peer_role_type).toInt(); + if (type == PEER_TYPE_P2P) + return; + } + + item = new QStandardItem(*default_icon, name); + if (item) { + item->setData(addr, peer_role_address); + item->setData(config_methods, + peer_role_config_methods); + item->setData(PEER_TYPE_P2P, peer_role_type); + if (!pri_dev_type.isEmpty()) + item->setData(pri_dev_type, + peer_role_pri_dev_type); + item->setData(items.join(QString("\n")), + peer_role_details); + item->setToolTip(ItemType(PEER_TYPE_P2P)); + model.appendRow(item); + } + + item = find_addr_type(addr, + PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT); + if (item) + item->setBackground(Qt::NoBrush); + } + + if (text.startsWith(P2P_EVENT_GROUP_STARTED)) { + /* P2P-GROUP-STARTED wlan0-p2p-0 GO ssid="DIRECT-3F" + * passphrase="YOyTkxID" go_dev_addr=02:40:61:c2:f3:b7 + * [PERSISTENT] */ + QStringList items = text.split(' '); + if (items.size() < 4) + return; + + int pos = text.indexOf(" ssid=\""); + if (pos < 0) + return; + QString ssid = text.mid(pos + 7); + pos = ssid.indexOf(" passphrase=\""); + if (pos < 0) + pos = ssid.indexOf(" psk="); + if (pos >= 0) + ssid.truncate(pos); + pos = ssid.lastIndexOf('"'); + if (pos >= 0) + ssid.truncate(pos); + + QStandardItem *item = new QStandardItem(*group_icon, ssid); + if (item) { + item->setData(PEER_TYPE_P2P_GROUP, peer_role_type); + item->setData(items[1], peer_role_ifname); + QString details; + if (items[2] == "GO") { + details = tr("P2P GO for interface ") + + items[1]; + } else { + details = tr("P2P client for interface ") + + items[1]; + } + if (text.contains(" [PERSISTENT]")) + details += "\nPersistent group"; + item->setData(details, peer_role_details); + item->setToolTip(ItemType(PEER_TYPE_P2P_GROUP)); + model.appendRow(item); + } + } + + if (text.startsWith(P2P_EVENT_GROUP_REMOVED)) { + /* P2P-GROUP-REMOVED wlan0-p2p-0 GO */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_ifname, items[1]); + for (int i = 0; i < lst.size(); i++) + model.removeRow(lst[i].row()); + return; + } + + if (text.startsWith(P2P_EVENT_PROV_DISC_SHOW_PIN)) { + /* P2P-PROV-DISC-SHOW-PIN 02:40:61:c2:f3:b7 12345670 */ + QStringList items = text.split(' '); + if (items.size() < 3) + return; + QString addr = items[1]; + QString pin = items[2]; + + QStandardItem *item = find_addr_type(addr, PEER_TYPE_P2P); + if (item == NULL) + return; + item->setData(SEL_METHOD_PIN_LOCAL_DISPLAY, + peer_role_selected_method); + item->setData(pin, peer_role_selected_pin); + QVariant var = item->data(peer_role_requested_method); + if (var.isValid() && + var.toInt() == SEL_METHOD_PIN_LOCAL_DISPLAY) { + ctx_item = item; + ctx_p2p_display_pin_pd(); + } + return; + } + + if (text.startsWith(P2P_EVENT_PROV_DISC_ENTER_PIN)) { + /* P2P-PROV-DISC-ENTER-PIN 02:40:61:c2:f3:b7 */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + QString addr = items[1]; + + QStandardItem *item = find_addr_type(addr, PEER_TYPE_P2P); + if (item == NULL) + return; + item->setData(SEL_METHOD_PIN_PEER_DISPLAY, + peer_role_selected_method); + QVariant var = item->data(peer_role_requested_method); + if (var.isValid() && + var.toInt() == SEL_METHOD_PIN_PEER_DISPLAY) { + ctx_item = item; + ctx_p2p_connect(); + } + return; + } + + if (text.startsWith(P2P_EVENT_INVITATION_RECEIVED)) { + /* P2P-INVITATION-RECEIVED sa=02:f0:bc:44:87:62 persistent=4 */ + QStringList items = text.split(' '); + if (items.size() < 3) + return; + if (!items[1].startsWith("sa=") || + !items[2].startsWith("persistent=")) + return; + QString addr = items[1].mid(3); + int id = items[2].mid(11).toInt(); + + char cmd[100]; + char reply[100]; + size_t reply_len; + + snprintf(cmd, sizeof(cmd), "GET_NETWORK %d ssid", id); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) + return; + reply[reply_len] = '\0'; + QString name; + char *pos = strrchr(reply, '"'); + if (pos && reply[0] == '"') { + *pos = '\0'; + name = reply + 1; + } else + name = reply; + + QStandardItem *item; + item = find_addr_type(addr, PEER_TYPE_P2P_INVITATION); + if (item) + model.removeRow(item->row()); + + item = new QStandardItem(*invitation_icon, name); + if (!item) + return; + item->setData(PEER_TYPE_P2P_INVITATION, peer_role_type); + item->setToolTip(ItemType(PEER_TYPE_P2P_INVITATION)); + item->setData(addr, peer_role_address); + item->setData(id, peer_role_network_id); + + model.appendRow(item); + + enable_persistent(id); + + return; + } + + if (text.startsWith(P2P_EVENT_INVITATION_RESULT)) { + /* P2P-INVITATION-RESULT status=1 */ + /* TODO */ + return; + } + + if (text.startsWith(WPS_EVENT_ER_AP_ADD)) { + /* + * WPS-ER-AP-ADD 87654321-9abc-def0-1234-56789abc0002 + * 02:11:22:33:44:55 pri_dev_type=6-0050F204-1 wps_state=1 + * |Very friendly name|Company|Long description of the model| + * WAP|http://w1.fi/|http://w1.fi/hostapd/ + */ + QStringList items = text.split(' '); + if (items.size() < 5) + return; + QString uuid = items[1]; + QString addr = items[2]; + QString pri_dev_type = items[3].mid(13); + int wps_state = items[4].mid(10).toInt(); + + int pos = text.indexOf('|'); + if (pos < 0) + return; + items = text.mid(pos + 1).split('|'); + if (items.size() < 1) + return; + + QStandardItem *item = find_uuid(uuid); + if (item) + return; + + item = new QStandardItem(*ap_icon, items[0]); + if (item) { + item->setData(uuid, peer_role_uuid); + item->setData(addr, peer_role_address); + int type = wps_state == 2 ? PEER_TYPE_WPS_ER_AP: + PEER_TYPE_WPS_ER_AP_UNCONFIGURED; + item->setData(type, peer_role_type); + item->setToolTip(ItemType(type)); + item->setData(pri_dev_type, peer_role_pri_dev_type); + item->setData(items.join(QString("\n")), + peer_role_details); + model.appendRow(item); + } + + return; + } + + if (text.startsWith(WPS_EVENT_ER_AP_REMOVE)) { + /* WPS-ER-AP-REMOVE 87654321-9abc-def0-1234-56789abc0002 */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_uuid, items[1]); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item = model.itemFromIndex(lst[i]); + if (item && + (item->data(peer_role_type).toInt() == + PEER_TYPE_WPS_ER_AP || + item->data(peer_role_type).toInt() == + PEER_TYPE_WPS_ER_AP_UNCONFIGURED)) + model.removeRow(lst[i].row()); + } + return; + } + + if (text.startsWith(WPS_EVENT_ER_ENROLLEE_ADD)) { + /* + * WPS-ER-ENROLLEE-ADD 2b7093f1-d6fb-5108-adbb-bea66bb87333 + * 02:66:a0:ee:17:27 M1=1 config_methods=0x14d dev_passwd_id=0 + * pri_dev_type=1-0050F204-1 + * |Wireless Client|Company|cmodel|123|12345| + */ + QStringList items = text.split(' '); + if (items.size() < 3) + return; + QString uuid = items[1]; + QString addr = items[2]; + QString pri_dev_type = items[6].mid(13); + int config_methods = -1; + int dev_passwd_id = -1; + + for (int i = 3; i < items.size(); i++) { + int pos = items[i].indexOf('=') + 1; + if (pos < 1) + continue; + QString val = items[i].mid(pos); + if (items[i].startsWith("config_methods=")) { + config_methods = val.toInt(0, 0); + } else if (items[i].startsWith("dev_passwd_id=")) { + dev_passwd_id = val.toInt(); + } + } + + int pos = text.indexOf('|'); + if (pos < 0) + return; + items = text.mid(pos + 1).split('|'); + if (items.size() < 1) + return; + QString name = items[0]; + if (name.length() == 0) + name = addr; + + remove_enrollee_uuid(uuid); + + QStandardItem *item; + item = new QStandardItem(*laptop_icon, name); + if (item) { + item->setData(uuid, peer_role_uuid); + item->setData(addr, peer_role_address); + item->setData(PEER_TYPE_WPS_ER_ENROLLEE, + peer_role_type); + item->setToolTip(ItemType(PEER_TYPE_WPS_ER_ENROLLEE)); + item->setData(items.join(QString("\n")), + peer_role_details); + item->setData(pri_dev_type, peer_role_pri_dev_type); + if (config_methods >= 0) + item->setData(config_methods, + peer_role_config_methods); + if (dev_passwd_id >= 0) + item->setData(dev_passwd_id, + peer_role_dev_passwd_id); + model.appendRow(item); + } + + return; + } + + if (text.startsWith(WPS_EVENT_ER_ENROLLEE_REMOVE)) { + /* + * WPS-ER-ENROLLEE-REMOVE 2b7093f1-d6fb-5108-adbb-bea66bb87333 + * 02:66:a0:ee:17:27 + */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + remove_enrollee_uuid(items[1]); + return; + } + + if (text.startsWith(WPS_EVENT_ENROLLEE_SEEN)) { + /* TODO: need to time out this somehow or remove on successful + * WPS run, etc. */ + /* + * WPS-ENROLLEE-SEEN 02:00:00:00:01:00 + * 572cf82f-c957-5653-9b16-b5cfb298abf1 1-0050F204-1 0x80 4 1 + * [Wireless Client] + * (MAC addr, UUID-E, pri dev type, config methods, + * dev passwd id, request type, [dev name]) + */ + QStringList items = text.split(' '); + if (items.size() < 7) + return; + QString addr = items[1]; + QString uuid = items[2]; + QString pri_dev_type = items[3]; + int config_methods = items[4].toInt(0, 0); + int dev_passwd_id = items[5].toInt(); + QString name; + + QStandardItem *item = find_addr(addr); + if (item) { + int type = item->data(peer_role_type).toInt(); + if (type == PEER_TYPE_ASSOCIATED_STATION) + return; /* already associated */ + } + + int pos = text.indexOf('['); + if (pos >= 0) { + int pos2 = text.lastIndexOf(']'); + if (pos2 >= pos) { + QStringList items2 = + text.mid(pos + 1, pos2 - pos - 1). + split('|'); + name = items2[0]; + } + } + if (name.isEmpty()) + name = addr; + + item = find_uuid(uuid); + if (item) { + QVariant var = item->data(peer_role_config_methods); + QVariant var2 = item->data(peer_role_dev_passwd_id); + if ((var.isValid() && config_methods != var.toInt()) || + (var2.isValid() && dev_passwd_id != var2.toInt())) + remove_enrollee_uuid(uuid); + else + return; + } + + item = new QStandardItem(*laptop_icon, name); + if (item) { + item->setData(uuid, peer_role_uuid); + item->setData(addr, peer_role_address); + item->setData(PEER_TYPE_WPS_ENROLLEE, + peer_role_type); + item->setToolTip(ItemType(PEER_TYPE_WPS_ENROLLEE)); + item->setData(items.join(QString("\n")), + peer_role_details); + item->setData(pri_dev_type, peer_role_pri_dev_type); + item->setData(config_methods, + peer_role_config_methods); + item->setData(dev_passwd_id, peer_role_dev_passwd_id); + model.appendRow(item); + } + + return; + } + + if (text.startsWith(WPA_EVENT_BSS_ADDED)) { + /* CTRL-EVENT-BSS-ADDED 34 00:11:22:33:44:55 */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + char cmd[20]; + snprintf(cmd, sizeof(cmd), "BSS ID-%d", items[1].toInt()); + add_bss(cmd); + return; + } + + if (text.startsWith(WPA_EVENT_BSS_REMOVED)) { + /* CTRL-EVENT-BSS-REMOVED 34 00:11:22:33:44:55 */ + QStringList items = text.split(' '); + if (items.size() < 2) + return; + remove_bss(items[1].toInt()); + return; + } +} + + +void Peers::ctx_p2p_connect() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + QString arg; + int config_methods = + ctx_item->data(peer_role_config_methods).toInt(); + enum selected_method method = SEL_METHOD_NONE; + QVariant var = ctx_item->data(peer_role_selected_method); + if (var.isValid()) + method = (enum selected_method) var.toInt(); + if (method == SEL_METHOD_PIN_LOCAL_DISPLAY) { + arg = ctx_item->data(peer_role_selected_pin).toString(); + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s %s display", + addr.toAscii().constData(), + arg.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to initiate P2P connect."); + msg.exec(); + return; + } + QMessageBox::information(this, + tr("PIN for ") + ctx_item->text(), + tr("Enter the following PIN on the\n" + "peer device: ") + arg); + } else if (method == SEL_METHOD_PIN_PEER_DISPLAY) { + StringQuery input(tr("PIN from peer display:")); + input.setWindowTitle(tr("PIN for ") + ctx_item->text()); + if (input.exec() != QDialog::Accepted) + return; + arg = input.get_string(); + } else if (config_methods == 0x0080 /* PBC */) { + arg = "pbc"; + } else { + StringQuery input(tr("PIN:")); + input.setWindowTitle(tr("PIN for ") + ctx_item->text()); + if (input.exec() != QDialog::Accepted) + return; + arg = input.get_string(); + } + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s %s", + addr.toAscii().constData(), + arg.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to initiate P2P connect."); + msg.exec(); + } +} + + +void Peers::ctx_p2p_req_pin() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + ctx_item->setData(SEL_METHOD_PIN_PEER_DISPLAY, + peer_role_requested_method); + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_PROV_DISC %s display", + addr.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to request PIN from peer.")); + msg.exec(); + } +} + + +void Peers::ctx_p2p_show_pin() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + ctx_item->setData(SEL_METHOD_PIN_LOCAL_DISPLAY, + peer_role_requested_method); + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_PROV_DISC %s keypad", + addr.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to request peer to enter PIN.")); + msg.exec(); + } +} + + +void Peers::ctx_p2p_display_pin() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s pin", + addr.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to initiate P2P connect."); + msg.exec(); + return; + } + reply[reply_len] = '\0'; + QMessageBox::information(this, + tr("PIN for ") + ctx_item->text(), + tr("Enter the following PIN on the\n" + "peer device: ") + reply); +} + + +void Peers::ctx_p2p_display_pin_pd() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + QString arg = ctx_item->data(peer_role_selected_pin).toString(); + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s %s display", + addr.toAscii().constData(), + arg.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to initiate P2P connect."); + msg.exec(); + return; + } + reply[reply_len] = '\0'; + QMessageBox::information(this, + tr("PIN for ") + ctx_item->text(), + tr("Enter the following PIN on the\n" + "peer device: ") + arg); +} + + +void Peers::ctx_p2p_enter_pin() +{ + if (ctx_item == NULL) + return; + QString addr = ctx_item->data(peer_role_address).toString(); + QString arg; + + StringQuery input(tr("PIN from peer:")); + input.setWindowTitle(tr("PIN for ") + ctx_item->text()); + if (input.exec() != QDialog::Accepted) + return; + arg = input.get_string(); + + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s %s keypad", + addr.toAscii().constData(), + arg.toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to initiate P2P connect."); + msg.exec(); + } +} + + +void Peers::ctx_p2p_remove_group() +{ + if (ctx_item == NULL) + return; + char cmd[100]; + char reply[100]; + size_t reply_len; + snprintf(cmd, sizeof(cmd), "P2P_GROUP_REMOVE %s", + ctx_item->data(peer_role_ifname).toString().toAscii(). + constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to remove P2P Group."); + msg.exec(); + } +} + + +void Peers::closeEvent(QCloseEvent *) +{ + if (wpagui) { + char reply[20]; + size_t replylen = sizeof(reply) - 1; + wpagui->ctrlRequest("WPS_ER_STOP", reply, &replylen); + } +} + + +void Peers::done(int r) +{ + QDialog::done(r); + close(); +} + + +void Peers::remove_enrollee_uuid(QString uuid) +{ + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_uuid, uuid); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item = model.itemFromIndex(lst[i]); + if (item == NULL) + continue; + int type = item->data(peer_role_type).toInt(); + if (type == PEER_TYPE_WPS_ER_ENROLLEE || + type == PEER_TYPE_WPS_ENROLLEE) + model.removeRow(lst[i].row()); + } +} + + +void Peers::properties() +{ + if (ctx_item == NULL) + return; + + QMessageBox msg(this); + msg.setStandardButtons(QMessageBox::Ok); + msg.setDefaultButton(QMessageBox::Ok); + msg.setEscapeButton(QMessageBox::Ok); + msg.setWindowTitle(tr("Peer Properties")); + + int type = ctx_item->data(peer_role_type).toInt(); + QString title = Peers::ItemType(type); + + msg.setText(title + QString("\n") + tr("Name: ") + ctx_item->text()); + + QVariant var; + QString info; + + var = ctx_item->data(peer_role_address); + if (var.isValid()) + info += tr("Address: ") + var.toString() + QString("\n"); + + var = ctx_item->data(peer_role_uuid); + if (var.isValid()) + info += tr("UUID: ") + var.toString() + QString("\n"); + + var = ctx_item->data(peer_role_pri_dev_type); + if (var.isValid()) + info += tr("Primary Device Type: ") + var.toString() + + QString("\n"); + + var = ctx_item->data(peer_role_ssid); + if (var.isValid()) + info += tr("SSID: ") + var.toString() + QString("\n"); + + var = ctx_item->data(peer_role_config_methods); + if (var.isValid()) { + int methods = var.toInt(); + info += tr("Configuration Methods: "); + if (methods & 0x0001) + info += tr("[USBA]"); + if (methods & 0x0002) + info += tr("[Ethernet]"); + if (methods & 0x0004) + info += tr("[Label]"); + if (methods & 0x0008) + info += tr("[Display]"); + if (methods & 0x0010) + info += tr("[Ext. NFC Token]"); + if (methods & 0x0020) + info += tr("[Int. NFC Token]"); + if (methods & 0x0040) + info += tr("[NFC Interface]"); + if (methods & 0x0080) + info += tr("[Push Button]"); + if (methods & 0x0100) + info += tr("[Keypad]"); + info += "\n"; + } + + var = ctx_item->data(peer_role_selected_method); + if (var.isValid()) { + enum selected_method method = + (enum selected_method) var.toInt(); + switch (method) { + case SEL_METHOD_NONE: + break; + case SEL_METHOD_PIN_PEER_DISPLAY: + info += tr("Selected Method: PIN on peer display\n"); + break; + case SEL_METHOD_PIN_LOCAL_DISPLAY: + info += tr("Selected Method: PIN on local display\n"); + break; + } + } + + var = ctx_item->data(peer_role_selected_pin); + if (var.isValid()) { + info += tr("PIN to enter on peer: ") + var.toString() + "\n"; + } + + var = ctx_item->data(peer_role_dev_passwd_id); + if (var.isValid()) { + info += tr("Device Password ID: ") + var.toString(); + switch (var.toInt()) { + case 0: + info += tr(" (Default PIN)"); + break; + case 1: + info += tr(" (User-specified PIN)"); + break; + case 2: + info += tr(" (Machine-specified PIN)"); + break; + case 3: + info += tr(" (Rekey)"); + break; + case 4: + info += tr(" (Push Button)"); + break; + case 5: + info += tr(" (Registrar-specified)"); + break; + } + info += "\n"; + } + + msg.setInformativeText(info); + + var = ctx_item->data(peer_role_details); + if (var.isValid()) + msg.setDetailedText(var.toString()); + + msg.exec(); +} + + +void Peers::connect_pbc() +{ + if (ctx_item == NULL) + return; + + char cmd[100]; + char reply[100]; + size_t reply_len; + + int peer_type = ctx_item->data(peer_role_type).toInt(); + if (peer_type == PEER_TYPE_WPS_ER_ENROLLEE) { + snprintf(cmd, sizeof(cmd), "WPS_ER_PBC %s", + ctx_item->data(peer_role_uuid).toString().toAscii(). + constData()); + } else if (peer_type == PEER_TYPE_P2P || + peer_type == PEER_TYPE_P2P_CLIENT) { + snprintf(cmd, sizeof(cmd), "P2P_CONNECT %s pbc", + ctx_item->data(peer_role_address).toString(). + toAscii().constData()); + } else { + snprintf(cmd, sizeof(cmd), "WPS_PBC"); + } + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to start WPS PBC.")); + msg.exec(); + } +} + + +void Peers::learn_ap_config() +{ + if (ctx_item == NULL) + return; + + QString uuid = ctx_item->data(peer_role_uuid).toString(); + + StringQuery input(tr("AP PIN:")); + input.setWindowTitle(tr("AP PIN for ") + ctx_item->text()); + if (input.exec() != QDialog::Accepted) + return; + + char cmd[100]; + char reply[100]; + size_t reply_len; + + snprintf(cmd, sizeof(cmd), "WPS_ER_LEARN %s %s", + uuid.toAscii().constData(), + input.get_string().toAscii().constData()); + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to start learning AP configuration.")); + msg.exec(); + } +} + + +void Peers::ctx_hide_ap() +{ + hide_ap = true; + + if (model.rowCount() == 0) + return; + + do { + QModelIndexList lst; + lst = model.match(model.index(0, 0), + peer_role_type, PEER_TYPE_AP); + if (lst.size() == 0) { + lst = model.match(model.index(0, 0), + peer_role_type, PEER_TYPE_AP_WPS); + if (lst.size() == 0) + break; + } + + model.removeRow(lst[0].row()); + } while (1); +} + + +void Peers::ctx_show_ap() +{ + hide_ap = false; + add_scan_results(); +} + + +void Peers::ctx_p2p_show_passphrase() +{ + char reply[64]; + size_t reply_len; + + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest("P2P_GET_PASSPHRASE", reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText("Failed to get P2P group passphrase."); + msg.exec(); + } else { + reply[reply_len] = '\0'; + QMessageBox::information(this, tr("Passphrase"), + tr("P2P group passphrase:\n") + + reply); + } +} + + +void Peers::ctx_p2p_start_persistent() +{ + if (ctx_item == NULL) + return; + + char cmd[100]; + char reply[100]; + size_t reply_len; + + snprintf(cmd, sizeof(cmd), "P2P_GROUP_ADD persistent=%d", + ctx_item->data(peer_role_network_id).toInt()); + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to start persistent P2P Group.")); + msg.exec(); + } else if (ctx_item->data(peer_role_type).toInt() == + PEER_TYPE_P2P_INVITATION) + model.removeRow(ctx_item->row()); +} + + +void Peers::ctx_p2p_invite() +{ + if (ctx_item == NULL) + return; + + char cmd[100]; + char reply[100]; + size_t reply_len; + + snprintf(cmd, sizeof(cmd), "P2P_INVITE persistent=%d", + ctx_item->data(peer_role_network_id).toInt()); + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0 || + memcmp(reply, "FAIL", 4) == 0) { + QMessageBox msg; + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("Failed to invite peer to start persistent " + "P2P Group.")); + msg.exec(); + } +} + + +void Peers::ctx_p2p_delete() +{ + if (ctx_item == NULL) + return; + model.removeRow(ctx_item->row()); +} + + +void Peers::enable_persistent(int id) +{ + if (model.rowCount() == 0) + return; + + QModelIndexList lst = model.match(model.index(0, 0), + peer_role_network_id, id); + for (int i = 0; i < lst.size(); i++) { + QStandardItem *item = model.itemFromIndex(lst[i]); + int type = item->data(peer_role_type).toInt(); + if (type == PEER_TYPE_P2P_PERSISTENT_GROUP_GO || + type == PEER_TYPE_P2P_PERSISTENT_GROUP_CLIENT) + item->setBackground(Qt::NoBrush); + } +} diff --git a/Network/wpa_gui-qt4_/peers.h b/Network/wpa_gui-qt4_/peers.h new file mode 100644 index 0000000..a715395 --- /dev/null +++ b/Network/wpa_gui-qt4_/peers.h @@ -0,0 +1,96 @@ +/* + * wpa_gui - Peers class + * Copyright (c) 2009-2010, Atheros Communications + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef PEERS_H +#define PEERS_H + +#include +#include +#include "wpamsg.h" +#include "ui_peers.h" + +class WpaGui; + +class Peers : public QDialog, public Ui::Peers +{ + Q_OBJECT + +public: + Peers(QWidget *parent = 0, const char *name = 0, + bool modal = false, Qt::WFlags fl = 0); + ~Peers(); + void setWpaGui(WpaGui *_wpagui); + void event_notify(WpaMsg msg); + +public slots: + virtual void context_menu(const QPoint &pos); + virtual void enter_pin(); + virtual void connect_pbc(); + virtual void learn_ap_config(); + virtual void ctx_refresh(); + virtual void ctx_p2p_start(); + virtual void ctx_p2p_stop(); + virtual void ctx_p2p_listen(); + virtual void ctx_p2p_start_group(); + virtual void ctx_p2p_remove_group(); + virtual void ctx_p2p_connect(); + virtual void ctx_p2p_req_pin(); + virtual void ctx_p2p_show_pin(); + virtual void ctx_p2p_display_pin(); + virtual void ctx_p2p_display_pin_pd(); + virtual void ctx_p2p_enter_pin(); + virtual void properties(); + virtual void ctx_hide_ap(); + virtual void ctx_show_ap(); + virtual void ctx_p2p_show_passphrase(); + virtual void ctx_p2p_start_persistent(); + virtual void ctx_p2p_invite(); + virtual void ctx_p2p_delete(); + +protected slots: + virtual void languageChange(); + virtual void closeEvent(QCloseEvent *event); + +private: + void add_station(QString info); + void add_stations(); + void add_single_station(const char *addr); + bool add_bss(const char *cmd); + void remove_bss(int id); + void add_scan_results(); + void add_persistent(int id, const char *ssid, const char *bssid); + void add_persistent_groups(); + void update_peers(); + QStandardItem * find_addr(QString addr); + QStandardItem * find_addr_type(QString addr, int type); + void add_p2p_group_client(QStandardItem *parent, QString params); + QStandardItem * find_uuid(QString uuid); + void done(int r); + void remove_enrollee_uuid(QString uuid); + QString ItemType(int type); + void enable_persistent(int id); + + WpaGui *wpagui; + QStandardItemModel model; + QIcon *default_icon; + QIcon *ap_icon; + QIcon *laptop_icon; + QIcon *group_icon; + QIcon *invitation_icon; + QStandardItem *ctx_item; + + bool hide_ap; +}; + +#endif /* PEERS_H */ diff --git a/Network/wpa_gui-qt4_/peers.ui b/Network/wpa_gui-qt4_/peers.ui new file mode 100644 index 0000000..9508c25 --- /dev/null +++ b/Network/wpa_gui-qt4_/peers.ui @@ -0,0 +1,40 @@ + + + Peers + + + + 0 + 0 + 400 + 300 + + + + Peers + + + + + + + 0 + 0 + + + + true + + + QAbstractItemView::NoEditTriggers + + + QListView::IconMode + + + + + + + + diff --git a/Network/wpa_gui-qt4_/scanresults.cpp b/Network/wpa_gui-qt4_/scanresults.cpp new file mode 100644 index 0000000..459aa8c --- /dev/null +++ b/Network/wpa_gui-qt4_/scanresults.cpp @@ -0,0 +1,144 @@ +/* + * wpa_gui - ScanResults class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include + +#include "scanresults.h" +#include "wpagui.h" +#include "networkconfig.h" + + +ScanResults::ScanResults(QWidget *parent, const char *, bool, Qt::WFlags) + : QDialog(parent) +{ + setupUi(this); + + connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); + connect(scanButton, SIGNAL(clicked()), this, SLOT(scanRequest())); + connect(scanResultsWidget, + SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, + SLOT(bssSelected(QTreeWidgetItem *))); + + wpagui = NULL; + scanResultsWidget->setItemsExpandable(FALSE); + scanResultsWidget->setRootIsDecorated(FALSE); +} + + +ScanResults::~ScanResults() +{ +} + + +void ScanResults::languageChange() +{ + retranslateUi(this); +} + + +void ScanResults::setWpaGui(WpaGui *_wpagui) +{ + wpagui = _wpagui; + updateResults(); +} + + +void ScanResults::updateResults() +{ + char reply[2048]; + size_t reply_len; + int index; + char cmd[20]; + + scanResultsWidget->clear(); + + index = 0; + while (wpagui) { + snprintf(cmd, sizeof(cmd), "BSS %d", index++); + if (index > 1000) + break; + + reply_len = sizeof(reply) - 1; + if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) + break; + reply[reply_len] = '\0'; + + QString bss(reply); + if (bss.isEmpty() || bss.startsWith("FAIL")) + break; + + QString ssid, bssid, freq, signal, flags; + + QStringList lines = bss.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + int pos = (*it).indexOf('=') + 1; + if (pos < 1) + continue; + + if ((*it).startsWith("bssid=")) + bssid = (*it).mid(pos); + else if ((*it).startsWith("freq=")) + freq = (*it).mid(pos); + else if ((*it).startsWith("qual=")) + signal = (*it).mid(pos); + else if ((*it).startsWith("flags=")) + flags = (*it).mid(pos); + else if ((*it).startsWith("ssid=")) + ssid = (*it).mid(pos); + } + + QTreeWidgetItem *item = new QTreeWidgetItem(scanResultsWidget); + if (item) { + item->setText(0, ssid); + item->setText(1, bssid); + item->setText(2, freq); + item->setText(3, signal); + item->setText(4, flags); + } + + if (bssid.isEmpty()) + break; + } +} + + +void ScanResults::scanRequest() +{ + char reply[10]; + size_t reply_len = sizeof(reply); + + if (wpagui == NULL) + return; + + wpagui->ctrlRequest("SCAN", reply, &reply_len); +} + + +void ScanResults::getResults() +{ + updateResults(); +} + + +void ScanResults::bssSelected(QTreeWidgetItem *sel) +{ + NetworkConfig *nc = new NetworkConfig(); + if (nc == NULL) + return; + nc->setWpaGui(wpagui); + nc->paramsFromScanResults(sel); + nc->show(); + nc->exec(); +} diff --git a/Network/wpa_gui-qt4_/scanresults.h b/Network/wpa_gui-qt4_/scanresults.h new file mode 100644 index 0000000..2c4a1b0 --- /dev/null +++ b/Network/wpa_gui-qt4_/scanresults.h @@ -0,0 +1,46 @@ +/* + * wpa_gui - ScanResults class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef SCANRESULTS_H +#define SCANRESULTS_H + +#include +#include "ui_scanresults.h" + +class WpaGui; + +class ScanResults : public QDialog, public Ui::ScanResults +{ + Q_OBJECT + +public: + ScanResults(QWidget *parent = 0, const char *name = 0, + bool modal = false, Qt::WFlags fl = 0); + ~ScanResults(); + +public slots: + virtual void setWpaGui(WpaGui *_wpagui); + virtual void updateResults(); + virtual void scanRequest(); + virtual void getResults(); + virtual void bssSelected(QTreeWidgetItem *sel); + +protected slots: + virtual void languageChange(); + +private: + WpaGui *wpagui; +}; + +#endif /* SCANRESULTS_H */ diff --git a/Network/wpa_gui-qt4_/scanresults.ui b/Network/wpa_gui-qt4_/scanresults.ui new file mode 100644 index 0000000..81e405e --- /dev/null +++ b/Network/wpa_gui-qt4_/scanresults.ui @@ -0,0 +1,94 @@ + + ScanResults + + + + 0 + 0 + 452 + 244 + + + + Scan results + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + true + + + 5 + + + + SSID + + + + + BSSID + + + + + frequency + + + + + signal + + + + + flags + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Scan + + + + + + + Close + + + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/stringquery.cpp b/Network/wpa_gui-qt4_/stringquery.cpp new file mode 100644 index 0000000..1ca98d9 --- /dev/null +++ b/Network/wpa_gui-qt4_/stringquery.cpp @@ -0,0 +1,37 @@ +/* + * wpa_gui - StringQuery class + * Copyright (c) 2009, Atheros Communications + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include + +#include "stringquery.h" + + +StringQuery::StringQuery(QString label) +{ + edit = new QLineEdit; + edit->setFocus(); + QGridLayout *layout = new QGridLayout; + layout->addWidget(new QLabel(label), 0, 0); + layout->addWidget(edit, 0, 1); + setLayout(layout); + + connect(edit, SIGNAL(returnPressed()), this, SLOT(accept())); +} + + +QString StringQuery::get_string() +{ + return edit->text(); +} diff --git a/Network/wpa_gui-qt4_/stringquery.h b/Network/wpa_gui-qt4_/stringquery.h new file mode 100644 index 0000000..1b68217 --- /dev/null +++ b/Network/wpa_gui-qt4_/stringquery.h @@ -0,0 +1,34 @@ +/* + * wpa_gui - StringQuery class + * Copyright (c) 2009, Atheros Communications + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef STRINGQUERY_H +#define STRINGQUERY_H + +#include +#include +#include + +class StringQuery : public QDialog +{ + Q_OBJECT + +public: + StringQuery(QString label); + QString get_string(); + +private: + QLineEdit *edit; +}; + +#endif /* STRINGQUERY_H */ diff --git a/Network/wpa_gui-qt4_/userdatarequest.cpp b/Network/wpa_gui-qt4_/userdatarequest.cpp new file mode 100644 index 0000000..345f965 --- /dev/null +++ b/Network/wpa_gui-qt4_/userdatarequest.cpp @@ -0,0 +1,100 @@ +/* + * wpa_gui - UserDataRequest class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include "userdatarequest.h" +#include "wpagui.h" +#include "common/wpa_ctrl.h" + + +UserDataRequest::UserDataRequest(QWidget *parent, const char *, bool, + Qt::WFlags) + : QDialog(parent) +{ + setupUi(this); + + connect(buttonOk, SIGNAL(clicked()), this, SLOT(sendReply())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(queryEdit, SIGNAL(returnPressed()), this, SLOT(sendReply())); +} + + +UserDataRequest::~UserDataRequest() +{ +} + + +void UserDataRequest::languageChange() +{ + retranslateUi(this); +} + + +int UserDataRequest::setParams(WpaGui *_wpagui, const char *reqMsg) +{ + char *tmp, *pos, *pos2; + wpagui = _wpagui; + tmp = strdup(reqMsg); + if (tmp == NULL) + return -1; + pos = strchr(tmp, '-'); + if (pos == NULL) { + free(tmp); + return -1; + } + *pos++ = '\0'; + field = tmp; + pos2 = strchr(pos, ':'); + if (pos2 == NULL) { + free(tmp); + return -1; + } + *pos2++ = '\0'; + + networkid = atoi(pos); + queryInfo->setText(pos2); + if (strcmp(tmp, "PASSWORD") == 0) { + queryField->setText(tr("Password: ")); + queryEdit->setEchoMode(QLineEdit::Password); + } else if (strcmp(tmp, "NEW_PASSWORD") == 0) { + queryField->setText(tr("New password: ")); + queryEdit->setEchoMode(QLineEdit::Password); + } else if (strcmp(tmp, "IDENTITY") == 0) + queryField->setText(tr("Identity: ")); + else if (strcmp(tmp, "PASSPHRASE") == 0) { + queryField->setText(tr("Private key passphrase: ")); + queryEdit->setEchoMode(QLineEdit::Password); + } else + queryField->setText(field + ":"); + free(tmp); + + return 0; +} + + +void UserDataRequest::sendReply() +{ + char reply[10]; + size_t reply_len = sizeof(reply); + + if (wpagui == NULL) { + reject(); + return; + } + + QString cmd = QString(WPA_CTRL_RSP) + field + '-' + + QString::number(networkid) + ':' + + queryEdit->text(); + wpagui->ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + accept(); +} diff --git a/Network/wpa_gui-qt4_/userdatarequest.h b/Network/wpa_gui-qt4_/userdatarequest.h new file mode 100644 index 0000000..2b6e837 --- /dev/null +++ b/Network/wpa_gui-qt4_/userdatarequest.h @@ -0,0 +1,46 @@ +/* + * wpa_gui - UserDataRequest class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef USERDATAREQUEST_H +#define USERDATAREQUEST_H + +#include +#include "ui_userdatarequest.h" + +class WpaGui; + +class UserDataRequest : public QDialog, public Ui::UserDataRequest +{ + Q_OBJECT + +public: + UserDataRequest(QWidget *parent = 0, const char *name = 0, + bool modal = false, Qt::WFlags fl = 0); + ~UserDataRequest(); + + int setParams(WpaGui *_wpagui, const char *reqMsg); + +public slots: + virtual void sendReply(); + +protected slots: + virtual void languageChange(); + +private: + WpaGui *wpagui; + int networkid; + QString field; +}; + +#endif /* USERDATAREQUEST_H */ diff --git a/Network/wpa_gui-qt4_/userdatarequest.ui b/Network/wpa_gui-qt4_/userdatarequest.ui new file mode 100644 index 0000000..1de2a26 --- /dev/null +++ b/Network/wpa_gui-qt4_/userdatarequest.ui @@ -0,0 +1,109 @@ + + + + + UserDataRequest + + + + 0 + 0 + 216 + 103 + + + + Authentication credentials required + + + true + + + + + + + + + + + + + 0 + + + + + + + + + + + + true + + + QLineEdit::Password + + + + + + + + + 0 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + &OK + + + + + + true + + + true + + + + + + + &Cancel + + + + + + true + + + + + + + + + + diff --git a/Network/wpa_gui-qt4_/wpa_gui.desktop b/Network/wpa_gui-qt4_/wpa_gui.desktop new file mode 100644 index 0000000..ccc7d87 --- /dev/null +++ b/Network/wpa_gui-qt4_/wpa_gui.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=wpa_gui +Comment=Graphical user interface for wpa_supplicant +Exec=wpa_gui +Icon=wpa_gui +GenericName=wpa_supplicant user interface +Terminal=false +Type=Application +Categories=Qt;Network; diff --git a/Network/wpa_gui-qt4_/wpa_gui.pro b/Network/wpa_gui-qt4_/wpa_gui.pro new file mode 100644 index 0000000..85848d7 --- /dev/null +++ b/Network/wpa_gui-qt4_/wpa_gui.pro @@ -0,0 +1,68 @@ +TEMPLATE = app +LANGUAGE = C++ +TRANSLATIONS = lang/wpa_gui_de.ts + +CONFIG += qt warn_on release + +DEFINES += CONFIG_CTRL_IFACE + +win32 { + LIBS += -lws2_32 -static + DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE + SOURCES += ../../src/utils/os_win32.c +} else:win32-g++ { + # cross compilation to win32 + LIBS += -lws2_32 -static -mwindows + DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE + SOURCES += ../../src/utils/os_win32.c + RESOURCES += icons_png.qrc +} else:win32-x-g++ { + # cross compilation to win32 + LIBS += -lws2_32 -static -mwindows + DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE + DEFINES += _X86_ + SOURCES += ../../src/utils/os_win32.c + RESOURCES += icons_png.qrc +} else { + DEFINES += CONFIG_CTRL_IFACE_UNIX + SOURCES += ../../src/utils/os_unix.c +} + +INCLUDEPATH += . .. ../../src ../../src/utils + +HEADERS += wpamsg.h \ + wpagui.h \ + eventhistory.h \ + scanresults.h \ + userdatarequest.h \ + networkconfig.h \ + addinterface.h \ + peers.h \ + stringquery.h + +SOURCES += main.cpp \ + wpagui.cpp \ + eventhistory.cpp \ + scanresults.cpp \ + userdatarequest.cpp \ + networkconfig.cpp \ + addinterface.cpp \ + peers.cpp \ + stringquery.cpp \ + ../../src/common/wpa_ctrl.c + +RESOURCES += icons.qrc + +FORMS = wpagui.ui \ + eventhistory.ui \ + scanresults.ui \ + userdatarequest.ui \ + networkconfig.ui \ + peers.ui + + +unix { + UI_DIR = .ui + MOC_DIR = .moc + OBJECTS_DIR = .obj +} diff --git a/Network/wpa_gui-qt4_/wpagui.cpp b/Network/wpa_gui-qt4_/wpagui.cpp new file mode 100644 index 0000000..97bf5ac --- /dev/null +++ b/Network/wpa_gui-qt4_/wpagui.cpp @@ -0,0 +1,1748 @@ +/* + * wpa_gui - WpaGui class + * Copyright (c) 2005-2011, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifdef __MINGW32__ +/* Need to get getopt() */ +#include +#endif + +#ifdef CONFIG_NATIVE_WINDOWS +#include +#endif /* CONFIG_NATIVE_WINDOWS */ + +#include +#include +#include +#include +#include + +#include "wpagui.h" +#include "dirent.h" +#include "common/wpa_ctrl.h" +#include "userdatarequest.h" +#include "networkconfig.h" + +#if 1 +/* Silence stdout */ +#define printf wpagui_printf +static int wpagui_printf(const char *, ...) +{ + return 0; +} +#endif + +WpaGui::WpaGui(QApplication *_app, QWidget *parent, const char *, Qt::WFlags) + : QMainWindow(parent), app(_app) +{ + setupUi(this); + +#ifdef CONFIG_NATIVE_WINDOWS + fileStopServiceAction = new QAction(this); + fileStopServiceAction->setObjectName("Stop Service"); + fileStopServiceAction->setIconText(tr("Stop Service")); + fileMenu->insertAction(actionWPS, fileStopServiceAction); + + fileStartServiceAction = new QAction(this); + fileStartServiceAction->setObjectName("Start Service"); + fileStartServiceAction->setIconText(tr("Start Service")); + fileMenu->insertAction(fileStopServiceAction, fileStartServiceAction); + + connect(fileStartServiceAction, SIGNAL(triggered()), this, + SLOT(startService())); + connect(fileStopServiceAction, SIGNAL(triggered()), this, + SLOT(stopService())); + + addInterfaceAction = new QAction(this); + addInterfaceAction->setIconText(tr("Add Interface")); + fileMenu->insertAction(fileStartServiceAction, addInterfaceAction); + + connect(addInterfaceAction, SIGNAL(triggered()), this, + SLOT(addInterface())); +#endif /* CONFIG_NATIVE_WINDOWS */ + + (void) statusBar(); + + /* + * Disable WPS tab by default; it will be enabled if wpa_supplicant is + * built with WPS support. + */ + wpsTab->setEnabled(false); + wpaguiTab->setTabEnabled(wpaguiTab->indexOf(wpsTab), false); + + connect(fileEventHistoryAction, SIGNAL(triggered()), this, + SLOT(eventHistory())); + connect(fileSaveConfigAction, SIGNAL(triggered()), this, + SLOT(saveConfig())); + connect(actionWPS, SIGNAL(triggered()), this, SLOT(wpsDialog())); + connect(actionPeers, SIGNAL(triggered()), this, SLOT(peersDialog())); + connect(fileExitAction, SIGNAL(triggered()), qApp, SLOT(quit())); + connect(networkAddAction, SIGNAL(triggered()), this, + SLOT(addNetwork())); + connect(networkEditAction, SIGNAL(triggered()), this, + SLOT(editSelectedNetwork())); + connect(networkRemoveAction, SIGNAL(triggered()), this, + SLOT(removeSelectedNetwork())); + connect(networkEnableAllAction, SIGNAL(triggered()), this, + SLOT(enableAllNetworks())); + connect(networkDisableAllAction, SIGNAL(triggered()), this, + SLOT(disableAllNetworks())); + connect(networkRemoveAllAction, SIGNAL(triggered()), this, + SLOT(removeAllNetworks())); + connect(helpIndexAction, SIGNAL(triggered()), this, SLOT(helpIndex())); + connect(helpContentsAction, SIGNAL(triggered()), this, + SLOT(helpContents())); + connect(helpAboutAction, SIGNAL(triggered()), this, SLOT(helpAbout())); + connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect())); + connect(scanButton, SIGNAL(clicked()), this, SLOT(scan())); + connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB())); + connect(adapterSelect, SIGNAL(activated(const QString&)), this, + SLOT(selectAdapter(const QString&))); + connect(networkSelect, SIGNAL(activated(const QString&)), this, + SLOT(selectNetwork(const QString&))); + connect(addNetworkButton, SIGNAL(clicked()), this, SLOT(addNetwork())); + connect(editNetworkButton, SIGNAL(clicked()), this, + SLOT(editListedNetwork())); + connect(removeNetworkButton, SIGNAL(clicked()), this, + SLOT(removeListedNetwork())); + connect(networkList, SIGNAL(itemSelectionChanged()), this, + SLOT(updateNetworkDisabledStatus())); + connect(enableRadioButton, SIGNAL(toggled(bool)), this, + SLOT(enableListedNetwork(bool))); + connect(disableRadioButton, SIGNAL(toggled(bool)), this, + SLOT(disableListedNetwork(bool))); + connect(scanNetworkButton, SIGNAL(clicked()), this, SLOT(scan())); + connect(networkList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), + this, SLOT(editListedNetwork())); + connect(wpaguiTab, SIGNAL(currentChanged(int)), this, + SLOT(tabChanged(int))); + connect(wpsPbcButton, SIGNAL(clicked()), this, SLOT(wpsPbc())); + connect(wpsPinButton, SIGNAL(clicked()), this, SLOT(wpsGeneratePin())); + connect(wpsApPinEdit, SIGNAL(textChanged(const QString &)), this, + SLOT(wpsApPinChanged(const QString &))); + connect(wpsApPinButton, SIGNAL(clicked()), this, SLOT(wpsApPin())); + + eh = NULL; + scanres = NULL; + peers = NULL; + add_iface = NULL; + udr = NULL; + tray_icon = NULL; + startInTray = false; + ctrl_iface = NULL; + ctrl_conn = NULL; + monitor_conn = NULL; + msgNotifier = NULL; + ctrl_iface_dir = strdup("/var/run/wpa_supplicant"); + + parse_argv(); + +#ifndef QT_NO_SESSIONMANAGER + if (app->isSessionRestored()) { + QSettings settings("wpa_supplicant", "wpa_gui"); + settings.beginGroup("state"); + if (app->sessionId().compare(settings.value("session_id"). + toString()) == 0) + startInTray = settings.value("in_tray").toBool(); + settings.endGroup(); + } +#endif + + if (QSystemTrayIcon::isSystemTrayAvailable()) + createTrayIcon(startInTray); + else + show(); + + connectedToService = false; + textStatus->setText(tr("connecting to wpa_supplicant")); + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), SLOT(ping())); + timer->setSingleShot(FALSE); + timer->start(1000); + + if (openCtrlConnection(ctrl_iface) < 0) { + printf("Failed to open control connection to " + "wpa_supplicant.\n"); + } + + updateStatus(); + networkMayHaveChanged = true; + updateNetworks(); +} + + +WpaGui::~WpaGui() +{ + delete msgNotifier; + + if (monitor_conn) { + wpa_ctrl_detach(monitor_conn); + wpa_ctrl_close(monitor_conn); + monitor_conn = NULL; + } + if (ctrl_conn) { + wpa_ctrl_close(ctrl_conn); + ctrl_conn = NULL; + } + + if (eh) { + eh->close(); + delete eh; + eh = NULL; + } + + if (scanres) { + scanres->close(); + delete scanres; + scanres = NULL; + } + + if (peers) { + peers->close(); + delete peers; + peers = NULL; + } + + if (add_iface) { + add_iface->close(); + delete add_iface; + add_iface = NULL; + } + + if (udr) { + udr->close(); + delete udr; + udr = NULL; + } + + free(ctrl_iface); + ctrl_iface = NULL; + + free(ctrl_iface_dir); + ctrl_iface_dir = NULL; +} + + +void WpaGui::languageChange() +{ + retranslateUi(this); +} + + +void WpaGui::parse_argv() +{ + int c; + for (;;) { + c = getopt(qApp->argc(), qApp->argv(), "i:p:t"); + if (c < 0) + break; + switch (c) { + case 'i': + free(ctrl_iface); + ctrl_iface = strdup(optarg); + break; + case 'p': + free(ctrl_iface_dir); + ctrl_iface_dir = strdup(optarg); + break; + case 't': + startInTray = true; + break; + } + } +} + + +int WpaGui::openCtrlConnection(const char *ifname) +{ + char *cfile; + int flen; + char buf[2048], *pos, *pos2; + size_t len; + + if (ifname) { + if (ifname != ctrl_iface) { + free(ctrl_iface); + ctrl_iface = strdup(ifname); + } + } else { +#ifdef CONFIG_CTRL_IFACE_UDP + free(ctrl_iface); + ctrl_iface = strdup("udp"); +#endif /* CONFIG_CTRL_IFACE_UDP */ +#ifdef CONFIG_CTRL_IFACE_UNIX + struct dirent *dent; + DIR *dir = opendir(ctrl_iface_dir); + free(ctrl_iface); + ctrl_iface = NULL; + if (dir) { + while ((dent = readdir(dir))) { +#ifdef _DIRENT_HAVE_D_TYPE + /* Skip the file if it is not a socket. + * Also accept DT_UNKNOWN (0) in case + * the C library or underlying file + * system does not support d_type. */ + if (dent->d_type != DT_SOCK && + dent->d_type != DT_UNKNOWN) + continue; +#endif /* _DIRENT_HAVE_D_TYPE */ + + if (strcmp(dent->d_name, ".") == 0 || + strcmp(dent->d_name, "..") == 0) + continue; + printf("Selected interface '%s'\n", + dent->d_name); + ctrl_iface = strdup(dent->d_name); + break; + } + closedir(dir); + } +#endif /* CONFIG_CTRL_IFACE_UNIX */ +#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE + struct wpa_ctrl *ctrl; + int ret; + + free(ctrl_iface); + ctrl_iface = NULL; + + ctrl = wpa_ctrl_open(NULL); + if (ctrl) { + len = sizeof(buf) - 1; + ret = wpa_ctrl_request(ctrl, "INTERFACES", 10, buf, + &len, NULL); + if (ret >= 0) { + connectedToService = true; + buf[len] = '\0'; + pos = strchr(buf, '\n'); + if (pos) + *pos = '\0'; + ctrl_iface = strdup(buf); + } + wpa_ctrl_close(ctrl); + } +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ + } + + if (ctrl_iface == NULL) { +#ifdef CONFIG_NATIVE_WINDOWS + static bool first = true; + if (first && !serviceRunning()) { + first = false; + if (QMessageBox::warning( + this, qAppName(), + tr("wpa_supplicant service is not " + "running.\n" + "Do you want to start it?"), + QMessageBox::Yes | QMessageBox::No) == + QMessageBox::Yes) + startService(); + } +#endif /* CONFIG_NATIVE_WINDOWS */ + return -1; + } + +#ifdef CONFIG_CTRL_IFACE_UNIX + flen = strlen(ctrl_iface_dir) + strlen(ctrl_iface) + 2; + cfile = (char *) malloc(flen); + if (cfile == NULL) + return -1; + snprintf(cfile, flen, "%s/%s", ctrl_iface_dir, ctrl_iface); +#else /* CONFIG_CTRL_IFACE_UNIX */ + flen = strlen(ctrl_iface) + 1; + cfile = (char *) malloc(flen); + if (cfile == NULL) + return -1; + snprintf(cfile, flen, "%s", ctrl_iface); +#endif /* CONFIG_CTRL_IFACE_UNIX */ + + if (ctrl_conn) { + wpa_ctrl_close(ctrl_conn); + ctrl_conn = NULL; + } + + if (monitor_conn) { + delete msgNotifier; + msgNotifier = NULL; + wpa_ctrl_detach(monitor_conn); + wpa_ctrl_close(monitor_conn); + monitor_conn = NULL; + } + + printf("Trying to connect to '%s'\n", cfile); + ctrl_conn = wpa_ctrl_open(cfile); + if (ctrl_conn == NULL) { + free(cfile); + return -1; + } + monitor_conn = wpa_ctrl_open(cfile); + free(cfile); + if (monitor_conn == NULL) { + wpa_ctrl_close(ctrl_conn); + return -1; + } + if (wpa_ctrl_attach(monitor_conn)) { + printf("Failed to attach to wpa_supplicant\n"); + wpa_ctrl_close(monitor_conn); + monitor_conn = NULL; + wpa_ctrl_close(ctrl_conn); + ctrl_conn = NULL; + return -1; + } + +#if defined(CONFIG_CTRL_IFACE_UNIX) || defined(CONFIG_CTRL_IFACE_UDP) + msgNotifier = new QSocketNotifier(wpa_ctrl_get_fd(monitor_conn), + QSocketNotifier::Read, this); + connect(msgNotifier, SIGNAL(activated(int)), SLOT(receiveMsgs())); +#endif + + adapterSelect->clear(); + adapterSelect->addItem(ctrl_iface); + adapterSelect->setCurrentIndex(0); + + len = sizeof(buf) - 1; + if (wpa_ctrl_request(ctrl_conn, "INTERFACES", 10, buf, &len, NULL) >= + 0) { + buf[len] = '\0'; + pos = buf; + while (*pos) { + pos2 = strchr(pos, '\n'); + if (pos2) + *pos2 = '\0'; + if (strcmp(pos, ctrl_iface) != 0) + adapterSelect->addItem(pos); + if (pos2) + pos = pos2 + 1; + else + break; + } + } + + len = sizeof(buf) - 1; + if (wpa_ctrl_request(ctrl_conn, "GET_CAPABILITY eap", 18, buf, &len, + NULL) >= 0) { + buf[len] = '\0'; + + QString res(buf); + QStringList types = res.split(QChar(' ')); + bool wps = types.contains("WSC"); + actionWPS->setEnabled(wps); + wpsTab->setEnabled(wps); + wpaguiTab->setTabEnabled(wpaguiTab->indexOf(wpsTab), wps); + } + + return 0; +} + + +int WpaGui::ctrlRequest(const char *cmd, char *buf, size_t *buflen) +{ + int ret; + + if (ctrl_conn == NULL) + return -3; + ret = wpa_ctrl_request(ctrl_conn, cmd, strlen(cmd), buf, buflen, NULL); + if (ret == -2) + printf("'%s' command timed out.\n", cmd); + else if (ret < 0) + printf("'%s' command failed.\n", cmd); + + return ret; +} + + +QString WpaGui::wpaStateTranslate(char *state) +{ + if (!strcmp(state, "DISCONNECTED")) + return tr("Disconnected"); + else if (!strcmp(state, "INACTIVE")) + return tr("Inactive"); + else if (!strcmp(state, "SCANNING")) + return tr("Scanning"); + else if (!strcmp(state, "AUTHENTICATING")) + return tr("Authenticating"); + else if (!strcmp(state, "ASSOCIATING")) + return tr("Associating"); + else if (!strcmp(state, "ASSOCIATED")) + return tr("Associated"); + else if (!strcmp(state, "4WAY_HANDSHAKE")) + return tr("4-Way Handshake"); + else if (!strcmp(state, "GROUP_HANDSHAKE")) + return tr("Group Handshake"); + else if (!strcmp(state, "COMPLETED")) + return tr("Completed"); + else + return tr("Unknown"); +} + + +void WpaGui::updateStatus() +{ + char buf[2048], *start, *end, *pos; + size_t len; + + pingsToStatusUpdate = 10; + + len = sizeof(buf) - 1; + if (ctrl_conn == NULL || ctrlRequest("STATUS", buf, &len) < 0) { + textStatus->setText(tr("Could not get status from " + "wpa_supplicant")); + textAuthentication->clear(); + textEncryption->clear(); + textSsid->clear(); + textBssid->clear(); + textIpAddress->clear(); + +#ifdef CONFIG_NATIVE_WINDOWS + static bool first = true; + if (first && connectedToService && + (ctrl_iface == NULL || *ctrl_iface == '\0')) { + first = false; + if (QMessageBox::information( + this, qAppName(), + tr("No network interfaces in use.\n" + "Would you like to add one?"), + QMessageBox::Yes | QMessageBox::No) == + QMessageBox::Yes) + addInterface(); + } +#endif /* CONFIG_NATIVE_WINDOWS */ + return; + } + + buf[len] = '\0'; + + bool auth_updated = false, ssid_updated = false; + bool bssid_updated = false, ipaddr_updated = false; + bool status_updated = false; + char *pairwise_cipher = NULL, *group_cipher = NULL; + char *mode = NULL; + + start = buf; + while (*start) { + bool last = false; + end = strchr(start, '\n'); + if (end == NULL) { + last = true; + end = start; + while (end[0] && end[1]) + end++; + } + *end = '\0'; + + pos = strchr(start, '='); + if (pos) { + *pos++ = '\0'; + if (strcmp(start, "bssid") == 0) { + bssid_updated = true; + textBssid->setText(pos); + } else if (strcmp(start, "ssid") == 0) { + ssid_updated = true; + textSsid->setText(pos); + } else if (strcmp(start, "ip_address") == 0) { + ipaddr_updated = true; + textIpAddress->setText(pos); + } else if (strcmp(start, "wpa_state") == 0) { + status_updated = true; + textStatus->setText(wpaStateTranslate(pos)); + } else if (strcmp(start, "key_mgmt") == 0) { + auth_updated = true; + textAuthentication->setText(pos); + /* TODO: could add EAP status to this */ + } else if (strcmp(start, "pairwise_cipher") == 0) { + pairwise_cipher = pos; + } else if (strcmp(start, "group_cipher") == 0) { + group_cipher = pos; + } else if (strcmp(start, "mode") == 0) { + mode = pos; + } + } + + if (last) + break; + start = end + 1; + } + if (status_updated && mode) + textStatus->setText(textStatus->text() + " (" + mode + ")"); + + if (pairwise_cipher || group_cipher) { + QString encr; + if (pairwise_cipher && group_cipher && + strcmp(pairwise_cipher, group_cipher) != 0) { + encr.append(pairwise_cipher); + encr.append(" + "); + encr.append(group_cipher); + } else if (pairwise_cipher) { + encr.append(pairwise_cipher); + } else { + encr.append(group_cipher); + encr.append(" [group key only]"); + } + textEncryption->setText(encr); + } else + textEncryption->clear(); + + if (!status_updated) + textStatus->clear(); + if (!auth_updated) + textAuthentication->clear(); + if (!ssid_updated) + textSsid->clear(); + if (!bssid_updated) + textBssid->clear(); + if (!ipaddr_updated) + textIpAddress->clear(); +} + + +void WpaGui::updateNetworks() +{ + char buf[2048], *start, *end, *id, *ssid, *bssid, *flags; + size_t len; + int first_active = -1; + int was_selected = -1; + bool current = false; + + if (!networkMayHaveChanged) + return; + + if (networkList->currentRow() >= 0) + was_selected = networkList->currentRow(); + + networkSelect->clear(); + networkList->clear(); + + if (ctrl_conn == NULL) + return; + + len = sizeof(buf) - 1; + if (ctrlRequest("LIST_NETWORKS", buf, &len) < 0) + return; + + buf[len] = '\0'; + start = strchr(buf, '\n'); + if (start == NULL) + return; + start++; + + while (*start) { + bool last = false; + end = strchr(start, '\n'); + if (end == NULL) { + last = true; + end = start; + while (end[0] && end[1]) + end++; + } + *end = '\0'; + + id = start; + ssid = strchr(id, '\t'); + if (ssid == NULL) + break; + *ssid++ = '\0'; + bssid = strchr(ssid, '\t'); + if (bssid == NULL) + break; + *bssid++ = '\0'; + flags = strchr(bssid, '\t'); + if (flags == NULL) + break; + *flags++ = '\0'; + + if (strstr(flags, "[DISABLED][P2P-PERSISTENT]")) { + if (last) + break; + start = end + 1; + continue; + } + + QString network(id); + network.append(": "); + network.append(ssid); + networkSelect->addItem(network); + networkList->addItem(network); + + if (strstr(flags, "[CURRENT]")) { + networkSelect->setCurrentIndex(networkSelect->count() - + 1); + current = true; + } else if (first_active < 0 && + strstr(flags, "[DISABLED]") == NULL) + first_active = networkSelect->count() - 1; + + if (last) + break; + start = end + 1; + } + + if (networkSelect->count() > 1) + networkSelect->addItem(tr("Select any network")); + + if (!current && first_active >= 0) + networkSelect->setCurrentIndex(first_active); + + if (was_selected >= 0 && networkList->count() > 0) { + if (was_selected < networkList->count()) + networkList->setCurrentRow(was_selected); + else + networkList->setCurrentRow(networkList->count() - 1); + } + else + networkList->setCurrentRow(networkSelect->currentIndex()); + + networkMayHaveChanged = false; +} + + +void WpaGui::helpIndex() +{ + printf("helpIndex\n"); +} + + +void WpaGui::helpContents() +{ + printf("helpContents\n"); +} + + +void WpaGui::helpAbout() +{ + QMessageBox::about(this, "wpa_gui for wpa_supplicant", + "Copyright (c) 2003-2011,\n" + "Jouni Malinen \n" + "and contributors.\n" + "\n" + "This program is free software. You can\n" + "distribute it and/or modify it under the terms " + "of\n" + "the GNU General Public License version 2.\n" + "\n" + "Alternatively, this software may be distributed\n" + "under the terms of the BSD license.\n" + "\n" + "This product includes software developed\n" + "by the OpenSSL Project for use in the\n" + "OpenSSL Toolkit (http://www.openssl.org/)\n"); +} + + +void WpaGui::disconnect() +{ + char reply[10]; + size_t reply_len = sizeof(reply); + ctrlRequest("DISCONNECT", reply, &reply_len); + stopWpsRun(false); +} + + +void WpaGui::scan() +{ + if (scanres) { + scanres->close(); + delete scanres; + } + + scanres = new ScanResults(); + if (scanres == NULL) + return; + scanres->setWpaGui(this); + scanres->show(); + scanres->exec(); +} + + +void WpaGui::eventHistory() +{ + if (eh) { + eh->close(); + delete eh; + } + + eh = new EventHistory(); + if (eh == NULL) + return; + eh->addEvents(msgs); + eh->show(); + eh->exec(); +} + + +void WpaGui::ping() +{ + char buf[10]; + size_t len; + +#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE + /* + * QSocketNotifier cannot be used with Windows named pipes, so use a + * timer to check for received messages for now. This could be + * optimized be doing something specific to named pipes or Windows + * events, but it is not clear what would be the best way of doing that + * in Qt. + */ + receiveMsgs(); +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ + + if (scanres && !scanres->isVisible()) { + delete scanres; + scanres = NULL; + } + + if (eh && !eh->isVisible()) { + delete eh; + eh = NULL; + } + + if (udr && !udr->isVisible()) { + delete udr; + udr = NULL; + } + + len = sizeof(buf) - 1; + if (ctrlRequest("PING", buf, &len) < 0) { + printf("PING failed - trying to reconnect\n"); + if (openCtrlConnection(ctrl_iface) >= 0) { + printf("Reconnected successfully\n"); + pingsToStatusUpdate = 0; + } + } + + pingsToStatusUpdate--; + if (pingsToStatusUpdate <= 0) { + updateStatus(); + updateNetworks(); + } + +#ifndef CONFIG_CTRL_IFACE_NAMED_PIPE + /* Use less frequent pings and status updates when the main window is + * hidden (running in taskbar). */ + int interval = isHidden() ? 5000 : 1000; + if (timer->interval() != interval) + timer->setInterval(interval); +#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */ +} + + +static int str_match(const char *a, const char *b) +{ + return strncmp(a, b, strlen(b)) == 0; +} + + +void WpaGui::processMsg(char *msg) +{ + char *pos = msg, *pos2; + int priority = 2; + + if (*pos == '<') { + /* skip priority */ + pos++; + priority = atoi(pos); + pos = strchr(pos, '>'); + if (pos) + pos++; + else + pos = msg; + } + + WpaMsg wm(pos, priority); + if (eh) + eh->addEvent(wm); + if (peers) + peers->event_notify(wm); + msgs.append(wm); + while (msgs.count() > 100) + msgs.pop_front(); + + /* Update last message with truncated version of the event */ + if (strncmp(pos, "CTRL-", 5) == 0) { + pos2 = strchr(pos, str_match(pos, WPA_CTRL_REQ) ? ':' : ' '); + if (pos2) + pos2++; + else + pos2 = pos; + } else + pos2 = pos; + QString lastmsg = pos2; + lastmsg.truncate(40); + textLastMessage->setText(lastmsg); + + pingsToStatusUpdate = 0; + networkMayHaveChanged = true; + + if (str_match(pos, WPA_CTRL_REQ)) + processCtrlReq(pos + strlen(WPA_CTRL_REQ)); + else if (str_match(pos, WPA_EVENT_SCAN_RESULTS) && scanres) + scanres->updateResults(); + else if (str_match(pos, WPA_EVENT_DISCONNECTED)) + showTrayMessage(QSystemTrayIcon::Information, 3, + tr("Disconnected from network.")); + else if (str_match(pos, WPA_EVENT_CONNECTED)) { + showTrayMessage(QSystemTrayIcon::Information, 3, + tr("Connection to network established.")); + QTimer::singleShot(5 * 1000, this, SLOT(showTrayStatus())); + stopWpsRun(true); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_PBC)) { + wpsStatusText->setText(tr("WPS AP in active PBC mode found")); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + wpsInstructions->setText(tr("Press the PBC button on the " + "screen to start registration")); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_PIN)) { + wpsStatusText->setText(tr("WPS AP with recently selected " + "registrar")); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE_AUTH)) { + showTrayMessage(QSystemTrayIcon::Information, 3, + "Wi-Fi Protected Setup (WPS) AP\n" + "indicating this client is authorized."); + wpsStatusText->setText("WPS AP indicating this client is " + "authorized"); + if (textStatus->text() == "INACTIVE" || + textStatus->text() == "DISCONNECTED") + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_AP_AVAILABLE)) { + wpsStatusText->setText(tr("WPS AP detected")); + } else if (str_match(pos, WPS_EVENT_OVERLAP)) { + wpsStatusText->setText(tr("PBC mode overlap detected")); + wpsInstructions->setText(tr("More than one AP is currently in " + "active WPS PBC mode. Wait couple " + "of minutes and try again")); + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPS_EVENT_CRED_RECEIVED)) { + wpsStatusText->setText(tr("Network configuration received")); + wpaguiTab->setCurrentWidget(wpsTab); + } else if (str_match(pos, WPA_EVENT_EAP_METHOD)) { + if (strstr(pos, "(WSC)")) + wpsStatusText->setText(tr("Registration started")); + } else if (str_match(pos, WPS_EVENT_M2D)) { + wpsStatusText->setText(tr("Registrar does not yet know PIN")); + } else if (str_match(pos, WPS_EVENT_FAIL)) { + wpsStatusText->setText(tr("Registration failed")); + } else if (str_match(pos, WPS_EVENT_SUCCESS)) { + wpsStatusText->setText(tr("Registration succeeded")); + } +} + + +void WpaGui::processCtrlReq(const char *req) +{ + if (udr) { + udr->close(); + delete udr; + } + udr = new UserDataRequest(); + if (udr == NULL) + return; + if (udr->setParams(this, req) < 0) { + delete udr; + udr = NULL; + return; + } + udr->show(); + udr->exec(); +} + + +void WpaGui::receiveMsgs() +{ + char buf[256]; + size_t len; + + while (monitor_conn && wpa_ctrl_pending(monitor_conn) > 0) { + len = sizeof(buf) - 1; + if (wpa_ctrl_recv(monitor_conn, buf, &len) == 0) { + buf[len] = '\0'; + processMsg(buf); + } + } +} + + +void WpaGui::connectB() +{ + char reply[10]; + size_t reply_len = sizeof(reply); + ctrlRequest("REASSOCIATE", reply, &reply_len); +} + + +void WpaGui::selectNetwork( const QString &sel ) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply); + + if (cmd.contains(QRegExp("^\\d+:"))) + cmd.truncate(cmd.indexOf(':')); + else + cmd = "any"; + cmd.prepend("SELECT_NETWORK "); + ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + triggerUpdate(); + stopWpsRun(false); +} + + +void WpaGui::enableNetwork(const QString &sel) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply); + + if (cmd.contains(QRegExp("^\\d+:"))) + cmd.truncate(cmd.indexOf(':')); + else if (!cmd.startsWith("all")) { + printf("Invalid editNetwork '%s'\n", + cmd.toAscii().constData()); + return; + } + cmd.prepend("ENABLE_NETWORK "); + ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + triggerUpdate(); +} + + +void WpaGui::disableNetwork(const QString &sel) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply); + + if (cmd.contains(QRegExp("^\\d+:"))) + cmd.truncate(cmd.indexOf(':')); + else if (!cmd.startsWith("all")) { + printf("Invalid editNetwork '%s'\n", + cmd.toAscii().constData()); + return; + } + cmd.prepend("DISABLE_NETWORK "); + ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + triggerUpdate(); +} + + +void WpaGui::editNetwork(const QString &sel) +{ + QString cmd(sel); + int id = -1; + + if (cmd.contains(QRegExp("^\\d+:"))) { + cmd.truncate(cmd.indexOf(':')); + id = cmd.toInt(); + } + + NetworkConfig *nc = new NetworkConfig(); + if (nc == NULL) + return; + nc->setWpaGui(this); + + if (id >= 0) + nc->paramsFromConfig(id); + else + nc->newNetwork(); + + nc->show(); + nc->exec(); +} + + +void WpaGui::editSelectedNetwork() +{ + if (networkSelect->count() < 1) { + QMessageBox::information( + this, tr("No Networks"), + tr("There are no networks to edit.\n")); + return; + } + QString sel(networkSelect->currentText()); + editNetwork(sel); +} + + +void WpaGui::editListedNetwork() +{ + if (networkList->currentRow() < 0) { + QMessageBox::information(this, tr("Select A Network"), + tr("Select a network from the list to" + " edit it.\n")); + return; + } + QString sel(networkList->currentItem()->text()); + editNetwork(sel); +} + + +void WpaGui::triggerUpdate() +{ + updateStatus(); + networkMayHaveChanged = true; + updateNetworks(); +} + + +void WpaGui::addNetwork() +{ + NetworkConfig *nc = new NetworkConfig(); + if (nc == NULL) + return; + nc->setWpaGui(this); + nc->newNetwork(); + nc->show(); + nc->exec(); +} + + +void WpaGui::removeNetwork(const QString &sel) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply); + + if (cmd.contains(QRegExp("^\\d+:"))) + cmd.truncate(cmd.indexOf(':')); + else if (!cmd.startsWith("all")) { + printf("Invalid editNetwork '%s'\n", + cmd.toAscii().constData()); + return; + } + cmd.prepend("REMOVE_NETWORK "); + ctrlRequest(cmd.toAscii().constData(), reply, &reply_len); + triggerUpdate(); +} + + +void WpaGui::removeSelectedNetwork() +{ + if (networkSelect->count() < 1) { + QMessageBox::information(this, tr("No Networks"), + tr("There are no networks to remove." + "\n")); + return; + } + QString sel(networkSelect->currentText()); + removeNetwork(sel); +} + + +void WpaGui::removeListedNetwork() +{ + if (networkList->currentRow() < 0) { + QMessageBox::information(this, tr("Select A Network"), + tr("Select a network from the list " + "to remove it.\n")); + return; + } + QString sel(networkList->currentItem()->text()); + removeNetwork(sel); +} + + +void WpaGui::enableAllNetworks() +{ + QString sel("all"); + enableNetwork(sel); +} + + +void WpaGui::disableAllNetworks() +{ + QString sel("all"); + disableNetwork(sel); +} + + +void WpaGui::removeAllNetworks() +{ + QString sel("all"); + removeNetwork(sel); +} + + +int WpaGui::getNetworkDisabled(const QString &sel) +{ + QString cmd(sel); + char reply[10]; + size_t reply_len = sizeof(reply) - 1; + int pos = cmd.indexOf(':'); + if (pos < 0) { + printf("Invalid getNetworkDisabled '%s'\n", + cmd.toAscii().constData()); + return -1; + } + cmd.truncate(pos); + cmd.prepend("GET_NETWORK "); + cmd.append(" disabled"); + + if (ctrlRequest(cmd.toAscii().constData(), reply, &reply_len) >= 0 + && reply_len >= 1) { + reply[reply_len] = '\0'; + if (!str_match(reply, "FAIL")) + return atoi(reply); + } + + return -1; +} + + +void WpaGui::updateNetworkDisabledStatus() +{ + if (networkList->currentRow() < 0) + return; + + QString sel(networkList->currentItem()->text()); + + switch (getNetworkDisabled(sel)) { + case 0: + if (!enableRadioButton->isChecked()) + enableRadioButton->setChecked(true); + return; + case 1: + if (!disableRadioButton->isChecked()) + disableRadioButton->setChecked(true); + return; + } +} + + +void WpaGui::enableListedNetwork(bool enabled) +{ + if (networkList->currentRow() < 0 || !enabled) + return; + + QString sel(networkList->currentItem()->text()); + + if (getNetworkDisabled(sel) == 1) + enableNetwork(sel); +} + + +void WpaGui::disableListedNetwork(bool disabled) +{ + if (networkList->currentRow() < 0 || !disabled) + return; + + QString sel(networkList->currentItem()->text()); + + if (getNetworkDisabled(sel) == 0) + disableNetwork(sel); +} + + +void WpaGui::saveConfig() +{ + char buf[10]; + size_t len; + + len = sizeof(buf) - 1; + ctrlRequest("SAVE_CONFIG", buf, &len); + + buf[len] = '\0'; + + if (str_match(buf, "FAIL")) + QMessageBox::warning( + this, tr("Failed to save configuration"), + tr("The configuration could not be saved.\n" + "\n" + "The update_config=1 configuration option\n" + "must be used for configuration saving to\n" + "be permitted.\n")); + else + QMessageBox::information( + this, tr("Saved configuration"), + tr("The current configuration was saved." + "\n")); +} + + +void WpaGui::selectAdapter( const QString & sel ) +{ + if (openCtrlConnection(sel.toAscii().constData()) < 0) + printf("Failed to open control connection to " + "wpa_supplicant.\n"); + updateStatus(); + updateNetworks(); +} + + +void WpaGui::createTrayIcon(bool trayOnly) +{ + QApplication::setQuitOnLastWindowClosed(false); + + tray_icon = new QSystemTrayIcon(this); + tray_icon->setToolTip(qAppName() + tr(" - wpa_supplicant user interface")); + if (QImageReader::supportedImageFormats().contains(QByteArray("svg"))) + tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg")); + else + tray_icon->setIcon(QIcon(":/icons/wpa_gui.png")); + + connect(tray_icon, + SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); + + ackTrayIcon = false; + + tray_menu = new QMenu(this); + + disconnectAction = new QAction(tr("&Disconnect"), this); + reconnectAction = new QAction(tr("Re&connect"), this); + connect(disconnectAction, SIGNAL(triggered()), this, + SLOT(disconnect())); + connect(reconnectAction, SIGNAL(triggered()), this, + SLOT(connectB())); + tray_menu->addAction(disconnectAction); + tray_menu->addAction(reconnectAction); + tray_menu->addSeparator(); + + eventAction = new QAction(tr("&Event History"), this); + scanAction = new QAction(tr("Scan &Results"), this); + statAction = new QAction(tr("S&tatus"), this); + connect(eventAction, SIGNAL(triggered()), this, SLOT(eventHistory())); + connect(scanAction, SIGNAL(triggered()), this, SLOT(scan())); + connect(statAction, SIGNAL(triggered()), this, SLOT(showTrayStatus())); + tray_menu->addAction(eventAction); + tray_menu->addAction(scanAction); + tray_menu->addAction(statAction); + tray_menu->addSeparator(); + + showAction = new QAction(tr("&Show Window"), this); + hideAction = new QAction(tr("&Hide Window"), this); + quitAction = new QAction(tr("&Quit"), this); + connect(showAction, SIGNAL(triggered()), this, SLOT(show())); + connect(hideAction, SIGNAL(triggered()), this, SLOT(hide())); + connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); + tray_menu->addAction(showAction); + tray_menu->addAction(hideAction); + tray_menu->addSeparator(); + tray_menu->addAction(quitAction); + + tray_icon->setContextMenu(tray_menu); + + tray_icon->show(); + + if (!trayOnly) + show(); + inTray = trayOnly; +} + + +void WpaGui::showTrayMessage(QSystemTrayIcon::MessageIcon type, int sec, + const QString & msg) +{ + if (!QSystemTrayIcon::supportsMessages()) + return; + + if (isVisible() || !tray_icon || !tray_icon->isVisible()) + return; + + tray_icon->showMessage(qAppName(), msg, type, sec * 1000); +} + + +void WpaGui::trayActivated(QSystemTrayIcon::ActivationReason how) + { + switch (how) { + /* use close() here instead of hide() and allow the + * custom closeEvent handler take care of children */ + case QSystemTrayIcon::Trigger: + ackTrayIcon = true; + if (isVisible()) { + close(); + inTray = true; + } else { + show(); + inTray = false; + } + break; + case QSystemTrayIcon::MiddleClick: + showTrayStatus(); + break; + default: + break; + } +} + + +void WpaGui::showTrayStatus() +{ + char buf[2048]; + size_t len; + + len = sizeof(buf) - 1; + if (ctrlRequest("STATUS", buf, &len) < 0) + return; + buf[len] = '\0'; + + QString msg, status(buf); + + QStringList lines = status.split(QRegExp("\\n")); + for (QStringList::Iterator it = lines.begin(); + it != lines.end(); it++) { + int pos = (*it).indexOf('=') + 1; + if (pos < 1) + continue; + + if ((*it).startsWith("bssid=")) + msg.append("BSSID:\t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("ssid=")) + msg.append("SSID: \t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("pairwise_cipher=")) + msg.append("PAIR: \t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("group_cipher=")) + msg.append("GROUP:\t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("key_mgmt=")) + msg.append("AUTH: \t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("wpa_state=")) + msg.append("STATE:\t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("ip_address=")) + msg.append("IP: \t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("Supplicant PAE state=")) + msg.append("PAE: \t" + (*it).mid(pos) + "\n"); + else if ((*it).startsWith("EAP state=")) + msg.append("EAP: \t" + (*it).mid(pos) + "\n"); + } + + if (!msg.isEmpty()) + showTrayMessage(QSystemTrayIcon::Information, 10, msg); +} + + +void WpaGui::closeEvent(QCloseEvent *event) +{ + if (eh) { + eh->close(); + delete eh; + eh = NULL; + } + + if (scanres) { + scanres->close(); + delete scanres; + scanres = NULL; + } + + if (peers) { + peers->close(); + delete peers; + peers = NULL; + } + + if (udr) { + udr->close(); + delete udr; + udr = NULL; + } + + if (tray_icon && !ackTrayIcon) { + /* give user a visual hint that the tray icon exists */ + if (QSystemTrayIcon::supportsMessages()) { + hide(); + showTrayMessage(QSystemTrayIcon::Information, 3, + qAppName() + + tr(" will keep running in " + "the system tray.")); + } else { + QMessageBox::information(this, qAppName() + + tr(" systray"), + tr("The program will keep " + "running in the system " + "tray.")); + } + ackTrayIcon = true; + } + + event->accept(); +} + + +void WpaGui::wpsDialog() +{ + wpaguiTab->setCurrentWidget(wpsTab); +} + + +void WpaGui::peersDialog() +{ + if (peers) { + peers->close(); + delete peers; + } + + peers = new Peers(); + if (peers == NULL) + return; + peers->setWpaGui(this); + peers->show(); + peers->exec(); +} + + +void WpaGui::tabChanged(int index) +{ + if (index != 2) + return; + + if (wpsRunning) + return; + + wpsApPinEdit->setEnabled(!bssFromScan.isEmpty()); + if (bssFromScan.isEmpty()) + wpsApPinButton->setEnabled(false); +} + + +void WpaGui::wpsPbc() +{ + char reply[20]; + size_t reply_len = sizeof(reply); + + if (ctrlRequest("WPS_PBC", reply, &reply_len) < 0) + return; + + wpsPinEdit->setEnabled(false); + if (wpsStatusText->text().compare(tr("WPS AP in active PBC mode found"))) { + wpsInstructions->setText(tr("Press the push button on the AP to " + "start the PBC mode.")); + } else { + wpsInstructions->setText(tr("If you have not yet done so, press " + "the push button on the AP to start " + "the PBC mode.")); + } + wpsStatusText->setText(tr("Waiting for Registrar")); + wpsRunning = true; +} + + +void WpaGui::wpsGeneratePin() +{ + char reply[20]; + size_t reply_len = sizeof(reply) - 1; + + if (ctrlRequest("WPS_PIN any", reply, &reply_len) < 0) + return; + + reply[reply_len] = '\0'; + + wpsPinEdit->setText(reply); + wpsPinEdit->setEnabled(true); + wpsInstructions->setText(tr("Enter the generated PIN into the Registrar " + "(either the internal one in the AP or an " + "external one).")); + wpsStatusText->setText(tr("Waiting for Registrar")); + wpsRunning = true; +} + + +void WpaGui::setBssFromScan(const QString &bssid) +{ + bssFromScan = bssid; + wpsApPinEdit->setEnabled(!bssFromScan.isEmpty()); + wpsApPinButton->setEnabled(wpsApPinEdit->text().length() == 8); + wpsStatusText->setText(tr("WPS AP selected from scan results")); + wpsInstructions->setText(tr("If you want to use an AP device PIN, e.g., " + "from a label in the device, enter the eight " + "digit AP PIN and click Use AP PIN button.")); +} + + +void WpaGui::wpsApPinChanged(const QString &text) +{ + wpsApPinButton->setEnabled(text.length() == 8); +} + + +void WpaGui::wpsApPin() +{ + char reply[20]; + size_t reply_len = sizeof(reply); + + QString cmd("WPS_REG " + bssFromScan + " " + wpsApPinEdit->text()); + if (ctrlRequest(cmd.toAscii().constData(), reply, &reply_len) < 0) + return; + + wpsStatusText->setText(tr("Waiting for AP/Enrollee")); + wpsRunning = true; +} + + +void WpaGui::stopWpsRun(bool success) +{ + if (wpsRunning) + wpsStatusText->setText(success ? tr("Connected to the network") : + tr("Stopped")); + else + wpsStatusText->setText(""); + wpsPinEdit->setEnabled(false); + wpsInstructions->setText(""); + wpsRunning = false; + bssFromScan = ""; + wpsApPinEdit->setEnabled(false); + wpsApPinButton->setEnabled(false); +} + + +#ifdef CONFIG_NATIVE_WINDOWS + +#ifndef WPASVC_NAME +#define WPASVC_NAME TEXT("wpasvc") +#endif + +class ErrorMsg : public QMessageBox { +public: + ErrorMsg(QWidget *parent, DWORD last_err = GetLastError()); + void showMsg(QString msg); +private: + DWORD err; +}; + +ErrorMsg::ErrorMsg(QWidget *parent, DWORD last_err) : + QMessageBox(parent), err(last_err) +{ + setWindowTitle(tr("wpa_gui error")); + setIcon(QMessageBox::Warning); +} + +void ErrorMsg::showMsg(QString msg) +{ + LPTSTR buf; + + setText(msg); + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, err, 0, (LPTSTR) (void *) &buf, + 0, NULL) > 0) { + QString msg = QString::fromWCharArray(buf); + setInformativeText(QString("[%1] %2").arg(err).arg(msg)); + LocalFree(buf); + } else { + setInformativeText(QString("[%1]").arg(err)); + } + + exec(); +} + + +void WpaGui::startService() +{ + SC_HANDLE svc, scm; + + scm = OpenSCManager(0, 0, SC_MANAGER_CONNECT); + if (!scm) { + ErrorMsg(this).showMsg(tr("OpenSCManager failed")); + return; + } + + svc = OpenService(scm, WPASVC_NAME, SERVICE_START); + if (!svc) { + ErrorMsg(this).showMsg(tr("OpenService failed")); + CloseServiceHandle(scm); + return; + } + + if (!StartService(svc, 0, NULL)) { + ErrorMsg(this).showMsg(tr("Failed to start wpa_supplicant " + "service")); + } + + CloseServiceHandle(svc); + CloseServiceHandle(scm); +} + + +void WpaGui::stopService() +{ + SC_HANDLE svc, scm; + SERVICE_STATUS status; + + scm = OpenSCManager(0, 0, SC_MANAGER_CONNECT); + if (!scm) { + ErrorMsg(this).showMsg(tr("OpenSCManager failed")); + return; + } + + svc = OpenService(scm, WPASVC_NAME, SERVICE_STOP); + if (!svc) { + ErrorMsg(this).showMsg(tr("OpenService failed")); + CloseServiceHandle(scm); + return; + } + + if (!ControlService(svc, SERVICE_CONTROL_STOP, &status)) { + ErrorMsg(this).showMsg(tr("Failed to stop wpa_supplicant " + "service")); + } + + CloseServiceHandle(svc); + CloseServiceHandle(scm); +} + + +bool WpaGui::serviceRunning() +{ + SC_HANDLE svc, scm; + SERVICE_STATUS status; + bool running = false; + + scm = OpenSCManager(0, 0, SC_MANAGER_CONNECT); + if (!scm) { + printf("OpenSCManager failed: %d\n", (int) GetLastError()); + return false; + } + + svc = OpenService(scm, WPASVC_NAME, SERVICE_QUERY_STATUS); + if (!svc) { + printf("OpenService failed: %d\n\n", (int) GetLastError()); + CloseServiceHandle(scm); + return false; + } + + if (QueryServiceStatus(svc, &status)) { + if (status.dwCurrentState != SERVICE_STOPPED) + running = true; + } + + CloseServiceHandle(svc); + CloseServiceHandle(scm); + + return running; +} + +#endif /* CONFIG_NATIVE_WINDOWS */ + + +void WpaGui::addInterface() +{ + if (add_iface) { + add_iface->close(); + delete add_iface; + } + add_iface = new AddInterface(this, this); + add_iface->show(); + add_iface->exec(); +} + + +#ifndef QT_NO_SESSIONMANAGER +void WpaGui::saveState() +{ + QSettings settings("wpa_supplicant", "wpa_gui"); + settings.beginGroup("state"); + settings.setValue("session_id", app->sessionId()); + settings.setValue("in_tray", inTray); + settings.endGroup(); +} +#endif diff --git a/Network/wpa_gui-qt4_/wpagui.h b/Network/wpa_gui-qt4_/wpagui.h new file mode 100644 index 0000000..2e1af8e --- /dev/null +++ b/Network/wpa_gui-qt4_/wpagui.h @@ -0,0 +1,150 @@ +/* + * wpa_gui - WpaGui class + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef WPAGUI_H +#define WPAGUI_H + +#include +#include +#include "ui_wpagui.h" +#include "addinterface.h" + +class UserDataRequest; + + +class WpaGui : public QMainWindow, public Ui::WpaGui +{ + Q_OBJECT + +public: + WpaGui(QApplication *app, QWidget *parent = 0, const char *name = 0, + Qt::WFlags fl = 0); + ~WpaGui(); + + virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen); + virtual void triggerUpdate(); + virtual void editNetwork(const QString &sel); + virtual void removeNetwork(const QString &sel); + virtual void enableNetwork(const QString &sel); + virtual void disableNetwork(const QString &sel); + virtual int getNetworkDisabled(const QString &sel); + void setBssFromScan(const QString &bssid); +#ifndef QT_NO_SESSIONMANAGER + void saveState(); +#endif + +public slots: + virtual void parse_argv(); + virtual void updateStatus(); + virtual void updateNetworks(); + virtual void helpIndex(); + virtual void helpContents(); + virtual void helpAbout(); + virtual void disconnect(); + virtual void scan(); + virtual void eventHistory(); + virtual void ping(); + virtual void processMsg(char *msg); + virtual void processCtrlReq(const char *req); + virtual void receiveMsgs(); + virtual void connectB(); + virtual void selectNetwork(const QString &sel); + virtual void editSelectedNetwork(); + virtual void editListedNetwork(); + virtual void removeSelectedNetwork(); + virtual void removeListedNetwork(); + virtual void addNetwork(); + virtual void enableAllNetworks(); + virtual void disableAllNetworks(); + virtual void removeAllNetworks(); + virtual void saveConfig(); + virtual void selectAdapter(const QString &sel); + virtual void updateNetworkDisabledStatus(); + virtual void enableListedNetwork(bool); + virtual void disableListedNetwork(bool); + virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type, + int sec, const QString &msg); + virtual void showTrayStatus(); + virtual void wpsDialog(); + virtual void peersDialog(); + virtual void tabChanged(int index); + virtual void wpsPbc(); + virtual void wpsGeneratePin(); + virtual void wpsApPinChanged(const QString &text); + virtual void wpsApPin(); +#ifdef CONFIG_NATIVE_WINDOWS + virtual void startService(); + virtual void stopService(); +#endif /* CONFIG_NATIVE_WINDOWS */ + virtual void addInterface(); + +protected slots: + virtual void languageChange(); + virtual void trayActivated(QSystemTrayIcon::ActivationReason how); + virtual void closeEvent(QCloseEvent *event); + +private: + ScanResults *scanres; + Peers *peers; + bool networkMayHaveChanged; + char *ctrl_iface; + EventHistory *eh; + struct wpa_ctrl *ctrl_conn; + QSocketNotifier *msgNotifier; + QTimer *timer; + int pingsToStatusUpdate; + WpaMsgList msgs; + char *ctrl_iface_dir; + struct wpa_ctrl *monitor_conn; + UserDataRequest *udr; + QAction *disconnectAction; + QAction *reconnectAction; + QAction *eventAction; + QAction *scanAction; + QAction *statAction; + QAction *showAction; + QAction *hideAction; + QAction *quitAction; + QMenu *tray_menu; + QSystemTrayIcon *tray_icon; + QString wpaStateTranslate(char *state); + void createTrayIcon(bool); + bool ackTrayIcon; + bool startInTray; + + int openCtrlConnection(const char *ifname); + + bool wpsRunning; + + QString bssFromScan; + + void stopWpsRun(bool success); + +#ifdef CONFIG_NATIVE_WINDOWS + QAction *fileStartServiceAction; + QAction *fileStopServiceAction; + + bool serviceRunning(); +#endif /* CONFIG_NATIVE_WINDOWS */ + + QAction *addInterfaceAction; + AddInterface *add_iface; + + bool connectedToService; + + QApplication *app; + bool inTray; +}; + +#endif /* WPAGUI_H */ diff --git a/Network/wpa_gui-qt4_/wpagui.ui b/Network/wpa_gui-qt4_/wpagui.ui new file mode 100644 index 0000000..9f9039f --- /dev/null +++ b/Network/wpa_gui-qt4_/wpagui.ui @@ -0,0 +1,524 @@ + + WpaGui + + + + 0 + 0 + 345 + 330 + + + + wpa_gui + + + + :/icons/wpa_gui.svg:/icons/wpa_gui.svg + + + + + + + Adapter: + + + + + + + + + + Network: + + + + + + + + + + 0 + + + + Current Status + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + Status: + + + + + + + Last message: + + + + + + + Authentication: + + + + + + + Encryption: + + + + + + + SSID: + + + + + + + BSSID: + + + + + + + IP address: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Connect + + + + + + + Disconnect + + + + + + + Scan + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Manage Networks + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 61 + + + + + + + + Enabled + + + + + + + Edit + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 61 + + + + + + + + Disabled + + + + + + + Add + + + + + + + Scan + + + + + + + + WPS + + + + + + Status: + + + + + + + + + + + + + + PBC - push button + + + + + + + Generate PIN + + + + + + + PIN: + + + + + + + false + + + true + + + + + + + false + + + Use AP PIN + + + + + + + AP PIN: + + + + + + + false + + + + + + + true + + + + + + + + + + + + + 0 + 0 + 345 + 24 + + + + + &File + + + + + + + + + + + &Network + + + + + + + + + + + + &Help + + + + + + + + + + + + + Event &History + + + + + &Save Configuration + + + Ctrl+S + + + + + E&xit + + + Ctrl+Q + + + + + &Add + + + + + &Edit + + + + + &Remove + + + + + E&nable All + + + + + &Disable All + + + + + Re&move All + + + + + false + + + &Contents... + + + + + false + + + &Index... + + + + + &About + + + + + false + + + &Wi-Fi Protected Setup + + + + + &Peers + + + + + + + qtimer.h + qsocketnotifier.h + wpamsg.h + eventhistory.h + scanresults.h + peers.h + + + + + + diff --git a/Network/wpa_gui-qt4_/wpamsg.h b/Network/wpa_gui-qt4_/wpamsg.h new file mode 100644 index 0000000..4950b21 --- /dev/null +++ b/Network/wpa_gui-qt4_/wpamsg.h @@ -0,0 +1,41 @@ +/* + * wpa_gui - WpaMsg class for storing event messages + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef WPAMSG_H +#define WPAMSG_H + +#include +#include + +class WpaMsg { +public: + WpaMsg(const QString &_msg, int _priority = 2) + : msg(_msg), priority(_priority) + { + timestamp = QDateTime::currentDateTime(); + } + + QString getMsg() const { return msg; } + int getPriority() const { return priority; } + QDateTime getTimestamp() const { return timestamp; } + +private: + QString msg; + int priority; + QDateTime timestamp; +}; + +typedef QLinkedList WpaMsgList; + +#endif /* WPAMSG_H */ diff --git a/Network/wpamsg.h b/Network/wpamsg.h new file mode 100644 index 0000000..4950b21 --- /dev/null +++ b/Network/wpamsg.h @@ -0,0 +1,41 @@ +/* + * wpa_gui - WpaMsg class for storing event messages + * Copyright (c) 2005-2006, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef WPAMSG_H +#define WPAMSG_H + +#include +#include + +class WpaMsg { +public: + WpaMsg(const QString &_msg, int _priority = 2) + : msg(_msg), priority(_priority) + { + timestamp = QDateTime::currentDateTime(); + } + + QString getMsg() const { return msg; } + int getPriority() const { return priority; } + QDateTime getTimestamp() const { return timestamp; } + +private: + QString msg; + int priority; + QDateTime timestamp; +}; + +typedef QLinkedList WpaMsgList; + +#endif /* WPAMSG_H */ diff --git a/OtherInfo.cpp b/OtherInfo.cpp new file mode 100644 index 0000000..ce5a72b --- /dev/null +++ b/OtherInfo.cpp @@ -0,0 +1,263 @@ +#include "OtherInfo.h" +#include "ui_otherinfo.h" +#include +#include +#include +//#define FOR_ADJUST 0 +#define FOR_PHASE_ADJUST 1 +OtherInfo::OtherInfo(QWidget *parent) : + QWidget(parent), + ui(new Ui::OtherInfo) +{ + + ui->setupUi(this); + lockPhaseFlag = false; + lockedPhase = 0; + ui->memDisplayAndEdit->setHidden(1); + + ui->lab_enableChargeFullTime->setHidden(1); + ui->lab_phaseDetectDelay->setHidden(1); + ui->lab_phaseDetectVol->setHidden(1); + ui->lab_phaseHighLowRatio->setHidden(1); + ui->lab_phase_detect_pulse_num->setHidden(1); + + ui->checkBoxChargeFullTime->setHidden(1); + //ui->memDisplayAndEdit->setHidden(1); + ui->pushButtonLockPhase->setHidden(1); + //ui->spinBoxLockedPhase->setHidden(1); + //ui->spinBoxPhaseDetectVoltage->setEnabled(1); +#ifndef FOR_PHASE_ADJUST + ui->lab_phaseDetectVol->setHidden(1); + ui->spinBoxPhaseDetectVoltage->setHidden(1); + ui->spinBoxPhaseDetectVoltage->setEnabled(1); + //ui->spinBoxPhaseGroupValue->setHidden(1); + //ui->labelPhaseGroups->setHidden(1); + //ui->lab_phase_detect_pulse_num->setHidden(1); + ui->labelPhaseDetectNum->setHidden(1); + ui->spinBoxPhaseDetectDotNum->setHidden(1); + //ui->lab_phaseDetectDelay->setHidden(1); + ui->labelPhaseDetectDelay->setHidden(1); + ui->spinBoxPhaseDetectDelay->setHidden(1); +#else +#endif +} + +OtherInfo::~OtherInfo() +{ + delete ui; + +} +void OtherInfo::OtherupdateSysParaToUI(){ + updateSysParaToUI(); +} + +#define PHASE_BY_HAND_DIV 8 //相位会在逻辑里面放大 +void OtherInfo::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; + ui->phaseGraphic->bindSysPara(sysPara); + ui->memDisplayAndEdit->bindSysPara(sysPara); + lockPhaseFlag = sysPara->para.phaseByHand != 0; + updateLockPhaseWidgets(); +} + +void OtherInfo::updateSysParaToUI(){ + if(sysPara){ + ui->spinBoxHighLowRatio->setValue(sysPara->para.phaseHighLowRatio); + ui->spinBoxPhaseDetectDotNum->setValue(sysPara->para.phase_detect_pulse_num); + ui->spinBoxPhaseDetectVoltage->setValue(sysPara->para.phaseDetectVol); + + ui->spinBoxPhaseDetectDelay->setValue(sysPara->para.phaseDetectDelay); + ui->spinBoxPhaseShift->setValue(sysPara->para.phaseShift); + ui->spinBoxBlickLightPeriod->setValue(sysPara->para.blinkLightPeriod); + ui->checkBoxChargeFullTime->setChecked(sysPara->para.enableChargeFullTime); + } +} + +void OtherInfo::onAuthChanged(int auth){ + //ui->memDisplayAndEdit->setShown(auth & AUTH_SUPER_USER2); + //ui->pushButtonLockPhase->setEnabled(auth & AUTH_SUPER_USER2); + //ui->pushButtonLockPhase->setShown(auth & AUTH_SUPER_USER2); + //ui->spinBoxLockedPhase->setShown(auth & AUTH_SUPER_USER2); + + + //ui->lab_enableChargeFullTime->setShown(auth & AUTH_SUPER_USER2); + //ui->lab_phaseDetectDelay->setShown(auth & AUTH_SUPER_USER2); + //ui->lab_phaseDetectVol->setShown(auth & AUTH_SUPER_USER2); + //ui->lab_phaseHighLowRatio->setShown(auth & AUTH_SUPER_USER2); + //ui->lab_phase_detect_pulse_num->setShown(auth & AUTH_SUPER_USER2); + + +} + +void OtherInfo::applyUIPara(){ + if(sysPara){ + sysPara->para.phaseHighLowRatio = ui->spinBoxHighLowRatio->value();//界面上是相检, 占空比 + //sysPara->para.phase_detect_pulse_num = 6;// ui->spinBoxPhaseDetectDotNum->value(); + sysPara->para.phase_detect_pulse_num = ui->spinBoxPhaseDetectDotNum->value(); +#ifndef FOR_PHASE_ADJUST + sysPara->para.phase_detect_pulse_num = 7; + sysPara->para.phaseDetectVol = 35; //ui->spinBoxPhaseDetectVoltage->value(); + sysPara->para.phaseDetectDelay = 100;// ui->spinBoxPhaseDetectDelay->value(); +#else + sysPara->para.phaseDetectVol = ui->spinBoxPhaseDetectVoltage->value(); + sysPara->para.phaseDetectDelay = ui->spinBoxPhaseDetectDelay->value(); + sysPara->para.phase_detect_pulse_num = ui->spinBoxPhaseDetectDotNum->value(); +#endif + sysPara->para.phaseShift = ui->spinBoxPhaseShift->value(); + //qDebug()<<"shift:"<para.phaseShift; + //qDebug()<<"shift:0x"<para.phaseShift, 0, 16); + sysPara->para.blinkLightPeriod = ui->spinBoxBlickLightPeriod->value(); + sysPara->para.enableChargeFullTime = 1;//ui->checkBoxChargeFullTime->isChecked()?1:0; + // 由FPGA 设置 + if(sysPara->devOp->writeFpgaPrintPara() != -1) + QMessageBox::information(this,tr("提示"),tr("应用成功")); + + } +} +void OtherInfo::phaseDetectResultRecord(void){ + if(!memcmp(lastPhaseChargeReulse,sysPara->status.phaseChargeResult,sizeof(sysPara->status.phaseChargeResult))){ + return; + } + sysPara->devOp->readPhaseDetectHighTm(); + QFile phaseRecordFile("/home/plg/doc/phaseDetectResultRecord.txt"); + if (!phaseRecordFile.exists()) { + if (phaseRecordFile.open(QFile::WriteOnly | QFile::Truncate)) { + QTextStream out(&phaseRecordFile); + out << "time"<< "," + << "flight_tm"<< "," + << "phase"<< "," + << "curr_charge_phase"<< "," + << "ink_dot_number"<< "," + << "high_sig_cnt"<< "," + << "reg_phase_shift"<< "," + << "phase_detect_dot_num"<< "," + << "phase_charge_result_bit" + << "\n"; + phaseRecordFile.close(); + } + + } + if (phaseRecordFile.open(QFile::WriteOnly | QFile::Append)) { + QTextStream out(&phaseRecordFile); +// out << "flight_tm" +// << "phase" +// << "curr_charge_phase" +// << "ink_dot_number" +// << "high_sig_cnt" +// << "reg_phase_shift" +// << "phase_detect_dot_num" +// << "phase_charge_result_bit" +// << "\n"; + out << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss ") << "," // "flight_tm" + << sysPara->status.flightTm << "," // "flight_tm" + << "None" << "," //"phase" + << sysPara->status.phase << "," //"curr_charge_phase" + << sysPara->status.ink_dot_num << "," //"ink_dot_number" + << sysPara->para.phase_detect_high_cnt<< "," //"high_sig_cnt" + << sysPara->para.phaseShift<< "," //"reg_phase_shift" + << sysPara->para.phase_detect_pulse_num<< "," //"phase_detect_dot_num" + ; + for (quint8 i = 0; i < sizeof(sysPara->status.phaseDetectHighTm); ++i) { + out << sysPara->status.phaseDetectHighTm[i];// << ","; // "phase_charge_result_bit" + if (i < sizeof(sysPara->status.phaseDetectHighTm) - 1) { + out << ","; + } + } + out << "\n"; + phaseRecordFile.close(); + } +} + +void OtherInfo::updateSysStatusToUI(){ + if(sysPara){ + if(memcmp(lastPhaseChargeReulse,sysPara->status.phaseChargeResult,sizeof(sysPara->status.phaseChargeResult))){ + sysPara->devOp->readPhaseDetectHighTm(); + ui->phaseGraphic->updateSysStatusToUI(); + } + memcpy(lastPhaseChargeReulse,sysPara->status.phaseChargeResult,sizeof(sysPara->status.phaseChargeResult)); + ui->labelFlightTm->setText(QString::number(sysPara->status.flightTm*2) + "|" + QString::number(sysPara->status.ink_dot_num) + tr("点")); //逻辑里面已经除以2 + ui->labelPhasePosition->setText(QString::number(sysPara->status.phase)); + + //ui->lab_enableChargeFullTime->setText(sysPara->para.enableChargeFullTime?"FULL":"0"); + + ui->lab_phaseDetectDelay->setText( QString("%1").arg(sysPara->para.phaseDetectDelay)); + ui->lab_phaseDetectVol->setText(QString("%1").arg(sysPara->para.phaseDetectVol)); + + ui->lab_phaseHighLowRatio->setText(QString("%1").arg(sysPara->para.phaseHighLowRatio)); + + //ui->lab_phase_detect_pulse_num->setText(QString("%1").arg(sysPara->para.phase_detect_pulse_num)); + + ui->memDisplayAndEdit->updateSysStatusToUI(); + /* if(ui->checkBoxChargeFullTime->isChecked()){ + ui->spinBoxHighLowRatio->setEnabled(false); + } + else */ + //ui->spinBoxHighLowRatio->setEnabled(true); + + } +} + +void OtherInfo::on_pushButtonApply_pressed() +{ + applyUIPara(); + if(sysPara){ + sysPara->saveParaToFile(); + //qDebug()<<"save OtherInfo para."; + } + +} + + +void OtherInfo::updateLockPhaseWidgets(){ + if(sysPara){ + if(lockPhaseFlag) + ui->pushButtonLockPhase->setText(tr("解锁相位")); + else + ui->pushButtonLockPhase->setText(tr("锁定相位")); + if(lockPhaseFlag){ + //ui->spinBoxLockedPhase->setMaximum(sysPara->para.divideRatio*2 - 1); + //ui->spinBoxLockedPhase->setSingleStep(sysPara->para.divideRatio/32); + sysPara->devOp->setPhaseByHand(sysPara->status.phase/PHASE_BY_HAND_DIV); + //ui->spinBoxLockedPhase->setEnabled(true); + //ui->spinBoxLockedPhase->setValue(sysPara->status.phase); + ui->phaseGraphic->setLockedPhase(true,sysPara->status.phase); + } + else{ + sysPara->devOp->setPhaseByHand(0); + //ui->spinBoxLockedPhase->setEnabled(false); + //ui->spinBoxLockedPhase->setValue(0); + ui->phaseGraphic->setLockedPhase(false,0); + } + ui->phaseGraphic->updateSysStatusToUI(); + } +} + +void OtherInfo::on_pushButtonLockPhase_pressed() +{ + lockPhaseFlag = !lockPhaseFlag; + updateLockPhaseWidgets(); +} + + +void OtherInfo::on_spinBoxHighLowRatio_valueChanged(int dutyCycle) +{ + if(sysPara){ + sysPara->devOp->setPhaseDetectVoltageDutyCycle(dutyCycle); + } +} + +void OtherInfo::on_spinBoxLockedPhase_valueChanged(int newPhase) +{ + if(sysPara){ + sysPara->devOp->setPhaseByHand(newPhase/PHASE_BY_HAND_DIV); + ui->phaseGraphic->setLockedPhase(true,newPhase); + ui->phaseGraphic->updateSysStatusToUI(); + } +} + +void OtherInfo::on_spinBoxBlickLightPeriod_editingFinished() +{ + if(sysPara){ + sysPara->devOp->setBlickLightPeriod(ui->spinBoxBlickLightPeriod->value()); + } +} diff --git a/OtherInfo.h b/OtherInfo.h new file mode 100644 index 0000000..e53eb15 --- /dev/null +++ b/OtherInfo.h @@ -0,0 +1,47 @@ +#ifndef OTHERINFO_H +#define OTHERINFO_H + +#include +#include "ParaSettingUI.h" +#include +#include + +namespace Ui { +class OtherInfo; +} + +class OtherInfo : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit OtherInfo(QWidget *parent = 0); + ~OtherInfo(); + void bindSysPara(SysPara *sysPara); + void updateSysParaToUI(); + void applyUIPara(); + void updateSysStatusToUI(); + void phaseDetectResultRecord(); + +private slots: + void on_pushButtonApply_pressed(); + void OtherupdateSysParaToUI(); + void on_pushButtonLockPhase_pressed(); + + void on_spinBoxHighLowRatio_valueChanged(int arg1); + + void on_spinBoxLockedPhase_valueChanged(int arg1); + + void on_spinBoxBlickLightPeriod_editingFinished(); + void onAuthChanged(int auth); + +private: + Ui::OtherInfo *ui; + void updateLockPhaseWidgets(); + unsigned char lastPhaseChargeReulse[8]; + bool lockPhaseFlag; + int lockedPhase; + +}; + +#endif // OTHERINFO_H diff --git a/ParaSettingUI.cpp b/ParaSettingUI.cpp new file mode 100644 index 0000000..2432c8b --- /dev/null +++ b/ParaSettingUI.cpp @@ -0,0 +1,43 @@ +/* + * ParaSettingUI.cpp + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + + + + +#include "ParaSettingUI.h" +#include "QDebug" +ParaSettingUI::ParaSettingUI(){ + sysPara = 0; +} + +ParaSettingUI::~ParaSettingUI(){ + +} + +void ParaSettingUI::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; +} + + +void ParaSettingUI::updateSysParaToUI(){ + qDebug() << "Warn!!ParaSettingUI::updateSysParaToUI() should be implemented by subclass"; +} + +void ParaSettingUI::applyUIPara(){ + qDebug() << "Warn!!ParaSettingUI::applyUIPara() should be implemented by subclass"; +} + +void ParaSettingUI::updateSysStatusToUI(){ + qDebug() << "Warn!!ParaSettingUI::updateSysStatusToUI() should be implemented by subclass"; +} + +void ParaSettingUI::updateAuthorization(int auth){ + // do nothing here +} diff --git a/ParaSettingUI.h b/ParaSettingUI.h new file mode 100644 index 0000000..a2ec0e5 --- /dev/null +++ b/ParaSettingUI.h @@ -0,0 +1,31 @@ +/* + * ParaSettingUI.h + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + * 只要是有参数需要设置的UI继承此类 + + */ + +#ifndef PARASETTINGUI_H_ +#define PARASETTINGUI_H_ + +#include "SysPara.h" +class ParaSettingUI{ +public: + ParaSettingUI(); + ~ParaSettingUI(); + + void bindSysPara(SysPara *sysPara); + void updateSysParaToUI(); /*这个方法需要被子类重写*/ + void applyUIPara(); /*这个方法需要被子类重写*/ + void updateSysStatusToUI(); /*这个方法需要被子类重写*/ + void updateAuthorization(int auth); /*这个方法需要被子类重写*/ +protected: + SysPara *sysPara; +}; + + +#endif /* PARASETTINGUI_H_ */ diff --git a/PhaseGraphic.cpp b/PhaseGraphic.cpp new file mode 100644 index 0000000..4dfe4ba --- /dev/null +++ b/PhaseGraphic.cpp @@ -0,0 +1,125 @@ +/* + * phaseGraphic.cpp + * + * Created on: Jun 29, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "PhaseGraphic.h" +#include "QPalette" +#include +PhaseGraphic::PhaseGraphic(QWidget *parent) : + QWidget(parent){ + + pen.setStyle(Qt::SolidLine); + pen.setWidth(2); + pen.setBrush(Qt::red); + pen.setCapStyle(Qt::RoundCap); + pen.setJoinStyle(Qt::RoundJoin); + brush.setStyle(Qt::SolidPattern); + setPalette(QPalette(Qt::white)); + setAutoFillBackground(true); + setMinimumSize(626,150); + lockPhaseFlag = false; + lockedPhase = 0; + phaseCount = 32; +} +PhaseGraphic::~PhaseGraphic(){ + +} + +void PhaseGraphic::paintEvent(QPaintEvent *){ + if(sysPara){ + QString num; + QRect rec = rect(); + int w = rec.width() - 30; + int h = rec.height(); + int step = w/phaseCount; + int high = h/3; + int low = 2*h/3; + int x_shift = 10; + int current_x = x_shift; + int phaseStep = sysPara->para.divideRatio*2/phaseCount; + int currentPhase = 0; + int phasePos = sysPara->para.divideRatio?w*sysPara->status.phase/(sysPara->para.divideRatio*2):0; + int phasePosEdgePos = sysPara->status.phasePosEdge*w/phaseCount; + int phaseNegEdgePos = sysPara->status.phaseNegEdge*w/phaseCount; + int lockPhasePos = sysPara->para.divideRatio?w*lockedPhase/(sysPara->para.divideRatio*2):0; + unsigned int maxPhaseDetectHighVoltageTm = 0; + for(int i = 0;i < phaseCount; i++){ + if(sysPara->status.phaseDetectHighTm[i] > maxPhaseDetectHighVoltageTm) + maxPhaseDetectHighVoltageTm = sysPara->status.phaseDetectHighTm[i]; + } + QPainter p(this); + pen.setBrush(Qt::red); + p.setPen(pen); + p.setBrush(brush); + for(int i = 0; i < 8;i++){ + for(int j = 0;j < 8; j++){ + + if(sysPara->status.phaseChargeResult[i] & (1<status.phaseDetectHighTm[i*8+j]*h/(3*maxPhaseDetectHighVoltageTm):0; + int nextPhaseDetectHighPos = maxPhaseDetectHighVoltageTm?sysPara->status.phaseDetectHighTm[(i*8 + j + 1)%phaseCount]*h/(3*maxPhaseDetectHighVoltageTm):0; + p.drawLine ( current_x, low - currPhaseDetectHighPos, current_x + step, low - nextPhaseDetectHighPos); + current_x = (8*i + j + 1)*w/phaseCount + x_shift; + currentPhase += phaseStep; + } + } + + p.drawLine(current_x,low - 5,current_x,low + 5); + num = QString::number(currentPhase); + p.drawText(current_x - num.size()*4,low + 20,num); //做后的标尺 + num = QString::number(maxPhaseDetectHighVoltageTm); + + p.drawText(x_shift + 10,high - 10,num); //给坐标画标尺 + + p.drawLine(phasePos + x_shift,low + 10,phasePos + x_shift,high - 10); //将相位尺标记一下 + pen.setBrush(Qt::blue);p.setPen(pen); + p.drawLine(phasePosEdgePos + x_shift - 3,low + 10,phasePosEdgePos + x_shift + 3,low - 30); + p.drawLine(phaseNegEdgePos + x_shift + 3,low + 10,phaseNegEdgePos + x_shift - 3,low - 30); + if(lockPhaseFlag){ + pen.setBrush(Qt::green);p.setPen(pen); + p.drawLine(lockPhasePos + x_shift,low + 5,lockPhasePos + x_shift,high - 5); + } + } +} + + +void PhaseGraphic::updateSysStatusToUI(){ + update(); +} + + +void PhaseGraphic::setLockedPhase(bool enable,int val){ + lockPhaseFlag = enable; + lockedPhase = val; +} + +void PhaseGraphic::setPhaseCount(int count) +{ + switch(count) { + case 64: + phaseCount = 64; + break; + case 32: + phaseCount = 32; + break; + case 16: + phaseCount = 16; + break; + default: + phaseCount = 64; + break; + } +} diff --git a/PhaseGraphic.h b/PhaseGraphic.h new file mode 100644 index 0000000..3b56862 --- /dev/null +++ b/PhaseGraphic.h @@ -0,0 +1,40 @@ +/* + * phaseGraphic.h + * + * Created on: Jun 29, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef PHASEGRAPHIC_H_ +#define PHASEGRAPHIC_H_ + + +#include "QWidget" +#include "ParaSettingUI.h" +#include +#include +class PhaseGraphic:public QWidget,public ParaSettingUI{ + Q_OBJECT + +public: + explicit PhaseGraphic(QWidget *parent = 0); + ~PhaseGraphic(); + + void paintEvent(QPaintEvent *); + + void updateSysStatusToUI(); + + void setLockedPhase(bool enable,int val); + void setPhaseCount(int count); +private: + + QPen pen; + QBrush brush; + int lockPhaseFlag; + int lockedPhase; + int phaseCount; // 份数 +}; +#endif /* PHASEGRAPHIC_H_ */ diff --git a/PicEdit.cpp b/PicEdit.cpp new file mode 100644 index 0000000..92cd9b5 --- /dev/null +++ b/PicEdit.cpp @@ -0,0 +1,956 @@ +#include "PicEdit.h" +#include "ui_picedit.h" +#include "SysPara.h" +#include +#include +#include "ui_InputMethod.h" +#include "InputMethod.h" +#include "Public.h" +#include "stdio.h" +#include "myinclude.h" +#include "dlgdrawinit.h" +#include + +PicEdit::PicEdit(QWidget *parent) : + QWidget(parent), + ui(new Ui::PicEdit) +{ + ui->setupUi(this); + ui->lineEditInputTxt->setMaximumWidth(1); + fileDialog = 0; + charSpace=0; + dlgdraw =0; + lineSpace=1; + openedFileName = ""; + newFileAppending = false;//Qt::Key_Backspace + inserPicFile = false; + connect(ui->widgetPic,SIGNAL(picWidgetModify()),this,SLOT(enableSaveButton())); + connect(ui->widgetPic,SIGNAL(ShowKeybord()),this,SLOT(showKeybord())); + connect(ui->widgetPic,SIGNAL(rowColChanged(QString)),ui->label_ROWCOL,SLOT(setText(QString))); + connect(ui->widgetPic,SIGNAL(currXYChanged(QString)),ui->label_CURXY,SLOT(setText(QString))); + connect(ui->widgetPic,SIGNAL(ChangeFont(int)),this,SLOT(onChangeFont(int))); +#ifdef MYSAVEFILEDLG + dialogSaveFile =new DialogSaveFile(0); +#endif + textEdit=new QTextEdit; + zkEditEn=0; + dialogFileOperation = new DialogFileOperation(0); + dialogInsertVari = new DialogInsertVari(0); + dialogLineSpace = new DialogLineSpace(0); + timer = new QTimer(); + connect(timer, SIGNAL(timeout()), ui->widgetPic, SLOT(cursorFlash())); + connect(timer, SIGNAL(timeout()), this, SLOT(cursorFlash())); + timer->start(500); + + ui->pushButtonZKEdit->setEnabled (zkEditEn); + + VarNum=0; + isInput =0; + + ui->scrollArea->setAlignment ( Qt::AlignAbsolute ); + ui->radioButtonCharCurrent->setChecked (1); + ui->widgetPic->charPara.CharCurrent=1; + + ui->comboBoxLattice->setCurrentIndex (1); + + ui->pushButtonSave->setEnabled(false); + forcePicWidgetSize = false; + ui->widgetPic->charPara.DrawGridEn=true; + ui->checkBoxDrawGridEn->setCheckState ((Qt::CheckState)ui->widgetPic->charPara.DrawGridEn ); + ui->widgetPic->charPara.DrawEn=false; + + ui->widgetPic->initWidget(300,ui->spinBoxHeightPoint->value()); + setEnterKey(1); + openedFileName = ""; + ui->widgetPic->setScale (3); + ui->widgetPic->resizeWidget (150,8); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + memset(var,0,sizeof(var)); + ui->widgetPic->picSetHome(); + ui->labInserMode->setText((ui->widgetPic->charPara.insertMode)? tr("插入模式"):tr("修改模式")); + ui->label_Note->setText(tr("编辑现有的多字体文件\r\n请使用修改模式!!!")); + + ui->widgetPic->charPara.DrawEn=0; + ui->widgetPic->drawPara.width = 10; + ui->widgetPic->drawPara.height = 8; + + ui->checkBoxControlChar->hide(); + ui->checkBoxBold->hide(); + // ui->pushButtonDrawPIC->hide(); + +} + +PicEdit::~PicEdit() +{ + delete ui; + if(fileDialog) + delete fileDialog; + if(fileDialog) + delete fileDialog; + if(dialogInsertVari) + delete dialogInsertVari; + if(dialogLineSpace) + delete dialogLineSpace; + if(dlgdraw) delete dlgdraw; +#ifdef MYSAVEFILEDLG + if(dialogSaveFile) delete dialogSaveFile; + if(dialogFileOperation) delete dialogFileOperation; +#endif + +} +void PicEdit::setEnterKey(int n) +{ + // ui->pushButtonEnsure->setIcon(QIcon( n?":/icon/sure.png":":/icon/keyenter.png")); // icon().addPixmap(,0,0); + // ui->pushButtonEnsure->setText(n?"":"换行"); ///icon/sure.png +} + +void PicEdit::on_pushButtonZKEdit_pressed( ) +{ + //qDebug ()<<"start 1"<widgetPic->charPara.CharWidth<widgetPic->charPara.CharHeight; + //qDebug ()<<"11"; + if(ui->widgetPic->zkEditEn) + { + ui->widgetPic->zkEditEn=0; + ui->pushButtonNew->setEnabled (true); + ui->pushButtonInsertVari->setEnabled (true); + ui->pushButtonOpen->setEnabled (true); + ui->pushButtonSaveAs->setEnabled (true); + ui->pushButtonImport->setEnabled (true); + ui->pushButtonSave->setText (tr("保存/打印")); + ui->pushButtonSave->setText (tr("保存")); + ui->pushButtonZKEdit->setText (tr("字库编辑")); + ui->comboBoxLattice->setDisabled (0); + ui->spinBoxHeightPoint->setDisabled (0); + //ui->spinBoxWidthPoint->setDisabled (0); + ui->widgetPic->charPara.CharCurrent=1; + //ui->widgetPic->charPara.CurrentEn =1; + ui->widgetPic->charPara.DrawEn =0; + ui->widgetPic->charPara.LineSpace=1; + ui->pushButtonImport->setEnabled(true); + ui->widgetPic->initWidget (30,ui->widgetPic->charPara.LineHeight); + ui->labelNote2->setText (tr("点击光栅可打开键盘,点击空白处关闭"));// 请选择字体,打开键盘并输入要编辑的字符. + // 点击光栅可打开键盘,点击其它空白处可关闭键盘. + //qDebug ()<<"22"; + emit zkEditEnStatus(tr("信息编辑")); + + } + else { + //qDebug ()<<"33"; + ui->widgetPic->zkEditNow(); + ui->widgetPic->charPara.DrawEn =1; + ui->pushButtonNew->setDisabled(true); + ui->pushButtonInsertVari->setDisabled (true); + ui->pushButtonOpen->setDisabled (true); + ui->pushButtonSaveAs->setDisabled (true); + ui->pushButtonImport->setDisabled (true); + ui->pushButtonSave->setDisabled (true); + //ui->comboBoxLattice->setDisabled (true); + ui->spinBoxHeightPoint->setDisabled (true); + //ui->spinBoxWidthPoint->setDisabled (true); + //qDebug ()<<"441"; + ui->pushButtonSave->setText (tr("字库保存")); + //qDebug ()<<"442"; + ui->pushButtonZKEdit->setText (tr("返回信息编辑")); + //qDebug ()<<"443"; + ui->pushButtonImport->setEnabled(false); + ui->labelNote2->setText (tr("请选择字体,打开键盘并输入要编辑的字符"));// 请选择字体,打开键盘并输入要编辑的字符. + //qDebug ()<<"44"; + // 点击光栅可打开键盘,点击其它空白处可关闭键盘. + //emit zkEditEnStatus(tr("字库编辑")); + //ui->lineEditInputTxt->setFocus (); + ui->widgetPic->zkEditEn=1; + } + //qDebug ()<<"start 2"<widgetPic->charPara.CharWidth<widgetPic->charPara.CharHeight; +} + +void PicEdit::checkNewFileAppending(){ + if(newFileAppending){ + ui->widgetPic->initWidget(300,ui->spinBoxHeightPoint->value()); + openedFileName = ""; + } + newFileAppending = false; +} + +void PicEdit::onSave_File_reject(){ + checkNewFileAppending(); +} + +void PicEdit::bindSysPara(SysPara *sysPara){ + ui->widgetPic->bindSysPara (sysPara); + this->sysPara = sysPara; +} + +bool PicEdit::maybeSave(){ + if(!ui->widgetPic->isModified()) + return true; + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("图片已经改变,是否保存?")); + QPushButton *saveButton = msgBox.addButton(tr("保存"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("放弃保存"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + + msgBox.exec(); + + if (msgBox.clickedButton() == saveButton) { + newFileAppending = true; + on_pushButtonSave_clicked(); + + + return false; + } + else if (msgBox.clickedButton() == cancleSaveButton) { + return true; + } + + else + return false; + + return true; +} + +void PicEdit::on_pushButtonNew_pressed(){ + if(maybeSave()) + { + + ui->widgetPic->initWidget(300,ui->spinBoxHeightPoint->value()+1); + openedFileName = ""; + ui->labelFileName->setText(""); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + VarNum=0; + ui->widgetPic->zkEditEn=false; + memset(var,0,sizeof(var)); + ui->widgetPic->charPara.DrawEn =0; + ui->widgetPic->charPara.CharCurrent=1; + ui->widgetPic->charPara.CurrentEn =1; + ui->lineEditInputTxt->setFocus (); + } +} + +void PicEdit::showKeybord( ) +{ + if(!ui->widgetPic->charPara.DrawEn || ui->widgetPic->zkEditEn ) ui->lineEditInputTxt->setFocus (); +} + +void PicEdit::enableSaveButton(){ + ui->pushButtonSave->setEnabled(true); + if(ui->widgetPic->zkEditEn) ui->comboBoxLattice->setDisabled (1); + +} + +void PicEdit::on_pushButtonEnlarge_pressed() +{ + ui->widgetPic->enlargeDisplay(); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + +} + +void PicEdit::on_pushButtonReduce_pressed() +{ + ui->widgetPic->reduceDisplay(); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); +} + + + +void PicEdit::on_pushButtonEnsure_pressed() +{ + ui->widgetPic->ensureCurrPos(); + //qDebug()<<"ENLINE2"; +} + + +void PicEdit::on_pushButtonLeft_pressed() +{ + //ui->widgetPic->charPara.CharHeight =ui->widgetPic->charPara.LineHeight; + ui->widgetPic->currPositionMove(ui->widgetPic->charPara.CharCurrent? (-ui->widgetPic->charPara.CharWidth):(-1),0); +} +void PicEdit::on_pushButtonRight_pressed() +{ +//ui->widgetPic->charPara.CharHeight =ui->widgetPic->charPara.LineHeight; + ui->widgetPic->currPositionMove(ui->widgetPic->charPara.CharCurrent?ui->widgetPic->charPara.CharWidth:1,0); + +} +void PicEdit::on_pushButtonUp_pressed() +{ + //ui->widgetPic->charPara.CharHeight =ui->widgetPic->charPara.LineHeight; + ui->widgetPic->currPositionMove(0,ui->widgetPic->charPara.CharCurrent?-(ui->widgetPic->charPara.LineHeight):-1); + //qDebug()<<"TEST2014 UP"; +} +void PicEdit::on_pushButtonDown_pressed() +{ +//ui->widgetPic->charPara.CharHeight =ui->widgetPic->charPara.LineHeight; + ui->widgetPic->currPositionMove(0,ui->widgetPic->charPara.CharCurrent?ui->widgetPic->charPara.LineHeight:1); +} +void PicEdit::on_spinBoxHeightPoint_valueChanged(int height) +{ + ui->widgetPic->resizeWidget (ui->widgetPic->getWidth (),height); + //qDebug ()<<"HeightPoint:"<widgetPic->charPara.DrawEn=true; + + dlgdraw = new dlgDrawInit; + //dlgdraw->setWindowTitle(tr("设置图案参数")); + dlgdraw->setFocus(); + connect(dlgdraw,SIGNAL(dlgDrawOK()),this,SLOT(ondlgDrawOK())); + + dlgdraw->setWidth(ui->widgetPic->drawPara.width); + dlgdraw->setHeight(ui->widgetPic->drawPara.height); + dlgdraw->show(); + +} +#endif +void PicEdit::ondlgDrawOK() +{ + + ui->widgetPic->charPara.DrawEn=true; + ui->widgetPic->drawPara.width= dlgdraw->getWidth(); + ui->widgetPic->drawPara.height=dlgdraw->getHeight(); + if(maybeSave()) + { + DrawInit(1); + + } + if(dlgdraw) delete dlgdraw; + +} +void PicEdit::on_checkBoxDrawGridEn_clicked( ) +{ + ui->widgetPic->charPara.DrawGridEn=ui->checkBoxDrawGridEn->checkState (); + ui->widgetPic->resizeWidget (ui->widgetPic->getWidth (),ui->widgetPic->getHeight ()); + ui->widgetPic->update (); + +} + +void PicEdit::on_checkBoxControlChar_clicked( ) +{ + ui->widgetPic->charPara.checkBoxControlChar=ui->checkBoxControlChar->checkState (); +} + +void PicEdit::on_pushButtonSaveAs_clicked() +{ +#ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->setTitleTxt(tr("文件另存为...")); + dialogSaveFile->refreshListView(1); + dialogSaveFile->setEnterFileName(""); + dialogSaveFile->show(); + +#else + + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + fileDialog->showFileDialog(tr("另存为"),QString(DOC_ROOT_DIR), + ui->widgetPic->charPara.DrawEn?QString("Picture files (*.jpg)"): + QString("Picture files (*.png)") + );// *.png )"));// + +#endif + +} +void PicEdit::onSaveASFile(QString fileName,bool Flag){// use for dialogSaveFile class + // filename= fileName ; + if( ui->widgetPic->charPara.DrawEn ){ + if( !fileName.endsWith(".jpg",Qt::CaseInsensitive) ) + fileName += ".jpg"; + + ui->widgetPic->saveImage1(fileName); + + //ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + + } + else { + + if( !fileName.endsWith(".png",Qt::CaseInsensitive) ) + fileName += ".png"; + + ui->widgetPic->saveImage(fileName); + + //ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + + QString str1 =QFileInfo( fileName).baseName()+".dpn"; + if(sysPara){ + + sysPara->sysFile = QString( PARA_ROOT_DIR+str1); + sysPara->savePrintParaToFile(); + } + printThisFileNow(fileName); + +} + +checkNewFileAppending(); +} + +void PicEdit::onSaveAS_FIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++) + { + + QString fileName = files[i]; + //qDebug()<<"onSaveAS_FIle_select"<widgetPic->charPara.DrawEn ){ + if( !fileName.endsWith(".jpg",Qt::CaseInsensitive) ) + fileName += ".jpg"; + + ui->widgetPic->saveImage1(fileName); + + //ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + + } + else { + + if( !fileName.endsWith(".png",Qt::CaseInsensitive) ) + fileName += ".png"; + + ui->widgetPic->saveImage(fileName); + + //ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + + QString str1 =QFileInfo( fileName).baseName()+".dpn"; + if(sysPara){ + + sysPara->sysFile = QString( PARA_ROOT_DIR+str1); + sysPara->savePrintParaToFile(); + } + } + + printThisFileNow(fileName); + + } + + checkNewFileAppending(); + +} +void PicEdit::onFileOpen(QString fileName,bool forcePicWidgetSize) +{ + + if(inserPicFile) + { + + if (fileName.endsWith(".png") )ui->widgetPic->insertImage(fileName,false); + else ui->widgetPic->insertImage1(fileName,0); + // if(openedFileName=="") openedFileName= fileName; + + } + else { + if(fileName.endsWith(".png")){ + ui->widgetPic->loadImage(fileName,false); + openedFileName = fileName; + } + else if(fileName.endsWith(".jpg")){ + ui->widgetPic->insertImage1(fileName,1); + VarNum=0; + ui->widgetPic->zkEditEn=false; + memset(var,0,sizeof(var)); + ui->widgetPic->charPara.CurrentEn =1; + ui->widgetPic->charPara.DrawEn=1; + } + ui->widgetPic->setScale (3); + ui->labelFileName->setText(tr("文件名:)")+QFileInfo( fileName).fileName()); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + VarNum=0; + } +} +void PicEdit::updateAuthorization(int auth){ + // do nothing here + zkEditEn= (auth&AUTH_DISPLAY_SYSTEM_SETTING) ||(auth&AUTH_DISPLAY_SYSTEM_MANAGE); + ui->pushButtonZKEdit->setEnabled (zkEditEn); +} + +void PicEdit::on_pushButtonOpen_clicked() +{ + + disconnect(dialogFileOperation,SIGNAL(openFile(QString,bool)),0,0); + connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + dialogFileOperation->refreshListView(1); + dialogFileOperation->exec(); + inserPicFile = false; + + +} + + +void PicEdit::onOpenFIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + QString fileName = files.value(i); + ui->widgetPic->loadImage(fileName,forcePicWidgetSize); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + VarNum=0; + } +} + +void PicEdit::on_pushButtonSave_clicked() +{ + if(ui->widgetPic->zkEditEn && zkEditEn ) { + ui->widgetPic->zkEditSave(); + ui->pushButtonOpen->setDisabled (true); + ui->pushButtonSave->setDisabled (true); + //ui->pushButtonImport->setEnabled(true); + ui->pushButtonZKEdit->setText (tr("返回信息编辑")); + ui->comboBoxLattice->setDisabled (0); + emit zkEditEnStatus(tr("字库编辑")); + return ; + } + + if(!openedFileName.isEmpty()){ + //qDebug()<<"on_pushButtonSave_clicked"<widgetPic->charPara.DrawEn) { + //if(openedFileName.endsWith("html")) + openedFileName =DOC_ROOT_DIR+ QFileInfo(openedFileName).baseName()+".jpg"; + ui->widgetPic->saveImage1(openedFileName); + } + else { + //if(openedFileName.endsWith("html")) + openedFileName = DOC_ROOT_DIR+QFileInfo(openedFileName).baseName()+".png"; + + ui->widgetPic->saveImage(openedFileName); + // qDebug()<<"on_pushButtonSave_clicked"<pushButtonSave->setEnabled(true); + printThisFileNow(openedFileName); + + } + else { +#ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->refreshListView(1); + dialogSaveFile->setTitleTxt(tr("文件保存为...")); + dialogSaveFile->setEnterFileName(""); + dialogSaveFile->show(); +#else + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(rejected()),this,SLOT(onSave_File_reject())); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + fileDialog->showFileDialog(tr("保存"),tr(DOC_ROOT_DIR), + ui->widgetPic->charPara.DrawEn?QString("Picture files (*.jpg)"): + QString("Picture files (*.png)") + + ); +#endif + } +} + +void PicEdit::on_pushButtonImport_clicked() +{ //insert pic 插入图片 pushButtonImport + inserPicFile =true; + disconnect(dialogFileOperation,SIGNAL(openFile(QString,bool)),0,0); + connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + dialogFileOperation->refreshListView(1); + dialogFileOperation->exec(); +} +void PicEdit::on_pushButtonEnd_pressed(){ + ui->widgetPic->picSetEnd (); +} +void PicEdit::on_pushButtonHome_pressed(){ + ui->widgetPic->picSetHome(); +} +void PicEdit::keyPressEvent(QKeyEvent *e) +{ ui->widgetPic->charPara.CharHeight =ui->widgetPic->charPara.LineHeight; + switch(e->key()) + { + case Qt::Key_Return1:on_pushButtonEnsure_pressed(); + //qDebug()<<"TEST2014 ENTER"; + break; + case Qt::Key_Up1: on_pushButtonUp_pressed(); + //qDebug()<<"TEST2014 UP2"; + break; + case Qt::Key_Left1: on_pushButtonLeft_pressed();break; + case Qt::Key_Right1:on_pushButtonRight_pressed();break; + case Qt::Key_Down1:on_pushButtonDown_pressed();break; + case Qt::Key_Enter1: + //qDebug()<<"ENLINE"; + break; + case Qt::Key_Home1:ui->widgetPic->picSetHome(); break; + case Qt::Key_End1:ui->widgetPic->picSetEnd (); break; + case Qt::Key_Clear1: break; + case Qt::Key_Backspace1: + ui->widgetPic->picDelOneChar (); break; + case Qt::Key_Delete1: + ui->widgetPic->picDelNextChar (); + break; + } + //if(e->key())qDebug()<<"TES"<key(); +} + + +void PicEdit::on_comboBoxLattice_currentIndexChanged(int index) +{ //字体选择 + int font[]={5,7,9,12,16,16,24,24,32}; + int fontWidth[]= {5,5,6,8,8,12,24,24,24 }; + ui->widgetPic->charPara.Font=(PFONTNAME)index; + ui->widgetPic->charPara.CharHeight =font[index]; + ui->widgetPic->charPara.LineHeight = ui->widgetPic->charPara.CharHeight+ui->widgetPic->charPara.LineSpace; + ui->widgetPic->charPara.CharWidth =fontWidth[index] ; + if( ui->widgetPic->getHeight ()spinBoxHeightPoint->setValue (font[index]); + if( ui->widgetPic->currYpos+ ui->widgetPic->charPara.LineHeight > ui->widgetPic->getHeight() ){ + ui->widgetPic->resizeWidget( ui->widgetPic->getWidth(),ui->widgetPic->currYpos+ ui->widgetPic->charPara.LineHeight); + } + + ui->widgetPic->update (); + ui->lineEditInputTxt->setFocus (); +} + +void PicEdit::on_lineEditInputTxt_textEdited (QString txt) +{ + var[0]=0;var[1]=0; +#ifdef VARBOLD + ui->widgetPic->charPara.Bold=ui->comboBoxBoldMul->currentIndex(); + if(ui->widgetPic->charPara.Bold>2)ui->widgetPic->charPara.Bold=2; +#else + ui->widgetPic->charPara.Bold = ui->checkBoxBold->isChecked(); +#endif + + emit ui->widgetPic->inputTxtDot (txt,var); + ui->lineEditInputTxt->clear (); + // QTime t1;t1.start();// qDebug ()<lineEditInputTxt->setFocus (); +} +void PicEdit::on_pushButtonDeleteChar_clicked() +{ + + ui->widgetPic->picDelOneChar (); +} +void PicEdit::on_radioButtonCharCurrent_clicked() +{ + ui->widgetPic->charPara.CharCurrent=ui->radioButtonCharCurrent->isChecked (); +} + +void PicEdit::on_radioButtonDotCurrent_clicked() +{ + ui->widgetPic->charPara.CharCurrent=ui->radioButtonCharCurrent->isChecked (); +} + +void PicEdit::on_pushButtonInsertVari_pressed() +{ + + + if(dialogInsertVari->exec() == QDialog::Accepted ){ + int pixelSize =ui->widgetPic->charPara.CharHeight;// ui->comboBoxLattice->currentIndex (); + QFont font; + font.setFamily(Public::getFontFamily(pixelSize)); + font.setPixelSize(pixelSize); + font.setWeight(ui->checkBoxBold->isChecked()?QFont::Bold:QFont::Normal); + + font.setLetterSpacing(QFont::AbsoluteSpacing,ui->widgetPic->charPara.FontGap); // sysPara->para.textEditCharSpace + QFontMetrics fontMetrics(font); + ui->widgetPic->charPara.Bold = ui->checkBoxBold->isChecked(); + + + int width = (fontMetrics.width("0123456789"))/10 ; + int height = fontMetrics.ascent () + fontMetrics.descent();//pixelSize; + int digitalNum; + int varType; + unsigned char splitMode; + dialogInsertVari->getValue(&varType,&digitalNum,&splitMode); + QString txt; + +//================ + int val = 0; + QTime t = QTime::currentTime(); + QDate d = QDate::currentDate(); + switch(varType){ + case 0:val = d.year(); digitalNum=digitalNum>2?4:2; break; + case 1:val = d.month();digitalNum=2;break; + case 2:val = d.day();digitalNum=2;break; + //case 3:val = d.dayOfWeek();digitalNum=2;break; //weekNumber + case 3:val = d.weekNumber();digitalNum=2;break; + case 4:val = t.hour(); digitalNum=2;break; + case 5:val = t.minute();digitalNum=2;break; + case 6:val = t.second();digitalNum=2;break; + case 7:val = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); break; + case 8:val = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt();break; + case 13:val = QString::number(sysPara->status.Status_Counter3.cnt3CurrValue,16).toInt();break; + + default:val=0; + } + // qDebug()<widgetPic->charPara.FontGap;//4 + //sysPara + +#ifdef VARBOLD + ui->widgetPic->charPara.Bold=ui->comboBoxBoldMul->currentIndex(); + if(ui->widgetPic->charPara.Bold>2)ui->widgetPic->charPara.Bold=2; +#else + ui->widgetPic->charPara.Bold = ui->checkBoxBold->isChecked(); +#endif + if(digitalNum) ui->widgetPic->inputTxtDot (txt,var); + } + ui->lineEditInputTxt->setFocus (); + +} + +void PicEdit::ChinaProview(QString txt) +{ + int mCol = (int)textEdit->document()->size().width(); + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(mCol > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + mCol= MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int maxPicHeight = MAX_PRINT_ROW_NUM + 12; + //qDebug ()<document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + + //image.save("printImage.jpg"); + + unsigned char mDat[mCol*maxPicHeight]; + memset(mDat,0,sizeof(mDat)); + int firstRow = maxPicHeight; + /*--------------------------------------------------------------------------*/ + for(int j = 0; j < maxPicHeight; j++){ //计算首行位置 + for(int i = 0; i < mCol; i++){ + QRgb rgb = image.pixel(i,j); + if(rgb&0xff000000){ + firstRow = j; + break; + } + } + if(firstRow != maxPicHeight) + break; + } + /*--------------------------------------------------------------------------*/ + int lastRow = firstRow + MAX_PRINT_ROW_NUM; + lastRow = (lastRow>maxPicHeight)?maxPicHeight:lastRow; + for(int j = 0; j < lastRow - firstRow; j++){ + for(int i = 0; i < mCol; i++){ + QRgb rgb = image.pixel(i,j + firstRow); + if((rgb&0x80000000)){ //判断alpha + if((rgb & 0xffffff) == 0xff0000){ + mDat[ i* j + firstRow]=0; + } + } + } + } +} + + +void PicEdit::on_pushButtonCharSpace_pressed () +{ //QScrollBar mScrollBar; + dialogLineSpace->setValue (ui->widgetPic->charPara.LineSpace,ui->widgetPic->charPara.FontGap); + if(dialogLineSpace->exec() == QDialog::Accepted ){ + dialogLineSpace->getValue (&lineSpace,&charSpace); + if(charSpace<1)charSpace=1; + ui->widgetPic->charPara.FontGap=charSpace; + ui->widgetPic->charPara.LineSpace= lineSpace; + ui->widgetPic->charPara.LineHeight = ui->widgetPic->charPara.CharHeight +ui->widgetPic->charPara.LineSpace; + } +} +void PicEdit::DrawInit(bool mode) +{ + if( mode) + { + ui->widgetPic->initWidget(ui->widgetPic->drawPara.width,ui->widgetPic->drawPara.height); + openedFileName = ""; + ui->labelFileName->setText(""); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + VarNum=0; + ui->widgetPic->zkEditEn=false; + memset(var,0,sizeof(var)); + ui->widgetPic->charPara.CurrentEn =1; + //ui->spinBoxWidth->show(); + //ui->labWidth->show(); + //ui->pushButtonInsertVari->hide(); + ui->widgetPic->charPara.DrawEn=1; + } + else + { + + ui->pushButtonInsertVari->show(); + ui->widgetPic->charPara.DrawEn=0; + emit on_pushButtonNew_pressed(); + } +} + +void PicEdit::printThisFileNow(QString fileName) +{ + if( ui->widgetPic->charPara.DrawEn) + { + DrawInit(0); + return ; + } + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("是否立即喷印当前的文件?")); + QPushButton *saveButton = msgBox.addButton(tr("是"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("否"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + + msgBox.exec(); + + if (msgBox.clickedButton() == saveButton) { + + emit openCurrentFile(fileName,false); + emit setMainTabNow(0); + + } +} + +void PicEdit::EditCurrFile(QString fileName) +{ + ui->widgetPic->loadImage(fileName,forcePicWidgetSize); + openedFileName = fileName; + ui->labelFileName->setText(tr("文件名:")+QFileInfo( fileName).fileName()); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + ui->pushButtonSave->setEnabled(true); + VarNum=0; +} + +void PicEdit::onChangeFont(int n) +{// + //char font[]={5,7,9,12,16,24,24,32}; + int i=0; + if(n>24) i=6; + else if(n>16) i=5; + else if(n>12) i=4; + else if(n>9) i=3; + else if(n>7) i=2; + else if(n>5) i=1; + else i=0; + ui->comboBoxLattice->setCurrentIndex(i); + //qDebug()<widgetPic->charPara.insertMode =!ui->widgetPic->charPara.insertMode; + ui->labInserMode->setText((ui->widgetPic->charPara.insertMode)?tr("插入模式"):tr("修改模式")); +} + + + +void PicEdit::cursorFlash() +{ + static int n=0; + static int m=0; + // static bool r_DrawEn=0; + if(sysPara==NULL) return; + if(sysPara->para.EditMode==TXTFILE){ + ui->widgetPic->pEditMode=0; + return; + } + else if(sysPara->para.EditMode==PICFILE) + ui->widgetPic->pEditMode=1; + // r_DrawEn = char + + + if(isActiveWindow()){ + if(n<31)n++;else n=0; + if(n==10){ + ui->label_Note->setText(tr("按回车键(Enter)可增加新行. 选择字体,光栅会自动调整")); + ui->labelNote2->setText((m%2)?tr("选择[字体]可改变光标大小."):tr("选择[绘图]方式,可以绘制任意图形")); + // qDebug()<<"n:"<label_Note->setText(tr("光标不匹配时,不能输入或删除.")); + ui->labelNote2->setText((m%2)?tr("点击空白处可关闭键盘."):tr("通过[字库编辑]功能,用户可以自定义新字符")); + m++;m=m&0xff; + // qDebug()<<"n:"<label_Note->setText(tr("选择[文本模式]可切换到主界面编辑方式.")); + ui->labelNote2->setText((m%2)?tr("点击光栅可打开键盘,点击空白处关闭键盘"):tr("使用[字库编辑]功能,用户可自己修改字形")); + // q + } + //qDebug()<<"n:"< +#include +#include +#include +#include "MyFileDialog.h" +#include "DialogInsertVari.h" +#include "MyInputMethod.h" +#include "DialogFileOperation.h" +#include "DialogLineSpace.h" +#include "SysPara.h" +#include "string.h" +#include "dlgdrawinit.h" +#include "DialogSaveFile.h" +#define MYDLG + +namespace Ui { +class PicEdit; +} + +#define MAX_PIC_HEIGHT 40 +#define MAX_PIC_WIDTH 100 +class PicEdit : public QWidget +{ + Q_OBJECT + +public: + explicit PicEdit(QWidget *parent = 0); + ~PicEdit(); + + void bindSysPara(SysPara *sysPara); + + void setEnterKey(int n); + + void DrawInit(bool mode); + + +private slots: + void ondlgDrawOK(); +#if 0 /* no use */ + void on_pushButtonDrawPIC_clicked(); +#endif + void updateAuthorization(int auth); + void cursorFlash(); + void on_pushButtonEnd_pressed(); + void on_pushButtonHome_pressed(); + + void on_pushButtonNew_pressed(); + void EditCurrFile(QString fileName); + void on_pushButtonEnlarge_pressed(); + + void on_pushButtonReduce_pressed(); + + void on_pushButtonUp_pressed(); + + void on_pushButtonLeft_pressed(); + + void on_pushButtonEnsure_pressed(); + + void on_pushButtonRight_pressed(); + + void on_pushButtonDown_pressed(); + + + void on_checkBoxDrawGridEn_clicked(); + + void on_spinBoxHeightPoint_valueChanged (int i); + //void on_spinBoxWidthPoint_valueChanged (int i); + void on_pushButtonSaveAs_clicked(); + void onSaveAS_FIle_select(); + void onSave_File_reject(); + void on_pushButtonOpen_clicked(); + + + void onOpenFIle_select(); + void on_pushButtonSave_clicked(); + + void enableSaveButton(); + + void on_pushButtonImport_clicked(); + void on_lineEditInputTxt_textEdited(QString txt); + void on_comboBoxLattice_currentIndexChanged(int index); + void on_pushButtonStartInput_clicked(); + void on_pushButtonDeleteChar_clicked(); + void on_radioButtonCharCurrent_clicked(); + void on_radioButtonDotCurrent_clicked(); + void showKeybord( ); + void on_pushButtonInsertVari_pressed(); + void on_pushButtonCharSpace_pressed(); + void on_pushButtonZKEdit_pressed(); + //void + void ChinaProview(QString txt); + void onFileOpen(QString txt,bool m); + void printThisFileNow(QString s); + void onChangeFont(int n); + void on_pushButtonInsertMode_pressed(); + void on_checkBoxControlChar_clicked(); +Q_SIGNALS: + void openCurrentFile(QString ,bool); + void zkEditEnStatus(QString); + void setMainTabNow(int); + void setMainTabEdit(int); +protected slots: + void onSaveASFile(QString fileName, bool Flag); +private: + Ui::PicEdit *ui; + MyFileDialog *fileDialog; + dlgDrawInit * dlgdraw; + QString openedFileName; + //MyInputMethod *myInputMethod; + DialogFileOperation *dialogFileOperation; + DialogInsertVari *dialogInsertVari; + DialogLineSpace *dialogLineSpace; + SysPara *sysPara; + QTextEdit *textEdit; + QTimer *timer; + bool isInput; + bool zkEditEn; + bool newFileAppending; + bool inserPicFile; + void checkNewFileAppending(); + bool maybeSave(); + bool forcePicWidgetSize; + void keyPressEvent(QKeyEvent *e); + int lineSpace,charSpace; + int var[41]; + vars_t *p_avr; + vars_t mVar[10]; + int VarNum; +#ifdef MYSAVEFILEDLG + DialogSaveFile *dialogSaveFile; +#endif +}; + +#endif // PICEDIT_H diff --git a/PicWidget.cpp b/PicWidget.cpp new file mode 100644 index 0000000..3041c5a --- /dev/null +++ b/PicWidget.cpp @@ -0,0 +1,1953 @@ +/* + * PicWidget.cpp + * + * Created on: Jul 2, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "PicWidget.h" +#include +#include +#include +#include +#include +#include "LogInfo.h" +#include +#include + +#include "myinclude.h" + +PicWidget::PicWidget(QWidget *parent):QWidget(parent){ + memset(pointMap,0,sizeof(pointMap)); + heightPoint = 0; + widthPoint = 0; + lineNum=0; + lineMaxNum=0; + pEditMode=0; + memset(linePara,0,sizeof(linePara)); + scale = 16; + currXpos = 0; + currYpos = 0; + altPrint=0; + zkEditEn=false; + startCol=0;startRow=0; + modified = false; + charPara.DrawGridEn=(Qt::CheckState)true; + charPara.Bold=0; + charPara.Font=ST07; + charPara.CharWidth = 6; + charPara.CharHeight = 7; + charPara.Width = 0; + charPara.CharCurrent=1; + charPara.CurrentEn =1; + charPara.LineSpace=1; + charPara.FontGap=1; + charPara.LineHeight = 8; + isInput =0; + charPara.insertMode=1; + + system("chmod a+x /opt/zk/unitogb"); + unitogb.setFileName ("/opt/zk/unitogb"); + zkAsc.setFileName ("/opt/zk/asc.bin"); + + zkHz07.setFileName ("/opt/zk/HZK7S"); + zkHz09.setFileName ("/opt/zk/ST1010"); + zkHz12.setFileName ("/opt/zk/HZK12S"); + zkHz16.setFileName ("/opt/zk/HZK16S"); + zkHz24.setFileName ("/opt/zk/ST2424"); + zkHz16H.setFileName ("/opt/zk/HZK16H"); + zkHz24H.setFileName ("/opt/zk/HZK24H"); + + //cal_currHeightEn=0; + // qDebug()<<"dfdsfasfsdaf"; +} + +PicWidget::~PicWidget(){ + if(zkAsc.isOpen ()) zkAsc.close (); + if(zkHz07.isOpen ()) zkHz07.close (); + if(zkHz09.isOpen ()) zkHz09.close (); + if(zkHz12.isOpen ()) zkHz12.close (); + if(zkHz16.isOpen ()) zkHz16.close (); + if(zkHz24.isOpen ()) zkHz24.close (); +} +void PicWidget::showVar(QString mode,char *var,int len) +{ +#ifdef DEBUG1 + QString s="",ss;int n=0; + qDebug ()<rect(); //重绘部分大小。 + painter.setBrushOrigin(0,40); + static bool flash=0; + flash =!flash; + int x = (int)(rect.x()/scale); + int y = (int)(rect.y()/scale); + int x_ = rect.x() + rect.width(); + int y_ = rect.y() + rect.height(); + int last_x = x_/scale; + int last_y = y_/scale; + for(int i = x; i < widthPoint && i <= last_x; i++){ + for(int j = y; j < heightPoint && j <= last_y; j++){ + QPen pen; + int width = 0; + int YM=heightPoint-1-j; + if(currXpos == i && charPara.CurrentEn && currYpos+(charPara.DrawEn?0:charPara.CharHeight-1) >= YM && currYpos <= YM ){ + width = (scale>4)?1:1;// biankuang + if(flash) + pen.setColor(QColor(Qt::red)); + else{ + width = (scale > 6 && charPara.DrawGridEn)?1:0; + pen.setColor(QColor(Qt::gray)); + } + } + else { + width = (scale > 6 && charPara.DrawGridEn)?1:0; + pen.setColor(QColor(Qt::gray)); + } + + pen.setWidth(width); + painter.setPen(width?pen:Qt::NoPen); + if((pointMap[i*MAX_PIC_WIDGET_HEIGHT + YM]&0x01)==1) + { + painter.setBrush(QColor(Qt::black)); + } + else { + if((pointMap[i*MAX_PIC_WIDGET_HEIGHT + YM]& FLINE0)) painter.setBrush(QColor(Qt::cyan)); + //else if((pointMap[i*MAX_PIC_WIDGET_HEIGHT + YM]& FCOL0 & charPara.checkBoxControlChar)) painter.setBrush(QColor(Qt::yellow)); // magenta, yellow, + else if((pointMap[i*MAX_PIC_WIDGET_HEIGHT + YM]& FVAR)) painter.setBrush(QColor(Qt::green)); + else painter.setBrush(QColor(Qt::white)); + } + painter.drawRect(i*scale + width,j*scale + width,scale - 2*width,scale - 2*width); // + } + } + + if(zkEditEn) + emit rowColChanged(tr("编辑字符:%1").arg (currentEditTxt)); + else + emit rowColChanged(tr("[%1行,%2列]").arg (heightPoint).arg (widthPoint)); + + emit currXYChanged(tr("光标[%1,%2]").arg (currYpos).arg (currXpos/*/charPara.CharWidth*/)); //label_CURXY + + emit disp(); +} + +void PicWidget::resizeWidget(int w,int h){ + if(w > MAX_WIDTH || h > MAX_PIC_WIDGET_HEIGHT){ + QMessageBox::warning(0,tr("警告"),tr("最大支持宽度:%1 高度:%2 当前请求:%3 x %4").arg(MAX_WIDTH).arg(MAX_PIC_WIDGET_HEIGHT).arg(w).arg(h)); + widthPoint = (w > MAX_WIDTH)?MAX_WIDTH:w; + heightPoint = (h > MAX_PIC_WIDGET_HEIGHT)?MAX_PIC_WIDGET_HEIGHT:h; + } + else{ + widthPoint = w; + heightPoint = h; + } + resize(w*scale,h*scale); + update(); +} + +void PicWidget::cursorFlash() +{ + if(pEditMode==0 || zkEditEn )return; + + movePicView(); + //update (); + update (); + if(isInput) emit ShowKeybord (); + //qDebug()<<"cur runing."; +} + +int PicWidget::getFontHeight(int x,int y) +{ int res=0, xx=x*MAX_HEIGHT+y; + int font[]={5,7,9,12,16,16,24,24,32}; + unsigned char c=0; + if( (c=pointMap[xx]) & (FLINE0|FCOL0)) + { + res = font[(c>>1)& 0x0f] ; + if(resline.maxFont)line.maxFont=res; + //qDebug()<<( (pointMap[xx+CFONT]>>1)& 0x0f)<>1); + if(resline.maxLineHeight)line.maxFont=res; + // qDebug()<<( (pointMap[xx+CFONT]>>1)& 0x0f)< MAX_HEIGHT-1 )&& x==0) return x1; + if(f0==0 && x>0) { + x = getPrePos(x,x); + f0 = getFontHeight(x,y); + } + while(x){ + x0=x; + x = getPrePos(x,x);//32); + f1 =getFontHeight(x,y); + if(f0 < f1 ){ + x1=x0; + break; + } + + } + return x1; +} +int PicWidget::isCanDelete(int x,int y){ + int res=0; + int xx=x*MAX_HEIGHT+y; + for(int j=4;jlinePara[0]){linePara[1]=x; linePara[0]=h;} + if( linePara[n]) { + n++; + linePara[n]=h; + } + else linePara[n]=h; + } + } + x++; + } + else break; + } + //qDebug()<<"LINEH:"<=5 && y==heightPoint-1){ +// if(y>= currYpos+2*charPara.LineHeight) y=currYpos+charPara.LineHeight; +// y0=y; +// } + //qDebug()<=5){ + if((currYpos-y)>=2*charPara.LineHeight) y=currYpos-charPara.LineHeight; + } + + return y; +} + +int PicWidget::getNextPos(int x,int n) +{ int x1=x++,xx=0; + int varFlag=0; + if(( pointMap[x*MAX_HEIGHT+currYpos]&FVAR) == FVAR){ + varFlag=1; + n=widthPoint-x;//124*8; + while(n--) + { + if((( pointMap[x*MAX_HEIGHT+currYpos]&FVAR) == FVAR) &&( pointMap[x*MAX_HEIGHT+currYpos]&FLINE0)) x++; + else {x++;break;} + xx++; + if(x>widthPoint-1)break; + } + if(x>=widthPoint) x=widthPoint;//{ x=x1+charPara.CharWidth;} + if(xx==0) x=x1; + return x; + } + + while(n--) + { + if((( pointMap[x*MAX_HEIGHT+currYpos]&FCOL0) == 0x00) &&( pointMap[x*MAX_HEIGHT+currYpos]&FLINE0)) x++; + else break; + xx++; + //qDebug()<<"getNextPos1:"<=widthPoint ) x=widthPoint;//{ x=x1+charPara.CharWidth;} + if(xx==0) x=x1; + //qDebug()<<"getNextPos"<MAX_WIDTH-1)return 1; + while(n) + { if(x>=MAX_WIDTH) break; + n--; + if(( pointMap[x*MAX_HEIGHT+currYpos]&(FLINE0 | FCOL0))== 0x00) x++; + else break; + // if(xx<30)xx++;else break; + } + return (n<=0); +} + +int PicWidget::isVar(int x,int y) //isVar +{ + return (( pointMap[x*MAX_HEIGHT+y]&FVAR) == FVAR) ; +} + +int PicWidget::getPrePos(int x,int n) +{ x--; + int n0=x; + n=x; + while(n--) + { + if(x){ + if(( pointMap[x*MAX_HEIGHT+currYpos]&FCOL0)) break; + x--; + } + else break; + } + if(( pointMap[x*MAX_HEIGHT+currYpos]&FVAR) == FVAR){ + n=n0; + while(n--) + { + if((( pointMap[x*MAX_HEIGHT+currYpos]&FVAR) == FVAR) &&( pointMap[x*MAX_HEIGHT+currYpos]&FLINE0)) x--; + else {x++;break;} + if(x<=0) break; + + } + if(x<=0) x=0; + } + return x; +} + +void PicWidget::mousePressEvent ( QMouseEvent * event ){ + int x = (int )(event->x()/(scale)); + int y = heightPoint -(int )(event->y()/scale)-1; + static bool r_DrawEn=!charPara.DrawEn; + + if(x < widthPoint && y < heightPoint){ + int oriX = currXpos; + int oriY = currYpos; + + if(charPara.DrawEn) + { modified = true; + + currXpos = x; + currYpos = y; + if((pointMap[x*MAX_PIC_WIDGET_HEIGHT + y]&0x1e) ==(unsigned char)(0x00)) + { + if(pointMap[x*MAX_PIC_WIDGET_HEIGHT + y]&0x01) + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] &=0xfe; + else pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] |=0x01; + } + if(r_DrawEn) update(oriX*scale,oriY*scale,scale,scale); //将原来的焦点去掉 + else update(oriX*scale,oriY*scale,scale,scale*(charPara.LineHeight+1)); //将原来的焦点去掉 + update(x*scale,y*scale,scale,scale); + emit picWidgetModify(); + update(); + // + } + else + { + currXpos = x; + currYpos = y; + + currXpos = SiteStart(currXpos); + currYpos = getDownLine(currXpos); + // if(isVar(oriX,currYpos)) getNextPos(oriX,24*8); + // currXpos = getNextPos(currXpos,charPara.CharWidth); + + if(currXpos > widthPoint) currXpos=widthPoint; + if(currXpos<0) currXpos=0; + if(currYpos<0) currYpos=0; + + + if(charPara.DrawEn) + { + + if(currYpos>=heightPoint) currYpos=heightPoint; + if(isVar(currXpos,currYpos)){ + currXpos = getNextPos( currXpos,24*8); + } + } + else + { + if(isVar(currXpos,currYpos)){ + currXpos = getNextPos( currXpos,24*8); + } + } + //emit movePicView(); + emit ShowKeybord(); + update(oriX*scale,oriY*scale,scale,scale*(charPara.LineHeight)); + update(currXpos*scale,currYpos*scale,scale,scale*(charPara.LineHeight)); + } + r_DrawEn=charPara.DrawEn; + + } +} +int PicWidget::isBlankCol() +{ int cnt=0; + int x = currXpos*MAX_PIC_WIDGET_HEIGHT; + for(char i=0;i0){ // right + currXpos = getNextPos(oriX,widthPoint-currXpos); + + } + else if(shiftX<0){ + if(currXpos) + currXpos = getPrePos(oriX,currXpos); + } + else { } + + if(shiftY<0){ // UP + currYpos = getUpLine(oriX); + if(isVar(oriX,currYpos)) + currXpos = getPrePos(oriX,124*8); + else currXpos = SiteStart(oriX); + + } + else if(shiftY>0){ + if(currYpos) + currYpos = getDownLine(oriX); + if(isVar(oriX,currYpos)) + currXpos = getPrePos(oriX,124*8); + else currXpos = SiteStart(oriX); + } + else{ } + + } + else { + + if(shiftX>0) shiftX=1; + else if(shiftX<0) shiftX=-1; + else shiftX=0; + currXpos += shiftX; + if(currXpos<0)currXpos=0; + else if(currXpos>=widthPoint-1)currXpos=widthPoint-1; + + // qDebug()<<"Y0:"<0) shiftY=-1; + else if(shiftY<0) shiftY=1; + else shiftY=0; + currYpos += shiftY; + if(currYpos<0) currYpos=0; + if(currYpos>heightPoint-1) currYpos =heightPoint-1; + // qDebug()<<"Y1:"<40) h0=40; + if(altPrint){ + h0 = h0/2; + } + + return h0; +} + +int PicWidget::getWidth(){ + return widthPoint; + +} + +int PicWidget::getScaleValue(){ + return scale; +} +void PicWidget::bindSysPara(SysPara *sysPara){ + //this->sysPara1 = sysPara; +} +void PicWidget::initWidget(int w,int h){ + scale = 30; + if(parentWidget()){ + startRow=0; + startCol=0; + QWidget *widget = parentWidget(); + int width = widget->geometry().width(); + int height = widget->geometry().height(); + int scaleX = w?width/w:width; //不要除零 + int scaleY = h?height/(h):height; + scaleX = scaleX > 0?scaleX:1; //scale不能小于零 + scaleY = scaleY > 0?scaleY:1; + scale = scaleY>10?10:scaleY;// > scaleY?scaleX:scaleY; + if(charPara.DrawEn) scale=(scale<8)?8:scale; + else scale=(scale>4)?4:scale; + } + currXpos = 0; + currYpos = 0; + varNum =0; + charPara.Width = w; + //emit movePicView(1); + memset(pointMap,0,sizeof(pointMap)); + resizeWidget(w,h); + modified = false; + picSetHome(); +} + +void PicWidget::enlargeDisplay(){ + if(scale < (1<<10)){ + scale = scale + ((scale>2)?scale/2:1); + resize(widthPoint*scale,heightPoint*scale); + update(); + } +} + + +void PicWidget::reduceDisplay(){ + if(scale > 1){ + scale = scale - ((scale > 2)?scale/3:1); + resize(widthPoint*scale,heightPoint*scale); + update(); + } +} + +void PicWidget::setScale(int scale){ + if(scale > 1) + this->scale = scale; + else + scale = 1; + resize(widthPoint*scale,heightPoint*scale); + update(); +} +void PicWidget::insertImage1(QString filename,bool forceSize){ + if((widthPoint == 0 || heightPoint == 0) && forceSize){ + QMessageBox::warning(0,tr("警告"),tr("请新创建建图片")); + } + else { + QImage img(filename); + if(img.isNull()){ + QMessageBox::warning(0,tr("警告"),tr("文件:%1 无法打开").arg(filename)); + } + else { + int w = img.rect().width(); + int h = img.rect().height(); + + + if(widthPoint +w 16 + else temp=6; // 24 + //int font[]={5,7,9,12,16,16,24,24,32}; + wRow[0]=( temp<<1)& 0x1e; + if(h<7) temp=h-5; //5 + else if(h<9) temp=h-7;//7 + else if(h<12) temp=h-9;//9 + else if(h<16) temp=h-12;//12 + else if(h<24) temp=h-16;//4,5 =>16 + else temp=h-24; // 24 + wRow[1]=( temp <<1)& 0x1e; + wRow[2]=(charPara.FontGap <<1)& 0x1e; + wRow[3]=(charPara.Bold <<1)& 0x1e; + wRow[4]=(charPara.CharWidth <<1)& 0x1e; + wRow[5]=(charPara.LineHeight <<1)& 0x1e; + } + + if(forceSize){ + widthPoint =w; + heightPoint=h; + currXpos=0; + currYpos=0; + } + resizeWidget(widthPoint,heightPoint); + charInsert(w,0); + + for(int i = 0; i < w;i++){ + if((currXpos+ i)>=MAX_WIDTH) break; + + for(int j = 0; j < h ; j++){ + if((currYpos + j)>=MAX_PIC_WIDGET_HEIGHT) break; // continue;// + QRgb argb = img.pixel(i,j); + + //qDebug() << "i:" << i << "j" << j << " " << QString::number(argb,16); + if((argb == 0xffffffff) ) //节约时钟周期 + { + pointMap[(currXpos+i)*MAX_PIC_WIDGET_HEIGHT +(currYpos+h-1-j)] = (i?0:FCOL0) |(jwidthPoint)currXpos=widthPoint; + update(); + } + } +} + +void PicWidget::insertImage(QString filename,bool forceSize){ + + if((widthPoint == 0 || heightPoint == 0) && forceSize){ + QMessageBox::warning(0,tr("警告"),tr("请新创建建图片")); + } + else { + QImage img(filename); + if(img.isNull()){ + QMessageBox::warning(0,tr("警告"),tr("文件:%1 无法打开").arg(filename)); + } + else + { + int w = img.rect().width(); + int h = img.rect().height(); + bool isToWidth=0; + + charInsert(w,0); + +// widthPoint+=w; +// /* 2014-2-28 修正了插入图片造成死机问题。原因:由于数组下标溢出 */ +// if(widthPoint>MAX_WIDTH){ widthPoint=MAX_WIDTH;} +// if(heightPoint>MAX_PIC_WIDGET_HEIGHT){ heightPoint=MAX_PIC_WIDGET_HEIGHT;} +// if(w+currXpos>widthPoint) {w = widthPoint-currXpos;isToWidth=1;} +// if(h+currYpos>heightPoint){ h =heightPoint-currYpos;isToWidth=1;} + +// resizeWidget (widthPoint,heightPoint); + + for(int i = 0; i < w;i++){ + if((currXpos+ i)>=MAX_WIDTH) break; + uint c=0;uchar cc=0,c1=0; + + for(int j = 0; j < h ; j++){ + if((currYpos + j)>=MAX_PIC_WIDGET_HEIGHT) break; // continue;// + QRgb argb = img.pixel(i,j); + c1 = argb&0xff; + + //qDebug() << "i:" << i << "j" << j << " " << QString::number(argb,16); + if((argb == 0xffffffff) ) //节约时钟周期 + { + pointMap[(currXpos+i)*MAX_PIC_WIDGET_HEIGHT +(currYpos+h-1-j)] = (i?0:FCOL0) |(jwidthPoint)currXpos=widthPoint; + update(); + } + } +} +void PicWidget::readPng(int x,int y,int w,int h) +{ + +} + +void PicWidget::loadImage(QString filename,bool forceSize){ + + if((widthPoint == 0 || heightPoint == 0) && forceSize){ + QMessageBox::warning(0,tr("警告"),tr("请新创建建图片")); + } + else { + QImage img(filename); + if(img.isNull()){ + QMessageBox::warning(0,tr("警告"),tr("文件:%1 无法打开").arg(filename)); + } + else + { + int w = img.rect().width(); + int h = img.rect().height(); + startRow=0; + startCol=0; + varNum =0; + memset(pointMap,0,sizeof(pointMap)); + if(!forceSize){ + widthPoint = (w > MAX_WIDTH)?MAX_WIDTH:w; + heightPoint = (h > MAX_PIC_WIDGET_HEIGHT)?MAX_PIC_WIDGET_HEIGHT:h; + resize(widthPoint*scale,heightPoint*scale); + } + // readPng(0,0,w,h); + for(int i = 0; i < widthPoint;i++){ + uint c=0;uchar cc=0,c1=0; + for(int j = 0; j < heightPoint ; j++){ + bool pixelVisible = false; + int init_x = i*w/widthPoint; + int end_x = (w >= widthPoint)?(i + 1)*w/widthPoint:init_x + 1; + int init_y = j*h/heightPoint; + int end_y = (h >= heightPoint)?(j + 1)*h/heightPoint:init_y + 1; + c=0; + for(int l = init_x; l < end_x; l++){ + for(int m = init_y; m < end_y; m ++){ + QRgb argb = img.pixel(l,m); + c1 = argb&0xff; + + //qDebug() << "i:" << i << "j" << j << " " << QString::number(argb,16); + if((argb == 0xffffffff) ) //节约时钟周期 + { + continue; + } + if(((argb & 0xffffff00)==0xff000000 ) + ||((argb & 0xffffff00)==0xffffff00 )) //节约时钟周期 + { + c = c1; + pixelVisible = true; + break; + } + } + if(pixelVisible || c) break; + } + pointMap[i*MAX_PIC_WIDGET_HEIGHT +(heightPoint-1- j)] = c; + }// one col end + } + currXpos=0; + currYpos=0; + //currMode = cal_currHeight()>0; + line.Len=widthPoint; + charPara.LineHeight =getLineHeight(0,0); + if( getLineEnd(0)<5) { + qDebug()<<"FILE TYPE ERROR!"; + } + update(); + } + } +} + +void PicWidget::getPrintDat(unsigned char *dat,unsigned char alt2,SysPara *sysPara) +{ + if(!sysPara ) return; + int res=0; + res = resizePicRect(alt2); + + int hStart,hEnd; + int h= endRow-startRow+1;// + + hStart= (alt2>1)?h>>1:0; + hEnd = (alt2==1)?h>>1 :h; + + for(int i = 0 ; i < widthPoint; i++) + { + unsigned char c=0,c1=0; + int j=0; + for( j = hStart; j < hEnd; j++) + { + c |= (pointMap[(i)*MAX_PIC_WIDGET_HEIGHT+startRow + h-1-j]&0x01)? (1 << (j%8)):0; + if(j%8==7) { dat[i*5+(j-hStart)/8]=c; c=0; } + } + dat[i*5+(j-hStart)/8]=c; + } +} + +/* =============================================== + 040608 121416 242628 32343638 4648 52545658 646668 727476787A 848688 949698 + 02 0A 16 22 2A 3A 44 48 52 62 7A 82 8A 92 9A + 02 0A 16 2A 3A 44 48 52 62 7A 82 8A 92 9A + 02 0A 16 2A 343638 42 48 52545658 62646668 78 848688 92 9A + 02 0A 16 28 3A 42 48 5A 62 6A 78 82 8A 9496989A + 02 0A 16 26 3A 424446484A 5A 62 6A 76 82 8A 9A + 03 0B 17 25 3B 49 5B 63 6B 77 83 8B 9B + 050709 131517191B 232527292B 33353739 49 53555759 656769 77 858789 93959799 +=============================================== */ + +void PicWidget::getCharRamData(SysPara *sysPara) +{ + // 生成字模数据 + if(sysPara->status.variNum) + { + int ramAddress = 0; + if(sysPara->status.variNum>8)sysPara->status.variNum=8; + + for(int i = 0; i < sysPara->status.variNum; i++){ + + vars_t *p_var = &sysPara->status.vars[i]; + p_var->bassAddr = -1; + if(p_var->original){ //清除原来的记录 + if(p_var->dat){ + free(p_var->dat); + } + p_var->original = false; + } + for(int j = 0; j < i; j ++){ //重复检测是否有重复大小的字存在 + if((p_var->height == sysPara->status.vars[j].height) + &&(p_var->width/p_var->digitalNum == sysPara->status.vars[j].width/sysPara->status.vars[j].digitalNum )) + { + p_var->bassAddr = sysPara->status.vars[j].bassAddr; + p_var->datHeight = sysPara->status.vars[j].datHeight; + p_var->datWidth = sysPara->status.vars[j].datWidth; + p_var->rowByteNum = sysPara->status.vars[j].rowByteNum; + p_var->dat = sysPara->status.vars[j].dat; + break; + } + } + if(p_var->bassAddr == -1){ + int width = (p_var->digitalNum)?(p_var->width/p_var->digitalNum):5; + int height = p_var->height; + if(p_var->digitalNum>8 || p_var->type >9 + || p_var->digitalNum<2 || p_var->width<5 + || p_var->height<5 || p_var->height>24 + || p_var->type <0 ||p_var->letterSpace >5 + || p_var->letterSpace <0 + ) + { + return; + } + + // 先根据变量高度,选择一种字体,然后读出0~9的字模,然后进行行列转换,存储到p_var->dat + //char font[]={5,7,9,12,16,16,24,24,32}; + if(p_var->height>=18) charPara.Font=ST24; + else if(p_var->height>=13) { + charPara.Font=p_var->width/p_var->digitalNum-p_var->letterSpace==(p_var->bold?24:12)?HT16:ST16; + } + else if(p_var->height>=10) charPara.Font=ST12; + else if(p_var->height>=8) charPara.Font=ST09; + else if(p_var->height>=6) charPara.Font=ST07; + else charPara.Font=ST05; + + width = (p_var->digitalNum)?(10*p_var->width/p_var->digitalNum):12; + + int zm_width = 11* width; + int zm_height = p_var->height; + unsigned char pMap[(zm_width+10)*40]; // >720 + + charPara.LineSpace = p_var->letterSpace; + //memset(zm,0,sizeof(zm)); + memset(pMap,0,sizeof(pMap)); + inputRamDot (QString("0123456789"),pMap, p_var);// READ DOT FROM ASB.BIN + + int rowDiff = p_var->endRowPos - p_var->startRowPos; + int firstValidRow; + int lastValidRow = 0; + int firstValidRowDiff; + if(lastValidRow >= rowDiff){ + firstValidRow = lastValidRow - rowDiff; + firstValidRowDiff = firstValidRow; + } + else { + firstValidRow = 0; + firstValidRowDiff = lastValidRow > rowDiff; + } + firstValidRow = firstValidRow >= 0?firstValidRow:0; //纠正 第一行位置 + int rowByteNum = rowDiff/8 + ((rowDiff%8)?1:0); // 行数 + + unsigned char *dat = (unsigned char *)calloc(width,rowByteNum); + + for(int k = zm_height - 1; k >= 0 ; k--){ + for(int j = 0; j < zm_width; j ++){ + if(pMap[j*MAX_PIC_WIDGET_HEIGHT+k]&0x01){ + lastValidRow = k + 1; + break; + } + } + if(lastValidRow != 0) + break; + } + +#ifdef DEBUG_NUMZK + printf ("firstValidRow:%d,lastValidRow:%d,rowByteNum:%d,width:%d\n\r",firstValidRow,lastValidRow,rowByteNum,width) ; +#endif + for(int k = firstValidRow; k < lastValidRow; k++){ + for(int j = 0; j < width; j ++){ + int currRow = k - firstValidRowDiff; + if(pMap[j*MAX_PIC_WIDGET_HEIGHT+k]&0x01){ + dat[rowByteNum*j + currRow/8] |= (1<<(currRow%8)); +#ifdef DEBUG_NUMZK + printf("%02X",rowByteNum*j + currRow/8); +#endif + } + else{ +#ifdef DEBUG_NUMZK + printf(" "); +#endif + } + } +#ifdef DEBUG_NUMZK + printf("\n"); +#endif + } + p_var->bassAddr = ramAddress; + p_var->datHeight = height; + p_var->datWidth = width; + p_var->rowByteNum = rowByteNum; + p_var->dat = dat; + p_var->original = true; + p_var->currVal = -1; //相当于初始化 + ramAddress += rowByteNum * width; + } + } + } +} + +int PicWidget::readVar(SysPara *sysPara, unsigned char alt2)// alt2 =0,1,2 +{ + if(sysPara) + { + varNum=0; // _______SAMW + altPrint = alt2; + resizePicRect(alt2); + + for(int j = 0; j < heightPoint; j++) + { + line.maxFont=MAX_HEIGHT;line.minFont =0; // start + + for(int i = 0 ; i < widthPoint; i++) + { + getLineHeight(i,j); // cal min lineHeight, max lineHeight + + unsigned char c[6]; + unsigned char c1=pointMap[i*MAX_PIC_WIDGET_HEIGHT + j]; + + if((c1 & FCOL0 ) && (c1 & FLINE0) && (c1 & FVAR)) + { // 定位变量的起点 +// // W0 ==font V1 = type V2 = diginum V3 = width + c1=(pointMap[(i+VTYPE)*MAX_PIC_WIDGET_HEIGHT + j] >>1)& 0x0f; //type + c[0]=(pointMap[(i+CFONT)*MAX_PIC_WIDGET_HEIGHT + j] >>1)& 0x0f; //font + if(c1 > 9 && c1 != 13) continue; //type,cnt3 is 13 + c[1]=c1; + // qDebug ()<<"C1"<status.vars[varNum].type=c[VTYPE]; + sysPara->status.vars[varNum].digitalNum=c[VDIGIT]; + sysPara->status.vars[varNum].width=c[VWIDTH]; + sysPara->status.vars[varNum].height =getFontHeight(i,j); + sysPara->status.vars[varNum].startColPos =i; + sysPara->status.vars[varNum].startRowPos=endRow+1-(j+sysPara->status.vars[varNum].height); + sysPara->status.vars[varNum].endRowPos=endRow+1-(j); + c1=(pointMap[(i)*MAX_PIC_WIDGET_HEIGHT + j+ CFONTGAP] >>1)& 0x0f; //font + sysPara->status.vars[varNum].letterSpace= c1>5?5:c1; + } +#ifdef DEBUGX + qDebug ()<<"varNum t dig sw sh ls sc sr er "; + qDebug ()<status.vars[varNum].type + <status.vars[varNum].digitalNum + <status.vars[varNum].width + << sysPara->status.vars[varNum].height + << sysPara->status.vars[varNum].letterSpace + <status.vars[varNum].startColPos + <status.vars[varNum].startRowPos + <status.vars[varNum].endRowPos + ; +#endif + + varNum++; + if(varNum>8){ + varNum=8; + QMessageBox::warning(this,tr("警告"),tr("信息中的变量数超过了最大值(8)!请减小变量数.")); + break; + } + i+=c[VWIDTH]-1; + + } + + + } + j+=line.minLineHeight?line.minLineHeight-1:0; + } + //startCol =0; + sysPara->status.variNum=varNum; + //qDebug()<<"varn:"<status.variNum; + } // end of if(sysPara) + return varNum; +} + +// resizePicRect(); +int PicWidget::resizePicWidth(bool rowEn) +{ + //int w=0,Flag=0; + startCol=0; + endCol=0; + for(int j = 0; j < heightPoint; j++){ + { + for(int i = endCol ; i < widthPoint; i++) + if(((pointMap[i*MAX_PIC_WIDGET_HEIGHT + j]&0x01))||((pointMap[i*MAX_PIC_WIDGET_HEIGHT + j]&FLINE0))) + { + if(endCol21 ) endRow=lastLinePos+23; + else if(lastLineHeigt>16) ; + else if(lastLineHeigt>13) endRow=lastLinePos+15; + else if(lastLineHeigt>10) endRow=lastLinePos+11; + else if(lastLineHeigt>7) endRow=lastLinePos+8; + else if(lastLineHeigt>5) endRow=lastLinePos+6; + + } + return startRow; +} + +/* + 文件格式说明 + 1. 在图像文件中,存储变量信息,D0=1表示有点,D0=0表示无点 + 2.地址 信息D6~D1 + 0 0xaa + 1 varNum + 2 0x68 + 3 + 3. 变量参数 隐藏在变量占位符中D6~D1 + 列编号 变量信息(1~128) + 0 类型+1 + 1 位数+1 + 2 字符宽度(点)/2 +1 + 3 字符高度(点)+1 + 4 字符间隔+1 + */ + +void PicWidget::saveImage(QString filename){ + if(widthPoint == 0 || heightPoint == 0){ + QMessageBox::warning(0,"警告","请新创建图片"); + } + else { + update (); + resizePicWidth(0); + // resizePicRect(0); + QSize size(widthPoint,heightPoint); + QImage image(size,QImage::Format_ARGB32); + image.fill(qRgba(0,0,0,0xff)); + for(int i = 0 ; i < widthPoint; i++){ + for(int j = 0; j < heightPoint; j++){ + uint c = 0; + uchar cc= pointMap[( i)*MAX_PIC_WIDGET_HEIGHT +(heightPoint-1- j)]; + if((cc&0x01)==1) + { + c=0xff000000 | (cc) ; + } + else + { + if(cc==0) c=0xffffffff; + else c = 0xffffff00 | (cc); + } + image.setPixel(i,j,c); + } + } + image.save(filename); + } + setModified(false); +} + +void PicWidget::saveImage1(QString filename){ + if(widthPoint == 0 || heightPoint == 0){ + QMessageBox::warning(0,"警告","请新创建建图片"); + } + else { + QSize size(widthPoint,heightPoint); + QImage image(size,QImage::Format_ARGB32); + image.fill(qRgba(0,0,0,0xff)); + for(int i = 0 ; i < widthPoint; i++){ + for(int j = 0; j < heightPoint; j++){ + image.setPixel(i,j,pointMap[i*MAX_PIC_WIDGET_HEIGHT +heightPoint-1- j]?0xff000000:0xffffffff); + } + } + filename = DOC_ROOT_DIR+ QFileInfo(filename).baseName()+".jpg"; + image.save( filename ); + } + setModified(false); +} + +int PicWidget::picDelOneChar() +{ + int posx =currXpos; + //int posy =currYpos; + emit picWidgetModify(); + if(zkEditEn) + { + memset(pointMap,0,40*40); + resizeWidget (widthPoint,heightPoint); + update (); + return 0; + } + + if(posx==0)return 0; + if(isCanDelete(currXpos,currYpos)) return -1; + currXpos = getPrePos(posx,posx);//32); + picDelNextChar( ); + + return 0; +#if 0 + int posxEnd = getLineEnd(posx); + int posx2 = getPrePos(posx,32); + //========================= +#ifdef FONTMATCH //是否需要匹配字体能操作 + if(getFontHeight(posx2,posy)!=charPara.CharHeight)return posx; +#endif + + if(posxEnd>posx && posx2posx && posx2>posx) + {//13 0 24 30 172 + //qDebug()<<"DelNext:"<=line.Len) + { + line.Len -=posx-posx2; + //line.Len; + resizeWidget(line.Len,heightPoint); + } + movePicView(); + update (); + return posx; +} + +void PicWidget::delDots(int x1,int x2,int y1,int h){ + int i,j; + for(i=x1;i0){ + int xMaxPos= linePara[1];// + for(i=x2-1;i>=x1;i--) { + + if(icurrXpos && posx2){ + + moveDots(currXpos,posx1,posy1,linePara[0],w); // + + } + else if(posx1==currXpos && posx2){ + if( pointMap[posx1*MAX_PIC_WIDGET_HEIGHT+posy1] & (FCOL0 | FVAR)) { + // qDebug()<<"INsert1:"<w){ + // qDebug()<<"INsert2:"; + } + else{ + //qDebug()<<"INsert3:"; + return -1; + } + + } + + return 0; +} +char PicWidget::getZkPic(char *dat) +{ int n=0; + QString s="S-",s1; + //showVar ("MAP:",(char *)pointMap,40*10); + for(int i=0;iisOpen ()) pzkEditFile->close (); + pzkEditFile->open (QIODevice::ReadWrite); + char dot[100]; + ///for(int i=0;i<100;i++)dot[i]=0; + memset(dot,0,sizeof(dot)); + getZkPic(dot); // + //qDebug ()<<"zk-2-"<fileName ()<seek(zkOffset); + pzkEditFile->write(dot,zkReadNum); + pzkEditFile->close (); +} + +void PicWidget::readAscDot(unsigned int asc,char *dot) +{ + int offset1[]={BIN0805,BIN0808,BIN0810,BIN0812,BIN0816,BIN1616,BIN2424,BIN2424,BIN2424}; + int fontNum[]= {8,8,10,12,16,32,72,72,72 }; + int fontHeight[]={5,7,9,12,16,16,24,24,24 }; + int fontWidth[]= {5,5,7,8,8,12,24,24,24 }; + QFile *pzkFile; + pzkFile = (QFile * )&zkAsc; + if(!pzkFile->isOpen ()) pzkFile->open (QIODevice::ReadWrite); + pzkEditFile = (QFile * )pzkFile; + charPara.CharHeight = fontHeight[charPara.Font]; + charPara.CharWidth = fontWidth [charPara.Font]+charPara.FontGap; + charPara.LineHeight = charPara.CharHeight +charPara.LineSpace; + zkReadNum = fontNum[charPara.Font]; + zkOffset = asc*fontNum[charPara.Font]+offset1[charPara.Font]; + pzkFile->seek(zkOffset); + pzkFile->read(dot,zkReadNum); + //qDebug ()<<"EN"<close (); +} + +void PicWidget::readZhDot(unsigned int ingb,char *dot ) +{ + unsigned int gbCode=0; + unsigned char gbcode[4]; + if(!unitogb.isOpen ()) unitogb.open (QIODevice::ReadWrite); + unitogb.seek (ingb); + unitogb.read ((char*)gbcode,2); + unitogb.close (); + gbCode = (gbcode[0]<<8)+gbcode[1]; + + QFile *pzkFile1[]={&zkHz05,&zkHz07,&zkHz09,&zkHz12,&zkHz16,&zkHz16H,&zkHz24,&zkHz24H,&zkHz24H}; + int fontNum[]= {8,16,20,24,32,32,72,72,72 }; + int fontHeight[]={5,8,10,12,16,16,24,24,24 }; + int fontWidth[]= {8,8,9,12,16,16,24,24,24 }; + // qDebug()<=0xa1)&&(gbcode[0]<=0xff)) + { + //qDebug()<isOpen ()) + pzkEditFile->open (QIODevice::ReadWrite); + zkReadNum = fontNum[charPara.Font]; + zkOffset =(gbcode[0]-0xa1)*zkReadNum*94+(gbcode[1]-0xa1)*zkReadNum; //区位码=区字节+位字节 16*2 + pzkEditFile->seek(zkOffset); + pzkEditFile->read(dot,zkReadNum); // write to stderr + //qDebug ()<<"CH:"<fileName ()<0 && var[0]<10) { + if(currYpos){ + if( pointMap[(currXpos)*MAX_PIC_WIDGET_HEIGHT +currYpos-1]&0x1e){ + QMessageBox::warning(this,tr("警告"),tr("两个变量之间至少要空出一个墨点!")); + return 0; + } + + } + if(varNum<7) varNum++; + + if(currXpos>5){ + if( pointMap[(currXpos-1)*MAX_PIC_WIDGET_HEIGHT +currYpos]&0x1e) // have cnt? + { + QMessageBox::warning(this,tr("警告"),tr("两个变量之间至少要空出一个墨点!")); + return 0; + } + } + } + code_index=0; + currentEditTxt =txt; + int r_heightPoint =heightPoint; + int r_widthPoint =widthPoint; + if( widthPoint>MAX_WIDTH) + { + widthPoint=MAX_WIDTH; + return 0; + } + if( currXpos >=MAX_WIDTH ) + { + currXpos=MAX_WIDTH; + return 0; + } + + while(k=0x20 && incode<0x80) + { // ascii + zkIncode = (incode & 0x7f)-0x20; + readAscDot(zkIncode,dot); + if(getInserEnable(currXpos,currYpos,charPara.CharWidth,charPara.CharHeight)) { + shows(QString("insertEN var x:%1,k:%2").arg(currXpos).arg(k)); + return -1; + } + if(charInsert(charPara.CharWidth,1)<0){ + shows(QString("insert1 var x:%1,k:%2").arg(currXpos).arg(k)); + return -1; + } + + if(var[0]) currXpos +=varDotMap(dot,var); + else currXpos +=charDotMap(dot,1); + } + // 先处理特殊功能键 + else if(incode<0x20 )// if(txt.at (0).toAscii ()<0x20) + { + if( txt.at (0).toAscii () =='\n') // enter key key + { + zkIncode = (0x30)-0x20; + readAscDot(zkIncode,dot); + if( charPara.CharCurrent){ + int h0=getLineHeight(currXpos,currYpos); + if(h0=lineMaxNum){ if(lineMaxNum=4000) // ? + { + zkIncode = (incode-0x0020)*2; + // qDebug()<heightPoint)charPara.LineHeight+currYpos>heightPoint; + + if(widthPoint < currXpos+300) widthPoint = currXpos+300; + if(widthPoint>MAX_WIDTH) widthPoint=MAX_WIDTH; + if(heightPointMAX_HEIGHT) heightPoint=MAX_HEIGHT; + + + if( r_heightPoint < heightPoint || r_widthPoint width/p_var->digitalNum; + int char_bold; + // int num_w ; + int xx=0;// QString str="----\n"; + while(k=0x20 && incode<0x80) + { // ascii + zkIncode = (incode & 0x7f)-0x20; + readAscDot(zkIncode,dot); + char_bold = char_width/(charPara.CharWidth-charPara.FontGap); + + int w = char_bold; + + for(int i=0,n=0;i 580 ?currXpos*scale-580 :0),0)); + r_currXpos=currXpos; + } +} + +int PicWidget::charDotMap(char *dot,bool english ) +{ + int mx=0,mxx=0; + unsigned char wRow[32]; + memset(&wRow,0,sizeof(wRow)); + + if(zkEditEn==0){ + wRow[0]=(charPara.Font <<1)& 0x1e; + wRow[1]=(charPara.LineSpace <<1)& 0x1e; + wRow[2]=(charPara.FontGap <<1)& 0x1e; + wRow[3]=(charPara.Bold <<1)& 0x1e; + wRow[4]=(charPara.CharWidth <<1)& 0x1e; + wRow[5]=(charPara.LineHeight <<1)& 0x1e; + } + // qDebug()<<"wR:"<>1)& 0x0f; // 0 font 1 type 2 digit + while( (c2= pointMap[(x)*MAX_PIC_WIDGET_HEIGHT + y]) & FVAR ){ + if(c2 & FCOL0) n++; + x++;w++; + if(x>widthPoint || w>30*8 || n>8 ) {w=0;n=0;break;} + } + if(w && c1 ==n){// + + c[2]=n;c[3]=w; + } + return n; +} + +void PicWidget::VarGapSet(int x,int h) +{ + for(int i=0;i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SysPara.h" +#include "ParaSettingUI.h" + +#define MAX_PIC_WIDGET_HEIGHT 60 +#define MAX_PIC_WIDGET_WIDTH 600*8 +#define MAX_WIDTH MAX_PIC_WIDGET_WIDTH-100 +#define MAX_HEIGHT MAX_PIC_WIDGET_HEIGHT +#define MAXLINE 40 + +#define FVAR (1<<5) +#define FCOL0 (1<<6) +#define FLINE0 (1<<7) + +#define CFONT 0 +#define CLINESPACE 1 +#define CFONTGAP 2 +#define CBOLD 3 +#define CHEIGHT 4 + +#define VTYPE 1 +#define VDIGIT 2 +#define VWIDTH 3 +#define VTYPE0 4 +#define VTYPE1 5 +//#define C 5 + +#define BIN0808 100 +#define BIN0809 1000 +#define BIN0810 2000 +#define BIN0812 3000 +#define BIN0816 5000 +#define BIN1616 7000 +#define BIN2424 11000 +//#define BIN1224 15000 +#define BIN0805 20000 + +//是否需要匹配字体能操作 +//#define FONTMATCH + +typedef enum{ + ST05=0, + ST07=1, + ST09=2, + ST12=3, + ST16=4, + HT16=5, + ST24=6, + HT24=7, + ST32=8 +}PFONTNAME; + +typedef struct +{ + bool DrawEn;// 绘图 + bool DrawGridEn; // 网格 checkBoxDrawGridEn + int Width;// 字串长度 + unsigned char CharHeight; //字符高度 + unsigned char CharWidth; //字符宽度 + unsigned char FontGap; // 字符间隔 + PFONTNAME Font;// 字体 + bool CharCurrent; //光标类型,字符还是像素 + bool CurrentEn; + unsigned char LineSpace; + unsigned char Bold; // 字体加粗 + unsigned char LineHeight; + bool insertMode; + bool checkBoxControlChar;//控制符显示 +} t_charPara; + +typedef struct{ + int width; + int height; + bool enable; +} t_draw; + +typedef struct{ + int Len; + int yPos; + int xPos; + int minFont; + int maxFont; + int minLineHeight; + int maxLineHeight; +}t_line; + +class PicWidget:public QWidget{ + Q_OBJECT + +public: + explicit PicWidget(QWidget *parent = 0); + ~PicWidget(); + + void resizeWidget(int w,int h); + void initWidget(int w,int h); + void loadImage(QString filename,bool forceSize = true); + void insertImage(QString filename,bool forceSize = false); + + void saveImage(QString filename); + void enlargeDisplay(); + void reduceDisplay(); + void setScale(int scale); + + void paintEvent(QPaintEvent *); + + void mousePressEvent ( QMouseEvent * event ); + + void currPositionMove(int shiftX,int shiftY); + void ensureCurrPos(); + int getScaleValue(); + bool isModified(); + int getHeight(); + int getWidth(); + void readAscDot(unsigned int asc, char *dot); + void readZhDot(unsigned int ingb, char *dot); + int inputTxtDot(QString txt,int *var); + int inputRamDot(QString txt,unsigned char *pMap, vars_t *p_var); + int charDotMap( char *dot,bool english ); + int varDotMap(char *dot,int *var); + int picDelOneChar(); + int picDelNextChar(); + t_charPara charPara; + t_draw drawPara; + int picSetHome(); + int picSetEnd(); + void showVar(QString mode,char *var,int len); + int getVarNum(); + int readVar(SysPara *sysPara, unsigned char alt2); + void getPrintDat(unsigned char *dat,unsigned char alt2,SysPara *sysPara); + void getCharRamData(SysPara *sysPara); + + int resizePicRect(bool alt2); + void movePicView(); + void bindSysPara(SysPara *sysPara); + int altPrint; + int startRow; + int startCol; + int heightPoint; + int widthPoint; + int scale; + int currXpos; + int currYpos; + int endRow; + int endCol; + bool zkEditEn; + bool isInput ; + bool pEditMode; + void zkEditNow(); + void zkEditSave(); + void disp(); + QString currentEditTxt; + int resizePicWidth(bool rowEn); + int getNextPos(int x, int n); + int getLineEnd(int x); + int getUpLine(int x); + int getDownLine(int x); + int getPrePos(int x, int n); + int getBlandPos(int x, int n); + int SiteStart(int x); + void moveDots(int x1, int x2, int y1, int h, int w); + int getFontHeight(int x, int y); + + void VarGapSet(int x, int h); + int VarGetWidth(int x,int y,unsigned char *c); + int getLineHeight(int x, int y); + int getInserEnable(int x, int y, int w, int h); + void delDots(int x1, int x2, int y1, int h); + int isVar(int x, int y); + int getPicRealHeight(); + int getUpLineStart(int x, int y); + int isCanDelete(int x, int y); + void readPng(int x, int y, int w, int h); + void insertImage1(QString filename, bool forceSize); + void saveImage1(QString filename); + void shows(QString s); +public slots: + void cursorFlash(); // 光标闪烁 + + +Q_SIGNALS: + void picWidgetModify(); + void ShowKeybord( ); + void rowColChanged(QString); + void currXYChanged(QString); + void ChangeFont(int cc); +private: + unsigned char pointMap[MAX_PIC_WIDGET_HEIGHT * (MAX_PIC_WIDGET_WIDTH)]; + + bool modified; + int varNum; + t_line line; + int linePara[MAXLINE]; + int lineNum; + int lineMaxNum; + //SysPara *sysPara1; + void setModified(bool m); + void saveZhDot(); + char getZkPic(char *dat); + int charInsert(int w,bool txtMode); + int isBlankCol(); + unsigned long zkOffset; + unsigned char zkReadNum; + unsigned int zkIncode; + QFile *pzkEditFile; + QString txt; + /* 字库文件*/ + QFile zkAsc; + char cal_currHeightEn; + // char currMode; // ddddd + QFile zkHz05; + QFile zkHz07; + QFile zkHz09; + QFile zkHz12; + QFile zkHz16; + QFile zkHz24; + QFile zkHz16H; + QFile zkHz24H; + //QFile zkHz32; + QFile unitogb; +}; + +#endif /* PICWIDGET_H_ */ diff --git a/PrintSetting.cpp b/PrintSetting.cpp new file mode 100644 index 0000000..c08beac --- /dev/null +++ b/PrintSetting.cpp @@ -0,0 +1,1871 @@ +#include "PrintSetting.h" +#include "ui_printsetting.h" +#include "SysPara.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "DevOp.h" +#include "Public.h" +#include "LogInfo.h" +#include +#include +#include +#include +#include +#include "myinclude.h" +#include +#include +#include"scene/picscene.h" +#include"scene/pictextitem.h" + +PrintSetting::PrintSetting(QWidget *parent) : + QWidget(parent), + ui(new Ui::PrintSetting) +{ + ui->setupUi(this); + ui->comboBoxPrintMode->setView(new QListView()); + + dialogAuthorization = new DialogAuthorization(parent); + dialogAuthVarSet = new DialogAuthorization(parent); + + last_area_end = 0; + area_end = 0; + lockpulse = false; + dialogShowCounter = new DialogShowCounter(parent); + dialogShowCounter->setLCDframe(); + dialogShowCounter->hide(); + connect(dialogShowCounter,SIGNAL(rejected()),this,SLOT(ondialogShowCounterAccepted())); + connect(dialogShowCounter,SIGNAL(accepted()),this,SLOT(ondialogShowCounterAccepted())); + + refresh_timer = new QTimer(); + connect(refresh_timer, SIGNAL(timeout()), this, SLOT(refreshtimerHandler())); +// refresh_timer->start(100); + + +#ifdef ENCRYPT_VOL + dialogModPasswd = new Dialogmodifypasswd(parent); + dialogModPasswd->hide(); + modify_vol = false; + keepVolVal = ui->spinBoxHighVoltageValue->value(); + ui->spinBoxHighVoltageValue->setEnabled(false); + ui->spinBoxStartVoltage->setEnabled(false); + connect(dialogModPasswd,SIGNAL(accepted()),this,SLOT(on_dialogModPasswdAccepted())); +#else + ui->volButton->hide(); +#endif + +// ui->radioButtonFUllColFIxVal->setEnabled(false); + + dlgInputAddr = new DlgInputAddr(parent); + + dlgInputAddr->GetAddr(); + dlgInputAddr->vpnConnect(); + dlgInputAddr->hide(); + + dlgvarLen = new DlgVarLength(parent); + + dlgvarLen->hide(); + + connect(dialogAuthorization,SIGNAL(accepted()),this,SLOT(ondialogAuthorizationAccepted())); + connect(dialogAuthVarSet,SIGNAL(accepted()),this,SLOT(ondialogAuthVarSetAccepted())); + //connect(this,SIGNAL(authChanged(int )),this,SLOT(showVolDacEdit(int ))); + connect(dlgInputAddr,SIGNAL(changeMac(QString)),ui->labMac,SLOT(setText(QString))); +#ifdef __NETWORKMANAGER__ + connect(dlgInputAddr,SIGNAL(changeMac(QString)),this,SLOT(showMachInfo(QString))); +#endif + connect(ui->pushButtonVAR,SIGNAL(pressed()),this,SLOT(on_checkVarLenChg())); + connect(dlgvarLen,SIGNAL(on_set()),this,SLOT(on_VarLenSet())); + if(Public::ReadLanguageName()=="Chinese"){ + ui->labelZFGD->setPixmap(QPixmap(QString::fromUtf8(":/image/AH12.png"))); + }else + { + ui->labelZFGD->setPixmap(QPixmap(QString::fromUtf8(":/image/AH13.png"))); + } + //ui->labelZFGD->setPixmap(QPixmap(QString::fromUtf8(":/image/AH12.png"))); + + dialogAuthorization->hide(); + + auth = AUTH_NONE; + //showVolDacEdit(auth); + // +// QFont f =font(); +// f.setFamily("wenquanyi"); +// f.setPixelSize(13); +// setFont(f); + + // ui->pushTestSysSet->hide(); + + //ui->spinBoxFullColFixVal->hide(); + ui->tabWidget_2->removeTab(1);//去掉高级设置标签 + ui->tabWidget_2->setCurrentIndex(0); + + ui->tabWidget->setCurrentIndex(0); +// ui->tabWidget->removeTab(2); + //ui->tabWidget->widget(1)->setBackgroundRole(QPalette::BrightText); + //ui->tabWidget->widget(1)->palette().setColor(QColor(0,0,0,255)); + ui->tabWidget->widget(1)->setStyleSheet("color:blue"); + + //ui->tabWidget->widget(1)->setWindowIcon(QIcon(":/icon/Estartprint2.png")); + //ui->tabWidget->widget(1)->setBac + +#ifndef CABLEUSER + ui->tabWidget->hide(); + ui->checkSynCntEn->hide(); + ui->checkVol1of8En->hide(); +#endif +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QStringList headerLabels = QStringList()<tableWidget->setHorizontalHeaderLabels(headerLabels); + ui->tableWidget->setFocusPolicy(Qt::NoFocus); + ui->tableWidget->horizontalHeader()->setHighlightSections(false); + ui->tableWidget->setColumnHidden(3,true);//第3列用来标志是否保存当前行 + QHeaderView* vertivalHeader = ui->tableWidget->verticalHeader(); + vertivalHeader->setFixedWidth(60); + ui->tableWidget->setColumnWidth(2,120); + + //工程模式隐藏选项 + flagOfEngineeringMode = 0; + EngineeringModeDisplay(); + specailMachineSetting(0); + + +#else + delete ui->tableWidget; + delete ui->checkBoxGroupCnt1; + delete ui->Cnt3AddRowBtn; + delete ui->Cnt3InsertRowBtn; + delete ui->Cnt3RemoveRowBtn; + delete ui->cnt3RemoveAllRowsBtn; +#endif +#ifdef SPACEFLAG + +#else +#endif + +} + +PrintSetting::~PrintSetting() +{ + delete ui; + delete dialogAuthorization; + +#ifdef ENCRYPT_VOL + delete dialogModPasswd; +#endif +} + +void PrintSetting::on_checkVarLenChg() +{ + //DlgVarLength dlg; + //bool en = ui->checkVARLEN->isChecked(); + if(sysPara) + { + dialogAuthVarSet->clearAuth(); + dialogAuthVarSet->show(); + } +} +void PrintSetting::on_VarLenSet() +{ + //qDebug()<<"on_set"; + if(sysPara){ + sysPara->para.headLen=dlgvarLen->headLen; + sysPara->para.endLen=dlgvarLen->endLen; + sysPara->para.varLen=dlgvarLen->varLen; + sysPara->para.varLen1=dlgvarLen->varLen1; + sysPara->para.varLenEn = dlgvarLen->varEn; + ui->checkVARLEN->setChecked(dlgvarLen->varEn); + } +} +void PrintSetting::ondialogAuthVarSetAccepted(){ + QString authString = dialogAuthVarSet->getAuth(); + if(authString == "07710665") + { + dlgvarLen->headLen = sysPara->para.headLen; + dlgvarLen->endLen = sysPara->para.endLen; + dlgvarLen->varLen = sysPara->para.varLen; + dlgvarLen->varLen1 = sysPara->para.varLen1; + dlgvarLen->varEn=sysPara->para.varLenEn; + dlgvarLen->applyUI(sysPara->para.cnt1EndValue - sysPara->para.cnt1StartValue+1);//sysPara->para.synTriggerPrintLenMm + //dlgvarLen->lab_4->setText("ddd"); + dlgvarLen->show(); + dlgvarLen->setFocus(); + //sysPara->para.varLenEn = en; + } +} +void PrintSetting::bindSysPara(SysPara *sysPara){ + this->sysPara =sysPara; + //ui->volDacEdit + //ui->volDacEdit->bindSysPara(sysPara); +} + +void PrintSetting::PrintupdateSysParaToUI() +{ + updateSysParaToUI(); +} + + + +void PrintSetting::updateSysParaToUI(){ + if(sysPara){ + //ui->checkSpace->setChecked(sysPara->para.checkSpace); + ui->checkVARLEN->setChecked(sysPara->para.varLenEn?1:0); + + ui->comBoxExtSrceen->setCurrentIndex(sysPara->para.ExtScreenType); + ui->comBoxExtMeterType->setCurrentIndex(sysPara->para.ExtMeterType); + + ui->checkBoxLeftRightInverse->setChecked(sysPara->para.leftRightInverse); + ui->checkBoxUpDownInverse->setChecked(sysPara->para.upDownInverse); + ui->checkBoxScanInverse->setChecked(sysPara->para.scanInverse); + ui->checkBoxRecycleWarnAction->setChecked(sysPara->para.RecycleWarnAction); + ui->checkBoxPowerOffAfterPhaseFault->setChecked(sysPara->para.powerOffAfterPhaseFault); + ui->checkBoxSuspendAfterPhaseFault->setChecked(!sysPara->para.powerOffAfterPhaseFault); + ui->checkBoxSuspendAfterPhaseFault->setChecked(sysPara->para.suspendAfterPhaseFault); + ui->checkBoxStopCounterMeterAfterFault->setEnabled(sysPara->para.suspendAfterPhaseFault); + ui->checkBoxStopCounterMeterAfterFault->setChecked(sysPara->para.stopCounterMeterAfterFault); + ui->comboBoxPrintMode->setCurrentIndex(sysPara->para.currPrintMode); + ui->spinBox_gearPumpSpeedAlarm->setValue(sysPara->para.gearPumpSpeedAlarm); + + /*----------------------------------------*/ + + ui->spinBoxColDelay->setValue(sysPara->para.printColDelay); + ui->spinBoxColRepeatCnt->setValue(sysPara->para.charBold); + ui->spinBoxCnt1EndValue->setValue(sysPara->para.cnt1EndValue); + ui->spinBoxCnt1RepeateCnt->setValue(sysPara->para.cnt1RepeateValue); + ui->spinBoxCnt1StartValue->setValue(sysPara->para.cnt1StartValue); + ui->spinBoxCnt1StepValue->setValue(sysPara->para.cnt1StepValue); + ui->spinBoxCnt1CurrValue->setValue(sysPara->para.cnt1CurrValue); + ui->spinBoxCnt2EndValue->setValue(sysPara->para.cnt2EndValue); + ui->spinBoxCnt2RepeateCnt->setValue(sysPara->para.cnt2RepeateValue); + ui->spinBoxCnt2StartValue->setValue(sysPara->para.cnt2StartValue); + ui->spinBoxCnt2StepValue->setValue(sysPara->para.cnt2StepValue); + ui->spinBoxCnt2CurrValue->setValue(sysPara->para.cnt2CurrValue); + + ui->spinBoxCnt3EndValue->setValue(sysPara->para.cnt3EndValue); + ui->spinBoxCnt3RepeateCnt->setValue(sysPara->para.cnt3RepeateValue); + ui->spinBoxCnt3StartValue->setValue(sysPara->para.cnt3StartValue); + ui->spinBoxCnt3StepValue->setValue(sysPara->para.cnt3StepValue); + ui->spinBoxCnt3CurrValue->setValue(sysPara->para.cnt3CurrValue); + + ui->spinBoxStartVoltage->setValue(sysPara->para.startVoltage); + + ui->spinBoxEndVoltage->setValue(sysPara->para.endVoltage); + + ui->spinBoxHighVoltageValue->setValue(sysPara->para.HighVoltageAmplitude); + + ui->spinBoxReducedPixelNum->setValue(sysPara->para.reducedPixelNumRatio); + ui->comboBoxReducedPixMode->setCurrentIndex(sysPara->para.reducedPixelMode); + ui->spinBoxRowSequenceMode->setValue(sysPara->para.rowSequenceMode); + ui->spinBoxPointVoltageAdjustPos->setValue(sysPara->para.pointVoltageAdjustPos); + ui->spinBoxVoltageAdjustValue->setValue(sysPara->para.PointVoltageAdjustValue); + ui->spinBoxLineEndAdjustPointCnt->setValue(sysPara->para.lineEndAdjustPointCnt); + ui->comboBoxLineEndAdjustPointMode->setCurrentIndex(sysPara->para.lineEndAdjustPointDelay); + ui->spinBoxLastLineEndPointFixedValue->setValue(sysPara->para.lastLineEndPointFixedValue); +// ui->spinBoxFullColFixVal->setValue(sysPara->para.FullColFixVal); + ui->radioButtonFUllColFIxVal->setChecked(sysPara->para.FullColFixVal); + + + ui->comboBoxIndustry->setCurrentIndex(sysPara->para.industryIndex); + ui->comboBoxRecommendedPrintSpeed->setCurrentIndex(sysPara->para.recommendedPrintSpeed); + +#if(0) + ui->checkBoxAlterPrintEnable->setChecked (sysPara->para.alterPrint.enable );// 原来的 +#else + ui->comboBoxAlterPrintEnable->setCurrentIndex (sysPara->para.alterPrint.enable );// 修改后的 + if(sysPara->para.alterPrint.enable == 0) + { + ui->spinBoxXStartValue->setEnabled(false); + ui->spinBoxXRepeatTimeValue->setEnabled(false); + ui->spinBoxXGapValue->setEnabled(false); + } +#endif + ui->spinBoxXStartValue->setValue (sysPara->para.alterPrint.startValue ); + ui->spinBoxXGapValue->setValue (sysPara->para.alterPrint.repeatValue); + ui->spinBoxXRepeatTimeValue->setValue (sysPara->para.alterPrint.repeatPrintTimes); + ui->spinBoxDistanceTail->setValue(sysPara->para.alterPrint.DistanceTail ); + ui->checkBoxCnt1NatureValue->setChecked ( sysPara->para.Cnt1NatureValue); // + ui->checkBoxSpeedOver->setChecked(sysPara->para.speedoverPaushPrint); + ui->checkSynCntEn->setChecked(sysPara->para.SynCntEn); + ui->checkVol1of8En->setChecked(sysPara->para.Vol1of8En); + ui->checkBoxEleEyeRetrigDis->setChecked( sysPara->para.eleEyeReTrigDisable ); + ui->checkmode0211->setChecked(sysPara->para.mode0211); + ui->resetToCnt1InitValueCheckBox->setChecked(sysPara->para.cnt1ResetToInitValue); + //ui->checkBoxPrintOnce->setChecked(sysPara->para.printOnce); + //ui->checkBoxNumPoint->setChecked(sysPara->para.printNumPoint); + //ui->checkBoxReciclar->setChecked(sysPara->para.Reciclar); + ui->dacScaledSpinBox->setValue(sysPara->para.dacScale); + ui->checkBoxResetSendData->setChecked(sysPara->para.ResetSendData); + ui->spinBoxJumpStartValue->setValue( sysPara->para.stepPrint.startValue ); + ui->spinBoxJumpEndValue->setValue( sysPara->para.stepPrint.endValue ); + //ui->checkBoxStepPrintEn->setEnabled( sysPara->para.stepPrint.enbale ); + ui->checkBoxStepPrintEn->setChecked( sysPara->para.stepPrint.enbale ); + ui->spinBoxJumpStepValue->setValue(sysPara->para.stepPrint.StepValue); + + + ui->checkProductResetEn->setChecked(sysPara->para.ResetProductCntEn); + ui->checkAllProductResetEn->setChecked(sysPara->para.ResetAllProductCntEn); + ui->checkHVFaultCloseEn->setChecked(sysPara->para.HVFaultCloseEn); + + // 电眼触发计数器动作 选择 + ui->eleCNT1IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x10)?1:0); + ui->radCNT1ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x10)?0:1); + + ui->eleCNT2IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?1:0); + ui->radCNT2ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?0:1); + + ui->eleCNT3IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x40)?1:0); + ui->radCNT3ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x40)?0:1); + + ui->checkBoxGearPumpEnable->setChecked(sysPara->para.gearPumpEnable); + ui->checkBox_ReclaimPumpEnable->setChecked(sysPara->para.flagOfReclaimPumEnable); + ui->checkBoxCharWidthSet->setChecked(sysPara->para.charWidthSetEnable); + ui->checkBoxMagnet->setChecked(sysPara->para.isCheckMagnet); + ui->printfLightCheckBox->setChecked(sysPara->para.isCheckPrintLight); + + ui->phaseHighCntSpinBox->setValue( sysPara->para.phaseHighCnt); + + sysPara->para.bcOption.var1Num=ui->spinBoxCnt1EndValue->text().length(); + sysPara->para.bcOption.var2Num=ui->spinBoxCnt2EndValue->text().length(); +// sysPara->para.bcOption.var3Num=ui->spinBoxCnt2EndValue_2->text().length(); + //ui->volDacEdit->updateSysParaToUI(); + //高速模式 + ui->checkBox_FastMode->setChecked(sysPara->para.flagOfFastMode); +#ifdef MIMA + ui->labMac->setText(QString(" Mac:%1").arg(dlgInputAddr->jd.addr)); + showMachInfo(QString::number(dlgInputAddr->jd.addr)); +#else + ui->labMac->setText(QString("")); +#endif + ui->CBDateFormat1->setCurrentIndex(sysPara->para.ExpirySplitMode);//p_var->splitMode + ui->spinBoxExpiryDate->setValue(sysPara->para.ExpiryDay); + //on_spinBoxExpiryDate_valueChanged(sysPara->print.ExpiryVar.); + ui->checkBoxSaveCNTStateValue->setCheckState(sysPara->para.isCntSaveStateValue ? Qt::Checked : Qt::Unchecked); + + LoadCnt1GroupSettingsToUI(); + if(sysPara->para.mode0211 || sysPara->para.FullColFixVal) + { + ui->spinBoxStartVoltage->setEnabled(false); + ui->spinBoxEndVoltage->setEnabled(false); + } + } +} +#include "VerBVersion.h" +void PrintSetting::showMachInfo(QString Mac) +{ +#ifdef __NETWORKMANAGER__ + QString VernonBach; + VernonBach.sprintf("%d.%d.%d.", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER); + VernonBach = VernonBach + (QString) Public::DateToString(__DATE__)+"_"+UP_PRINTER_STAGE_VER; + QString FpgaVer = "No:"+QString::number(sysPara->status.build_dat.builTime); + LogInfo::showMachineInformation(Mac,"QString SerialNum", VernonBach, FpgaVer); +#endif +} +void PrintSetting::showRemoteControl(QString SuperNodeIP,QString EdgeIP) +{ +#ifdef __NETWORKMANAGER__ + QString VernonBach; + VernonBach.sprintf("%d.%d.%d.", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER); + VernonBach = VernonBach + (QString) Public::DateToString(__DATE__)+"_"+UP_PRINTER_STAGE_VER; + QString FpgaVer = "No:"+QString::number(sysPara->status.build_dat.builTime); + //LogInfo::showMachineInformation(Mac,"QString SerialNum", VernonBach, FpgaVer); +#endif +} + +void PrintSetting::applyUIPara(){ + if(sysPara){ + + unsigned char rExtScreenType =sysPara->para.ExtScreenType; + sysPara->para.ExtScreenType = ui->comBoxExtSrceen->currentIndex(); + sysPara->para.ExtMeterType = ui->comBoxExtMeterType->currentIndex(); + sysPara->para.gearPumpSpeedAlarm = ui->spinBox_gearPumpSpeedAlarm->value(); + if(//rExtScreenType==0 && + sysPara->para.ExtScreenType) + sysPara->devOp->uart2Init(); + if(sysPara->para.ExtScreenType==0) + { + sysPara->status.ExtScreenEn =0; + } + + checkCnt1EndValueOnUI(); +// if(true == ui->checkVARLEN->isChecked() ) +// { +// sysPara->para.varLenEn = 1; +// }else +// { +// sysPara->para.varLenEn = 0; +// } + sysPara->para.varLenEn = ui->checkVARLEN->isChecked(); +// qDebug()<< "[applyUIPara] ui->checkVARLEN->isChecked()="<< ui->checkVARLEN->isChecked(); +// qDebug()<< "[applyUIPara] sysPara->para.varLenEn="<< sysPara->para.varLenEn; + sysPara->para.checkSpace = 0;//ui->checkSpace->isChecked(); + sysPara->para.leftRightInverse = ui->checkBoxLeftRightInverse->isChecked(); + sysPara->para.upDownInverse = ui->checkBoxUpDownInverse->isChecked(); + sysPara->para.scanInverse = ui->checkBoxScanInverse->isChecked(); + sysPara->para.currPrintMode = ui->comboBoxPrintMode->currentIndex(); + sysPara->para.suspendAfterPhaseFault = ui->checkBoxSuspendAfterPhaseFault->isChecked(); + sysPara->para.powerOffAfterPhaseFault = ui->checkBoxPowerOffAfterPhaseFault->isChecked(); + sysPara->para.RecycleWarnAction = ui->checkBoxRecycleWarnAction->isChecked(); + sysPara->para.stopCounterMeterAfterFault = ui->checkBoxStopCounterMeterAfterFault->isChecked(); + sysPara->para.printColDelay = ui->spinBoxColDelay->value(); + sysPara->para.cnt1EndValue = ui->spinBoxCnt1EndValue->value(); + sysPara->para.cnt1RepeateValue = ui->spinBoxCnt1RepeateCnt->value(); + sysPara->para.cnt1StartValue = ui->spinBoxCnt1StartValue->value(); + sysPara->para.cnt1StepValue = ui->spinBoxCnt1StepValue->value(); + sysPara->para.cnt1CurrValue = ui->spinBoxCnt1CurrValue->value(); //这个值设置没关系,在关机前还会再此被设置 + sysPara->para.cnt2EndValue = ui->spinBoxCnt2EndValue->value(); + sysPara->para.cnt2RepeateValue = ui->spinBoxCnt2RepeateCnt->value(); + sysPara->para.cnt2StartValue = ui->spinBoxCnt2StartValue->value(); + sysPara->para.cnt2StepValue = ui->spinBoxCnt2StepValue->value(); + sysPara->para.cnt2CurrValue = ui->spinBoxCnt2CurrValue->value(); + + sysPara->para.cnt3EndValue = ui->spinBoxCnt3EndValue->value(); + sysPara->para.cnt3RepeateValue = ui->spinBoxCnt3RepeateCnt->value(); + sysPara->para.cnt3StartValue = ui->spinBoxCnt3StartValue->value(); + sysPara->para.cnt3StepValue = ui->spinBoxCnt3StepValue->value(); + sysPara->para.cnt3CurrValue = ui->spinBoxCnt3CurrValue->value(); + + sysPara->para.startVoltage = ui->spinBoxStartVoltage->value(); + sysPara->para.endVoltage = ui->spinBoxEndVoltage->value(); + sysPara->para.charBold = ui->spinBoxColRepeatCnt->value(); + sysPara->para.HighVoltageAmplitude = ui->spinBoxHighVoltageValue->value(); + sysPara->status.cnt1CurrentValueInitDoneFlag = !ui->checkBoxResetCnt1CurrValue->isChecked(); + sysPara->status.cnt2CurrentValueInitDoneFlag = !ui->checkBoxResetCnt2CurrValue->isChecked(); + sysPara->status.cnt3CurrentValueInitDoneFlag = !ui->checkBoxResetCnt3CurrValue->isChecked(); + ApplyCnt1GroupSetting(); + + sysPara->para.flagOfFastMode = ui->checkBox_FastMode->isChecked(); + if(sysPara->para.flagOfFastMode || sysPara->status.FPGAVersionType == 1){ + if(ui->comboBoxPrintMode->count()>=3){ + ui->comboBoxPrintMode->setItemText(0,tr("超高速")); + ui->comboBoxPrintMode->setItemText(1,tr("高速")); + ui->comboBoxPrintMode->removeItem(2); + } + }else{ + if(ui->comboBoxPrintMode->count()<3){ + ui->comboBoxPrintMode->setItemText(0,tr("快速")); + ui->comboBoxPrintMode->setItemText(1,tr("标准")); + ui->comboBoxPrintMode->addItem(tr("慢速")); + } + } + sysPara->devOp->writeFpgaCalandar(0); + + sysPara->para.reducedPixelNumRatio = ui->spinBoxReducedPixelNum->value(); + sysPara->para.reducedPixelMode = ui->comboBoxReducedPixMode->currentIndex(); + sysPara->para.rowSequenceMode = ui->spinBoxRowSequenceMode->value(); + + sysPara->para.pointVoltageAdjustPos = ui->spinBoxPointVoltageAdjustPos->value(); + sysPara->para.PointVoltageAdjustValue = ui->spinBoxVoltageAdjustValue->value(); + + sysPara->para.lineEndAdjustPointCnt = ui->spinBoxLineEndAdjustPointCnt->value(); + sysPara->para.lineEndAdjustPointDelay = ui->comboBoxLineEndAdjustPointMode->currentIndex(); + sysPara->para.lastLineEndPointFixedValue = ui->spinBoxLastLineEndPointFixedValue->value(); + + sysPara->para.FullColFixVal = ui->radioButtonFUllColFIxVal->isChecked();//2020/3/2 + sysPara->para.dacScale = ui->dacScaledSpinBox->value(); + + sysPara->para.industryIndex = ui->comboBoxIndustry->currentIndex(); + sysPara->para.recommendedPrintSpeed = ui->comboBoxRecommendedPrintSpeed->currentIndex(); + + if(ui->eleCNT1IncEn->isChecked()) + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x10); // CNT1 +1 + else + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xef); // CNT1 = current + + if(ui->eleCNT2IncEn->isChecked()) + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x20); // CNT2 +1 + else + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xdf); // CNT2 = current + + if(ui->eleCNT3IncEn->isChecked()) + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x40); // CNT3 +1 + else + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xbf); // CNT3 = current + + + //ui->radCNT1ResetEn->isChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x40)?1:0); + //ui->radCNT2ResetEn->isChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x80)?1:0); + // +#if(0) + sysPara->para.alterPrint.enable =ui->checkBoxAlterPrintEnable->isChecked (); // 原来的 +#else + sysPara->para.alterPrint.enable =ui->comboBoxAlterPrintEnable->currentIndex();// 修改后的 + if(sysPara->para.alterPrint.enable) + sysPara->para.textEditLineSpace = 0; +#endif + sysPara->para.alterPrint.lineSpace = sysPara->para.textEditLineSpace; + sysPara->para.alterPrint.startValue = ui->spinBoxXStartValue->value (); + sysPara->para.alterPrint.repeatValue = ui->spinBoxXGapValue->value (); + sysPara->para.alterPrint.repeatPrintTimes =ui->spinBoxXRepeatTimeValue->value (); + sysPara->para.alterPrint.DistanceTail =ui->spinBoxDistanceTail->value (); + if( sysPara->para.alterPrint.startValue>= sysPara->para.alterPrint.repeatValue ) + { + sysPara->para.alterPrint.startValue =sysPara->para.alterPrint.repeatValue -1; + ui->spinBoxXStartValue->setValue (sysPara->para.alterPrint.startValue); + + + + QMessageBox::information(this,tr("提示:交替参数不正确"),tr("要求:起始位置<交替间隔")); + } + if( sysPara->para.alterPrint.repeatPrintTimes+sysPara->para.alterPrint.startValue + > sysPara->para.alterPrint.repeatValue ) + { + sysPara->para.alterPrint.repeatPrintTimes =sysPara->para.alterPrint.repeatValue -sysPara->para.alterPrint.startValue-1; + ui->spinBoxXRepeatTimeValue->setValue (sysPara->para.alterPrint.repeatPrintTimes); + + QMessageBox::information(this,tr("提示:交替参数不正确"),tr("要求:(重复次数+起始位置)<交替间隔")); + } + + sysPara->para.Cnt1NatureValue = ui->checkBoxCnt1NatureValue->isChecked (); // + sysPara->para.speedoverPaushPrint = ui->checkBoxSpeedOver->isChecked(); + sysPara->para.SynCntEn = ui->checkSynCntEn->isChecked(); + sysPara->para.Vol1of8En = ui->checkVol1of8En->isChecked();//打印优化 + sysPara->para.mode0211 = ui->checkmode0211->isChecked();//添加0211模式 + sysPara->para.cnt1ResetToInitValue = ui->resetToCnt1InitValueCheckBox->isChecked();// 电眼复位时,复位起始值或当前值 + //sysPara->para.printOnce = ui->checkBoxPrintOnce->isChecked();// 每条信息只喷一次 +// sysPara->para.printOnce = 0;sysPara->para.rrr_nc = 0;// 每条信息只喷一次 + //sysPara->para.printNumPoint = ui->checkBoxNumPoint->isChecked();// 每条信息只喷一次 + sysPara->para.Reciclar = 0; //sysPara->para.Reciclar = ui->checkBoxReciclar->isChecked(); + sysPara->para.stepPrint.startValue = ui->spinBoxJumpStartValue->value(); + sysPara->para.stepPrint.endValue = ui->spinBoxJumpEndValue->value(); + sysPara->para.stepPrint.enbale = ui->checkBoxStepPrintEn->isChecked(); + sysPara->para.stepPrint.StepValue = ui->spinBoxJumpStepValue->value(); + sysPara->para.ResetSendData = ui->checkBoxResetSendData->isChecked(); + sysPara->para.eleEyeReTrigDisable = ui->checkBoxEleEyeRetrigDis->isChecked(); + + sysPara->para.ResetAllProductCntEn = ui->checkAllProductResetEn->isChecked(); + sysPara->para.ResetProductCntEn = ui->checkProductResetEn->isChecked(); + sysPara->para.HVFaultCloseEn = ui->checkHVFaultCloseEn->isChecked(); + sysPara->para.gearPumpEnable = ui->checkBoxGearPumpEnable->isChecked(); + sysPara->para.flagOfReclaimPumEnable = ui->checkBox_ReclaimPumpEnable->isChecked(); + sysPara->para.phaseHighCnt = ui->phaseHighCntSpinBox->value(); + sysPara->para.charWidthSetEnable = ui->checkBoxCharWidthSet->isChecked(); + sysPara->para.isCheckMagnet = ui->checkBoxMagnet->isChecked(); + sysPara->para.isCheckPrintLight = ui->printfLightCheckBox->isChecked(); + + sysPara->para.bcOption.var1Num=ui->spinBoxCnt1EndValue->text().length(); + sysPara->para.bcOption.var2Num=ui->spinBoxCnt2EndValue->text().length(); +// sysPara->para.bcOption.var3Num=ui->spinBoxCnt2EndValue_2->text().length(); + + //qDebug()<<"sysPara->para.bcOption.varNum"<para.bcOption.var1Num<para.bcOption.var2Num; + sysPara->para.ExpiryDay = ui->spinBoxExpiryDate->value(); + sysPara->para.ExpirySplitMode = ui->CBDateFormat1->currentIndex(); + ui->resetToCnt1InitValueCheckBox->isChecked(); + //qDebug()<print.ExpiryDay; + if(sysPara->devOp->writeFpgaPrintPara() != -1) // save para to disk file. + QMessageBox::information(this,tr("提示"),tr("应用成功")); + + //ui->labelCnt1CurrValueTxt->setEnabled(false); +// ui->labelCnt2CurrValueTxt->setEnabled(false); + ui->spinBoxCnt1CurrValue->setEnabled(false); + ui->spinBoxCnt2CurrValue->setEnabled(false); + ui->spinBoxCnt3CurrValue->setEnabled(false); + + ui->checkBoxResetCnt1CurrValue->setChecked(false); + ui->checkBoxResetCnt2CurrValue->setChecked(false); + ui->checkBoxResetCnt3CurrValue->setChecked(false); + + if(sysPara->para.EditMode==SCENE) + { + QList items = pGetPicScene->selectedItems(); + if(items.size() > 0) + { + PicTextItem* picText = qgraphicsitem_cast(items.at(0)); + picText->CatchCnt1StartValue = ui->lineEditStartValue->text().toInt(); + picText->CatchCnt1CurrValue = ui->lineEditCountValue->text().toInt(); + picText->SpecialConditions = ui->radioButtonSpecialCondition->isChecked(); + pGetPicScene->clearSelection(); + //emit SwitchTimerShowItem(true); + } + } + } + + +} + +void PrintSetting::updateSysStatusToUI(){ + if(sysPara){ + + ui->labelCnt1CurrValue->setText(QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16)); + ui->labelCnt2CurrValue->setText(QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16)); + ui->labelCnt3CurrValue->setText(QString::number(sysPara->status.Status_Counter3.cnt3CurrValue,16)); + //ui->volDacEdit->updateSysStatusToUI(); + //ui->labPulse ->setText(); + //ui->labPulse ->setText(QString("%1 pps").arg((unsigned int)sysPara->status.synPulseCntPer1s)); + int rDay= sysPara->para.openInkLineTime/24/3600; + long tmp = sysPara->para.openInkLineTime%(24*3600); + int rHour = tmp/3600; tmp =tmp%3600; + int rMinute = tmp/60; + int rSecond=tmp%60; + QString s=""; + //s.sprintf(tr("%4d天 %02d:%02d:%02d").toUtf8(), rDay,rHour,rMinute,rSecond);ui->labOpenInkLineTime->setText(s); + s.sprintf(("%6d:%02d:%02d"), rDay*24+rHour,rMinute,rSecond);ui->labOpenInkLineTime->setText(s); + //ui->labOpenInkLineTime->setText(tr("%1天 %2:%3:%4").arg(rDay).arg(rHour).arg(rMinute).arg(rSecond)); + ui->labTrunOnPowerCnt->setText(QString::number(sysPara->para.TrunOnPowerCnt,10)); + } +} +void PrintSetting::on_pushButtonClearRunTime_pressed(){ + sysPara->para.openInkLineTime=0; + sysPara->para.TrunOnPowerCnt=0; + sysPara->saveParaToFile(); + +} + +void PrintSetting::on_pushButtonApply_pressed() +{ + applyUIPara(); + PrintSettingLog(); +} +void PrintSetting::PrintSettingLog(){ + //qDebug()<comboBoxPrintMode->currentIndex()); + qDebug()<spinBoxColDelay->value()); + qDebug()<spinBoxColRepeatCnt->value()); + qDebug()<spinBoxStartVoltage->value()); + qDebug()<spinBoxEndVoltage->value()); + qDebug()<spinBoxHighVoltageValue->value()); + qDebug()<checkBoxRecycleWarnAction->isChecked()); + qDebug()<checkBoxPowerOffAfterPhaseFault->isChecked()); + qDebug()<checkSynCntEn->isChecked()); + qDebug()<checkHVFaultCloseEn->isChecked()); + qDebug()<checkBoxSpeedOver->isChecked()); + qDebug()<checkBoxSuspendAfterPhaseFault->isChecked()); + qDebug()<checkmode0211->isChecked()); + qDebug()<checkVol1of8En->isChecked()); + qDebug()<checkBoxCnt1NatureValue->isChecked()); + qDebug()<checkBoxStopCounterMeterAfterFault->isChecked()); + qDebug()<checkBoxEleEyeRetrigDis->isChecked()); + qDebug()<radioButtonFUllColFIxVal->isChecked()); + qDebug()<checkBoxUpDownInverse->isChecked()); + qDebug()<checkBoxLeftRightInverse->isChecked()); + qDebug()<comboBoxIndustry->currentIndex()); + qDebug()<comboBoxRecommendedPrintSpeed->currentIndex()); + qDebug()<checkBoxMagnet->isChecked()); + qDebug()<checkBoxCharWidthSet->isChecked()); + qDebug()<checkBoxGearPumpEnable->isChecked()); + qDebug()<checkBoxResetSendData->isChecked()); + qDebug()<spinBoxCnt1StartValue->value()); + qDebug()<spinBoxCnt1EndValue->value()); + qDebug()<spinBoxCnt1RepeateCnt->value()); + qDebug()<spinBoxCnt1StepValue->value()); + qDebug()<spinBoxCnt1CurrValue->value()); + qDebug()<checkBoxResetCnt1CurrValue->isChecked()); + //qDebug()<checkBoxNumPoint->isChecked()); + qDebug()<checkVARLEN->isChecked()); + qDebug()<resetToCnt1InitValueCheckBox->isChecked()); + qDebug()<CBDateFormat1->currentIndex()); + qDebug()<checkBoxSaveCNTStateValue->isChecked()); + qDebug()<spinBoxExpiryDate->value()); +// qDebug()<checkBoxCircleProductCnt->isChecked()); + qDebug()<spinBoxCnt2StartValue->value()); + qDebug()<spinBoxCnt2EndValue->value()); + qDebug()<spinBoxCnt2RepeateCnt->value()); + qDebug()<spinBoxCnt2StepValue->value()); + qDebug()<spinBoxCnt2CurrValue->value()); + qDebug()<checkBoxResetCnt2CurrValue->isChecked()); + qDebug()<spinBoxXStartValue->value()); + qDebug()<spinBoxXGapValue->value()); + qDebug()<spinBoxXRepeatTimeValue->value()); + qDebug()<comboBoxAlterPrintEnable->currentIndex()); +// qDebug()<para.HiddenFuncEnable); +} + +void PrintSetting::on_checkBoxResetCnt1CurrValue_released() +{ + bool checked = ui->checkBoxResetCnt1CurrValue->isChecked(); + ui->spinBoxCnt1CurrValue->setEnabled(checked); +} + +void PrintSetting::on_checkBoxResetCnt2CurrValue_released() +{ + bool checked = ui->checkBoxResetCnt2CurrValue->isChecked(); + ui->spinBoxCnt2CurrValue->setEnabled(checked); +} + +void PrintSetting::on_checkBoxResetCnt3CurrValue_released() +{ + bool checked = ui->checkBoxResetCnt3CurrValue->isChecked(); + ui->spinBoxCnt3CurrValue->setEnabled(checked); +} + +void PrintSetting::on_checkBoxSaveCNTStateValue_released() +{ + bool checked = ui->checkBoxSaveCNTStateValue->isChecked(); + sysPara->para.isCntSaveStateValue = checked; +} + +//void PrintSetting::on_checkBoxCircleProductCnt_released() +//{ +// bool checked = ui->checkBoxCircleProductCnt->isChecked(); +// sysPara->status.circleProductCnt = checked; +//} + +void PrintSetting::on_dialogModPasswdAccepted() +{ + QString authString = dialogModPasswd->getModPasswd(); + if(authString == "987456123") + { + qDebug()<< "right choice"; + modify_vol = true; + ui->volButton->setText("取消授权"); + ui->spinBoxHighVoltageValue->setEnabled(true); + ui->spinBoxStartVoltage->setEnabled(true); + } + else + { + QMessageBox::critical(this,tr("错误"),tr("授权码:") + authString + tr(" 错误")); + } + +} + + +void PrintSetting::ondialogAuthorizationAccepted(){ + QFile file("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtssl.o"); + + QString authString = dialogAuthorization->getAuth(); + + sysPara->devOp->checkAuthorization(authString); + + if(authString == "nnyp"){ + //if(authString == "axmk"){ + auth = AUTH_DISPLAY_SYSTEM_SETTING | AUTH_DISPLAY_SYSTEM_MANAGE | AUTH_DISPLAY_OTHER_INFO + | AUTH_SUPER_USER1|AUTH_SUPER_USER2; + } + else + if(authString == "biyang"){ + auth = AUTH_DISPLAY_SYSTEM_SETTING | AUTH_DISPLAY_SYSTEM_MANAGE + | AUTH_DISPLAY_LOG_INFO | AUTH_SUPER_USER1 ; + } + else if(authString == "by2016"){ + auth = + AUTH_DISPLAY_LOG_INFO | AUTH_SUPER_USER1 |AUTH_SUPER_USER2; + + } + else if(authString == "nnyp0998"){ + flagOfEngineeringMode =true; + + auth = AUTH_DISPLAY_SYSTEM_SETTING | AUTH_DISPLAY_SYSTEM_MANAGE + | AUTH_DISPLAY_LOG_INFO | AUTH_DISPLAY_OTHER_INFO| AUTH_SUPER_USER1 |AUTH_SUPER_USER2; + EngineeringModeDisplay(); + specailMachineSetting(1); + } +#ifdef MIMA + //MIMA +#ifndef TEMPMIMA + else + if(authString.left(7) == "3239305" && authString.right(4)=="1407") +#else + else + if( dlgInputAddr->checkSupperInit(authString) ) +#endif + { + QDir dirlib("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/"); + if(!dirlib.exists()) + { + system("mkdir -p /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/"); + system("touch /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtssl.o"); + } + if(!file.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + + } + else { + sysPara->status.WorkTimeOut=0; + dlgInputAddr->SetNewJm(1); + file.close(); + QMessageBox::warning(0,"提示",QString("软件初始化完成.") ); + } + } + + else if( dlgInputAddr->checkSupperJm(authString)) + { + sysPara->status.WorkTimeOut=0; + dlgInputAddr->ReadJm(); + dlgInputAddr->show(); + ui->labMac->setText(QString("Mac:%1").arg(dlgInputAddr->jd.addr)); + } + else if(dlgInputAddr->checWhJm(authString)) // 0xa001 + { + sysPara->status.WorkTimeOut=0; + QMessageBox::warning(this,tr("提示"),tr("喷码机维护设置成功!"),QMessageBox::Ok); + specailMachineSetting(1); + } + else if(dlgInputAddr->checkSysJm(authString)) + { + dlgInputAddr->SaveJm(); + dlgInputAddr->show(); + ui->labMac->setText(QString("Mac:%1").arg(dlgInputAddr->jd.addr)); + sysPara->status.WorkTimeOut=0; + QMessageBox::warning(this,tr( "提示"),tr("系统维护设置成功!") ,QMessageBox::Ok); + } +#endif + else if(authString == "vbip") + { + dlgInputAddr->setNodeIpAndPrivateIp(false); + dlgInputAddr->show(); + } + else { + auth = AUTH_NONE; + QMessageBox::critical(this,tr("错误"),tr("密码:") + authString + tr(" 不存在")); + } + emit authChanged(auth); + if(auth == AUTH_NONE ) {sysPara->status.adjHightVolInitEN=0;sysPara->status.updateSoftEN=0;} + ui->pushButtonAuth->setText((auth == AUTH_NONE)?tr("输入密码"):tr("取消授权")); +} + +void PrintSetting::EngineeringModeDisplay() +{ + if(flagOfEngineeringMode) + { + ui->tabWidget_2->addTab(ui->tab_9,tr("其他设置")); + ui->tabWidget_2->addTab(ui->tab_11,tr("打印电压缩放")); + ui->tabWidget->addTab(ui->tab_8,tr("计数器3设置")); + ui->tabWidget->addTab(ui->tab_6,tr("跳米设置")); + ui->checkBoxSpeedOver->setVisible(1); + ui->checkBoxSuspendAfterPhaseFault->setVisible(1); + ui->checkmode0211->setVisible(1); + ui->checkVol1of8En->setVisible(1); + ui->checkBoxStopCounterMeterAfterFault->setVisible(1); + ui->checkBoxEleEyeRetrigDis->setVisible(1); + ui->radioButtonFUllColFIxVal->setVisible(1); + ui->checkBoxCharWidthSet->setVisible(1); + ui->radioCNT3->setVisible(1); + ui->radioButtonSpecialCondition->setVisible(1); + ui->label_7->setVisible(1); + ui->label_6->setVisible(1); + } + else + { + ui->tabWidget_2->removeTab(4); + ui->tabWidget->removeTab(3); + ui->tabWidget->removeTab(2); + ui->checkBoxSpeedOver->hide(); + ui->checkBoxSuspendAfterPhaseFault->hide(); + ui->checkmode0211->hide(); + ui->checkVol1of8En->hide(); + ui->checkBoxStopCounterMeterAfterFault->hide(); + ui->checkBoxEleEyeRetrigDis->hide(); + ui->radioButtonFUllColFIxVal->hide(); + ui->checkBoxCharWidthSet->hide(); + ui->radioCNT3->hide(); + ui->radioButtonSpecialCondition->hide(); + ui->label_7->hide(); + ui->label_6->hide(); + } +} + +void PrintSetting::on_checkBoxSuspendAfterPhaseFault_clicked() +{ + ui->checkBoxStopCounterMeterAfterFault->setEnabled(ui->checkBoxSuspendAfterPhaseFault->isChecked()); +} + +void PrintSetting::on_checkBoxPowerOffAfterPhaseFault_clicked() +{ + ui->checkBoxStopCounterMeterAfterFault->setEnabled(!ui->checkBoxPowerOffAfterPhaseFault->isChecked() && ui->checkBoxSuspendAfterPhaseFault->isChecked()); + ui->checkBoxSuspendAfterPhaseFault->setEnabled(!ui->checkBoxPowerOffAfterPhaseFault->isChecked()); + +} +#include +#include + +void PrintSetting::on_pushButtonAuth_pressed() +{ + if(auth == AUTH_NONE){ + dialogAuthorization->clearAuth(); + dialogAuthorization->show(); + } + else { + emit authChanged(AUTH_NONE); + auth = AUTH_NONE; + sysPara->status.adjHightVolInitEN=0;sysPara->status.updateSoftEN=0; + ui->pushButtonAuth->setText(tr("输入密码")); + flagOfEngineeringMode = false; + EngineeringModeDisplay(); + this->updateSysParaToUI(); + specailMachineSetting(0); + } +} + +void PrintSetting::updateAuthorization(int auth){ + ui->dacScaledSpinBox->setEnabled(auth & AUTH_SUPER_USER1); + ui->checkBoxScanInverse->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelVoltageAdjustPos->setEnabled(auth & AUTH_SUPER_USER1); +// ui->spinBoxPointVoltageAdjustPos->setEnabled(auth & AUTH_SUPER_USER1); + ui->labelReducedPixelNum->setEnabled(auth & AUTH_SUPER_USER1); + ui->spinBoxReducedPixelNum->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelVoltageAdjustValue->setEnabled(auth & AUTH_SUPER_USER1); +// ui->spinBoxVoltageAdjustValue->setEnabled(auth & AUTH_SUPER_USER1); + ui->labelRowSequenceMode->setEnabled(auth & AUTH_SUPER_USER1); + ui->spinBoxRowSequenceMode->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelReducedPixMode->setEnabled(auth & AUTH_SUPER_USER1); +// ui->comboBoxReducedPixMode->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelLineEndAdjustPointCnt->setEnabled(auth & AUTH_SUPER_USER1); +// ui->spinBoxLineEndAdjustPointCnt->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelLineEndAdjustPointMode->setEnabled(auth & AUTH_SUPER_USER1); +// ui->comboBoxLineEndAdjustPointMode->setEnabled(auth & AUTH_SUPER_USER1); +// ui->spinBoxLastLineEndPointFixedValue->setEnabled(auth & AUTH_SUPER_USER1); +// ui->labelLastLineEndPointFixedValue->setEnabled(auth & AUTH_SUPER_USER1); + ui->pushButtonClearRunTime->setEnabled(auth & AUTH_SUPER_USER1); // 透明按钮 + //ui->volDacEdit->updateAuthorization (auth); +} + +void PrintSetting::on_spinBoxLastLineEndPointFixedValue_valueChanged(int arg1) +{ + if(sysPara){ + sysPara->devOp->setLastLineEndPointFixedValue(arg1); + } +} + +void PrintSetting::on_pushButtonRecommendedSetting_clicked() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认使用推荐设置?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + /*----------------------------设置参数,然后更新到界面-----------------------------*/ + int industry = ui->comboBoxIndustry->currentIndex(); + int speed = ui->comboBoxRecommendedPrintSpeed->currentIndex(); + ui->comboBoxPrintMode->setCurrentIndex((industry?1:0) + speed + 1); + ui->spinBoxVoltageAdjustValue->setValue(0); + ui->comboBoxReducedPixMode->setCurrentIndex(0); + ui->spinBoxReducedPixelNum->setValue((speed == 0)?55:((speed == 1)?30:0)); + ui->spinBoxRowSequenceMode->setValue(1); + ui->checkBoxScanInverse->setChecked(false); + ui->spinBoxLineEndAdjustPointCnt->setValue(2); + ui->comboBoxLineEndAdjustPointMode->setCurrentIndex((industry?3:1) + speed + 1); + ui->spinBoxLastLineEndPointFixedValue->setValue((speed < 2)?-20:0); + on_pushButtonApply_pressed(); + } +} + +void PrintSetting::showVolDacEdit(int auth){ +/* + if((auth&AUTH_SUPER_USER2)) + { + if(ui->tabWidget_2->indexOf (ui->tab_8)==-1) + ui->tabWidget_2->addTab (ui->tab_8,tr("点距电压微调")); + } + else { + if(ui->tabWidget_2->indexOf (ui->tab_8)!=-1) + ui->tabWidget_2->removeTab (ui->tabWidget_2->indexOf (ui->tab_8));//ui->tabWidget_2->indexOf (ui->tab_8) + } + */ +} + + +void PrintSetting::on_pushOnlyCNT1Clear_pressed(){ + sysPara->devOp->clearProductCnt(1<<2); // 计数器1单独清零 + //sysPara->para.totalProductCnt += sysPara->status.productCnt; + //qDebug()<<"only1"; +} + +void PrintSetting::on_pushOnlyCNT2Clear_pressed(){ + sysPara->devOp->clearProductCnt(1<<3);// 计数器2单独清零 + //qDebug()<<"only2"; +} +void PrintSetting::on_pushButtonRanddomBackUP_pressed(){ + QMessageBox::StandardButton ret; + + QFile f1("/home/plg/Xrand2.txt"); + QString str; + //f1.open(QFile::ReadWrite); + int len = f1.size(); + + if(f1.size()<100 ) + { + ret = QMessageBox::warning(this, tr("提示"), + tr("随机码文件为空,不需要导出"), + QMessageBox::Ok ); + //f1.close(); + return; + } + //f1.close(); + + ret = QMessageBox::warning(this, tr("提示"), + tr("随机码文本将展出到U盘,请插入U盘"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + + LogInfo::setRunStatusText("正在导出随机码文件到U盘......"); + sysPara->devOp->RandTxtBakup(1); + LogInfo::setRunStatusText("随机码文件导出完成."); + + } + +} + +void PrintSetting::on_spinBoxExpiryDate_valueChanged(int arg1) +{ + QDate curDate= QDate::currentDate().addDays(arg1); + //ui->CBDateFormat1->clear(); + QString DateTime;QString format; + +// str.sprintf("%04d-%02d-%02d",curDate.year(),curDate.month(),curDate.day()); +// ui->CBDateFormat1->setItemText(0,str);//ui->CBDateFormat1->addItem(str); +// str.sprintf("%04d/%02d/%02d",curDate.year(),curDate.month(),curDate.day()); +// ui->CBDateFormat1->setItemText(1,str);//ui->CBDateFormat1->addItem(str); +// str.sprintf("%04d%02d%02d",curDate.year(),curDate.month(),curDate.day()); +// ui->CBDateFormat1->setItemText(2,str);//ui->CBDateFormat1->addItem(str); + ui->CBDateFormat1->count(); + for(int i=0;i < ui->CBDateFormat1->count();++i) { + format = ui->CBDateFormat1->itemText(i); + DateTime = QDateTime::currentDateTime().toString(format); + ui->CBDateFormat1->setItemText(i,DateTime); + //qDebug()<CBDateFormat1->addItem(str.toLocal8Bit()); + + //ui->CBDateFormat1->setCurrentIndex(sysPara->para.ExpirySplitMode);//p_var->splitMode + //sysPara->para.ExpiryDay = arg1; +} + +void PrintSetting::on_CBDateFormat1_currentIndexChanged(int index) +{ + sysPara->para.ExpirySplitMode = index; +} + +void PrintSetting::updateCnt1GroupsTblWgt() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QPalette Palette; + QLineEdit *pLineEdit; + int rowCnt=ui->tableWidget->rowCount(); + //int rowCnt=sysPara->para.Cnt1ByGroup.cnt1GroupCnt; + + //qDebug()<<"updateCnt1GroupsTblWgt count"<status.cnt1GroupRunningIndex; + for(int i=0;itableWidget->cellWidget(i,j); + Palette = pLineEdit->palette(); + if(sysPara->para.cnt1ByGroupEnalbe && (i == sysPara->status.cnt1GroupRunningIndex)) + { + Palette.setColor(QPalette::Normal,QPalette::Base, Qt::green); + } + else + { + Palette.setColor(QPalette::Normal,QPalette::Base, Qt::lightGray); + } + pLineEdit->setPalette(Palette); + } + } +#endif +} + +void PrintSetting::onUpdateCnt1GroupDisp(bool bChangeToNext) +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + if(bChangeToNext)//循环数走完 + { + //改变当前执行的分段的背景颜色 + updateCnt1GroupsTblWgt(); + } +#endif +} + +void PrintSetting::LoadCnt1GroupSettingsToUI() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QLineEdit *pLineEdit; + ui->checkBoxGroupCnt1->setChecked(sysPara->para.cnt1ByGroupEnalbe); + on_checkBoxGroupCnt1_clicked(sysPara->para.cnt1ByGroupEnalbe); + //qDebug()<<"LoadCnt1GroupSettingsToUI:cnt1GroupCnt "<para.Cnt1ByGroup.cnt1GroupCnt; + ui->tableWidget->setRowCount(sysPara->para.Cnt1ByGroup.cnt1GroupCnt); + QRegExp regx("[0-9]+$"); + QValidator *validator = new QRegExpValidator(regx, this); + QRegExp regxLoop("[1-9][0-9]+$"); + QValidator *validatorLoop = new QRegExpValidator(regxLoop, this); + for(int i=0; ipara.Cnt1ByGroup.cnt1GroupCnt; i++) + { + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].StartValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(i,0,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].EndValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(i,1,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].LoopTimes)); + pLineEdit->setValidator(validatorLoop); + ui->tableWidget->setCellWidget(i,2,pLineEdit); + } +#if 0 /* 只是打开一个文件,还没有点击开始打印,该文件的变量1的起始和结束设定就起作用了,所以去掉。如果想要分段计米生效只能点击应用了 */ + sysPara->devOp->writeFpgaCalandar(1); + sysPara->devOp->writeCnt1GroupSetting(1); +#endif + updateCnt1GroupsTblWgt(); +#endif +} +void PrintSetting::checkCnt1EndValueOnUI() +{ +#if 0 + int cnt1Start,cnt1End,cnt1Step; + int remain; + int cnt1GroupRow=ui->tableWidget->rowCount(); + bool cnt1GroupEn=ui->checkBoxGroupCnt1->isChecked(); + if(cnt1GroupEn && cnt1GroupRow !=0) + { + + QLineEdit *pLineEdit0 = (QLineEdit *)ui->tableWidget->cellWidget(0,0); + cnt1Start = pLineEdit0->text().toInt(); + QLineEdit *pLineEdit1 = (QLineEdit *)ui->tableWidget->cellWidget(0,1); + cnt1End = pLineEdit1->text().toInt(); + + cnt1Step = ui->spinBoxCnt1StepValue->value(); + remain =(cnt1End-cnt1Start)%cnt1Step; + if(remain != 0) + { + pLineEdit1->setText(QString::number(cnt1End-remain)); + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1").arg(cnt1End-remain), + QMessageBox::Ok); + } + } + else + { + cnt1Start = ui->spinBoxCnt1StartValue->value(); + cnt1End = ui->spinBoxCnt1EndValue->value(); + cnt1Step = ui->spinBoxCnt1StepValue->value(); + remain =(cnt1End-cnt1Start)%cnt1Step; + if(remain !=0 ) + { + ui->spinBoxCnt1EndValue->setValue(cnt1End-remain); + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("计数器1(结束-开始)不能被增量整除,结束值将被设为%1").arg(cnt1End-remain), + QMessageBox::Ok); + } + } +#endif +} + +void PrintSetting::ApplyCnt1GroupSetting() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QLineEdit *pLineEdit; + sysPara->para.cnt1ByGroupEnalbe = ui->checkBoxGroupCnt1->isChecked(); + sysPara->para.Cnt1ByGroup.cnt1GroupCnt=ui->tableWidget->rowCount(); + if(sysPara->para.cnt1ByGroupEnalbe && sysPara->para.Cnt1ByGroup.cnt1GroupCnt==0) + { + sysPara->para.cnt1ByGroupEnalbe=false; + ui->checkBoxGroupCnt1->setChecked(false); + on_checkBoxGroupCnt1_clicked(false); + } + //qDebug()<<"ApplyCnt1GroupSetting:cnt1GroupCnt "<para.Cnt1ByGroup.cnt1GroupCnt; + + for(int i=0; ipara.Cnt1ByGroup.cnt1GroupCnt; i++) + { + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(i,0); + sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].StartValue = pLineEdit->text().toInt(); + + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(i,1); + sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].EndValue = pLineEdit->text().toInt(); + + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(i,2); + sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].LoopTimes = pLineEdit->text().toInt(); + //qDebug()<para.Cnt1ByGroup.cnt1GroupSettings[i].StartValue + // <<"end "<para.Cnt1ByGroup.cnt1GroupSettings[i].EndValue + // <<"Loop "<para.Cnt1ByGroup.cnt1GroupSettings[i].LoopTimes; + } + sysPara->devOp->writeCnt1GroupSetting(1); + sysPara->saveParaToFile(); + //改变当前执行的分段的背景颜色 + updateCnt1GroupsTblWgt(); +#endif +} +void PrintSetting::rowWidgetCreate(int rowIndex) +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QLineEdit* pLineEdit; + QRegExp regx("[0-9]+$"); + QValidator *validator = new QRegExpValidator(regx, this); + QRegExp regxLoop("[1-9][0-9]+$"); + QValidator *validatorLoop = new QRegExpValidator(regxLoop, this); + for(int i=0;i<3;i++) + { + if(i==3) + { + //ui->tableWidget->item(rowIndex,i)->setCheckState(Qt::Unchecked); + } + else { + if(i<2) + { + pLineEdit = new QLineEdit(tr("0")); + pLineEdit->setValidator(validator); + } + else if(i==2) + { + pLineEdit = new QLineEdit(tr("1")); + pLineEdit->setValidator(validatorLoop); + } + ui->tableWidget->setCellWidget(rowIndex,i,pLineEdit); + } + } +#endif +} + +void PrintSetting::on_checkBoxGroupCnt1_clicked(bool checked) +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + if(checked) + { + ui->spinBoxCnt1StartValue->setEnabled(false); + ui->spinBoxCnt1EndValue->setEnabled(false); +// ui->checkBoxResetCnt1CurrValue->setEnabled(false); + } + else + { + ui->spinBoxCnt1StartValue->setEnabled(true); + ui->spinBoxCnt1EndValue->setEnabled(true); + ui->checkBoxResetCnt1CurrValue->setEnabled(true); + } +#endif +} + +void PrintSetting::on_Cnt3AddRowBtn_pressed() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + int rowCnt=ui->tableWidget->rowCount(); + if(rowCnt>=MAX_CNT1_GROUPS_NUM) + { + return; + } + //sysPara->para.cnt1GroupCnt++; + ui->tableWidget->setRowCount(rowCnt+1); + rowWidgetCreate(rowCnt); +#endif +} + +void PrintSetting::on_Cnt3InsertRowBtn_pressed() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + int rowIndex=ui->tableWidget->currentRow(); + int rowCnt=ui->tableWidget->rowCount(); + if(rowIndex<0||rowCnt>=MAX_CNT1_GROUPS_NUM) + { + //qDebug()<<"max counter1 groups num is "<tableWidget->insertRow(rowIndex+1); + rowWidgetCreate(rowIndex+1); +#endif +} + +void PrintSetting::on_Cnt3RemoveRowBtn_pressed() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + int rowIndex=ui->tableWidget->currentRow(); + if(rowIndex<0) + { + return; + } + QMessageBox::StandardButton ret; + if(rowIndex==sysPara->status.cnt1GroupRunningIndex) + { + QMessageBox::warning(this, tr("错误"), + tr("正在打印第%1组设置,不可删除").arg(rowIndex+1), + QMessageBox::Ok); + return; + } + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认删除第%1组设置?").arg(rowIndex+1), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + ui->tableWidget->removeRow(rowIndex); + } +#endif +} + +void PrintSetting::on_cnt3RemoveAllRowsBtn_pressed() +{ +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认删除全部设置?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + int rowCnt=ui->tableWidget->rowCount(); + for(int i=rowCnt-1;i>=0;i--) + { + ui->tableWidget->removeRow(i); + } + } +#endif +} + +void PrintSetting::on_comboBoxAlterPrintEnable_currentIndexChanged(int index) +{ + if(index==0) + { + ui->spinBoxXStartValue->setEnabled(false); + ui->spinBoxXRepeatTimeValue->setEnabled(false); + ui->spinBoxXGapValue->setEnabled(false); + } + else + { + ui->spinBoxXStartValue->setEnabled(true); + ui->spinBoxXRepeatTimeValue->setEnabled(true); + ui->spinBoxXGapValue->setEnabled(true); + } + if(index==3) + { + ui->spinBoxDistanceTail->setEnabled(true); + } + else + { + ui->spinBoxDistanceTail->setEnabled(false); + } +} + +void PrintSetting::on_checkVol1of8En_clicked(bool checked) +{ + if(checked && ui->checkmode0211->checkState()) + { + + ui->checkmode0211->setChecked(false); + } +} + +void PrintSetting::on_checkmode0211_clicked(bool checked) +{ + if(checked && ui->checkVol1of8En->checkState()) + { + ui->checkVol1of8En->setChecked(false); + } + if(checked && ui->radioButtonFUllColFIxVal->checkState()) + { + ui->radioButtonFUllColFIxVal->setChecked(false); + } + //sysPara->para.Vol1of8En = !checked;//打印优化 + if(!checked && ui->radioButtonFUllColFIxVal->checkState() == false) + { + ui->spinBoxStartVoltage->setEnabled(true); + ui->spinBoxEndVoltage->setEnabled(true); + } + else + { + ui->spinBoxStartVoltage->setEnabled(false); + ui->spinBoxEndVoltage->setEnabled(false); + } +} + + + +void PrintSetting::on_volButton_clicked() +{ + if(!modify_vol) + { + dialogModPasswd->clearAuth(); + dialogModPasswd->show(); + }else + { + modify_vol = false; + ui->volButton->setText("修改授权"); + ui->spinBoxHighVoltageValue->setEnabled(false); + ui->spinBoxStartVoltage->setEnabled(false); + } +} + + +void PrintSetting::on_spinBoxColDelay_valueChanged(int arg1) +{ + if(!sysPara->para.charWidthSetEnable) + { + if(arg1 == 0) + { + + QMessageBox::warning(this, tr("警告"), + tr("字体宽度不能为0"), + QMessageBox::Ok | QMessageBox::Cancel); + ui->spinBoxColDelay->setValue(sysPara->para.printColDelay); + } + } + else + { + sysPara->para.printColDelay = arg1; + } +} + +void PrintSetting::on_radioButtonFUllColFIxVal_clicked(bool checked) +{ +#if 0 + if(checked) //使用调整电压时,打印模式默认快速,且没有字形优化 + { + ui->checkVol1of8En->setChecked(false); + sysPara->para.Vol1of8En = !checked;//打印优化 + ui->checkVol1of8En->setEnabled(false); + + ui->comboBoxPrintMode->setCurrentIndex(0); + sysPara->para.currPrintMode = ui->comboBoxPrintMode->currentIndex(); + ui->comboBoxPrintMode->setEnabled(!checked); + + }else + { + ui->checkVol1of8En->setEnabled(true); + ui->comboBoxPrintMode->setEnabled(true); + } +#endif + if(!checked && ui->checkmode0211->checkState() == false) + { + ui->spinBoxStartVoltage->setEnabled(true); + ui->spinBoxEndVoltage->setEnabled(true); + } + else + { + ui->spinBoxStartVoltage->setEnabled(false); + ui->spinBoxEndVoltage->setEnabled(false); + } + if(checked && ui->checkmode0211->checkState()) + { + + ui->checkmode0211->setChecked(false); + } +} + + + +void PrintSetting::on_metreCountButton_clicked() +{ +// sysPara->status.calandar_and_dat.cnt1CurrValue = 123; + dialogShowCounter->show(); + dialogShowCounter->init_arg(); + refresh_timer->start(500); +// qDebug()<<"asdasd"; +// sysPara->status.calandar_and_dat.cnt2CurrValue; +} +void PrintSetting::ondialogShowCounterAccepted(void) +{ + refresh_timer->stop(); +// qDebug()<<"refresh_timer stop"; +} + +void PrintSetting::updateUIForSpecialCondition(PicScene* pPicScene) +{ + if(sysPara->para.EditMode==SCENE) + { + pGetPicScene = pPicScene; + QList items = pGetPicScene->selectedItems(); + if(items.size() > 0) + { + PicTextItem* picText = qgraphicsitem_cast(items.at(0)); + ui->radioButtonSpecialCondition->setEnabled(true); + ui->radioButtonSpecialCondition->setChecked(picText->SpecialConditions); + ui->lineEditCountValue->setText(QString::number(picText->CatchCnt1CurrValue)); + ui->lineEditStartValue->setText(QString::number(picText->CatchCnt1StartValue)); +// if(picText->SpecialConditions) +// { +// ui->comboBoxShowMode->setEnabled(true); +// ui->lineEditCountValue->setEnabled(true); +// } +// else +// { +// ui->comboBoxShowMode->setEnabled(false); +// ui->lineEditCountValue->setEnabled(false); +// } + } + else + { + ui->radioButtonSpecialCondition->setEnabled(false); + ui->comboBoxShowMode->setEnabled(false); + ui->lineEditCountValue->setEnabled(false); + ui->lineEditStartValue->setEnabled(false); + } + } + else + { + ui->radioButtonSpecialCondition->setEnabled(false); + ui->comboBoxShowMode->setEnabled(false); + ui->lineEditCountValue->setEnabled(false); + ui->lineEditStartValue->setEnabled(false); + } +} + +void PrintSetting::on_radioButtonSpecialCondition_clicked(bool checked) +{ + if(sysPara->para.EditMode==SCENE) + { + //emit SwitchTimerShowItem(false); + QList items = pGetPicScene->selectedItems(); + if(items.size() > 0) + { + PicTextItem* picText = qgraphicsitem_cast(items.at(0)); + //picText->SpecialConditions = checked; + ui->comboBoxShowMode->setEnabled(checked); + ui->lineEditCountValue->setEnabled(checked); + ui->lineEditStartValue->setEnabled(checked); + } + } +} + +void PrintSetting::refreshtimerHandler(void) +{ + int bcdTodec = 0; + int resetmetre = 0; +// int cn1StartValue = ui->spinBoxCnt1StartValue->value(); +// int cn1EndValue = ui->spinBoxCnt1EndValue->value(); + + resetmetre = dialogShowCounter->getResetMetreState(area_end); + + if(last_area_end != area_end){ + //qDebug() << "set spinBoxCnt1StartValue"; + last_area_end = area_end; + ui->spinBoxCnt1StartValue->setValue(0); + ui->spinBoxCnt1EndValue->setValue(area_end); + sysPara->para.cnt1EndValue = area_end; + } + + + if(true == resetmetre){ + if(sysPara){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否立即重新计米?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->devOp->clearProductCnt(3 | 0x10);// [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt = 0; + } + + } + resetmetre = false; + } + + //bcdTodec = sysPara->status.calandar_and_dat.cnt1CurrValue - (sysPara->status.calandar_and_dat.cnt1CurrValue>>4)*6; + //dialogShowCounter->refreshdate(sysPara->status.productCnt,cn1StartValue,cn1EndValue,bcdTodec); + int currValue1 = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + int currCnt1GroupIndex = sysPara->status.cnt1GroupRunningIndex; + int currCnt1GroupLoop = sysPara->status.cnt1GroupCurrentLoop; + int cnt1StartValue = sysPara->para.Cnt1ByGroup.cnt1GroupSettings[currCnt1GroupIndex].StartValue; + int cnt1EndValue = sysPara->para.Cnt1ByGroup.cnt1GroupSettings[currCnt1GroupIndex].EndValue; + + dialogShowCounter->refreshdate(currValue1, cnt1StartValue, cnt1EndValue, currCnt1GroupIndex, currCnt1GroupLoop); +} + +void PrintSetting::on_lockoulsepushButton_clicked() +{ + if(lockpulse){ + ui->lockoulsepushButton->setText(tr("锁定脉冲计数")); + lockpulse = false; + }else{ + ui->lockoulsepushButton->setText(tr("解锁脉冲计数")); + lockpulse = true; + } + +} + +void PrintSetting::on_spinBoxCnt1EndValue_valueChanged(int arg1) +{ + if(lockpulse){ + sysPara->para.productCntPerOutputPulse = arg1; + // qDebug()<< "emit change_OutputPulse()"; + emit change_OutputPulse(); + } + +} + +void PrintSetting::moveRow( int nFrom, int nTo) +{ + int StartValue,EndValue,LoopTimes; + + int To_StartValue,To_EndValue,To_LoopTimes; + QLineEdit *pLineEdit; + + + if( nFrom == nTo ) { + return; + } + if( nFrom < 0 || nTo < 0 ) { + return; + } + int nRowCount = ui->tableWidget->rowCount(); + if( nFrom >= nRowCount || nTo >= nRowCount ) return; + + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(nFrom,0); + StartValue = pLineEdit->text().toInt(); + + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(nFrom,1); + EndValue = pLineEdit->text().toInt(); + + pLineEdit = (QLineEdit *)ui->tableWidget->cellWidget(nFrom,2); + LoopTimes = pLineEdit->text().toInt(); + +// qDebug()<<"StartValue="<setText(QString::number(StartValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(nTo,0,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(EndValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(nTo,1,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(LoopTimes)); + pLineEdit->setValidator(validatorLoop); + ui->tableWidget->setCellWidget(nTo,2,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(To_StartValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(nFrom,0,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(To_EndValue)); + pLineEdit->setValidator(validator); + ui->tableWidget->setCellWidget(nFrom,1,pLineEdit); + + pLineEdit = new QLineEdit; + pLineEdit->setText(QString::number(To_LoopTimes)); + pLineEdit->setValidator(validatorLoop); + ui->tableWidget->setCellWidget(nFrom,2,pLineEdit); + + ui->tableWidget->selectRow(nTo); +// ui->tableWidget->clearFocus(); +// ui->tabWidget->focusPolicy(); +} +//调用 +void PrintSetting::on_moveUp_clicked() +{ + moveRow(ui->tableWidget->currentRow(),ui->tableWidget->currentRow() - 1); +} + +void PrintSetting::on_moveDown_clicked() +{ + moveRow(ui->tableWidget->currentRow(),ui->tableWidget->currentRow() + 1); +} + + +void PrintSetting::on_pushButtonUpRow_clicked() +{ + on_moveUp_clicked(); +} + +void PrintSetting::on_pushButtonDownRow_clicked() +{ + on_moveDown_clicked(); +} + +void PrintSetting::on_pushOnlyCNT3Clear_pressed() +{ + sysPara->devOp->clearProductCnt(1<<4);// 计数器3单独清零 +} + +void PrintSetting::setCNT1BackColor(bool flag) +{ + if(flag) + { + ui->radioCNT1->setCheckable(true); + ui->radioCNT1->setChecked(true); + } + else + { + ui->radioCNT1->setChecked(false); + ui->radioCNT1->setCheckable(false); + } +// if(flag) +// { +// //ui->tabWidget->widget(0)->setStyleSheet("QTabBar::tab{background-color:rgb(255, 0, 0);}"); //设置选中背景色 +// ui->radioCNT1->setChecked(flag); +// } +// else +// { +// //ui->tabWidget->widget(0)->setStyleSheet("QTabBar::tab{background-color:rgb(239, 239, 239);}"); //设置选中背景色 +// ui->radioCNT1->setChecked(flag); +// } +} + +void PrintSetting::setCNT2BackColor(bool flag) +{ + if(flag) + { + ui->radioCNT2->setCheckable(true); + ui->radioCNT2->setChecked(true); + } + else + { + ui->radioCNT2->setChecked(false); + ui->radioCNT2->setCheckable(false); + } +} + +void PrintSetting::setCNT3BackColor(bool flag) +{ + if(flag) + { + ui->radioCNT3->setCheckable(true); + ui->radioCNT3->setChecked(true); + } + else + { + ui->radioCNT3->setChecked(false); + ui->radioCNT3->setCheckable(false); + } +} +void PrintSetting::getFpgaVersionSetDisable(){ + qDebug()<<"getFpgaVersionSetDisable"; + sysPara->devOp->readbuilDat(); + sysPara->devOp->readFpgaVersionNum(); + int FPGAVersion =sysPara->status.build_dat.builTime; + unsigned int type = sysPara->status.fpgaVersionNum >> 12; + QString FPGAChip = "Null"; + if(sysPara->status.FPGAChipType == 1) + FPGAChip = "E15"; + else if(sysPara->status.FPGAChipType == 2) + FPGAChip = "E22"; + LogInfo::setRunStatusText(tr("builTime:%1").arg(FPGAVersion)); + LogInfo::setRunStatusText(tr("fpgaVersionNum: %1").arg(sysPara->status.fpgaVersionNum)); + LogInfo::setRunStatusText(tr("FPGAType: %1").arg(type)); + LogInfo::setRunStatusText(tr("FPGAChip: %1").arg(FPGAChip)); + + if(66 == FPGAVersion) + sysPara->status.FPGAVersionType = 1; + else if(67 == FPGAVersion && type != 1) + sysPara->status.FPGAVersionType = 2; + else if(72 == FPGAVersion && type != 5) + sysPara->status.FPGAVersionType = 3; + else if(73 ==FPGAVersion && type != 4) + sysPara->status.FPGAVersionType = 4; + else if(67 > FPGAVersion) + sysPara->status.FPGAVersionType = 5; + LogInfo::setRunStatusText(tr("FPGAVersion: %1").arg(FPGAVersion)); + LogInfo::setRunStatusText(tr("FPGAVersionType: %1").arg(sysPara->status.FPGAVersionType)); + + if (FPGAVersion == 67){ + sysPara->status.flagOfNo67FPGA = 1; + ui->checkBox_FastMode->setEnabled(true); + } + + if(FPGAVersion== 67 && sysPara->status.FPGAVersionType == 0) + { + if(!sysPara->para.flagOfFastMode) + uiSettingForNo67(); + else + uiSettingForNo66(); + } + else if(sysPara->status.FPGAVersionType == 1) + uiSettingForNo66(); + else if(sysPara->status.FPGAVersionType == 2) + uiSettingForNo67(); + else if(FPGAVersion == 72) + uiSettingForNo72(); + else if(FPGAVersion == 73) + uiSettingForNo73(); + + qDebug()<<"checkmode0211:"<checkmode0211->isChecked(); + qDebug()<<"charWidthSetEnable:"<checkBoxCharWidthSet->isChecked(); + qDebug()<<"Vol1of8En:"<checkVol1of8En->isChecked(); + qDebug()<<"FullColFixVal:"<radioButtonFUllColFIxVal->isChecked(); + + sysPara->para.mode0211 = ui->checkmode0211->isChecked();//添加0211模式 + sysPara->para.charWidthSetEnable = ui->checkBoxCharWidthSet->isChecked(); + sysPara->para.Vol1of8En = ui->checkVol1of8En->isChecked();//打印优化 + sysPara->para.FullColFixVal = ui->radioButtonFUllColFIxVal->isChecked();//2020/3/2 + +} +void PrintSetting::uiSettingForNo66(){ + ui->checkBox_FastMode->setChecked(true); + if(sysPara->para.currPrintMode>1) + ui->comboBoxPrintMode->setCurrentIndex(0); + ui->comboBoxPrintMode->setCurrentIndex(sysPara->para.currPrintMode); + ui->checkBoxCharWidthSet->setChecked(true); + ui->checkVol1of8En->setChecked(true); + ui->radioButtonFUllColFIxVal->setChecked(true); + ui->checkmode0211->setChecked(false); + ui->comboBoxPrintMode->setItemText(0,tr("超高速")); + ui->comboBoxPrintMode->setItemText(1,tr("高速")); + if(ui->comboBoxPrintMode->count()>2) + ui->comboBoxPrintMode->removeItem(2); +} + +void PrintSetting::uiSettingForNo67(){ + ui->checkBox_FastMode->setEnabled(true); + if(!sysPara->para.flagOfFastMode){ + ui->checkBox_FastMode->setChecked(false); + if(sysPara->para.currPrintMode>2) + ui->comboBoxPrintMode->setCurrentIndex(0); + ui->comboBoxPrintMode->setCurrentIndex(sysPara->para.currPrintMode); + ui->checkBoxCharWidthSet->setChecked(true); + ui->checkVol1of8En->setChecked(true); + ui->radioButtonFUllColFIxVal->setChecked(true); + ui->checkmode0211->setChecked(false); + if(ui->comboBoxPrintMode->count()<=2){ + ui->comboBoxPrintMode->setItemText(0,tr("快速")); + ui->comboBoxPrintMode->setItemText(1,tr("标准")); + ui->comboBoxPrintMode->addItem(tr("慢速")); + } + } +} +void PrintSetting::uiSettingForNo72(){ + sysPara->status.flagOfNo67FPGA = 0; + sysPara->para.flagOfFastMode=false; + ui->checkBox_FastMode->setChecked(false); + ui->checkBox_FastMode->setEnabled(false); + ui->comboBoxPrintMode->setCurrentIndex(1); + ui->comboBoxPrintMode->setEnabled(true); + ui->checkBoxCharWidthSet->setChecked(false); + ui->checkVol1of8En->setChecked(false); + ui->radioButtonFUllColFIxVal->setChecked(false); + ui->checkmode0211->setChecked(true); + if(ui->comboBoxPrintMode->count()<=2){ + ui->comboBoxPrintMode->setItemText(0,tr("快速")); + ui->comboBoxPrintMode->setItemText(1,tr("标准")); + ui->comboBoxPrintMode->addItem(tr("慢速")); + } +} + +void PrintSetting::uiSettingForNo73() +{ + sysPara->status.flagOfNo67FPGA = 0; + sysPara->para.flagOfFastMode=false; + ui->checkBox_FastMode->setChecked(false); + ui->checkBox_FastMode->setEnabled(false); + ui->checkBoxCharWidthSet->setChecked(false); + ui->checkVol1of8En->setChecked(false); + ui->radioButtonFUllColFIxVal->setChecked(false); + ui->checkmode0211->setChecked(false); + if(ui->comboBoxPrintMode->count()<=2){ + ui->comboBoxPrintMode->setItemText(0,tr("快速")); + ui->comboBoxPrintMode->setItemText(1,tr("标准")); + ui->comboBoxPrintMode->addItem(tr("慢速")); + } +} + +void PrintSetting::specailMachineSetting(bool enable){ + ui->checkBox_ReclaimPumpEnable->setEnabled(enable); + ui->spinBox_gearPumpSpeedAlarm->setEnabled(enable); +} diff --git a/PrintSetting.h b/PrintSetting.h new file mode 100644 index 0000000..baa3e73 --- /dev/null +++ b/PrintSetting.h @@ -0,0 +1,173 @@ +#ifndef PRINTSETTING_H +#define PRINTSETTING_H + +#include +#include "dialogmodifypasswd.h" +#include "DialogAuthorization.h" +#include "ParaSettingUI.h" +#include "dlginputaddr.h" + +#include "dlgvarlength.h" +#include "dialogshowcounter.h" + +#include "TextEditOption.h" // 需要使用文件文本编辑功能 +#include +#include +#include +//#include "mainwindow.h" + +namespace Ui { +class PrintSetting; +} + +class PicScene; +class PicTextItem; + +class PrintSetting : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit PrintSetting(QWidget *parent = 0); + ~PrintSetting(); + + void updateSysParaToUI(); //重载 + void applyUIPara(); //重载 + void updateCnt1GroupsTblWgt(); + + void checkCnt1EndValueOnUI(); + void ApplyCnt1GroupSetting(); + void updateSysStatusToUI(); + void updateAuthorization(int auth); + void PreviewEdit(); // + void bindSysPara(SysPara *sysPara); + void LoadCnt1GroupSettingsToUI(); + void rowWidgetCreate(int rowIndex); + + void moveRow(int currentRow, int toRow); + void on_moveUp_clicked(); + void on_moveDown_clicked(); + + void PrintSettingLog(); + void getFpgaVersionSetDisable(); + void uiSettingForNo66(); + void uiSettingForNo67(); + void uiSettingForNo72(); + void uiSettingForNo73(); + void specailMachineSetting(bool); + bool flagOfEngineeringMode; + void EngineeringModeDisplay(); + + DlgInputAddr *dlgInputAddr; + +public slots: + + void updateUIForSpecialCondition(PicScene* pPicScene); + +private slots: + void on_radioButtonSpecialCondition_clicked(bool checked); + void refreshtimerHandler(void); + + void ondialogShowCounterAccepted(void); + + void on_checkVarLenChg(); + void on_VarLenSet(); + + void on_pushButtonRanddomBackUP_pressed(); + void PrintupdateSysParaToUI(); + void showVolDacEdit(int auth); + void on_pushButtonApply_pressed(); + void on_checkBoxResetCnt1CurrValue_released(); + void on_checkBoxResetCnt2CurrValue_released(); + void on_pushButtonClearRunTime_pressed(); + void on_pushOnlyCNT1Clear_pressed(); + void on_pushOnlyCNT2Clear_pressed(); + + void ondialogAuthorizationAccepted(); + void ondialogAuthVarSetAccepted(); + void on_dialogModPasswdAccepted(); + + void on_checkBoxSuspendAfterPhaseFault_clicked(); + void on_checkBoxPowerOffAfterPhaseFault_clicked(); + + void on_pushButtonAuth_pressed(); +// void on_pushButtonXFileSelect_pressed(); + + void on_spinBoxLastLineEndPointFixedValue_valueChanged(int arg1); + + void on_pushButtonRecommendedSetting_clicked(); + void onUpdateCnt1GroupDisp(bool bChangeToNext); + + void on_Cnt3AddRowBtn_pressed(); + + void on_Cnt3RemoveRowBtn_pressed(); + + void on_Cnt3InsertRowBtn_pressed(); + + void on_checkBoxGroupCnt1_clicked(bool checked); + + void on_cnt3RemoveAllRowsBtn_pressed(); + + void on_comboBoxAlterPrintEnable_currentIndexChanged(int index); + + void on_checkVol1of8En_clicked(bool checked); + + void on_checkmode0211_clicked(bool checked); + void on_spinBoxExpiryDate_valueChanged(int arg1); + + void on_CBDateFormat1_currentIndexChanged(int index); + void showMachInfo(QString); + void showRemoteControl(QString SuperNodeIP,QString EdgeIP); + + void on_volButton_clicked(); + + void on_spinBoxColDelay_valueChanged(int arg1); + + void on_radioButtonFUllColFIxVal_clicked(bool checked); + + void on_metreCountButton_clicked(); + + void on_lockoulsepushButton_clicked(); + + void on_spinBoxCnt1EndValue_valueChanged(int arg1); + + void on_pushButtonUpRow_clicked(); + + void on_pushButtonDownRow_clicked(); + + + void on_checkBoxResetCnt3CurrValue_released(); + void on_checkBoxSaveCNTStateValue_released(); + // void on_checkBoxCircleProductCnt_released(); + + void on_pushOnlyCNT3Clear_pressed(); + void setCNT1BackColor(bool flag); + void setCNT2BackColor(bool flag); + void setCNT3BackColor(bool flag); + +Q_SIGNALS: + void authChanged(int auth); + void printPriveiw(); + void change_OutputPulse(); + void SwitchTimerShowItem(bool flag); +private: + Ui::PrintSetting *ui; + //MainWindow *mainWindow; + DialogAuthorization *dialogAuthorization; + DialogAuthorization *dialogAuthVarSet; + DlgVarLength *dlgvarLen; + int auth; + + Dialogmodifypasswd *dialogModPasswd; + DialogShowCounter *dialogShowCounter; + int modify_vol; + int keepVolVal; + QTimer *refresh_timer; + + int lockpulse; + int area_end; + int last_area_end; + PicScene* pGetPicScene; +}; + +#endif // PRINTSETTING_H diff --git a/PrintTextDisplay.cpp b/PrintTextDisplay.cpp new file mode 100644 index 0000000..36eae62 --- /dev/null +++ b/PrintTextDisplay.cpp @@ -0,0 +1,342 @@ +/* + * PrintTextDisplay.cpp + * + * Created on: Jul 9, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "PrintTextDisplay.h" +#include +#include +#include +#include +#include +#include +#include +#include "Public.h" +#include + +PrintTextDisplay::PrintTextDisplay(QWidget *parent): + QWidget(parent){ + setPalette(QPalette(Qt::white)); + setAutoFillBackground(true); + scaleRatio = 2; + origWidth = 0; + origHeight = 0; + setAttribute(Qt::WA_OpaquePaintEvent,true); //背景不自动重画 + updateDigitalOnly = false; +} + +PrintTextDisplay::~PrintTextDisplay(){ + +} + +void PrintTextDisplay::updateSysParaToUI(){ + +} + +void PrintTextDisplay::updateSysStatusToUI(){ + updateDigitalOnly = true; + update(); //表示只更新变量而已,该区域一定要包含实际的打印区域,否则显示不出来 +} + +void PrintTextDisplay::enlargeDisplay(){ + if(scaleRatio < 10){ + scaleRatio ++; + resize(scaleRatio*origWidth,scaleRatio*origHeight); + update(); + + } +} +void PrintTextDisplay::scroll_update() +{ + update(); +} + +void PrintTextDisplay::reduceDisplay(){ + if(scaleRatio > 1){ + scaleRatio --; + resize(scaleRatio*origWidth,scaleRatio*origHeight); + update(); + } +} + +//#define H02 2 +//#define H04 4 + +void PrintTextDisplay::setDisplaySize(int w,int h){ + origHeight = h; + + origWidth = w; + + resize(scaleRatio*origWidth,scaleRatio*(origHeight)); +} +void PrintTextDisplay::setScaleRatio(int ratio) +{ + if(ratio > 1) + { + if(ratio > 10) ratio =10; + scaleRatio =ratio; + resize(scaleRatio*origWidth,scaleRatio*origHeight); + update(); + } +} +void PrintTextDisplay::paintEvent(QPaintEvent *event){ +// qDebug() <<"x:" << event->rect().x() << "y:" << event->rect().y() << "width:" << event->rect().width() << "height" << event->rect().height(); + + QRect updateRect = event->rect(); + //2019/11/11 prevent pic shadow + updateRect.setY(0); + + static int r_altermode=-1; + + if(sysPara) + { + QPainter p(this); + p.scale(scaleRatio,scaleRatio); + p.setPen(Qt::NoPen); + + //qDebug()<<"updateRect"<para.AlterMode!=r_altermode)updateDigitalOnly=false; + //r_altermode=sysPara->para.AlterMode; + if(sysPara->para.AlterMode!=r_altermode) updateDigitalOnly=false; + r_altermode=sysPara->para.AlterMode; + //if(!updateDigitalOnly) + { //尽量减少不必要的刷屏动作 + + int x = updateRect.x()/scaleRatio; + int end_x = (( sysPara->status.addSpace?2:1)*(updateRect.x() + updateRect.width())/scaleRatio) + 1; + int w= end_x - x; + int y = updateRect.y()/scaleRatio; + int end_y = (updateRect.y() + updateRect.height())/scaleRatio + 1; + int h = end_y - y;; + p.setBrush(QColor(Qt::white)); + int y0=0; + //if(sysPara->para.AlterMode<2) y0=y; + if(sysPara->para.AlterMode<2) y0=0; + + //else if(sysPara->para.AlterMode==2) y0=0; + else if(sysPara->para.AlterMode==2) y0=y; + + if(sysPara->status.addSpace) + p.drawRect(x>>1,y0,w/2,h); + else + p.drawRect(x,y0,w,h); + + p.setBrush(QColor(Qt::green)); + + if(sysPara->para.AlterMode<2) + { + + } + else if(sysPara->para.AlterMode==2) + { + y = end_y; + end_y = end_y+h; + } + //qDebug()<<"updateRect"<status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + for(int i = 0; i < h && (i +y)< MAX_PRINT_ROW_NUM; i ++){ + for(int j = x; j < end_x && j < (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide); j++){ + if(dat[j*MAX_PRINT_ROW_BYTE_NUM + (i+y)/8] & (1<<((i+y)%8))){ + if(sysPara->status.addSpace){ + p.drawRect(j/2,i+y0,1,1);j++; + } + else + p.drawRect(j,i+y0,1,1); + } + } + } + + } + + //sysPara->para.qrOption.DisplayUpdate=1; + // 二维码显示 + //if(sysPara->para.qrOption.DisplayUpdate==1) + if(sysPara->para.qrOption.DisplayUpdate==1 && sysPara->print.QRvars[0].type != BAR) //lich fix + { + sysPara->para.qrOption.DisplayUpdate=0; + int varNum=0; + for( varNum=0;varNumstatus.QRvariNum;varNum++){ + int x = sysPara->print.QRvars[varNum].startColPos; + int w = sysPara->print.QRvars[varNum].width; + int end_x = x+w; + int h = sysPara->print.QRvars[varNum].height; + int end_y=sysPara->print.QRvars[varNum].endRowPos; + int y = sysPara->print.QRvars[varNum].startRowPos; + p.setBrush(QColor(Qt::white)); + + //p.drawRect(x,y,w,h); + if(sysPara->status.addSpace) + p.drawRect(x/2,y,w,h); + else + p.drawRect(x,y,w,h); + + p.setBrush(QColor(Qt::black)); + // p.setBrush(QColor(Qt::green)); + //qDebug()<<"PrintfTextDiaplay:"<status.printDat; + unsigned char *dat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + for(int i = y; i < end_y && (i +y)< MAX_PRINT_ROW_NUM; i ++){ + for(int j = x; j < end_x && j < (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide); j++){ + if(dat[j*MAX_PRINT_ROW_BYTE_NUM + (i)/8] & (1<<((i)%8))){ + //p.drawRect(j,i,1,1); + if(sysPara->status.addSpace){ + p.drawRect(j>>1,i,1,1);//j++; + } + else + p.drawRect(j,i,1,1); + } + } + } + } + } +#if 0 + for(int i = 0; i < sysPara->status.ExpiryVarNum; i++){ + int x,w,end_x,h,end_y,y; + if(i == 0) + { + if(sysPara->print.CurDateVar.type = CURDATE) + { + x = sysPara->print.CurDateVar.startColPos; + w = sysPara->print.CurDateVar.width; + end_x = x+w; + h = sysPara->print.CurDateVar.height; + end_y = sysPara->print.CurDateVar.endRowPos; + y = sysPara->print.CurDateVar.startRowPos; + } + } + else + { + + } + } +#endif + // 变量显示 + for(int i = 0; i < sysPara->status.variNum; i++){ + vars_t *p_var = &sysPara->status.vars[i]; + int val = p_var->currVal; + //val = 6569; + int x = p_var->startColPos; + int y = p_var->startRowPos; + int rowDiff = p_var->endRowPos - p_var->startRowPos; + int digitalNum = p_var->digitalNum; + + if(sysPara->para.AlterMode==2){ + if(ystatus.currAlterPrintRow) continue; + y = p_var->startRowPos-sysPara->status.currAlterPrintRow-1; + + } + + else if(sysPara->para.AlterMode==1){ + + if(y>=sysPara->status.currAlterPrintRow) continue; + + } + int base = 1; int j=0,jmin=0; + QString str=""; + int Num=0; + + if(digitalNum<=8 || Public::getType(p_var->type) < 9 || p_var->type == 37 || p_var->type == 38 || Public::getType(p_var->type) == 13) // 0-8 变量 显示刷新 + { + for(int j = 0; j < digitalNum;j ++){ + if(val>base-1)jmin=digitalNum-j-1; + base *= 10; + } + str= QString("%1").arg(val%base,digitalNum,10,QLatin1Char('0')); + } + else { // 大于 9 是什么变量呢? 随机数 显示刷新 + base = 1; j=0,jmin=0; + for(int j = 0; j < 8;j ++){ + if(val>base-1)jmin=8-j-1; + base *= 10; + } + str= QString("%1").arg(val%base,8,10,QLatin1Char('0')); + val = QString::number( sysPara->status.calandar_and_dat.RandomValue2 ,16).toInt(); + Num = digitalNum-8; + base = 1; + jmin=0; + for(int j = 0; j < Num;j ++){ + if(val>base-1)jmin=Num-j-1; + base *= 10; + } + str= QString("%1").arg(val%base,Num,10,QLatin1Char('0'))+str; + } + + + if(!sysPara->para.Cnt1NatureValue) jmin=0; + + p.setBrush(QColor(Qt::white)); + if(sysPara->status.addSpace) + p.drawRect(x/2,y,p_var->width/2,p_var->height); + else p.drawRect(x,y,p_var->width,p_var->height); + + //p.setBrush(QColor(Qt::red));//之前都是红色 + if(p_var->type==7 || p_var->type==37 || p_var->type==57|| p_var->type==67) p.setBrush(QColor(Qt::black));//变量1 + else if(p_var->type==8 || p_var->type==38 || p_var->type==58 || p_var->type==68) p.setBrush(QColor(Qt::blue));//变量2 + else if(p_var->type==13) p.setBrush(QColor(Qt::red));//变量3 + else p.setBrush(QColor(Qt::red)); //其他 + + + + + QChar *qchar = str.data(); + int charWidth = p_var->datWidth/10; + + for( j = jmin; j < digitalNum; j++){ + int digitalIndex = qchar[j].toAscii() - '0'; + unsigned char *pAaddr = p_var->dat + (digitalIndex*charWidth)*p_var->rowByteNum; + + for(int k = 0; k < rowDiff; k++){ + for(int l = 0; l < charWidth; l++){ + if(pAaddr[l*p_var->rowByteNum + k/8] & (1<<(k%8))){ + //p.drawRect(x + j*charWidth + l,y + k,1,1); + if(sysPara->status.addSpace){ + p.drawRect((x + j*charWidth + l)/2,y + k,1,1);l++; + } + else + p.drawRect(x + j*charWidth + l,y + k,1,1); +#ifdef DEBUG3 + printf("0"); + } + else + printf("."); + } + printf("\n"); +#else + } + } +#endif + } + } + } + updateDigitalOnly = false; +// update(); + } + + +} + diff --git a/PrintTextDisplay.h b/PrintTextDisplay.h new file mode 100644 index 0000000..f8555b1 --- /dev/null +++ b/PrintTextDisplay.h @@ -0,0 +1,47 @@ +/* + * PrintTextDisplay.h + * + * Created on: Jul 9, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef PRINTTEXTDISPLAY_H_ +#define PRINTTEXTDISPLAY_H_ + +#include +#include "ParaSettingUI.h" +class PrintTextDisplay:public QWidget,public ParaSettingUI{ + +public: + explicit PrintTextDisplay(QWidget *parent = 0); + ~PrintTextDisplay(); + + void updateSysParaToUI(); //重载 + + void updateSysStatusToUI(); //重载 + + void paintEvent(QPaintEvent *); + + void resizeWidget(int w,int h); + + + + void enlargeDisplay(); + void reduceDisplay(); + + void setDisplaySize(int w,int h); + + void setScaleRatio(int ratio); + void scroll_update(); +private: + int scaleRatio; + int origHeight; + int origWidth; + bool updateDigitalOnly; +}; + + +#endif /* PRINTTEXTDISPLAY_H_ */ diff --git a/Public.cpp b/Public.cpp new file mode 100644 index 0000000..634193b --- /dev/null +++ b/Public.cpp @@ -0,0 +1,431 @@ +/* + * Public.cpp + * + * Created on: Jul 16, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "Public.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static QString FontName; + +Public::Public(){ + +} +// "Zfull-GB";break;/ +Public::~Public(){ + FontName=""; +} +// 20160303 : #define FONTV "WenQuanYiCN" ; FONTV1 FONTV2 "WenQuanYiNX" +//#define FONTV "DejaVuSansnx"//"DejaVu Sans" +#define FONTV "WenQuanYiCN" +//#define FONTV "WenQuanYiNX" +#define FONTV1 "WenQuanYiNX" +//#define FONTV1 "DejaVu Sans" +//#define FONTV2 "DejaVu Sans" +#define FONTV2 "WenQuanYiNX"//"WenQuanYi Micro Hei" +//"Zfull-GB" +#define FONTC "wenquanyi" + +//#define FONTC "WenQuanYi" +int Public::getMinFontPixelSize(){ + return 5; +} +QString Public::getFontFamily(int pixelSize){ + switch(pixelSize){ + +#ifdef VNLG + case 5: + case 6: + case 7: + case 9: + return "biyang";break; + case 10: + case 11: + case 12: + return (FontName=="Chinese" || FontName=="English")?FONTC:FONTV;break;//return "UnDotum";break;// + //return "UnDotum";break;//Zfull-GB + case 14:case 13:case 15: + case 16: + case 24: + case 32: + return (FontName=="Chinese" || FontName=="English")?FONTC:FONTV;break;//return "UnDotum";break;//return (FontName=="Chinese")?FONTC:"Zfull-GB";break; + case 28: + //case 32: + case 36: + return //(FontName=="Chinese")?FONTC: + //FONTV1;// + (FontName=="Chinese" || FontName=="English")?FONTV2:FONTV1;break; + + // "Zfull-GB";break;//return "UnDotum";break;//return (FontName=="Chinese")?FONTC:"Zfull-GB";break; + // 16点阵以上直接使用方正字体 + default: + return + (FontName=="Chinese" || FontName=="English")?FONTV2:FONTV1;break; + //FONTC; // + //"WenQuanYi Micro Hei"; + //"WenQuanYiMH"; +#else + case 5://return "SerifL";break; + case 6: + case 7: + case 9:return "biyang";break; + default:return + FONTC; +#endif + + break;//return "WenQuanYi Zen Hei"; break; + } + return FONTV2; +} + +QString Public::getFontFamily(int pixelSize, int vartype){ + switch(pixelSize){ + case 5: + case 6: + case 7: + case 9: + { + if(vartype>19&& vartype<30) + { + return "SerifL"; + } + else if(vartype>39&& vartype<50) + { + return "SerifR"; + } + else if((vartype>29&& vartype<40) || vartype == 90 || vartype==91) + { + return "bangla"; + } + else if((vartype>49&& vartype<60) || vartype == 100 || vartype==101) + { + return "biyangF"; + } + else if((vartype>59&& vartype<70) || vartype == 110 || vartype==111) + { + return "Roman"; + } + else + { + return "biyang"; + } +// (vartype>19&& vartype<30)?"SerifL": +// (vartype>39&& vartype<50)?"SerifR": +// "biyang"; + } + break; + default:return + FONTC; + break;//return "WenQuanYi Zen Hei"; break; + } + + return FONTV2; +} + +static int pixel_size[] = {5,7,9,12,16,21,24};//,28,32}; +#define NUM 6 +int Public::derivePixelSizeFromHeight(int value){ + static int init_done; + static int height[NUM*2]; + //static int heightB[NUM]; + +// 12 -12 16--15 24 --19 28 -22 32 --25 +/* +HEIL 0 6 +HEIL 1 8 +HEIL 2 10 +HEIL 3 13 +HEIL 4 17 +HEIL 5 32 +HEIL 6 37 +HEIL 7 42 + */ + if(!init_done){ + for(int i = 0; i < NUM; i++){ + QFont font; + font.setFamily(Public::getFontFamily(pixel_size[i])); + font.setPixelSize(pixel_size[i]); + font.setBold(0); + height[2*i] = getNumberHeight(font); + font.setBold(1); + height[2*i+1] = getNumberHeight(font); + //qDebug()<<"HEIL"<2) { + len=file1.readLine((char*)buf,256); + if(len){ + buf[len]='\0'; + QString s1 = buf; + int n=s1.indexOf("\r\n"); + if(n) + s1 = s1.mid(0,n); + if(s1.endsWith("utf8.txt")) InputTxtFileName = s1; + else InputTxtFileName = "WINPY_utf8.txt"; + } + } + if(file1.isOpen()) file1.close(); + } + return InputTxtFileName; +} + +QString Public::ReadLanguageName() +{ + QFile file1("/home/plg/UseEn"); + QString language="Chinese"; + char buf[256]; + + if(file1.exists()) + { + file1.open(QFile::ReadWrite); + int len=file1.readLine((char*)buf,256); + buf[len]='\0'; + //qDebug()<<"language:"<2) { + language = buf; + int n=language.indexOf("\r\n"); + if(n>0) + language = language.mid(0,n); + } + if(file1.isOpen())file1.close(); + } + //qDebug()<<"language2:"<drawContents (&painter, image.rect()); /*将text写到pic*/ + text1.hide(); +#if 0 + QString s; + s.sprintf("/home/ss%d-%d.jpg",font.pixelSize(),font.bold()?75:50); + image.save(s); +#endif + + int imgHeight = image.height(); + int imgWidth = image.width(); + int FirstValidRow = 0; + bool lastFlag=0; + int k,j; + for(k = 0; k 0 ; k--){ + for( j = 0; j < imgWidth; j ++){ + QRgb rgb = image.pixel(j,k); + //qDebug()<= 60) tmp = vartype-60; + else if(tmp >= 50) tmp = vartype-50; + else if(tmp >= 40) tmp = vartype-40; + else if(tmp >= 30) tmp = vartype-30; + else if(tmp >= 20) tmp = vartype-20; + return tmp; + + +} + +/* + * +#ifdef MMVAR11 + // 同一行先排序: ,不同行分开排序,如何实现。 + int i,j; + for(i=0;istatus.variNum-1;i++){ + bool ch_flag=0; + for(j=i+1;jstatus.variNum;j++){ + if(sysPara->status.vars[j].startColPos < sysPara->status.vars[j-1].startColPos ){ + int n=sysPara->status.vars[j].startRowPos; + sysPara->status.vars[j].startRowPos = sysPara->status.vars[j-1].startRowPos; + sysPara->status.vars[j-1].startRowPos = n; + n=sysPara->status.vars[j].startColPos; + sysPara->status.vars[j].startColPos = sysPara->status.vars[j-1].startColPos; + sysPara->status.vars[j-1].startColPos = n; + ch_flag =1; + } + } + if(ch_flag==0) break; + } +#endif +*/ diff --git a/Public.h b/Public.h new file mode 100644 index 0000000..d6ab64d --- /dev/null +++ b/Public.h @@ -0,0 +1,44 @@ +/* + * Public.h + * + * Created on: Jul 16, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef PUBLIC_H_ +#define PUBLIC_H_ + +#include +#include +#include +#include + +extern void MySleep(unsigned int msec); + +class Public{ +public: + Public(); + ~Public(); + static int getMinFontPixelSize(); + static QString getFontFamily(int pixelSize); + static QString getFontFamily(int pixelSize, int vartype);// 20160812 + static int derivePixelSizeFromHeight(int value); + static int derivePixelSizeFromHeightNx(int value); + static int getAdjustedPixelSize(int value); + static void resetPara(); + static void backupPara(); + static QString readLanguageType(); + static QString ReadLanguageName(); + static int getNumberHeight(QFont font); + static time_t getDateFromMacro(const char *time); + static QString DateToString(const char *time); + + static int getType(int vartype); // 将变量类型进行转换,以处理横向字体 + +}; + + +#endif /* PUBLIC_H_ */ diff --git a/PulseNumFix.cpp b/PulseNumFix.cpp new file mode 100644 index 0000000..9848454 --- /dev/null +++ b/PulseNumFix.cpp @@ -0,0 +1,109 @@ +#include "PulseNumFix.h" +#include "ui_pulsenumfix.h" +#include +#include +#include +PulseNumFix::PulseNumFix(QWidget *parent) : + QDialog(parent), + ui(new Ui::PulseNumFix) +{ + ui->setupUi(this); + this->setWindowTitle(tr("脉冲数修正")); + setUIEnableStatus(); + connect(this,SIGNAL(accepted()),this,SLOT(onButtonBoxAccepted())); + ui->lineEditRate->setValidator(new QDoubleValidator(0)); + ui->lineEditActualSynLength->setValidator(new QDoubleValidator(0)); + ui->lineEditLength->setValidator(new QDoubleValidator(0)); + ui->lineEditPulseNum->setValidator(new QDoubleValidator(0)); + ui->lineEditDiameter->setValidator(new QDoubleValidator(0)); + ui->lineEditPulsePerCycle->setValidator(new QDoubleValidator(0)); + this->setFixedSize(this->geometry().width(),this->geometry().height()); +} + +PulseNumFix::~PulseNumFix() +{ + delete ui; +} + +void PulseNumFix::setUIEnableStatus(){ + ui->lineEditRate->setEnabled(ui->radioButtonAccordingRate->isChecked()); + ui->labelRate->setEnabled(ui->radioButtonAccordingRate->isChecked()); + ui->lineEditActualSynLength->setEnabled(ui->radioButtonAccordingLength->isChecked()); + ui->labelActualSynLength->setEnabled(ui->radioButtonAccordingLength->isChecked()); + ui->lineEditLength->setEnabled(ui->radioButtonAccordingPulseNum->isChecked()); + ui->labelLength->setEnabled(ui->radioButtonAccordingPulseNum->isChecked()); + ui->lineEditPulseNum->setEnabled(ui->radioButtonAccordingPulseNum->isChecked()); + ui->labelPulseNum->setEnabled(ui->radioButtonAccordingPulseNum->isChecked()); + ui->lineEditDiameter->setEnabled(ui->radioButtonSynchonizerPara->isChecked()); + ui->labelDiameter->setEnabled(ui->radioButtonSynchonizerPara->isChecked()); + ui->lineEditPulsePerCycle->setEnabled(ui->radioButtonSynchonizerPara->isChecked()); + ui->labelPulsePerCycle->setEnabled(ui->radioButtonSynchonizerPara->isChecked()); +} + +void PulseNumFix::onButtonBoxAccepted() +{ + float pulseNumPerMM = 0; + if(sysPara){ + if(ui->radioButtonAccordingRate->isChecked()){ + float rate = ui->lineEditRate->text().toFloat(); + if(rate != 0){ + pulseNumPerMM = sysPara->status.synPulseCntPer1s/rate; + } + else { + QMessageBox::critical(0,tr("错误"),tr("速度不应该为0")); + } + } + else if(ui->radioButtonAccordingLength->isChecked()){ + float length = ui->lineEditActualSynLength->text().toFloat(); + if(length != 0){ + pulseNumPerMM = sysPara->para.synPulseNumPerMm * sysPara->para.synTriggerPrintLenMm / length; + } + else { + QMessageBox::critical(0,tr("错误"),tr("实际同步长度不应该为0")); + } + } + else if(ui->radioButtonAccordingPulseNum->isChecked()){ + float length = ui->lineEditLength->text().toFloat(); + float pulse = ui->lineEditPulseNum->text().toFloat(); + if(length != 0){ + pulseNumPerMM = pulse/length; + } + else { + QMessageBox::critical(0,tr("错误"),tr("长度不应该为0")); + } + } + else if(ui->radioButtonSynchonizerPara->isChecked()){ + float circle = ui->lineEditDiameter->text().toFloat() * 3.1415926; + float pulseNum = ui->lineEditPulsePerCycle->text().toFloat(); + if(circle != 0){ + pulseNumPerMM = pulseNum/circle; + }else { + QMessageBox::critical(0,tr("错误"),tr("直径不应该为0")); + } + } + if(pulseNumPerMM != 0){ + emit pulseNuxFixDone(pulseNumPerMM); + } + + } +} + +void PulseNumFix::on_radioButtonAccordingRate_released() +{ + setUIEnableStatus(); +} + +void PulseNumFix::on_radioButtonAccordingLength_released() +{ + setUIEnableStatus(); +} + +void PulseNumFix::on_radioButtonAccordingPulseNum_released() +{ + setUIEnableStatus(); +} + +void PulseNumFix::on_radioButtonSynchonizerPara_released() +{ + setUIEnableStatus(); +} diff --git a/PulseNumFix.h b/PulseNumFix.h new file mode 100644 index 0000000..53a91d3 --- /dev/null +++ b/PulseNumFix.h @@ -0,0 +1,39 @@ +#ifndef PULSENUMFIX_H +#define PULSENUMFIX_H + +#include +#include +#include +namespace Ui { +class PulseNumFix; +} + +class PulseNumFix : public QDialog,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit PulseNumFix(QWidget *parent = 0); + ~PulseNumFix(); + +Q_SIGNALS: + void pulseNuxFixDone(float); + +private slots: + void setUIEnableStatus(); + + void onButtonBoxAccepted(); + + void on_radioButtonAccordingRate_released(); + + void on_radioButtonAccordingLength_released(); + + void on_radioButtonAccordingPulseNum_released(); + + void on_radioButtonSynchonizerPara_released(); + +private: + Ui::PulseNumFix *ui; +}; + +#endif // PULSENUMFIX_H diff --git a/QBarCode.cpp b/QBarCode.cpp new file mode 100644 index 0000000..11497a4 --- /dev/null +++ b/QBarCode.cpp @@ -0,0 +1,809 @@ + +#include "QBarCode.h" +#include "ui_QBarCode.h" +#include "QImage" +#include "QFile" +#include "QFileInfo" +#include "QDebug" +#include "stdio.h" +#include "Public.h" +#include "QTextEdit" +//#include "SysPara.h" +#include "InkJetPrinter.h" + +static int dotn[]={5,7,9,12,16,24,32,40}; +#define AUTOREF false + +int AutoCount1=0; +#define MDTFLAG 0xff00FF10 +#define QRFLAG 0xff00FF20 +#define BARFLAG 0xff00FF30 + +extern InkJetPrinter *pInkJectPrinter; + +QBarCode::QBarCode(QWidget *parent) : + QDialog(parent), + ui(new Ui::QBarCode) +{ + ui->setupUi(this); + bcOK=false; + connect(ui->BarCodeGenerate,SIGNAL(pressed()),this,SLOT(ImgSave())); + connect(ui->pushBarPreview,SIGNAL(pressed()),this,SLOT(onEnCodeBar())); + connect(ui->BarCodeScale,SIGNAL(valueChanged(int)),this,SLOT(onScaleChange(int))); + //connect(ui->spinBoxXPos,SIGNAL(valueChanged(int)),this,SLOT(onXposChange(int))); + connect(ui->lineEditModule,SIGNAL(textChanged(QString)),this,SLOT(onBarCodeRefresh(QString))); + //connect(ui->pushBtnOpenFile,SIGNAL(pressed()),this,SLOT(generateCharRamData())); + AutoRefresh = false; + ui->labFileName->setText(tr("文件未保存")); + ui->lineEditModule->setText("BEC301B030"); + scene = new QGraphicsScene; + + + //ui->BarCodeType->addItem("BARCODE_128B"); + //ui->BarCodeType->addItem("BARCODE_128C"); + //ui->BarCodeType->addItem("BARCODE_128RAW"); + ui->BarCodeType->addItem(tr("CODE_128")); + ui->BarCodeType->addItem("CODE_39"); + ui->BarCodeType->addItem("CODE_ITF"); + ui->BarCodeType->addItem("CODE_NW7"); + ui->BarCodeType->addItem("CODE_JAP"); + ui->BarCodeType->addItem(tr("CODE_93")); + //ui->BarCodeType->addItem(tr("自适应编码")); + //ui->BarCodeType->addItem("BARCODE_ISBN"); + //ui->BarCodeType->addItem("BARCODE_EAN"); + //ui->BarCodeType->addItem("BARCODE_UPC"); + //ui->BarCodeType->addItem("BARCODE_39"); + //ui->BarCodeType->addItem("BARCODE_CBR"); + //ui->BarCodeType->addItem("BARCODE_CBR"); + //ui->BarCodeType->addItem("BARCODE_PLS"); + //ui->BarCodeType->addItem("BARCODE_MSI"); + ui->BarCodeHeigh->addItem(tr("5点")); + ui->BarCodeHeigh->addItem(tr("7点")); + ui->BarCodeHeigh->addItem(tr("9点")); + ui->BarCodeHeigh->addItem(tr("12点")); + ui->BarCodeHeigh->addItem(tr("16点")); + ui->BarCodeHeigh->addItem(tr("24点")); + //ui->BarCodeHeigh->addItem(tr("24点")); + //onEnCodeBar(); + //ui->BarCodeFont->setCurrentIndex(1); + ui->BarCodeHeigh->setCurrentIndex(3); + ui->BarCodeType->setCurrentIndex(0); + //ui->BarCodeScale->setValue(2); + //ui->spinBoxXPos->setValue(1); + fontSize = 5; +} + +QBarCode::~QBarCode() +{ + delete ui; +} +void QBarCode::TextBarCode(QString txt,int index) +{ + int ps = 1, pcl = 0, oflags; + ps = 0; pcl = 0; + oflags = BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; + //oflags = BARCODE_OUT_PS ; + /* and my data as code-128B autodetected */ + + //qDebug()<<"TextBarCode, txtLen:"<sysPara =sysPara; +} + +void QBarCode::onEnCodeBar(){ + QString txt2 =ui->lineEditModule->text().trimmed(); + QString txt3 =ui->lineEditLine->text().trimmed(); + QString txt4 =ui->lineEditLine1->text().trimmed(); + QString txtVar1,txtVar2; + QString txtVar5,txtVar6; + inkColor = ui->comboBoxInkColor->currentIndex()?1:0; + QString txt; + if(sysPara) + { + sysPara->para.bcOption.var1Type =1; + sysPara->para.bcOption.var2Type =2; + txtVar1=getVarTxt(ui->BarCodeVarEN1->isChecked(),sysPara->para.bcOption.var1Type); + txtVar2=getVarTxt(ui->BarCodeVarEN2->isChecked(),sysPara->para.bcOption.var2Type); + txtVar5=getVarTxt(ui->checkBoxBarDate->isChecked(),3); + txtVar6=getVarTxt(ui->checkBoxBarTime->isChecked(),4); + if(ui->BarCodeVarEN1->isChecked()) ui->lineEditVar1->setText(txtVar1); + if(ui->BarCodeVarEN2->isChecked()) ui->lineEditVar2->setText(txtVar2); + } + else qDebug()<<"no para init."; + +// %06d%04d TextBarCode, txtLen: 30 "BCD030000025000000020000340000" 1 + if(sysPara->para.isCheckInsertTime) + { + txt = txt2 + " " + txtVar5 + " " + txtVar6 + " " + txtVar1; + } + else + { + txt = txt2 + txtVar1+txt3+txtVar2+ txt4; + } + ui->label_Txt->setText(txt); + TextBarCode(txt, ui->BarCodeType->currentIndex()); + ShowBarCode(&imgBar); + //imgBar.save(QString().sprintf("BARV%d.bmp",imgBar.height()+ ui->BarCodeType->currentIndex()*100 )); +} + +QString QBarCode::getLabe_TxtString() +{ + return ui->label_Txt->text(); +} + +QString QBarCode::getVarTxt(bool varEn,unsigned varType) +{ + int tmp=1; + int varNum= (varType==1)? sysPara->para.bcOption.var1Num: + (varType==2)? sysPara->para.bcOption.var2Num: + 4; + QString txtVar=""; + char fmt[]="%04d"; + sprintf(fmt,"%%%02dd",varNum); + while(varNum-->0) tmp*=10; + //qDebug()<<"fmt"<status.calandar_and_dat.cnt1CurrValue,16).toInt(); + txtVar.sprintf(fmt,var1%tmp); //变量1 + } + else if(varType==2){ + int var2 = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); + txtVar.sprintf(fmt,var2%tmp); //变量2 + } + else if(varType==3) + { //日期 +// txtVar.sprintf("%04d%02d%02d",sysPara->status.calandar_and_dat.year, +// sysPara->status.calandar_and_dat.month, +// sysPara->status.calandar_and_dat.day); + QHash dateFormat; + dateFormat.insert(0,"yyyy-MM-dd"); + dateFormat.insert(1,"yyyy/MM/dd"); + dateFormat.insert(2,"yyyyMMdd"); + dateFormat.insert(3,"yyyy年MM月dd日"); + dateFormat.insert(4,"yyyy-MM-dd hh:mm"); + dateFormat.insert(5,"yyyy/MM/dd hh:mm"); + dateFormat.insert(6,"yyyyMMddhhmm"); + dateFormat.insert(7,"yyyy年MM月dd日 hh:mm"); + dateFormat.insert(8,"hh:mm"); + dateFormat.insert(9,"dd MM yy"); + dateFormat.insert(10,"dd/MM/yy"); + dateFormat.insert(11,"dd/MM/yyyy"); + dateFormat.insert(12,"dd-MM-yy"); + dateFormat.insert(13,"dd-MM-yyyy"); + + txtVar = QDateTime::currentDateTime().toString(dateFormat.value(sysPara->para.ExpirySplitMode)); + } + else if(varType==4) + { //时间 +// txtVar.sprintf("%02d%02d",sysPara->status.calandar_and_dat.hour, +// sysPara->status.calandar_and_dat.minute); + //sysPara->status.calandar_and_dat.second); + txtVar = QDateTime::currentDateTime().toString("hh:mm"); + } + else {} + + } + return txtVar; +} + +/* + * Do it all in one step + */ +int QBarCode::Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags) +{ + struct Barcode_Item * bc; + + if (!(bc=Barcode_Create(text))) { + qDebug()<<"mem less then:";//<< -ENOMEM ; + return -1; + } + + if ( Barcode_Position(bc, wid, hei, xoff, yoff, 0.0) < 0 + || Barcode_Encode(bc, flags) < 0 + //|| Barcode_Print(bc, f, flags) < 0 + ) { + qDebug()<<"EnCode Error:"<< bc->error; + Barcode_Delete(bc); + return -1; + } + //QFile f1; + bcText = text; + bcTextinfo = bc->textinfo; + bcPartial = bc->partial; + Barcode_ToImage(bc);// KEY + Barcode_Delete(bc); + return 0; +} +// 将条形码编码转换成点阵图形 +int QBarCode::Barcode_ToImage(Barcode_Item * bc ){ + + bc->ascii; + bc->partial; + bc->textinfo; + int len =QString(bc->partial).length(); + + QString txt = bc->ascii; + txt = txt.trimmed(); + + inkColor = ui->comboBoxInkColor->currentIndex()?1:0; + int xoffset = inkColor?16:8; + int bcWidth1 =0; + for(int i=0;ipartial[i]&0x0f); + + bcHeight = dotn[ui->BarCodeHeigh->currentIndex()] ;//+(inkColor?xoffset/2:0); + bcWidth = xoffset + bcWidth1*(1+ui->BarCodeDot->currentIndex()); + + QImage image(bcWidth,bcHeight,QImage::Format_ARGB32); + // inkColor --白墨 + //if(inkColor) + { + for(int j=0;j<=bcHeight-1;j++){ + for(int n=0;( nBarCodeDot->currentIndex()); + int xx=xoffset>>1; + int yoffset =0;//(inkColor?xx-1:0); + unsigned char py= inkColor?bcHeight-1:bcHeight-1; + for(int j=yoffset;j<=py ;j++){ + i=xx; + for(int n=0;( npartial[n])&0x07; + c = c*DotNum; + if(n&0x01) { + for(int r=0;rcheckBoxAddText->isChecked()) + { + OnCharRamData(&image); // add text + } + //OnCharRamData2(&image,txtWidth,height); // add text + //ShowBarCode(&image); + imgBar = image.copy(image.rect()); + + if(AutoCount1 && pInkJectPrinter->modbus->modbus_up_QRCODE == 0) + { + imgBar.setPixel(0,imgBar.height()-1,BARFLAG); // 设置定位标志 + //qDebug()<<"Barcode_ToImage:x,y"<15) fileName= fileName.left(15); + fileName.remove(QRegExp("/")); + fileName.remove(QRegExp("\\")); + ui->labFileName->setText(fileName+".bmp" ); + this->pictureName = "/home/plg/doc/"+ fileName + ".bmp" ; + + QString s2=""; + imgBar.rgbSwapped(); + if(pInkJectPrinter->modbus->modbus_up_QRCODE == 1) + { +// qDebug()<<"save modbusQR"; + s2 = "modbusQR.bmp"; + this->pictureName=DOC_ROOT_DIR+s2; + imgBar.save(pictureName); + pInkJectPrinter->modbus->modbus_up_QRCODE = 0; + } + else + { + imgBar.save(this->pictureName); + } + //qDebug()<<"svae imag"<BarCodeType->currentIndex()*100 )); + + sysPara->saveParaToFile(); +} + + +void QBarCode::onScaleChange(int n){ + //ShowBarCode("tmp.bmp"); + if(bcOK==0) + onEnCodeBar(); + ShowBarCode(&imgBar); +} + +void QBarCode::onXposChange(int n){ + //ShowBarCode(this->pictureName); + //emit onEnCodeBar(); + if(AutoRefresh) { + onEnCodeBar(); + // ui->lineEdit->setFocus(); + } +} + +void QBarCode::SetOption(bcOption_t *bcOption){ + + AutoCount1=bcOption->var1En | bcOption->var2En; + + //ui->checkBoxInsertFlag->setChecked(1);//bcOption->AutoCount + //ui->BarCodeFont->setCurrentIndex(bcOption->font); + if(bcOption->height<7) ui->BarCodeHeigh->setCurrentIndex(bcOption->height); + else qDebug()<<"SetOption height"<height; + ui->BarCodeType->setCurrentIndex(bcOption->type); + ui->BarCodeScale->setValue(bcOption->scale); + ui->comboBoxInkColor->setCurrentIndex(bcOption->InkColor?1:0); + QString s1=bcOption->text; + ui->lineEditModule->setText(bcOption->TxtModule); + ui->lineEditLine->setText(bcOption->TxtLine); + ui->lineEditLine1->setText(bcOption->TxtLine1); + if(sysPara) + { + sysPara->para.bcOption.var1Type =1; + sysPara->para.bcOption.var2Type =2; + + txtVar1=getVarTxt(bcOption->var1En,bcOption->var1Type); + ui->lineEditVar1->setText(txtVar1); + txtVar2=getVarTxt(bcOption->var2En,bcOption->var2Type); + ui->lineEditVar2->setText(txtVar2); + + ui->BarCodeVarEN1->setChecked(bcOption->var1En); + ui->BarCodeVarEN2->setChecked(bcOption->var2En); + } + else qDebug()<<"no para init."; + + if(s1.length()>15) s1 = s1.left(15); + s1 +=".bmp"; + this->pictureName=DOC_ROOT_DIR+s1; + //onEnCodeBar(); + AutoRefresh = AUTOREF; + + sysPara->para.isCheckBarCodeAddText ? ui->checkBoxAddText->setChecked(true) : ui->checkBoxAddText->setChecked(false); + ui->checkBoxBarDate->setChecked(sysPara->para.isCheckBarDate); + ui->checkBoxBarTime->setChecked(sysPara->para.isCheckBarTime); +} + +void QBarCode::GetOption(bcOption_t *bcOption){ + bcOption->height = ui->BarCodeHeigh->currentIndex(); + bcOption->type = ui->BarCodeType->currentIndex(); + bcOption->InkColor = ui->comboBoxInkColor->currentIndex()?1:0; + bcOption->AutoCount = 1; + + bcOption->var1En = ui->BarCodeVarEN1->isChecked(); + bcOption->var2En = ui->BarCodeVarEN2->isChecked(); + + snprintf(bcOption->text,sizeof(bcOption->text),"%s",bcText.toAscii().constData()); + if(sysPara){ + snprintf(bcOption->TxtModule,sizeof(bcOption->TxtModule),"%s",ui->lineEditModule->text().toAscii().constData()); + snprintf(bcOption->TxtLine,sizeof(bcOption->TxtLine),"%s",ui->lineEditLine->text().toAscii().constData()); + snprintf(bcOption->TxtLine1,sizeof(bcOption->TxtLine1),"%s",ui->lineEditLine1->text().toAscii().constData()); + } + + sysPara->para.isCheckBarCodeAddText = ui->checkBoxAddText->isChecked() ? true : false; + sysPara->para.isCheckBarDate = ui->checkBoxBarDate->isChecked(); + sysPara->para.isCheckBarTime = ui->checkBoxBarTime->isChecked(); +} + +void QBarCode::GetOption2(bcPara_t *bcOption){ + bcOption->height = imgBar.height(); + bcOption->type = ui->BarCodeType->currentIndex(); + //bcOption->InkColor = ui->comboBoxInkColor->currentIndex()?1:0; + bcOption->width = imgBar.width(); + //snprintf(bcOption->text,sizeof(bcOption->text),"%s",bcText.toAscii().constData()); +} +void QBarCode::on_pushBtnColse_pressed() +{ + flagInsert = ui->checkBoxInsertFlag->checkState()?1:0; + + //ui->checkBoxInsertFlag->setChecked(0); + //qDebug()<<"flagInsert"<checkBoxInsertFlag->checkState(); + //flagCount = ui + emit onBarCodeClose(); + this->close(); + AutoRefresh = false; + bcOK = false; +} +void QBarCode::onBarCodeRefresh(QString s){ + if(AutoRefresh) + { + //onEnCodeBar(); + //ui->lineEdit->setFocus(); + } + //ui->label_Txt->setText(bcText); +} + +void QBarCode::extSetText(QString text) +{ + //ui->comboBoxType->setCurrentIndex(1); + //ui->lineEditIn->setText(text); + //ui->lineEditIn2->setText(""); + //ui->lineEditCNT->setText(""); +// QString strTxt=ui->lineEditModule->text(); + + if(sysPara->para.isCheckInsertTime) + { + //ui->lineEditLine->setText(text); + } + else + { + ui->lineEditModule->setText(text); + ui->lineEditLine->setText(""); + ui->BarCodeVarEN1->setChecked(false); + } + ui->lineEditLine1->setText(""); + ui->BarCodeVarEN2->setChecked(false); + + pInkJectPrinter->modbus->modbus_up_QRCODE =1; + + emit onEnCodeBar(); + emit ImgSave(); +} + +void QBarCode::setFontSize(int PixelSize) +{ + fontSize = PixelSize; +} +int QBarCode::ImgLeftPos(QImage *img){ + int firstValidCol=0; + bool found =0; + int w = img->width(); + int h = img->height(); + unsigned char *dat = img->bits(); //if( *(dat+ j*4 + k*w*4 ) ==0x00 ) + for(int j = 0; j pixel(j,k); if((rgb&0x00ffffff)==0){ + if( *(dat+ j*4 + k*w*4 ) ==0x00 ) { + if(j>firstValidCol) firstValidCol = j ; + found=1; + break; + } + } + if(found) break; + } + return firstValidCol; +} + +int QBarCode::ImgRightPos(QImage *img){ + int lastValidCol=0; + bool found=0; + int scnt=0; + int w = img->width(); + int h = img->height(); + lastValidCol = w-1; + unsigned char *dat = img->bits(); //if( *(dat+ j*4 + k*w*4 ) ==0x00 ) + for(int j = w-1; j>0; j --){ + for(int k =0; k < h ; k++){ + scnt++; + //QRgb rgb = img->pixel(j,k); + //if((rgb&0x00ffffff)==0){ + if( *(dat+ j*4 + k*w*4 ) ==0x00 ) + { + if(jdrawContents (&painter,image.rect() ); //将text写到picimage.rect() + textEdit.hide(); + int xoff=0; + int lastValidRow = (bcHeight>height)? height + (bcHeight-height)/2: height; + // height + int startValidRow = (bcHeight>height)? (bcHeight-height)/2: 0; + ui->labStatus->setText(tr("标签宽度:%1,标签高度:%2,文本宽度:%3").arg(bcWidth).arg(height+bcHeight).arg(Txtwidth));// 文本宽度 标签宽度 条码宽度 + xoff =bcWidth+inkColor*4 ; + for(int k = 0; k < height; k++){ + for(int j = 0; j < Txtwidth; j ++){ + QRgb rgb = image.pixel(j,k); + img1->setPixel( xoff+j,startValidRow+k,rgb); + } + } + +} + +// Test +void QBarCode::OnCharRamData(QImage *img1){/* 生成字模数据 */ + textEdit.document()->setDocumentMargin(0); + int Txtwidth ; + //int height = bcHeight<16?bcHeight:16; + int height = fontSize; + int letterSpace=1 ; + textEdit.clear(); + int DPI = textEdit.logicalDpiX(); + DPI = DPI?DPI:1; //Pixel = DPI * Point / 72 + QFont font = textEdit.font(); + textEdit.insertHtml(QString("%4") + .arg(Public::getFontFamily(height)).arg(height*72/DPI).arg(400).arg(bcText)); //600表示加粗,400表示普通 + + font = textEdit.font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,letterSpace); + font.setFamily(Public::getFontFamily(height)); + font.setPixelSize(height); + font.setWeight(QFont::Normal); + textEdit.setFont(font); + QFontMetrics fontMetrics(font); + Txtwidth = (fontMetrics.width(bcText)); + QSize size(Txtwidth+(Txtwidth>>2),height+bcHeight); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff); + QPainter painter(&image); + textEdit.setGeometry(0,0,1000,50); + textEdit.show(); //如果不显示,似乎不会绘制 + textEdit.setFixedWidth(image.rect().width()); + textEdit.document()->drawContents (&painter,image.rect() ); //将text写到picimage.rect() + textEdit.hide(); + Txtwidth = ImgRightPos(&image); + image.save("./QbarCodemage.bmp"); + int xoff=0; + int lastValidRow = height +bcHeight; + //img1->rect() + ui->labStatus->setText(tr("标签宽度:%1,标签高度:%2,文本宽度:%3").arg(bcWidth).arg(height+bcHeight).arg(Txtwidth));// 文本宽度 标签宽度 条码宽度 + if( bcWidth >= Txtwidth ) + { + xoff = (bcWidth-Txtwidth)/2; +// for(int k = 0; k < height; k++){ +// for(int j = 0; j < Txtwidth; j ++){ +// QRgb rgb = image.pixel(j,k); +// if((j+xoff)setPixel( xoff+j,k+bcHeight,rgb); +// } + +// } + QImage qimg3 = QImage(bcWidth, height+bcHeight + 1, QImage::Format_RGB32); + qimg3.fill(0xffffff); + + QPainter p(&qimg3); + + p.drawPixmap(0, 0, img1->width(), img1->height(), QPixmap::fromImage(*img1)); + + p.drawPixmap(xoff, bcHeight + 1, image.width(), image.height(), QPixmap::fromImage(image)); + + //QPixmap pix3 = QPixmap::fromImage(qimg3); + //ui->label_dislocation->setPixmap(pix3.scaled(ui->label_dislocation->width(), ui->label_dislocation->height(), Qt::KeepAspectRatio)); + *img1 = qimg3.copy(0,0,qimg3.width(),qimg3.height()); + + img1->save("./QbarCodemage1.bmp"); + } + else { + int h1 = lastValidRow-1; //24 9 + for(int k = h1; k >= bcHeight; k--){ + for(int j = 0; j < Txtwidth; j ++){ + QRgb rgb = image.pixel(j,k-bcHeight); + image.setPixel( j,k,rgb); + image.setPixel(j,k-bcHeight,0x00ffffff); + } + } // dd djfdkf djfdkf二维码 + xoff = (Txtwidth-bcWidth)/2; + for(int k = 0; k < bcHeight; k++){ + +// if(inkColor){ +// if(kpixel(j,k); + if((xoff+j)save("./QbarCodemage2.bmp"); + } +} +void QBarCode::ShowBarCode(QString fileName) +{ + //scene = new QGraphicsScene; + scene->clear(); + int scale = ui->BarCodeScale->value(); + scene->setSceneRect( 0,0,bcWidth*(scale),bcHeight*(scale+1)+10); + scene->setItemIndexMethod(QGraphicsScene::NoIndex); + //QPixmap pixmap(QPixmap::fromImage(*img)); + QPixmap pixmap(fileName); + pixmap = pixmap.scaledToHeight(bcHeight*(scale+1)); + /***************设置view的场景*****************************/ + ui->BarCodeView->setScene(scene); + ui->BarCodeView->setRenderHint(QPainter::Antialiasing); + ui->BarCodeView->setCacheMode(QGraphicsView::CacheBackground); + ui->BarCodeView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + ui->BarCodeView->setDragMode(QGraphicsView::ScrollHandDrag); + //ui->graphicsView->resize(400,300); + ui->BarCodeView->setScene(scene);//设置view的场景 + +} +void QBarCode::ShowBarCode(QImage *img) +{ + //scene = new QGraphicsScene; + scene->clear(); + int scale = ui->BarCodeScale->value(); + scene->setSceneRect( 0,0,bcWidth*(scale+1)+10,bcHeight*(scale)); + scene->setItemIndexMethod(QGraphicsScene::NoIndex); + QPixmap pixmap(QPixmap::fromImage(*img)); + //pixmap = pixmap.scaledToHeight(bcHeight*(scale+1)); + pixmap = pixmap.scaledToWidth((scale+1)*bcWidth); + item = scene->addPixmap(pixmap); + /***************设置view的场景*****************************/ + ui->BarCodeView->setScene(scene); + ui->BarCodeView->setRenderHint(QPainter::Antialiasing); + ui->BarCodeView->setCacheMode(QGraphicsView::CacheBackground); + ui->BarCodeView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + ui->BarCodeView->setDragMode(QGraphicsView::ScrollHandDrag); + //ui->graphicsView->resize(400,300); + ui->BarCodeView->setScene(scene);//设置view的场景 +} + + +QString QBarCode::TextToBCImg(bcOption_t *bcVar,QString txt) +{ + + if(txt.isEmpty()){txt = "";return txt;} + // 转换条形码 + // ---- + int index = bcVar->barType; + + TextBarCode(txt, index); + //bcVar->width = imgBar.width(); + //bcVar->height = imgBar.height(); + bcWidth = imgBar.width(); + bcHeight = imgBar.height(); + //qDebug()<<"TextToBCImg"<status.printDat; + unsigned char *dat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + int w= imgBar.width(); + int h= imgBar.height(); + int n=0; + int hStart=0; + int wStart=0; + //qDebug()< + +#include "BarCode/barcode.h" +#include "QGraphicsScene" +#include "QGraphicsPixmapItem" +#include "SysPara.h" +#include "QTextEdit" +#include "ParaSettingUI.h" + +//typedef struct // BarCodeOption +//{ +// unsigned char xpos; +// unsigned char font; +// unsigned char height; +// unsigned char scale; +// unsigned char text[200]; +//}bcOption_t; +typedef struct { + unsigned int width; + unsigned char height; + unsigned char type; + unsigned char nc; +}bcPara_t; + +namespace Ui { + class QBarCode; +} + +class QBarCode : public QDialog, public ParaSettingUI +{ + Q_OBJECT + +public: + explicit QBarCode(QWidget *parent = 0); + ~QBarCode(); + void bindSysPara(SysPara *sysPara); + //unsigned char pointMap[40*1000]; + QString pictureName;//当前显示的图片 + void SetOption(bcOption_t *bcOption); + void GetOption(bcOption_t *bcOption); + QString bcText; + int bcWidth,bcHeight; + unsigned char flagInsert:1; + unsigned char flagCount:1; + unsigned char inkColor:1; + unsigned char flagNC:5; + + int ImgRightPos(QImage *img); + int ImgLeftPos(QImage *img); + int getDat(unsigned char *dat,int varNum); + int getDat2(SysPara* sysPara,int varNum); +public: + QImage imgBar; + + QString TextToBCImg(bcOption_t *bcVar,QString txt); + void TextBarCode(QString txt, int index); + void GetOption2(bcPara_t *bcOption); + QString getLabe_TxtString(); + QString getVarTxt(bool varEn, unsigned varType);// 0,1,2,3,4 + void extSetText(QString text); + public slots: + void setFontSize(int PixelSize); +private slots: + void onEnCodeBar(); + void onScaleChange(int n); + void onXposChange(int n); + void on_pushBtnColse_pressed(); + void ImgSave(); + void onBarCodeRefresh(QString s); +signals: + void onBarCodeClose(); +private: + + void OnCharRamData(QImage *img); + void OnCharRamData1(QImage *img); + void OnCharRamData2(QImage *img1,int Txtwidth,int height); + void ShowBarCode(QString fileName); + void ShowBarCode(QImage *img); + int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags); + int Barcode_ToImage(Barcode_Item * bc ); + int fontSize; + + QGraphicsScene *scene;//声明scene + QGraphicsPixmapItem *item;//声明item + bool bcOK; + QString bcPartial; + QString bcTextinfo; + bool AutoRefresh; + QTextEdit textEdit; + QString txtVar1,txtVar2; + +private: + Ui::QBarCode *ui; +}; + +#endif // QBARCODE_H diff --git a/QBarCode.ui b/QBarCode.ui new file mode 100644 index 0000000..e5d7fb4 --- /dev/null +++ b/QBarCode.ui @@ -0,0 +1,382 @@ + + + QBarCode + + + Qt::NonModal + + + + 0 + 0 + 710 + 350 + + + + + 16777215 + 400 + + + + Qt::StrongFocus + + + Dialog + + + + :/image/BarCode1.png:/image/BarCode1.png + + + false + + + + + + + + 条形码类型 + + + + + + + 条形码高度 + + + + + + + 条码宽度 + + + + + + + + 0 + 0 + + + + + 140 + 0 + + + + + + + + + + + + 1点 + + + + + 2点 + + + + + 3点 + + + + + 4点 + + + + + 5点 + + + + + 6点 + + + + + + + + 文本1 + + + Qt::AlignCenter + + + + + + + + 16777215 + 172 + + + + + + + + 20 + + + + + + + + 60 + 16777215 + + + + false + + + false + + + 1 + + + 10 + + + 1 + + + + + + + 显示缩放 + + + + + + + 墨水类型 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 1 + + + + 黑墨 + + + + + 白墨 + + + + + + + + + + + 文本3 + + + Qt::AlignCenter + + + + + + + false + + + + 80 + 16777215 + + + + + + + + Qt::LeftToRight + + + 计数器2 + + + + + + + + + + 文本2 + + + Qt::AlignCenter + + + + + + + false + + + + 80 + 16777215 + + + + + + + + Qt::LeftToRight + + + 计数器1 + + + + + + + Qt::LeftToRight + + + 插入文档 + + + + + + + 预览 + + + true + + + true + + + + + + + 返回 + + + + + + + 条码保存 + + + + + + + + 16777215 + 16 + + + + + + + + + + + + 16777215 + 16 + + + + FileName + + + Qt::AlignCenter + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + 增加数字行 + + + + + + + 日期 + + + + + + + 时间 + + + + + + + + + + diff --git a/QtQREnCode/121.pro b/QtQREnCode/121.pro new file mode 100644 index 0000000..758982d --- /dev/null +++ b/QtQREnCode/121.pro @@ -0,0 +1,49 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2013-04-25T18:27:50 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = 121 +TEMPLATE = app + + +SOURCES +=\ + bitstream.cpp \ + mask.cpp \ + qrenc.cpp \ + qrencode.cpp \ + qrinput.cpp \ + qrspec.cpp \ + rscode.cpp \ + split.cpp \ + mainwindow.cpp + +HEADERS += \ + bistream.h \ + mask.h \ + qrencode_inner.h \ + qrinput.h \ + qrspec.h \ + rscode.h \ + split.h \ + mainwindow.h + + + + + + +unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lqrencode + +INCLUDEPATH += $$PWD/../../../../../../../usr/local/include +DEPENDPATH += $$PWD/../../../../../../../usr/local/include + +unix:!macx: LIBS += -lpng12 + +FORMS += \ + mainwindow.ui diff --git a/QtQREnCode/bistream.h b/QtQREnCode/bistream.h new file mode 100644 index 0000000..e8362c8 --- /dev/null +++ b/QtQREnCode/bistream.h @@ -0,0 +1,43 @@ +#ifndef BISTREAM_H +#define BISTREAM_H + +/* + * qrencode - QR Code encoder + * + * Binary sequence class. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __BITSTREAM_H__ +#define __BITSTREAM_H__ + +typedef struct { + char *data; +} BitStream; + +extern BitStream *BitStream_new(void); +extern void BitStream_append(BitStream *bstream, BitStream *arg); +extern void BitStream_appendNum(BitStream *bstream, int bits, unsigned int num); +extern void BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data); +extern unsigned int BitStream_size(BitStream *bstream); +extern unsigned char *BitStream_toByte(BitStream *bstream); +extern void BitStream_free(BitStream *bstream); + +#endif /* __BITSTREAM_H__ */ + + +#endif // BISTREAM_H diff --git a/QtQREnCode/bitstream.cpp b/QtQREnCode/bitstream.cpp new file mode 100644 index 0000000..d2feac9 --- /dev/null +++ b/QtQREnCode/bitstream.cpp @@ -0,0 +1,180 @@ +/* + * qrencode - QR Code encoder + * + * Binary sequence class. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "bistream.h" + +BitStream *BitStream_new(void) +{ + BitStream *bstream; + + bstream = (BitStream *)malloc(sizeof(BitStream)); + bstream->data = NULL; + + return bstream; +} + +static BitStream *BitStream_newFromNum(int bits, unsigned int num) +{ + unsigned int mask; + int i; + char *p; + BitStream *bstream; + + bstream = BitStream_new(); + bstream->data = (char *)malloc(bits + 1); + + p = bstream->data; + mask = 1 << (bits - 1); + for(i=0; i> 1; + } + *p = '\0'; + + return bstream; +} + +static BitStream *BitStream_newFromBytes(int size, unsigned char *data) +{ + unsigned char mask; + int i, j; + char *p; + BitStream *bstream; + + bstream = BitStream_new(); + bstream->data = (char *)malloc(size * 8 + 1); + + p = bstream->data; + for(i=0; i> 1; + } + } + *p = '\0'; + + return bstream; +} + +void BitStream_append(BitStream *bstream, BitStream *arg) +{ + int l1, l2; + char *_new; + + if(arg == NULL || arg->data == NULL) { + return; + } + if(bstream->data == NULL) { + bstream->data = strdup(arg->data); + return; + } + + l1 = strlen(bstream->data); + l2 = strlen(arg->data); + _new = (char *)malloc(l1 + l2 + 1); + strcpy(_new, bstream->data); + strcat(_new, arg->data); + + free(bstream->data); + bstream->data = _new; +} + +void BitStream_appendNum(BitStream *bstream, int bits, unsigned int num) +{ + BitStream *b; + + b = BitStream_newFromNum(bits, num); + BitStream_append(bstream, b); + BitStream_free(b); +} + +void BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data) +{ + BitStream *b; + + b = BitStream_newFromBytes(size, data); + BitStream_append(bstream, b); + BitStream_free(b); +} + +unsigned int BitStream_size(BitStream *bstream) +{ + if(bstream->data == NULL) return 0; + + return strlen(bstream->data); +} + +unsigned char *BitStream_toByte(BitStream *bstream) +{ + int i, j, size, bytes; + unsigned char *data, v; + char *p; + + size = BitStream_size(bstream); + data = (unsigned char *)malloc((size + 7) / 8); + bytes = size / 8; + + p = bstream->data; + for(i=0; idata != NULL) { + free(bstream->data); + } + free(bstream); +} + diff --git a/QtQREnCode/form.ui b/QtQREnCode/form.ui new file mode 100644 index 0000000..f7d2e81 --- /dev/null +++ b/QtQREnCode/form.ui @@ -0,0 +1,19 @@ + + + Form + + + + 0 + 0 + 662 + 388 + + + + Form + + + + + diff --git a/QtQREnCode/main.cpp b/QtQREnCode/main.cpp new file mode 100644 index 0000000..b48f94e --- /dev/null +++ b/QtQREnCode/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/QtQREnCode/mainwindow.cpp b/QtQREnCode/mainwindow.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/QtQREnCode/mainwindow.cpp @@ -0,0 +1 @@ + diff --git a/QtQREnCode/mainwindow.h b/QtQREnCode/mainwindow.h new file mode 100644 index 0000000..ed42168 --- /dev/null +++ b/QtQREnCode/mainwindow.h @@ -0,0 +1,25 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private slots: + void on_pushButton_clicked(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/QtQREnCode/mainwindow.ui b/QtQREnCode/mainwindow.ui new file mode 100644 index 0000000..2adb789 --- /dev/null +++ b/QtQREnCode/mainwindow.ui @@ -0,0 +1,173 @@ + + + MainWindow + + + + 0 + 0 + 565 + 435 + + + + MainWindow + + + + + + 330 + 350 + 99 + 27 + + + + encode + + + + + + 10 + 290 + 541 + 51 + + + + + + + 20 + 270 + 67 + 17 + + + + Message + + + + + + 450 + 240 + 85 + 27 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + + + 310 + 240 + 85 + 27 + + + + + L + + + + + M + + + + + H + + + + + Q + + + + + + + 370 + 240 + 67 + 17 + + + + size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 230 + 250 + 67 + 17 + + + + level: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 40 + 10 + 431 + 211 + + + + TextLabel + + + + + + + 0 + 0 + 565 + 23 + + + + + + + + diff --git a/QtQREnCode/mask.cpp b/QtQREnCode/mask.cpp new file mode 100644 index 0000000..56a07d9 --- /dev/null +++ b/QtQREnCode/mask.cpp @@ -0,0 +1,257 @@ +/* + * qrencode - QR Code encoder + * + * Masking. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include "qrencode.h" +#include "qrencode_inner.h" +#include "qrspec.h" +#include "mask.h" + +/** + * Demerit coefficients. + * See Section 8.8.2, pp.45, JIS X0510:2004. + */ +#define N1 (3) +#define N2 (3) +#define N3 (40) +#define N4 (10) + +#define MASKMAKER(__exp__) \ + int x, y;\ + unsigned int b = 0;\ +\ + for(y=0; y= 5) { + demerit += N1 + (runLength[i] - 5); + //n1 += N1 + (runLength[i] - 5); + } + if((i & 1)) { + if(i >= 3 && i < length-2 && (runLength[i] % 3) == 0) { + fact = runLength[i] / 3; + if(runLength[i-2] == fact && + runLength[i-1] == fact && + runLength[i+1] == fact && + runLength[i+2] == fact) { + if(runLength[i-3] < 0 || runLength[i-3] >= 4 * fact) { + demerit += N3; + //n3 += N3; + } else if(i+3 >= length || runLength[i+3] >= 4 * fact) { + demerit += N3; + //n3 += N3; + } + } + } + } + } + + return demerit; +} + +int Mask_evaluateSymbol(int width, unsigned char *frame) +{ + int x, y; + unsigned char *p; + unsigned char b22, w22; + unsigned int i; + int head; + int demerit = 0; + + p = frame; + i = 0; + for(y=0; y 0 && y > 0) { + b22 = p[0] & p[-1] & p[-width] & p [-width-1]; + w22 = p[0] | p[-1] | p[-width] | p [-width-1]; + if((b22 | (w22 ^ 1))&1) { + demerit += N2; + } + } + if(x == 0 && (p[0] & 1)) { + runLength[0] = -1; + head = 1; + runLength[head] = 1; + } else if(x > 0) { + if((p[0] ^ p[-1]) & 1) { + head++; + runLength[head] = 1; + } else { + runLength[head]++; + } + } + p++; + } + demerit += Mask_calcN1N3(head+1, runLength); + } + + i = 0; + for(x=0; x 0) { + if((p[0] ^ p[-width]) & 1) { + head++; + runLength[head] = 1; + } else { + runLength[head]++; + } + } + p+=width; + } + demerit += Mask_calcN1N3(head+1, runLength); + } + + return demerit; +} + +unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level) +{ + int i; + unsigned char *mask, *bestMask; + int minDemerit = INT_MAX; + int bestMaskNum = 0; + int blacks; + int demerit; + + bestMask = NULL; + + for(i=0; i<8; i++) { +// n1 = n2 = n3 = n4 = 0; + demerit = 0; + mask = (unsigned char *)malloc(width * width); + blacks = maskMakers[i](width, frame, mask); + blacks += QRcode_writeFormatInformation(width, mask, i, level); + blacks = 100 * blacks / (width * width); + demerit = (abs(blacks - 50) / 5) * N4; +// n4 = demerit; + if(demerit > minDemerit) { + free(mask); + continue; + } + demerit += Mask_evaluateSymbol(width, mask); +// printf("(%d,%d,%d,%d)=%d\n", n1, n2, n3 ,n4, demerit); + if(demerit < minDemerit) { + minDemerit = demerit; + bestMaskNum = i; + if(bestMask != NULL) { + free(bestMask); + } + bestMask = mask; + } else { + free(mask); + } + } + + return bestMask; +} + diff --git a/QtQREnCode/mask.h b/QtQREnCode/mask.h new file mode 100644 index 0000000..7c545c0 --- /dev/null +++ b/QtQREnCode/mask.h @@ -0,0 +1,37 @@ +#ifndef MASK_H +#define MASK_H + +/* + * qrencode - QR Code encoder + * + * Masking. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __MASK_H__ +#define __MASK_H__ + +#include "qrinput.h" + +extern unsigned char *Mask_makeMask(int width, unsigned char *frame, int mask); +extern int Mask_evaluateSymbol(int width, unsigned char *frame); +extern unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level); + +#endif /* __MASK_H__ */ + + +#endif // MASK_H diff --git a/QtQREnCode/qrenc.cpp b/QtQREnCode/qrenc.cpp new file mode 100644 index 0000000..6e17d2b --- /dev/null +++ b/QtQREnCode/qrenc.cpp @@ -0,0 +1,216 @@ + +#include +#include + +#include +#include +#include +#include +#include "mainwindow.h" +#include +#include "ui_mainwindow.h" + +char *intext = " "; +static int casesensitive = 0; +static int eightbit = 0; +static int kanji = 0; +static int version = 0; +static int Size = 3; +static int margin = 4; +static QRecLevel level = QR_ECLEVEL_L; + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + ui->textEdit->setText(tr("1234567893233695")); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +enum { + O_HELP, + O_OUTPUT, + O_SIZE, + O_VERSION, + O_LEVEL, + O_MARGIN, + O_KANJI, + O_CASE, + O_8BIT, +}; + +static const struct option options[] = { + {"h", no_argument , NULL, O_HELP}, + {"o", required_argument, NULL, O_OUTPUT}, + {"l", required_argument, NULL, O_LEVEL}, + {"s", required_argument, NULL, O_SIZE}, + {"v", required_argument, NULL, O_VERSION}, + {"m", required_argument, NULL, O_MARGIN}, + {"k", no_argument , NULL, O_KANJI}, + {"c", no_argument , NULL, O_CASE}, + {"8", no_argument , NULL, O_8BIT}, + {NULL, 0, NULL, 0} +}; + +static void usage(void) +{ + qDebug()<<( +"qrencode version %s\n\n" +"Usage: qrencode [OPTION]... [STRING]\n" +"Encode input data in a QR Code and save as a PNG image.\n\n" +" -h display this message.\n" +" -o FILENAME write PNG image to FILENAME. If '-' is specified, the result\n" +" will be output to standard output.\n" +" -s NUMBER specify the size of dot (pixel). (default=3)\n" +" -l {LMQH} specify error collectin level from L (lowest) to H (highest).\n" +" (default=L)\n" +" -v NUMBER specify the version of the symbol. (default=auto)\n" +" -m NUMBER specify the width of margin. (default=4)\n" +" -k assume that the input text contains kanji (shift-jis).\n" +" -c encode alphabet characters in 8-bit mode. If your application\n" +" is case-sensitive, choose this.\n" +" -8 encode entire data in 8-bit mode. -c and -k will be ignored.\n" +" [STRING] input data. If it is not specified, data will be taken from\n" +" standard input.\n" + ); +} + +#define MAX_DATA_SIZE 7090 /* from the specification */ +static char *readStdin(void) +{ + char *buffer; + int ret; + + buffer = (char *)malloc(MAX_DATA_SIZE); + ret = fread(buffer, 1, MAX_DATA_SIZE, stdin); + if(ret == 0) { + fprintf(stderr, "No input data.\n"); + exit(1); + } + if(!feof(stdin)) { + fprintf(stderr, "Input data is too large.\n"); + exit(1); + } + + buffer[ret] = '\0'; + + return buffer; +} + +static QRcode *encode(const char *intext) +{ + QRencodeMode hint; + QRcode *code; + + if(kanji) { + hint = QR_MODE_KANJI; + } else { + hint = QR_MODE_8; + } + + if(eightbit) { + code = QRcode_encodeString8bit(intext, version, level); + } else { + code = QRcode_encodeString(intext, version, level, hint, casesensitive); + } + + return code; +} + + static void qrencode(const char *intext, const char *outfile) +{ + FILE *fp; + QRcode *qrcode; + //png_structp png_ptr; + //png_infop info_ptr; + unsigned char *row, *p, *q; + int x, y, xx, yy, bit; + int realwidth; + + qrcode = encode(intext); + if(qrcode == NULL) { + fprintf(stderr, "Failed to encode the input data.\n"); + exit(1); + } + + realwidth = (qrcode->width + margin * 2) * Size; + + row = (unsigned char *)malloc(realwidth); + + // top margin + memset(row, 0x0, realwidth ); + + qDebug()<<"1: "<< qrcode->width<width + margin * 2) * Size; + QImage QRImage(realwidth,qrcode->width*Size,QImage::Format_ARGB32 ); + QImage *img; + img = &QRImage; + img->fill(0x00ffffff); + + /* data */ + p = qrcode->data; + int ypos=0;//margin * Size; + int xpos=0; + for(y=0; ywidth; y++) { + bit = 7; + bit = 7 - (margin * Size % 8); + xpos=margin * Size; + for(x=0; xwidth; x++) { + for(xx=0; xxsetPixel(xpos,ypos+yy,0xff000000); + } + } + xpos++; + + } + p++; + bit--; + if(bit < 0) { + //q++; + bit = 7; + } + } + ypos+=Size; + } + img->save("Myqr.bmp"); + + free(row); + QRcode_free(qrcode); +} + + + void MainWindow::on_pushButton_clicked() + { + QString in; + //usage(); + in = ui->textEdit->toPlainText(); + //intext = in.toLatin1().data(); + intext = (char *)malloc(in.length()*2); + memset(intext,0,sizeof(intext)); + //intext =in.unicode(); + //memcpy(&intext[0], in.unicode (),2*in.length()); + memcpy(intext,in.toLocal8Bit().data(),2*in.length()); + + qDebug()<comboBox_size->currentIndex()+3; + qrencode(intext,outfile); + QImage img("Myqr.bmp",0); + ui->labQRImage->setPixmap( QPixmap::fromImage(img,Qt::AutoColor)); + } + +int main(int argc, char **argv) +{ + + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/QtQREnCode/qrencode.cpp b/QtQREnCode/qrencode.cpp new file mode 100644 index 0000000..21c7ef6 --- /dev/null +++ b/QtQREnCode/qrencode.cpp @@ -0,0 +1,419 @@ + +/* + * qrencode - QR Code encoder + * + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "qrencode.h" +#include "qrencode_inner.h" +#include "qrspec.h" +#include "bistream.h" +#include "qrinput.h" +#include "rscode.h" +#include "split.h" +#include "mask.h" + +/****************************************************************************** + * Raw code + *****************************************************************************/ + +static void RSblock_init(RSblock *block, int dl, unsigned char *data, int el) +{ + RS *rs; + + block->dataLength = dl; + block->data = data; + block->eccLength = el; + block->ecc = (unsigned char *)malloc(el); + + rs = init_rs(8, 0x11d, 0, 1, el, 255 - dl - el); + encode_rs_char(rs, data, block->ecc); +} + +QRRawCode *QRraw_new(QRinput *input) +{ + QRRawCode *raw; + int *spec; + int i; + RSblock *rsblock; + unsigned char *p; + + p = QRinput_getByteStream(input); + if(p == NULL) { + return NULL; + } + + raw = (QRRawCode *)malloc(sizeof(QRRawCode)); + raw->datacode = p; + spec = QRspec_getEccSpec(input->version, input->level); + raw->version = input->version; + raw->blocks = QRspec_rsBlockNum(spec); + raw->rsblock = (RSblock *)malloc(sizeof(RSblock) * raw->blocks); + + rsblock = raw->rsblock; + p = raw->datacode; + for(i=0; ib1 = QRspec_rsBlockNum1(spec); + raw->dataLength = QRspec_rsBlockNum1(spec) * QRspec_rsDataCodes1(spec) + + QRspec_rsBlockNum2(spec) * QRspec_rsDataCodes2(spec); + raw->eccLength = QRspec_rsBlockNum(spec) * QRspec_rsEccCodes1(spec); + raw->count = 0; + free(spec); + return raw; +} + +/** + * Return a code (byte). + * This function can be called iteratively. + * @param raw raw code. + * @return code + */ +unsigned char QRraw_getCode(QRRawCode *raw) +{ + int col, row; + unsigned char ret; + + if(raw->count < raw->dataLength) { + row = raw->count % raw->blocks; + col = raw->count / raw->blocks; + if(col >= raw->rsblock[row].dataLength) { + row += raw->b1; + } + ret = raw->rsblock[row].data[col]; + } else if(raw->count < raw->dataLength + raw->eccLength) { + row = (raw->count - raw->dataLength) % raw->blocks; + col = (raw->count - raw->dataLength) / raw->blocks; + ret = raw->rsblock[row].ecc[col]; + } else { + return 0; + } + raw->count++; + return ret; +} + +void QRraw_free(QRRawCode *raw) +{ + int i; + + free(raw->datacode); + for(i=0; iblocks; i++) { + free(raw->rsblock[i].ecc); + } + free(raw->rsblock); + free(raw); +} + +/****************************************************************************** + * Frame filling + *****************************************************************************/ + +typedef struct { + int width; + unsigned char *frame; + int x, y; + int dir; + int bit; +} FrameFiller; + +static FrameFiller *FrameFiller_new(int width, unsigned char *frame) +{ + FrameFiller *filler; + + filler = (FrameFiller *)malloc(sizeof(FrameFiller)); + filler->width = width; + filler->frame = frame; + filler->x = width - 1; + filler->y = width - 1; + filler->dir = -1; + filler->bit = -1; + + return filler; +} + +static unsigned char *FrameFiller_next(FrameFiller *filler) +{ + unsigned char *p; + int x, y, w; + + if(filler->bit == -1) { + filler->bit = 0; + return filler->frame + filler->y * filler->width + filler->x; + } + + x = filler->x; + y = filler->y; + p = filler->frame; + w = filler->width; + + if(filler->bit == 0) { + x--; + filler->bit++; + } else { + x++; + y += filler->dir; + filler->bit--; + } + + if(filler->dir < 0) { + if(y < 0) { + y = 0; + x -= 2; + filler->dir = 1; + if(x == 6) { + x--; + y = 9; + } + } + } else { + if(y == w) { + y = w - 1; + x -= 2; + filler->dir = -1; + if(x == 6) { + x--; + y -= 8; + } + } + } + if(x < 0 || y < 0) return NULL; + + filler->x = x; + filler->y = y; + + if(p[y * w + x] & 0x80) { + // This tail recursion could be optimized. + return FrameFiller_next(filler); + } + return &p[y * w + x]; +} + +unsigned char *FrameFiller_fillerTest(int version) +{ + int width, length; + unsigned char *frame, *p; + FrameFiller *filler; + int i, j; + unsigned char cl = 1; + unsigned char ch = 0; + + width = QRspec_getWidth(version); + frame = QRspec_newFrame(version); + filler = FrameFiller_new(width, frame); + length = QRspec_getDataLength(version, QR_ECLEVEL_L) + + QRspec_getECCLength(version, QR_ECLEVEL_L); + + for(i=0; i> 1; + } + for(i=0; i<7; i++) { + if(format & 1) { + blacks += 2; + v = 0x85; + } else { + v = 0x84; + } + frame[width * (width - 7 + i) + 8] = v; + if(i == 0) { + frame[width * 8 + 7] = v; + } else { + frame[width * 8 + 6 - i] = v; + } + format= format >> 1; + } + + return blacks; +} + +/****************************************************************************** + * QR-code encoding + *****************************************************************************/ + +static QRcode *QRcode_new(int version, int width, unsigned char *data) +{ + QRcode *qrcode; + + qrcode = (QRcode *)malloc(sizeof(QRcode)); + qrcode->version = version; + qrcode->width = width; + qrcode->data = data; + + return qrcode; +} + +void QRcode_free(QRcode *qrcode) +{ + if(qrcode == NULL) return; + + if(qrcode->data != NULL) { + free(qrcode->data); + } + free(qrcode); +} + +QRcode *QRcode_encodeMask(QRinput *input, int version, QRecLevel level, int mask) +{ + int width; + QRRawCode *raw; + unsigned char *frame, *masked, *p, code, bit; + FrameFiller *filler; + int i, j; + QRcode *qrcode; + + QRinput_setVersion(input, version); + QRinput_setErrorCorrectionLevel(input, level); + + raw = QRraw_new(input); + if(raw == NULL) { + return NULL; + } + version = raw->version; + width = QRspec_getWidth(version); + frame = QRspec_newFrame(version); + filler = FrameFiller_new(width, frame); + + /* inteleaved data and ecc codes */ + for(i=0; idataLength + raw->eccLength; i++) { + code = QRraw_getCode(raw); + bit = 0x80; + for(j=0; j<8; j++) { + p = FrameFiller_next(filler); + *p = 0x02 | ((bit & code) != 0); + bit = bit >> 1; + } + } + QRraw_free(raw); + /* remainder bits */ + j = QRspec_getRemainder(version); + for(i=0; i + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** \mainpage + * Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D + * symbology. + * + *

Encoding

+ * + * There are two ways to encode data: encoding a string or + * encoding a structured data. + * + *

Encoding a string

+ * You can encode a string by calling QRcode_encodeString(). + * The given string is parsed automatically and encoded. If you want to encode + * data that can be represented as a C string style (NUL terminated), you can + * simply use this way. + * + * If the input data contains Kanji (Shift-JIS) characters and you want to + * encode them as Kanji in QR Code, you should give QR_MODE_KANJI as a hint. + * Otherwise, all of non-alphanumeric characters are encoded as 8 bit data. + * + * Please note that a C string can not contain NUL character. If your data + * contains NUL, you should chose the second way. + * + *

Encoding a structured data

+ * You can construct a structured input data manually. If the structure of the + * input data is known, you can use this way. + * At first, you must create a ::QRinput object by QRinput_new(). Then, you can + * add input data to the QRinput object by QRinput_append(). + * Finally you can call QRcode_encodeInput() to encode the QRinput data. + * You can reuse the QRinput data again to encode it in other symbols with + * different parameters. + * + *

Result

+ * The encoded symbol is resulted as a ::QRcode object. It will contain + * its version number, width of the symbol and an array represents the symbol. + * See ::QRcode for the details. You can free the object by QRcode_free(). + * + * Please note that the version of the result may be larger than specified. + * In such cases, the input data would be too large to be encoded in the + * symbol of the specified version. + * + */ + +#ifndef __QRENCODE_H__ +#define __QRENCODE_H__ + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * Encoding mode. + */ +typedef enum { + QR_MODE_NUM = 0, ///< Numeric mode + QR_MODE_AN, ///< Alphabet-numeric mode + QR_MODE_8, ///< 8-bit data mode + QR_MODE_KANJI ///< Kanji (shift-jis) mode +} QRencodeMode; + +/** + * Level of error correction. + */ +typedef enum { + QR_ECLEVEL_L = 0, ///< lowest + QR_ECLEVEL_M, + QR_ECLEVEL_Q, + QR_ECLEVEL_H ///< highest +} QRecLevel; + +/****************************************************************************** + * Input data + *****************************************************************************/ + +/** + * Data structure to store input data. + */ +typedef struct _QRinput QRinput; + +/** + * Instantiate an input data object. + * @return input object (initialized). + */ +extern QRinput *QRinput_new(void); + +/** + * Append data to the input object. + * The data is copied and appended to the input object. + * @param input input object. + * @param mode encoding mode. + * @param size size of data (byte). + * @param data a pointer to the memory area of the input data. + * @return -1 when the input data is invalid. Otherwise, return 0. + */ +extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data); + +/** + * Free the input object. + * All of data chunks in the input object are freed too. + * @param input input object. + */ +extern void QRinput_free(QRinput *input); + +/** + * Validate the input data. + * @param mode + * @param size + * @param data + * @return result return -1 if the input is invalid. Otherwise, return 0. + */ +extern int QRinput_check(QRencodeMode mode, int size, const unsigned char *data); + +/****************************************************************************** + * QRcode output + *****************************************************************************/ + +/** + * QRcode class. + * Symbol data is represented as an array contains width*width uchars. + * Each uchar represents a module (dot). If the less significant bit of + * the uchar is 1, the corresponding module is black. The other bits are + * meaningless for usual applications, but here the specification is described. + * + *
+ * MSB 76543210 LSB
+ *     |||||||`- 1=black/0=white
+ *     ||||||`-- data and ecc code area
+ *     |||||`--- format information
+ *     ||||`---- version information
+ *     |||`----- timing pattern
+ *     ||`------ alignment pattern
+ *     |`------- finder pattern and separator
+ *     `-------- non-data modules (format, timing, etc.)
+ * 
+ */ +typedef struct { + int version; ///< version of the symbol + int width; ///< width of the symbol + unsigned char *data; ///< symbol data +} QRcode; + +/** + * Create a symbol from the input data. + * @param input input data. + * @param version version of the symbol. If 0, the library chooses the minimum + * version for the input data. + * @param level error correction level. + * @return an instance of QRcode class. The version of the result QRcode may + * be larger than the designated version. + */ +extern QRcode *QRcode_encodeInput(QRinput *input, int version, QRecLevel level); + +/** + * Create a symbol from the string. The library automatically parses the input + * string and encodes in a QR Code symbol. + * @param string input string. It should be NULL terminated. + * @param version version of the symbol. If 0, the library chooses the minimum + * version for the input data. + * @param level error correction level. + * @param hint tell the library how non-alphanumerical characters should be + * encoded. If QR_MODE_KANJI is given, kanji characters will be + * encoded as Shif-JIS characters. If QR_MODE_8 is given, all of + * non-alphanumerical characters will be encoded as is. If you want + * to embed UTF-8 string, choose this. + * @param casesensitive case-sensitive(1) or not(0). + * @return an instance of QRcode class. The version of the result QRcode may + * be larger than the designated version. + */ +extern QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive); + +/** + * Same to QRcode_qncodeString, but encode whole data in 8-bit mode. + */ +extern QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level); + +/** + * Free the instance of QRcode class. + * @param qrcode an instance of QRcode class. + */ +extern void QRcode_free(QRcode *qrcode); + +#if defined(__cplusplus) +} +#endif + +#endif /* __QRENCODE_H__ */ diff --git a/QtQREnCode/qrencode_inner.cpp b/QtQREnCode/qrencode_inner.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/QtQREnCode/qrencode_inner.cpp @@ -0,0 +1 @@ + diff --git a/QtQREnCode/qrencode_inner.h b/QtQREnCode/qrencode_inner.h new file mode 100644 index 0000000..f2b0b34 --- /dev/null +++ b/QtQREnCode/qrencode_inner.h @@ -0,0 +1,72 @@ +#ifndef QRENCODE_INNER_H +#define QRENCODE_INNER_H + +/** + * qrencode - QR Code encoder + * + * Header for internal use + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __QRENCODE_INNER_H__ +#define __QRENCODE_INNER_H__ + +/** + * This header file includes definitions for inner use. + */ + +/****************************************************************************** + * Raw code + *****************************************************************************/ + +typedef struct { + int dataLength; + unsigned char *data; + int eccLength; + unsigned char *ecc; +} RSblock; + +typedef struct { + int version; + unsigned char *datacode; + int blocks; + RSblock *rsblock; + int count; + int dataLength; + int eccLength; + int b1; +} QRRawCode; + +extern QRRawCode *QRraw_new(QRinput *input); +extern unsigned char QRraw_getCode(QRRawCode *raw); +extern void QRraw_free(QRRawCode *raw); + +/****************************************************************************** + * Frame filling + *****************************************************************************/ +extern unsigned char *FrameFiller_fillerTest(int version); + +/****************************************************************************** + * Format information + *****************************************************************************/ +extern int QRcode_writeFormatInformation(int width, unsigned char *frame, int mask, QRecLevel level); + +extern QRcode *QRcode_encodeMask(QRinput *input, int version, QRecLevel level, int mask); +#endif /* __QRENCODE_INNER_H__ */ + + +#endif // QRENCODE_INNER_H diff --git a/QtQREnCode/qrinput.cpp b/QtQREnCode/qrinput.cpp new file mode 100644 index 0000000..dc2cd06 --- /dev/null +++ b/QtQREnCode/qrinput.cpp @@ -0,0 +1,776 @@ + +/* + * qrencode - QR Code encoder + * + * Input data chunk class + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "qrencode.h" +#include "qrspec.h" +#include "bistream.h" +#include "qrinput.h" + +/****************************************************************************** + * Entry of input data + *****************************************************************************/ + +static QRinput_List *QRinput_newEntry(QRencodeMode mode, int size, const unsigned char *data) +{ + QRinput_List *entry; + + if(QRinput_check(mode, size, data)) { + return NULL; + } + + entry = (QRinput_List *)malloc(sizeof(QRinput_List)); + entry->mode = mode; + entry->size = size; + entry->data = (unsigned char *)malloc(size); + memcpy(entry->data, data, size); + entry->bstream = NULL; + entry->next = NULL; + + return entry; +} + +static QRinput_List *QRinput_freeEntry(QRinput_List *entry) +{ + QRinput_List *next; + + next = entry->next; + free(entry->data); + if(entry->bstream) { + BitStream_free(entry->bstream); + } + free(entry); + + return next; +} + +/****************************************************************************** + * Input Data + *****************************************************************************/ + +QRinput *QRinput_new(void) +{ + QRinput *input; + + input = (QRinput *)malloc(sizeof(QRinput)); + input->head = NULL; + input->tail = NULL; + input->version = 0; + input->level = QR_ECLEVEL_L; + + return input; +} + +int QRinput_getVersion(QRinput *input) +{ + return input->version; +} + +void QRinput_setVersion(QRinput *input, int v) +{ + input->version = v; +} + +void QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level) +{ + input->level = level; +} + +QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input) +{ + return input->level; +} + +int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data) +{ + QRinput_List *entry; + + entry = QRinput_newEntry(mode, size, data); + if(entry == NULL) { + return -1; + } + + if(input->tail == NULL) { + input->head = entry; + input->tail = entry; + } else { + input->tail->next = entry; + input->tail = entry; + } + + return 0; +} + +void QRinput_free(QRinput *input) +{ + QRinput_List *list; + + list = input->head; + while(list != NULL) { + list = QRinput_freeEntry(list); + } + + free(input); +} + +/****************************************************************************** + * Numeric data + *****************************************************************************/ + +/** + * Check the input data. + * @param size + * @param data + * @return result + */ +static int QRinput_checkModeNum(int size, const char *data) +{ + int i; + + for(i=0; i '9') + return -1; + } + + return 0; +} + +/** + * Estimates the length of the encoded bit stream of numeric data. + * @param size + * @return number of bits + */ +int QRinput_estimateBitsModeNum(int size) +{ + int w; + int bits; + + w = size / 3; + bits = w * 10; + switch(size - w * 3) { + case 1: + bits += 4; + break; + case 2: + bits += 7; + break; + default: + break; + } + + return bits; +} + +/** + * Convert the number data to a bit stream. + * @param entry + */ +static void QRinput_encodeModeNum(QRinput_List *entry, int version) +{ + int words; + int i; + unsigned int val; + + words = entry->size / 3; + entry->bstream = BitStream_new(); + + val = 0x1; + BitStream_appendNum(entry->bstream, 4, val); + + val = entry->size; + BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_NUM, version), val); + + for(i=0; idata[i*3 ] - '0') * 100; + val += (entry->data[i*3+1] - '0') * 10; + val += (entry->data[i*3+2] - '0'); + + BitStream_appendNum(entry->bstream, 10, val); + } + + if(entry->size - words * 3 == 1) { + val = entry->data[words*3] - '0'; + BitStream_appendNum(entry->bstream, 4, val); + } else if(entry->size - words * 3 == 2) { + val = (entry->data[words*3 ] - '0') * 10; + val += (entry->data[words*3+1] - '0'); + BitStream_appendNum(entry->bstream, 7, val); + } +} + +/****************************************************************************** + * Alphabet-numeric data + *****************************************************************************/ + +const signed char QRinput_anTable[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1 +}; + +/** + * Check the input data. + * @param size + * @param data + * @return result + */ +static int QRinput_checkModeAn(int size, const char *data) +{ + int i; + + for(i=0; isize / 2; + entry->bstream = BitStream_new(); + + val = 0x2; + BitStream_appendNum(entry->bstream, 4, val); + + val = entry->size; + BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_AN, version), val); + + for(i=0; idata[i*2 ]) * 45; + val += (unsigned int)QRinput_lookAnTable(entry->data[i*2+1]); + + BitStream_appendNum(entry->bstream, 11, val); + } + + if(entry->size & 1) { + val = (unsigned int)QRinput_lookAnTable(entry->data[words * 2]); + + BitStream_appendNum(entry->bstream, 6, val); + } +} + +/****************************************************************************** + * 8 bit data + *****************************************************************************/ + +/** + * Estimates the length of the encoded bit stream of 8 bit data. + * @param size + * @return number of bits + */ +int QRinput_estimateBitsMode8(int size) +{ + return size * 8; +} + +/** + * Convert the 8bits data to a bit stream. + * @param entry + */ +static void QRinput_encodeMode8(QRinput_List *entry, int version) +{ + int i; + unsigned int val; + + entry->bstream = BitStream_new(); + + val = 0x4; + BitStream_appendNum(entry->bstream, 4, val); + + val = entry->size; + BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_8, version), val); + + for(i=0; isize; i++) { + BitStream_appendNum(entry->bstream, 8, entry->data[i]); + } +} + + +/****************************************************************************** + * Kanji data + *****************************************************************************/ + +/** + * Estimates the length of the encoded bit stream of kanji data. + * @param size + * @return number of bits + */ +int QRinput_estimateBitsModeKanji(int size) +{ + return (size / 2) * 13; +} + +/** + * Check the input data. + * @param size + * @param data + * @return result + */ +static int QRinput_checkModeKanji(int size, const unsigned char *data) +{ + int i; + unsigned int val; + + if(size & 1) + return -1; + + for(i=0; i 0x9ffc && val < 0xe040) || val > 0xebbf) { + return -1; + } + } + + return 0; +} + +/** + * Convert the kanji data to a bit stream. + * @param entry + */ +static void QRinput_encodeModeKanji(QRinput_List *entry, int version) +{ + int i; + unsigned int val, h; + + entry->bstream = BitStream_new(); + + val = 0x8; + BitStream_appendNum(entry->bstream, 4, val); + + val = entry->size / 2; + BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_KANJI, version), val); + + for(i=0; isize; i+=2) { + val = ((unsigned int)entry->data[i] << 8) | entry->data[i+1]; + if(val <= 0x9ffc) { + val -= 0x8140; + } else { + val -= 0xc140; + } + h = (val >> 8) * 0xc0; + val = (val & 0xff) + h; + + BitStream_appendNum(entry->bstream, 13, val); + } +} + +/****************************************************************************** + * Validation + *****************************************************************************/ + +/** + * Validate the input data + * @param mode + * @param size + * @param data + * @return result + */ +int QRinput_check(QRencodeMode mode, int size, const unsigned char *data) +{ + switch(mode) { + case QR_MODE_NUM: + return QRinput_checkModeNum(size, (const char *)data); + break; + case QR_MODE_AN: + return QRinput_checkModeAn(size, (const char *)data); + break; + case QR_MODE_KANJI: + return QRinput_checkModeKanji(size, data); + break; + default: + break; + } + + return 0; +} + +QRencodeMode QRinput_identifyMode(const char *string) +{ + unsigned char c, d; + unsigned int word; + + c = string[0]; + + if((unsigned char)((signed char)c - '0') < 10) { + return QR_MODE_NUM; + } else if((QRinput_lookAnTable(c)) >= 0) { + return QR_MODE_AN; + } else { + d = string[1]; + if(d != '\0') { + word = ((unsigned int)c << 8) | d; + if((word >= 0x8140 && word <= 0x9ffc) || (word >= 0xe040 && word <= 0xebbf)) { + return QR_MODE_KANJI; + } + } + } + + return QR_MODE_8; +} + +/****************************************************************************** + * Estimation of the bit length + *****************************************************************************/ + +/** + * Estimates the length of the encoded bit stream on the current version. + * @param entry + * @param version version of the symbol + * @return number of bits + */ +static int QRinput_estimateBitStreamSizeOfEntry(QRinput_List *entry, int version) +{ + int bits = 0; + int l, m; + int num; + + switch(entry->mode) { + case QR_MODE_NUM: + bits = QRinput_estimateBitsModeNum(entry->size); + break; + case QR_MODE_AN: + bits = QRinput_estimateBitsModeAn(entry->size); + break; + case QR_MODE_8: + bits = QRinput_estimateBitsMode8(entry->size); + break; + case QR_MODE_KANJI: + bits = QRinput_estimateBitsModeKanji(entry->size); + break; + } + + l = QRspec_lengthIndicator(entry->mode, version); + m = 1 << l; + num = (bits + m - 1) / m; + + bits += num * (4 + l); // mode indicator (4bits) + length indicator + + return bits; +} + +/** + * Estimates the length of the encoded bit stream of the data. + * @param input input data + * @param version version of the symbol + * @return number of bits + */ +int QRinput_estimateBitStreamSize(QRinput *input, int version) +{ + QRinput_List *list; + int bits = 0; + + list = input->head; + while(list != NULL) { + bits += QRinput_estimateBitStreamSizeOfEntry(list, version); + list = list->next; + } + + return bits; +} + +/** + * Estimates the required version number of the symbol. + * @param input input data + * @return required version number + */ +static int QRinput_estimateVersion(QRinput *input) +{ + int bits; + int _new, prev; + + _new = 0; + do { + prev = _new; + bits = QRinput_estimateBitStreamSize(input, prev); + _new = QRspec_getMinimumVersion((bits + 7) / 8, input->level); + if (_new == -1) { + return -1; + } + } while (_new > prev); + + return _new; +} + +/****************************************************************************** + * Data conversion + *****************************************************************************/ + +/** + * Convert the input data in the data chunk to a bit stream. + * @param entry + * @return number of bits + */ +static int QRinput_encodeBitStream(QRinput_List *entry, int version) +{ + int words; + QRinput_List *st1, *st2; + + if(entry->bstream != NULL) { + BitStream_free(entry->bstream); + entry->bstream = NULL; + } + + words = QRspec_maximumWords(entry->mode, version); + if(entry->size > words) { + st1 = QRinput_newEntry(entry->mode, words, entry->data); + st2 = QRinput_newEntry(entry->mode, entry->size - words, &entry->data[words]); + QRinput_encodeBitStream(st1, version); + QRinput_encodeBitStream(st2, version); + entry->bstream = BitStream_new(); + BitStream_append(entry->bstream, st1->bstream); + BitStream_append(entry->bstream, st2->bstream); + QRinput_freeEntry(st1); + QRinput_freeEntry(st2); + } else { + switch(entry->mode) { + case QR_MODE_NUM: + QRinput_encodeModeNum(entry, version); + break; + case QR_MODE_AN: + QRinput_encodeModeAn(entry, version); + break; + case QR_MODE_8: + QRinput_encodeMode8(entry, version); + break; + case QR_MODE_KANJI: + QRinput_encodeModeKanji(entry, version); + break; + default: + break; + } + } + + return BitStream_size(entry->bstream); +} + +/** + * Convert the input data to a bit stream. + * @param input input data. + * @return length of the bit stream. + */ +static int QRinput_createBitStream(QRinput *input) +{ + QRinput_List *list; + int bits = 0; + + list = input->head; + while(list != NULL) { + bits += QRinput_encodeBitStream(list, input->version); + list = list->next; + } + + return bits; +} + +/** + * Convert the input data to a bit stream. + * When the version number is given and that is not sufficient, it is increased + * automatically. + * @param input input data. + * @return -1 if the input data was too large. Otherwise 0. + */ +static int QRinput_convertData(QRinput *input) +{ + int bits; + int ver; + + ver = QRinput_estimateVersion(input); + if(ver > QRinput_getVersion(input)) { + QRinput_setVersion(input, ver); + } + + for(;;) { + bits = QRinput_createBitStream(input); + ver = QRspec_getMinimumVersion((bits + 7) / 8, input->level); + if(ver < 0) { + return -1; + } else if(ver > QRinput_getVersion(input)) { + QRinput_setVersion(input, ver); + } else { + break; + } + } + + return 0; +} + +/** + * Create padding bits for the input data. + * @param input input data. + * @return padding bit stream. + */ +static BitStream *QRinput_createPaddingBit(QRinput *input) +{ + int bits, maxbits, words, maxwords, i; + QRinput_List *list; + BitStream *bstream; + + if(input->version <= 0) + return NULL; + + maxwords = QRspec_getDataLength(input->version, input->level); + maxbits = maxwords * 8; + + list = input->head; + bits = 0; + while(list != NULL) { + bits += BitStream_size(list->bstream); + list = list->next; + } + + words = (bits + 7) / 8; + + if(maxbits - bits < 5) { + if(maxbits == bits) { + return NULL; + } else { + bstream = BitStream_new(); + BitStream_appendNum(bstream, maxbits - bits, 0); + return bstream; + } + } + + bits += 4; + words = (bits + 7) / 8; + + bstream = BitStream_new(); + BitStream_appendNum(bstream, words * 8 - bits + 4, 0); + + /* FIXME: It would be able to add padding bits by more efficient way. */ + for(i=0; ihead; + while(list != NULL) { + BitStream_append(bstream, list->bstream); + list = list->next; + } + + return bstream; +} + +/** + * Merge all bit streams in the input data and append padding bits + * @param input input data. + * @return padded merged bit stream + */ + +BitStream *QRinput_getBitStream(QRinput *input) +{ + BitStream *bstream; + BitStream *padding; + + bstream = QRinput_mergeBitStream(input); + if(bstream == NULL) { + return NULL; + } + padding = QRinput_createPaddingBit(input); + if(padding != NULL) { + BitStream_append(bstream, padding); + BitStream_free(padding); + } + + return bstream; +} + +/** + * Pack all bit streams padding bits into a byte array. + * @param input input data. + * @return padded merged byte stream + */ + +unsigned char *QRinput_getByteStream(QRinput *input) +{ + BitStream *bstream; + unsigned char *array; + + bstream = QRinput_getBitStream(input); + if(bstream == NULL) { + return NULL; + } + array = BitStream_toByte(bstream); + BitStream_free(bstream); + + return array; +} diff --git a/QtQREnCode/qrinput.h b/QtQREnCode/qrinput.h new file mode 100644 index 0000000..b84f78d --- /dev/null +++ b/QtQREnCode/qrinput.h @@ -0,0 +1,112 @@ +#ifndef QRINPUT_H +#define QRINPUT_H + +/* + * qrencode - QR Code encoder + * + * Input data chunk class + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __QRINPUT_H__ +#define __QRINPUT_H__ + +#include "qrencode.h" +#include "bistream.h" + +/****************************************************************************** + * Entry of input data + *****************************************************************************/ +typedef struct _QRinput_List QRinput_List; + +struct _QRinput_List { + QRencodeMode mode; + int size; ///< Size of data chunk (byte). + unsigned char *data; ///< Data chunk. + BitStream *bstream; + QRinput_List *next; +}; + +/****************************************************************************** + * Input Data + *****************************************************************************/ +struct _QRinput { + int version; + QRecLevel level; + QRinput_List *head; + QRinput_List *tail; +}; + +/** + * Get current error correction level. + * @param input input data. + * @return Current error correcntion level. + */ +extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input); + +/** + * Set error correction level of the QR-code that is to be encoded. + * @param input input data. + * @param level Error correction level. + */ +extern void QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level); + +/** + * Get current version. + * @param input input data. + * @return current version. + */ +extern int QRinput_getVersion(QRinput *input); + +/** + * Set version of the QR-code that is to be encoded. + * @param input input data. + * @param version version number (0 = auto) + */ +extern void QRinput_setVersion(QRinput *input, int version); + +/** + * Pack all bit streams padding bits into a byte array. + * @param input input data. + * @return padded merged byte stream + */ +extern unsigned char *QRinput_getByteStream(QRinput *input); + +extern int QRinput_estimateBitsModeNum(int size); +extern int QRinput_estimateBitsModeAn(int size); +extern int QRinput_estimateBitsMode8(int size); +extern int QRinput_estimateBitsModeKanji(int size); + +extern int QRinput_estimateBitStreamSize(QRinput *input, int version); +extern BitStream *QRinput_mergeBitStream(QRinput *input); +extern BitStream *QRinput_getBitStream(QRinput *input); + +extern const signed char QRinput_anTable[]; +extern QRencodeMode QRinput_identifyMode(const char *string); + +/** + * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). + * @param __c__ character + * @return value + */ +#define QRinput_lookAnTable(__c__) \ + ((__c__ & 0x80)?-1:QRinput_anTable[(int)__c__]) + +#endif /* __QRINPUT_H__ */ + + +#endif // QRINPUT_H diff --git a/QtQREnCode/qrspec.cpp b/QtQREnCode/qrspec.cpp new file mode 100644 index 0000000..0203bda --- /dev/null +++ b/QtQREnCode/qrspec.cpp @@ -0,0 +1,574 @@ + +/* + * qrencode - QR Code encoder + * + * QR Code specification in convenient format. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "qrspec.h" + +/****************************************************************************** + * Version and capacity + *****************************************************************************/ + +typedef struct { + int width; //< Edge length of the symbol + int words; //< Data capacity (bytes) + int remainder; //< Remainder bit (bits) + int ec[4]; //< Number of ECC code (bytes) +} QRspec_Capacity; + +/** + * Table of the capacity of symbols + * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004. + */ +static const QRspec_Capacity qrspecCapacity[QRSPEC_VERSION_MAX + 1] = { + { 0, 0, 0, { 0, 0, 0, 0}}, + { 21, 26, 0, { 7, 10, 13, 17}}, // 1 + { 25, 44, 7, { 10, 16, 22, 28}}, + { 29, 70, 7, { 15, 26, 36, 44}}, + { 33, 100, 7, { 20, 36, 52, 64}}, + { 37, 134, 7, { 26, 48, 72, 88}}, // 5 + { 41, 172, 7, { 36, 64, 96, 112}}, + { 45, 196, 0, { 40, 72, 108, 130}}, + { 49, 242, 0, { 48, 88, 132, 156}}, + { 53, 292, 0, { 60, 110, 160, 192}}, + { 57, 346, 0, { 72, 130, 192, 224}}, //10 + { 61, 404, 0, { 80, 150, 224, 264}}, + { 65, 466, 0, { 96, 176, 260, 308}}, + { 69, 532, 0, { 104, 198, 288, 352}}, + { 73, 581, 3, { 120, 216, 320, 384}}, + { 77, 655, 3, { 132, 240, 360, 432}}, //15 + { 81, 733, 3, { 144, 280, 408, 480}}, + { 85, 815, 3, { 168, 308, 448, 532}}, + { 89, 901, 3, { 180, 338, 504, 588}}, + { 93, 991, 3, { 196, 364, 546, 650}}, + { 97, 1085, 3, { 224, 416, 600, 700}}, //20 + {101, 1156, 4, { 224, 442, 644, 750}}, + {105, 1258, 4, { 252, 476, 690, 816}}, + {109, 1364, 4, { 270, 504, 750, 900}}, + {113, 1474, 4, { 300, 560, 810, 960}}, + {117, 1588, 4, { 312, 588, 870, 1050}}, //25 + {121, 1706, 4, { 336, 644, 952, 1110}}, + {125, 1828, 4, { 360, 700, 1020, 1200}}, + {129, 1921, 3, { 390, 728, 1050, 1260}}, + {133, 2051, 3, { 420, 784, 1140, 1350}}, + {137, 2185, 3, { 450, 812, 1200, 1440}}, //30 + {141, 2323, 3, { 480, 868, 1290, 1530}}, + {145, 2465, 3, { 510, 924, 1350, 1620}}, + {149, 2611, 3, { 540, 980, 1440, 1710}}, + {153, 2761, 3, { 570, 1036, 1530, 1800}}, + {157, 2876, 0, { 570, 1064, 1590, 1890}}, //35 + {161, 3034, 0, { 600, 1120, 1680, 1980}}, + {165, 3196, 0, { 630, 1204, 1770, 2100}}, + {169, 3362, 0, { 660, 1260, 1860, 2220}}, + {173, 3532, 0, { 720, 1316, 1950, 2310}}, + {177, 3706, 0, { 750, 1372, 2040, 2430}} //40 +}; + +int QRspec_getDataLength(int version, QRecLevel level) +{ + return qrspecCapacity[version].words - qrspecCapacity[version].ec[level]; +} + +int QRspec_getECCLength(int version, QRecLevel level) +{ + return qrspecCapacity[version].ec[level]; +} + +int QRspec_getMinimumVersion(int size, QRecLevel level) +{ + int i; + int words; + + for(i=1; i<= QRSPEC_VERSION_MAX; i++) { + words = qrspecCapacity[i].words - qrspecCapacity[i].ec[level]; + if(words >= size) return i; + } + + return -1; +} + +int QRspec_getWidth(int version) +{ + return qrspecCapacity[version].width; +} + +int QRspec_getRemainder(int version) +{ + return qrspecCapacity[version].remainder; +} + +/****************************************************************************** + * Length indicator + *****************************************************************************/ + +static const int lengthTableBits[4][3] = { + {10, 12, 14}, + { 9, 11, 13}, + { 8, 16, 16}, + { 8, 10, 12} +}; + +int QRspec_lengthIndicator(QRencodeMode mode, int version) +{ + int l; + + if(version <= 9) { + l = 0; + } else if(version <= 26) { + l = 1; + } else { + l = 2; + } + + return lengthTableBits[mode][l]; +} + +int QRspec_maximumWords(QRencodeMode mode, int version) +{ + int l; + int bits; + int words; + + if(version <= 9) { + l = 0; + } else if(version <= 26) { + l = 1; + } else { + l = 2; + } + + bits = lengthTableBits[mode][l]; + words = (1 << bits) - 1; + if(mode == QR_MODE_KANJI) { + words *= 2; // the number of bytes is required + } + + return words; +} + +/****************************************************************************** + * Error correction code + *****************************************************************************/ + +/** + * Table of the error correction code (Reed-Solomon block) + * See Table 12-16 (pp.30-36), JIS X0510:2004. + */ +static const int eccTable[QRSPEC_VERSION_MAX+1][4][2] = { + {{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}}, + {{ 1, 0}, { 1, 0}, { 1, 0}, { 1, 0}}, // 1 + {{ 1, 0}, { 1, 0}, { 1, 0}, { 1, 0}}, + {{ 1, 0}, { 1, 0}, { 2, 0}, { 2, 0}}, + {{ 1, 0}, { 2, 0}, { 2, 0}, { 4, 0}}, + {{ 1, 0}, { 2, 0}, { 2, 2}, { 2, 2}}, // 5 + {{ 2, 0}, { 4, 0}, { 4, 0}, { 4, 0}}, + {{ 2, 0}, { 4, 0}, { 2, 4}, { 4, 1}}, + {{ 2, 0}, { 2, 2}, { 4, 2}, { 4, 2}}, + {{ 2, 0}, { 3, 2}, { 4, 4}, { 4, 4}}, + {{ 2, 2}, { 4, 1}, { 6, 2}, { 6, 2}}, //10 + {{ 4, 0}, { 1, 4}, { 4, 4}, { 3, 8}}, + {{ 2, 2}, { 6, 2}, { 4, 6}, { 7, 4}}, + {{ 4, 0}, { 8, 1}, { 8, 4}, {12, 4}}, + {{ 3, 1}, { 4, 5}, {11, 5}, {11, 5}}, + {{ 5, 1}, { 5, 5}, { 5, 7}, {11, 7}}, //15 + {{ 5, 1}, { 7, 3}, {15, 2}, { 3, 13}}, + {{ 1, 5}, {10, 1}, { 1, 15}, { 2, 17}}, + {{ 5, 1}, { 9, 4}, {17, 1}, { 2, 19}}, + {{ 3, 4}, { 3, 11}, {17, 4}, { 9, 16}}, + {{ 3, 5}, { 3, 13}, {15, 5}, {15, 10}}, //20 + {{ 4, 4}, {17, 0}, {17, 6}, {19, 6}}, + {{ 2, 7}, {17, 0}, { 7, 16}, {34, 0}}, + {{ 4, 5}, { 4, 14}, {11, 14}, {16, 14}}, + {{ 6, 4}, { 6, 14}, {11, 16}, {30, 2}}, + {{ 8, 4}, { 8, 13}, { 7, 22}, {22, 13}}, //25 + {{10, 2}, {19, 4}, {28, 6}, {33, 4}}, + {{ 8, 4}, {22, 3}, { 8, 26}, {12, 28}}, + {{ 3, 10}, { 3, 23}, { 4, 31}, {11, 31}}, + {{ 7, 7}, {21, 7}, { 1, 37}, {19, 26}}, + {{ 5, 10}, {19, 10}, {15, 25}, {23, 25}}, //30 + {{13, 3}, { 2, 29}, {42, 1}, {23, 28}}, + {{17, 0}, {10, 23}, {10, 35}, {19, 35}}, + {{17, 1}, {14, 21}, {29, 19}, {11, 46}}, + {{13, 6}, {14, 23}, {44, 7}, {59, 1}}, + {{12, 7}, {12, 26}, {39, 14}, {22, 41}}, //35 + {{ 6, 14}, { 6, 34}, {46, 10}, { 2, 64}}, + {{17, 4}, {29, 14}, {49, 10}, {24, 46}}, + {{ 4, 18}, {13, 32}, {48, 14}, {42, 32}}, + {{20, 4}, {40, 7}, {43, 22}, {10, 67}}, + {{19, 6}, {18, 31}, {34, 34}, {20, 61}},//40 +}; + +int *QRspec_getEccSpec(int version, QRecLevel level) +{ + int b1, b2; + int data, ecc; + int *array; + + b1 = eccTable[version][level][0]; + b2 = eccTable[version][level][1]; + + data = QRspec_getDataLength(version, level); + ecc = QRspec_getECCLength(version, level); + + array = (int *)malloc(sizeof(int) * 6); + + if(b2 == 0) { + array[0] = b1; + array[1] = data / b1; + array[2] = ecc / b1; + array[3] = array[4] = array[5] = 0; + } else { + array[0] = b1; + array[1] = data / (b1 + b2); + array[2] = ecc / (b1 + b2); + array[3] = b2; + array[4] = array[1] + 1; + array[5] = (ecc - (array[2] * b1)) / b2; + } + + return array; +} + +/****************************************************************************** + * Alignment pattern + *****************************************************************************/ + +/** + * Positions of alignment patterns. + * This array includes only the second and the third position of the alignment + * patterns. Rest of them can be calculated from the distance between them. + * + * See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + */ +static const int alignmentPattern[QRSPEC_VERSION_MAX+1][2] = { + { 0, 0}, + { 0, 0}, {18, 0}, {22, 0}, {26, 0}, {30, 0}, // 1- 5 + {34, 0}, {22, 38}, {24, 42}, {26, 46}, {28, 50}, // 6-10 + {30, 54}, {32, 58}, {34, 62}, {26, 46}, {26, 48}, //11-15 + {26, 50}, {30, 54}, {30, 56}, {30, 58}, {34, 62}, //16-20 + {28, 50}, {26, 50}, {30, 54}, {28, 54}, {32, 58}, //21-25 + {30, 58}, {34, 62}, {26, 50}, {30, 54}, {26, 52}, //26-30 + {30, 56}, {34, 60}, {30, 58}, {34, 62}, {30, 54}, //31-35 + {24, 50}, {28, 54}, {32, 58}, {26, 54}, {30, 58}, //35-40 +}; + +QRspec_Alignment *QRspec_getAlignmentPattern(int version) +{ + int width; + int d, w, x, y, cx, cy; + QRspec_Alignment *al; + int *p; + + if(version < 2) return NULL; + + al = (QRspec_Alignment *)malloc(sizeof(QRspec_Alignment)); + + width = qrspecCapacity[version].width; + d = alignmentPattern[version][1] - alignmentPattern[version][0]; + if(d < 0) { + w = 2; + } else { + w = (width - alignmentPattern[version][0]) / d + 2; + } + + al->n = w * w - 3; + al->pos = (int *)malloc(sizeof(int) * al->n * 2); + + if(al->n == 1) { + al->pos[0] = alignmentPattern[version][0]; + al->pos[1] = alignmentPattern[version][0]; + + return al; + } +#if 0 + /* Just for debug purpose */ + printf("%d ", version); + cx = alignmentPattern[version][0]; + for(x=0; xpos; + + cx = alignmentPattern[version][0]; + for(x=1; xpos != NULL) { + free(al->pos); + } + free(al); + } +} + +/****************************************************************************** + * Version information pattern + *****************************************************************************/ + +/** + * Version information pattern (BCH coded). + * See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + */ +static const unsigned int versionPattern[QRSPEC_VERSION_MAX - 6] = { + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, + 0x27541, 0x28c69 +}; + +unsigned int QRspec_getVersionPattern(int version) +{ + if(version < 7 || version > QRSPEC_VERSION_MAX) return 0; + + return versionPattern[version -7]; +} + +/****************************************************************************** + * Format information + *****************************************************************************/ + +/* See calcFormatInfo in tests/test_qrspec.c */ +static const unsigned int formatInfo[4][8] = { + {0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976}, + {0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0}, + {0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed}, + {0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b} +}; + +unsigned int QRspec_getFormatInfo(int mask, QRecLevel level) +{ + if(mask < 0 || mask > 7) return 0; + + return formatInfo[level][mask]; +} + +/****************************************************************************** + * Frame + *****************************************************************************/ + +/** + * Cache of initial frames. + */ +/* C99 says that static storage shall be initialized to a null pointer + * by compiler. */ +static unsigned char *frames[QRSPEC_VERSION_MAX + 1]; + +/** + * Put a finder pattern. + * @param frame + * @param width + * @param ox,oy upper-left coordinate of the pattern + */ +static void putFinderPattern(unsigned char *frame, int width, int ox, int oy) +{ + static const unsigned char finder[] = { + 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, + 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, + 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1, + 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1, + 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1, + 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, + 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, + }; + int x, y; + const unsigned char *s; + + frame += oy * width + ox; + s = finder; + for(y=0; y<7; y++) { + for(x=0; x<7; x++) { + frame[x] = s[x]; + } + frame += width; + s += 7; + } +} + +/** + * Put an alignment pattern. + * @param frame + * @param width + * @param ox,oy center coordinate of the pattern + */ +static void putAlignmentPattern(unsigned char *frame, int width, int ox, int oy) +{ + static const unsigned char finder[] = { + 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, + 0xa1, 0xa0, 0xa0, 0xa0, 0xa1, + 0xa1, 0xa0, 0xa1, 0xa0, 0xa1, + 0xa1, 0xa0, 0xa0, 0xa0, 0xa1, + 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, + }; + int x, y; + const unsigned char *s; + + frame += (oy - 2) * width + ox - 2; + s = finder; + for(y=0; y<5; y++) { + for(x=0; x<5; x++) { + frame[x] = s[x]; + } + frame += width; + s += 5; + } +} + +static unsigned char *QRspec_createFrame(int version) +{ + unsigned char *frame, *p, *q; + int width; + int x, y; + unsigned int verinfo, mask; + QRspec_Alignment *alignment; + + width = qrspecCapacity[version].width; + frame = (unsigned char *)malloc(width * width); + memset(frame, 0, width * width); + /* Finder pattern */ + putFinderPattern(frame, width, 0, 0); + putFinderPattern(frame, width, width - 7, 0); + putFinderPattern(frame, width, 0, width - 7); + /* Separator */ + p = frame; + q = frame + width * (width - 7); + for(y=0; y<7; y++) { + p[7] = 0xc0; + p[width - 8] = 0xc0; + q[7] = 0xc0; + p += width; + q += width; + } + memset(frame + width * 7, 0xc0, 8); + memset(frame + width * 8 - 8, 0xc0, 8); + memset(frame + width * (width - 8), 0xc0, 8); + /* Mask format information area */ + memset(frame + width * 8, 0x84, 9); + memset(frame + width * 9 - 8, 0x84, 8); + p = frame + 8; + for(y=0; y<8; y++) { + *p = 0x84; + p += width; + } + p = frame + width * (width - 7) + 8; + for(y=0; y<7; y++) { + *p = 0x84; + p += width; + } + /* Timing pattern */ + p = frame + width * 6 + 8; + q = frame + width * 8 + 6; + for(x=1; xn; x++) { + putAlignmentPattern(frame, width, + alignment->pos[x*2], alignment->pos[x*2+1]); + } + QRspec_freeAlignment(alignment); + } + /* Version information */ + if(version >= 7) { + verinfo = QRspec_getVersionPattern(version); + + p = frame + width * (width - 11); + mask = 0x20000; + for(x=0; x<6; x++) { + for(y=0; y<3; y++) { + p[width * y + x] = 0x88 | ((mask & verinfo) != 0); + mask = mask >> 1; + } + } + + p = frame + width - 11; + mask = 0x20000; + for(y=0; y<6; y++) { + for(x=0; x<3; x++) { + p[x] = 0x88 | ((mask & verinfo) != 0); + mask = mask >> 1; + } + p += width; + } + } + /* and a little bit... */ + frame[width * (width - 8) + 8] = 0x81; + + return frame; +} + +unsigned char *QRspec_newFrame(int version) +{ + unsigned char *frame; + int width; + + if(version < 1 || version > QRSPEC_VERSION_MAX) return NULL; + + if(frames[version] == NULL) { + frames[version] = QRspec_createFrame(version); + } + width = qrspecCapacity[version].width; + frame = (unsigned char *)malloc(width * width); + memcpy(frame, frames[version], width * width); + + return frame; +} diff --git a/QtQREnCode/qrspec.h b/QtQREnCode/qrspec.h new file mode 100644 index 0000000..3f51b32 --- /dev/null +++ b/QtQREnCode/qrspec.h @@ -0,0 +1,193 @@ +#ifndef QRSPEC_H +#define QRSPEC_H + +/* + * qrencode - QR Code encoder + * + * QR Code specification in convenient format. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __QRSPEC_H__ +#define __QRSPEC_H__ + +#include "qrencode.h" + +/****************************************************************************** + * Version and capacity + *****************************************************************************/ + +/** + * Maximum version (size) of QR-code symbol. + */ +#define QRSPEC_VERSION_MAX 40 + +/** + * Maximum width of a symbol + */ +#define QRSPEC_WIDTH_MAX 177 + +/** + * Return maximum data code length (bytes) for the version. + * @param version + * @param level + * @return maximum size (bytes) + */ +extern int QRspec_getDataLength(int version, QRecLevel level); + +/** + * Return maximum error correction code length (bytes) for the version. + * @param version + * @param level + * @return ECC size (bytes) + */ +extern int QRspec_getECCLength(int version, QRecLevel level); + +/** + * Return a version number that satisfies the input code length. + * @param size input code length (byte) + * @param level + * @return version number + */ +extern int QRspec_getMinimumVersion(int size, QRecLevel level); + +/** + * Return the width of the symbol for the version. + * @param version + * @return width + */ +extern int QRspec_getWidth(int version); + +/** + * Return the numer of remainder bits. + * @param version + * @return number of remainder bits + */ +extern int QRspec_getRemainder(int version); + +/****************************************************************************** + * Length indicator + *****************************************************************************/ + +/** + * Return the size of lenght indicator for the mode and version. + * @param mode + * @param version + * @return the size of the appropriate length indicator (bits). + */ +extern int QRspec_lengthIndicator(QRencodeMode mode, int version); + +/** + * Return the maximum length for the mode and version. + * @param mode + * @param version + * @return the maximum length (bytes) + */ +extern int QRspec_maximumWords(QRencodeMode mode, int version); + +/****************************************************************************** + * Error correction code + *****************************************************************************/ + +/** + * Return an array of ECC specification. + * @param version + * @param level + * @return an array of ECC specification contains as following: + * {# of type1 blocks, # of data code, # of ecc code, + * # of type2 blocks, # of data code, # of ecc code} + * It can be freed by calling free(). + */ +int *QRspec_getEccSpec(int version, QRecLevel level); + +#define QRspec_rsBlockNum(__spec__) (__spec__[0] + __spec__[3]) +#define QRspec_rsBlockNum1(__spec__) (__spec__[0]) +#define QRspec_rsDataCodes1(__spec__) (__spec__[1]) +#define QRspec_rsEccCodes1(__spec__) (__spec__[2]) +#define QRspec_rsBlockNum2(__spec__) (__spec__[3]) +#define QRspec_rsDataCodes2(__spec__) (__spec__[4]) +#define QRspec_rsEccCodes2(__spec__) (__spec__[5]) + +/****************************************************************************** + * Alignment pattern + *****************************************************************************/ + +/** + * Array of positions of alignment patterns. + * X and Y coordinates are interleaved into 'pos'. + */ +typedef struct { + int n; //< Number of patterns + int *pos; +} QRspec_Alignment; + +/** + * Return positions of alignment patterns. + * @param version + * @return a QRspec_Alignment object that contains all of positions of alignment + * patterns. + */ +extern QRspec_Alignment *QRspec_getAlignmentPattern(int version); + +/** + * Free QRspec_Alignment instance. + * @param al QRspec_Alignment instance. + */ +extern void QRspec_freeAlignment(QRspec_Alignment *al); + +/****************************************************************************** + * Version information pattern + *****************************************************************************/ + +/** + * Return BCH encoded version information pattern that is used for the symbol + * of version 7 or greater. Use lower 18 bits. + * @param version + * @return BCH encoded version information pattern + */ +extern unsigned int QRspec_getVersionPattern(int version); + +/****************************************************************************** + * Format information + *****************************************************************************/ + +/** + * Return BCH encoded format information pattern. + * @param mask + * @param level + * @return BCH encoded format information pattern + */ +extern unsigned int QRspec_getFormatInfo(int mask, QRecLevel level); + +/****************************************************************************** + * Frame + *****************************************************************************/ + +/** + * Return a copy of initialized frame. + * When the same version is requested twice or more, a copy of cached frame + * is returned. + * @param version + * @return Array of unsigned char. You can free it by free(). + */ +/* WARNING: Thread unsafe!!! */ +extern unsigned char *QRspec_newFrame(int version); + +#endif /* __QRSPEC_H__ */ + + +#endif // QRSPEC_H diff --git a/QtQREnCode/rscode.cpp b/QtQREnCode/rscode.cpp new file mode 100644 index 0000000..0c5754d --- /dev/null +++ b/QtQREnCode/rscode.cpp @@ -0,0 +1,291 @@ + +/* + * qrencode - QR Code encoder + * + * Reed solomon encoder. This code is taken from Phil Karn's libfec then + * editted and packed into a pair of .c and .h files. + * + * Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q + * (libfec is released under the GNU Lesser General Public License.) + * + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include "rscode.h" + +/* Stuff specific to the 8-bit symbol version of the general purpose RS codecs + * + */ +typedef unsigned char data_t; + + +/** + * Reed-Solomon codec control block + */ +struct _RS { + int mm; /* Bits per symbol */ + int nn; /* Symbols per block (= (1<= rs->nn) { + x -= rs->nn; + x = (x >> rs->mm) + (x & rs->nn); + } + return x; +} + + +#define MODNN(x) modnn(rs,x) + +#define MM (rs->mm) +#define NN (rs->nn) +#define ALPHA_TO (rs->alpha_to) +#define INDEX_OF (rs->index_of) +#define GENPOLY (rs->genpoly) +#define NROOTS (rs->nroots) +#define FCR (rs->fcr) +#define PRIM (rs->prim) +#define IPRIM (rs->iprim) +#define PAD (rs->pad) +#define A0 (NN) + + +/* Initialize a Reed-Solomon codec + * symsize = symbol size, bits + * gfpoly = Field generator polynomial coefficients + * fcr = first root of RS code generator polynomial, index form + * prim = primitive element to generate polynomial roots + * nroots = RS code generator polynomial degree (number of roots) + * pad = padding bytes at front of shortened block + */ +static RS *init_rs_char(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad) +{ + RS *rs; + + +/* Common code for intializing a Reed-Solomon control block (char or int symbols) + * Copyright 2004 Phil Karn, KA9Q + * May be used under the terms of the GNU Lesser General Public License (LGPL) + */ +//#undef NULL +//#define NULL ((RS *)0) + + int i, j, sr,root,iprim; + + rs = NULL; + /* Check parameter ranges */ + if(symsize < 0 || symsize > 8*sizeof(data_t)){ + goto done; + } + + if(fcr < 0 || fcr >= (1<= (1<= (1<= ((1<mm = symsize; + rs->nn = (1<pad = pad; + + rs->alpha_to = (data_t *)malloc(sizeof(data_t)*(rs->nn+1)); + if(rs->alpha_to == NULL){ + free(rs); + rs = NULL; + goto done; + } + rs->index_of = (data_t *)malloc(sizeof(data_t)*(rs->nn+1)); + if(rs->index_of == NULL){ + free(rs->alpha_to); + free(rs); + rs = NULL; + goto done; + } + + /* Generate Galois field lookup tables */ + rs->index_of[0] = A0; /* log(zero) = -inf */ + rs->alpha_to[A0] = 0; /* alpha**-inf = 0 */ + sr = 1; + for(i=0;inn;i++){ + rs->index_of[sr] = i; + rs->alpha_to[i] = sr; + sr <<= 1; + if(sr & (1<nn; + } + if(sr != 1){ + /* field generator polynomial is not primitive! */ + free(rs->alpha_to); + free(rs->index_of); + free(rs); + rs = NULL; + goto done; + } + + /* Form RS code generator polynomial from its roots */ + rs->genpoly = (data_t *)malloc(sizeof(data_t)*(nroots+1)); + if(rs->genpoly == NULL){ + free(rs->alpha_to); + free(rs->index_of); + free(rs); + rs = NULL; + goto done; + } + rs->fcr = fcr; + rs->prim = prim; + rs->nroots = nroots; + rs->gfpoly = gfpoly; + + /* Find prim-th root of 1, used in decoding */ + for(iprim=1;(iprim % prim) != 0;iprim += rs->nn) + ; + rs->iprim = iprim / prim; + + rs->genpoly[0] = 1; + for (i = 0,root=fcr*prim; i < nroots; i++,root += prim) { + rs->genpoly[i+1] = 1; + + /* Multiply rs->genpoly[] by @**(root + x) */ + for (j = i; j > 0; j--){ + if (rs->genpoly[j] != 0) + rs->genpoly[j] = rs->genpoly[j-1] ^ rs->alpha_to[modnn(rs,rs->index_of[rs->genpoly[j]] + root)]; + else + rs->genpoly[j] = rs->genpoly[j-1]; + } + /* rs->genpoly[0] can never be zero */ + rs->genpoly[0] = rs->alpha_to[modnn(rs,rs->index_of[rs->genpoly[0]] + root)]; + } + /* convert rs->genpoly[] to index form for quicker encoding */ + for (i = 0; i <= nroots; i++) + rs->genpoly[i] = rs->index_of[rs->genpoly[i]]; + done:; + + return rs; +} + +RS *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad) +{ + RS *rs; + + for(rs = rslist; rs != NULL; rs = rs->next) { + if(rs->mm != symsize) continue; + if(rs->gfpoly != gfpoly) continue; + if(rs->fcr != fcr) continue; + if(rs->prim != prim) continue; + if(rs->nroots != nroots) continue; + if(rs->pad != pad) continue; + + return rs; + } + + rs = init_rs_char(symsize, gfpoly, fcr, prim, nroots, pad); + rs->next = rslist; + rslist = rs; + + return rs; +} + + +void free_rs_char(RS *rs) +{ + free(rs->alpha_to); + free(rs->index_of); + free(rs->genpoly); + free(rs); +} + +/* The guts of the Reed-Solomon encoder, meant to be #included + * into a function body with the following typedefs, macros and variables supplied + * according to the code parameters: + + * data_t - a typedef for the data symbol + * data_t data[] - array of NN-NROOTS-PAD and type data_t to be encoded + * data_t parity[] - an array of NROOTS and type data_t to be written with parity symbols + * NROOTS - the number of roots in the RS code generator polynomial, + * which is the same as the number of parity symbols in a block. + Integer variable or literal. + * + * NN - the total number of symbols in a RS block. Integer variable or literal. + * PAD - the number of pad symbols in a block. Integer variable or literal. + * ALPHA_TO - The address of an array of NN elements to convert Galois field + * elements in index (log) form to polynomial form. Read only. + * INDEX_OF - The address of an array of NN elements to convert Galois field + * elements in polynomial form to index (log) form. Read only. + * MODNN - a function to reduce its argument modulo NN. May be inline or a macro. + * GENPOLY - an array of NROOTS+1 elements containing the generator polynomial in index form + + * The memset() and memmove() functions are used. The appropriate header + * file declaring these functions (usually ) must be included by the calling + * program. + + * Copyright 2004, Phil Karn, KA9Q + * May be used under the terms of the GNU Lesser General Public License (LGPL) + */ + +#undef A0 +#define A0 (NN) /* Special reserved value encoding zero in index form */ + +void encode_rs_char(RS *rs, const data_t *data, data_t *parity) +{ + int i, j; + data_t feedback; + + memset(parity,0,NROOTS*sizeof(data_t)); + + for(i=0;i + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __RSCODE_H__ +#define __RSCODE_H__ + +/* + * General purpose RS codec, 8-bit symbols. + */ + +typedef struct _RS RS; + +/* WARNING: Thread unsafe!!! */ +extern RS *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad); +extern void encode_rs_char(RS *rs, const unsigned char *data, unsigned char *parity); +extern void free_rs_char(RS *rs); + +#endif /* __RSCODE_H__ */ + + +#endif // RSCODE_H diff --git a/QtQREnCode/split.cpp b/QtQREnCode/split.cpp new file mode 100644 index 0000000..6574de8 --- /dev/null +++ b/QtQREnCode/split.cpp @@ -0,0 +1,213 @@ + +/* + * qrencode - QR Code encoder + * + * Input data splitter. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "qrencode.h" +#include "qrinput.h" +#include "qrspec.h" +#include "split.h" + +#define isdigit(__c__) ((unsigned char)((signed char)(__c__) - '0') < 10) +#define isalnum(__c__) (QRinput_lookAnTable(__c__) >= 0) + +static int Split_eatNum(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive); +static int Split_eatAn(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive); +static int Split_eat8(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive); +static int Split_eatKanji(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive); + +static int Split_eatNum(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive) +{ + const char *p; + int run; + int dif; + int ln; + + ln = QRspec_lengthIndicator(QR_MODE_NUM, version); + + p = string; + while(isdigit(*p)) { + p++; + } + run = p - string; + if(*p & 0x80) { + dif = QRinput_estimateBitsModeNum(run) + 4 + ln + + QRinput_estimateBitsMode8(1) /* + 4 + l8 */ + - QRinput_estimateBitsMode8(run + 1) /* - 4 - l8 */; + if(dif > 0) { + return Split_eat8(string, input, version, hint, casesensitive); + } + } + if(isalnum(*p) && !casesensitive) { + dif = QRinput_estimateBitsModeNum(run) + 4 + ln + + QRinput_estimateBitsModeAn(1) /* + 4 + la */ + - QRinput_estimateBitsModeAn(run + 1) /* - 4 - la */; + if(dif > 0) { + return Split_eatAn(string, input, version, hint, casesensitive); + } + } + + QRinput_append(input, QR_MODE_NUM, run, (unsigned char *)string); + return run; +} + +static int Split_eatAn(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive) +{ + const char *p, *q; + int run; + int dif; + int la, ln; + + if(casesensitive) { + return Split_eat8(string, input, version, hint, casesensitive); + } + + la = QRspec_lengthIndicator(QR_MODE_AN, version); + ln = QRspec_lengthIndicator(QR_MODE_NUM, version); + + p = string; + while(isalnum(*p)) { + if(isdigit(*p)) { + q = p; + while(isdigit(*q)) { + q++; + } + dif = QRinput_estimateBitsModeAn(p - string) /* + 4 + la */ + + QRinput_estimateBitsModeNum(q - p) + 4 + ln + - QRinput_estimateBitsModeAn(q - string) /* - 4 - la */; + if(dif < 0) { + break; + } else { + p = q; + } + } else { + p++; + } + } + + run = p - string; + + if(*p & 0x80) { + dif = QRinput_estimateBitsModeAn(run) + 4 + la + + QRinput_estimateBitsMode8(1) /* + 4 + l8 */ + - QRinput_estimateBitsMode8(run + 1) /* - 4 - l8 */; + if(dif > 0) { + return Split_eat8(string, input, version, hint, casesensitive); + } + } + + QRinput_append(input, QR_MODE_AN, run, (unsigned char *)string); + return run; +} + +static int Split_eatKanji(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive) +{ + const char *p; + + p = string; + while(QRinput_identifyMode(p) == QR_MODE_KANJI) { + p += 2; + } + QRinput_append(input, QR_MODE_KANJI, p - string, (unsigned char *)string); + return p - string; +} + +static int Split_eat8(const char *string, QRinput *input, int version, QRencodeMode hint, int casesensitive) +{ + const char *p, *q; + QRencodeMode mode; + int dif; + int la, ln; + + la = QRspec_lengthIndicator(QR_MODE_AN, version); + ln = QRspec_lengthIndicator(QR_MODE_NUM, version); + + p = string; + while(*p != '\0') { + mode = QRinput_identifyMode(p); + if(hint == QR_MODE_KANJI && mode == QR_MODE_KANJI) { + break; + } + if(mode != QR_MODE_8 && mode != QR_MODE_KANJI) { + if(mode == QR_MODE_NUM) { + q = p; + while(isdigit(*q)) { + q++; + } + dif = QRinput_estimateBitsMode8(p - string) /* + 4 + l8 */ + + QRinput_estimateBitsModeNum(q - p) + 4 + ln + - QRinput_estimateBitsMode8(q - string) /* - 4 - l8 */; + if(dif < 0) { + break; + } else { + p = q; + } + } else if(!casesensitive) { + q = p; + while(isalnum(*q)) { + q++; + } + dif = QRinput_estimateBitsMode8(p - string) /* + 4 + l8 */ + + QRinput_estimateBitsModeAn(q - p) + 4 + la + - QRinput_estimateBitsMode8(q - string) /* - 4 - l8 */; + if(dif < 0) { + break; + } else { + p = q; + } + } else { + p++; + } + } else { + p++; + } + } + + QRinput_append(input, QR_MODE_8, p - string, (unsigned char *)string); + return p - string; +} + +void Split_splitStringToQRinput(const char *string, QRinput *input, + int version, QRencodeMode hint, int casesensitive) +{ + int length; + QRencodeMode mode; + + if(*string == '\0') return; + + mode = QRinput_identifyMode(string); + if(mode == QR_MODE_NUM) { + length = Split_eatNum(string, input, version, hint, casesensitive); + } else if(mode == QR_MODE_AN && !casesensitive) { + length = Split_eatAn(string, input, version, hint, casesensitive); + } else if(mode == QR_MODE_KANJI && hint == QR_MODE_KANJI) { + length = Split_eatKanji(string, input, version, hint, casesensitive); + } else { + length = Split_eat8(string, input, version, hint, casesensitive); + } + if(length == 0) return; + Split_splitStringToQRinput(&string[length], input, hint, mode, casesensitive); +} diff --git a/QtQREnCode/split.h b/QtQREnCode/split.h new file mode 100644 index 0000000..c1058c1 --- /dev/null +++ b/QtQREnCode/split.h @@ -0,0 +1,40 @@ +#ifndef SPLIT_H +#define SPLIT_H + +/* + * qrencode - QR Code encoder + * + * Input data splitter. + * Copyright (C) 2006,2007 Kentaro Fukuchi + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __SPLIT_H__ +#define __SPLIT_H__ + +#include "qrencode.h" +void Split_splitStringToQRinput(const char *string, QRinput *input, + int version, QRencodeMode hint, int casesensitive); +#endif /* __SPLIT_H__ */ + + +#endif // SPLIT_H diff --git a/QtUI b/QtUI new file mode 100644 index 0000000..4bef1b9 Binary files /dev/null and b/QtUI differ diff --git a/QtUI.pro b/QtUI.pro new file mode 100644 index 0000000..eca2717 --- /dev/null +++ b/QtUI.pro @@ -0,0 +1,382 @@ +###################################################################### +# Automatically generated by qmake (2.01a) ?? 11? 8 22:48:42 2013 +###################################################################### +# -spec /usr/local/Trolltech/QtEmbedded-4.6.3-arm/mkspecs/qws/linux-arm-g++ DEFINES+=ARM DEFINES+=QTV3 DEFINES+=VNLG +# DEFINES+=VNLG +# DEFINES+=UART2 DEFINES+=X86TEST DEFINES+=VNLG DEFINES+=UART1 +# GIT +#$ git config --global user.name "niexiong" +#$ git config --global user.email "nx@runoob.com" +# git clone git@119.23.201.56:/home/git/QtUI.git +# git pull +# git commit -am "提交说明" +# git push +# git add +# git add -f xxx.cpp #强制提交文件 +# git rm +# +# +QT += core gui network +QT += xml + +LIBS += -L/usr/local/openssl-1.0.2 -lssl -lcrypto + + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +include(qjson/upQJson.pri) + +TEMPLATE = app +#ifdef SPV210 + TARGET = qtUIV6 +#else + TARGET = QtUI +#endif +OBJECTS_DIR +=tmp +MOC_DIR +=tmp +DEPENDPATH += . +INCLUDEPATH += . +CODECFORTR = UTF-8 +#DEFINES+=UART1 +DEFINES+=UART2 +#DEFINES+=ENGLISH +DEFINES+=WARNING +#DFINES+=RANDDEBUGE +DEFINES+=ALT16 +DEFINES+=TEMPMIMA +DEFINES+=COUNTER1_BY_GROUP #分段计米 +DEFINES+=_2DCODE_ #QR二维码 +DEFINES+=PICSCENE +#DEFINES+=__2451WIFI__ +DEFINES+=__CONVERTERWIFI__ +DEFINES+=MODBUS + +#DEFINES+=__CONVERTERBOARD__ +DEFINES+=__VX__ +#DEFINES+=X86TEST + + +#else +#{ + +#} + +# Input +HEADERS += ClickLabel.h \ + DevOp.h \ + DialogAuthorization.h \ + DialogFileOperation.h \ + DialogFontSize.h \ + DialogInsertVari.h \ + DialogLineSpace.h \ + DigitalInput.h \ + InkJetPrinter.h \ + InputMethod.h \ + InsertSpaceNumDialog.h \ + LogInfo.h \ + mainwindow.h \ + MemDisplayAndEdit.h \ + MyFileDialog.h \ + MyInputMethod.h \ + MyTextEdit.h \ + OtherInfo.h \ + ParaSettingUI.h \ + PhaseGraphic.h \ + PicEdit.h \ + PicWidget.h \ + PrintSetting.h \ + PrintTextDisplay.h \ + Public.h \ + PulseNumFix.h \ + SysPara.h \ + SystemManage.h \ + SystemSetting.h \ + TextEditOption.h \ + TimeSettingDialog.h \ + TriggerCtrl.h \ + ZkEdit.h \ + myinclude.h \ + dlgdrawinit.h \ + zkWidget.h \ + qextserialbase.h \ + posix_qextserialport.h \ + dlginputaddr.h \ + dlgshowmsg.h \ + QBarCode.h \ + dlgQrCode.h \ + BarCode/cmdline.h \ + BarCode/barcode.h \ + QtQREnCode/split.h \ + QtQREnCode/mask.h \ + QtQREnCode/bistream.h \ + QtQREnCode/qrinput.h \ + QtQREnCode/qrencode_inner.h \ + QtQREnCode/qrspec.h \ + QtQREnCode/qrencode.h \ + QtQREnCode/rscode.h \ + Matrix/reedsol.h \ + Matrix/zint.h \ + Matrix/common.h \ + Matrix/dm200.h \ + DialogInputTxt.h \ + dlgmutilanguage.h \ + dlgmywarring.h \ + dlgselectinputlanguage.h \ + DialogSaveFile.h \ + dlgvarlength.h \ + VerBVersion.h \ + scene/picscene.h \ + scene/pictextitem.h \ + scene/SceneEditOption.h \ + scene/sceneviewwidget.h \ + Network/NetworkManager.h \ + modbus/modbus/include/mbconfig.h \ + modbus/modbus/include/mbframe.h \ + modbus/modbus/include/mbfunc.h \ + modbus/modbus/include/mbport.h \ + modbus/modbus/include/mbproto.h \ + modbus/modbus/include/mbutils.h \ + modbus/port/port.h \ + Tftp/filetranseceiver.h \ + modbus/modbus/include/mb.h \ + modbus/modbus/rtu/mbcrc.h \ + modbus/modbus/rtu/mbrtu.h \ + dialogmodifypasswd.h \ + logo_form.h \ + modbus/demo.h \ + dialogshowcounter.h \ + dialogcycleprint.h \ + print_net.h \ + scene/myview.h \ + modbus/modbus/tcp/mbtcp.h \ + modbus/modbustcp.h \ + moveinput.h \ + Log/dualfilelogger.h \ + Log/filelogger.h \ + Log/logger.h \ + Log/logglobal.h \ + Log/logmessage.h \ + modbus/modbustcp.h \ + modbus/modbus/tcp/mbtcp.h \ + modbus/demo.h + + + +FORMS += dialogauthorization.ui \ + dialogfileoperation.ui \ + dialogfontsize.ui \ + dialoginsertvari.ui \ + dialoglinespace.ui \ + dialogpointdistanceadjust.ui \ + inkjetprinter.ui \ + InputMethod.ui \ + insertspacenumdialog.ui \ + loginfo.ui \ + mainwindow.ui \ + memdisplayandedit.ui \ + otherinfo.ui \ + printsetting.ui \ + pulsenumfix.ui \ + systemmanage.ui \ + systemsetting.ui \ + texteditoption.ui \ + timesettingdialog.ui \ + triggerctrl.ui \ + zkedit.ui \ + picedit.ui \ + dlgdrawinit.ui \ + digitalinput.ui \ + dlginputaddr.ui \ + dlgshowmsg.ui \ + QBarCode.ui \ + dlgQrCode.ui \ + DialogInputTxt.ui \ + dlgmutilanguage.ui \ + dlgmywarring.ui \ + dlgselectinputlanguage.ui \ + dialogsavefile.ui \ + dlgvarlength.ui \ + scene/sceneEditOption.ui \ + Network/NetworkManager.ui \ + dialoginputpasswd.ui \ + dialogmodifypasswd.ui \ + logo_form.ui \ + dialogshowcounter.ui \ + dialogcycleprint.ui \ + moveinput.ui +SOURCES += ClickLabel.cpp \ + DevOp.cpp \ + DialogAuthorization.cpp \ + DialogFileOperation.cpp \ + DialogFontSize.cpp \ + DialogInsertVari.cpp \ + DialogLineSpace.cpp \ + DigitalInput.cpp \ + InkJetPrinter.cpp \ + InputMethod.cpp \ + InsertSpaceNumDialog.cpp \ + LogInfo.cpp \ + main.cpp \ + mainwindow.cpp \ + MemDisplayAndEdit.cpp \ + MyFileDialog.cpp \ + MyInputMethod.cpp \ + MyTextEdit.cpp \ + OtherInfo.cpp \ + ParaSettingUI.cpp \ + PhaseGraphic.cpp \ + PicEdit.cpp \ + PicWidget.cpp \ + PrintSetting.cpp \ + PrintTextDisplay.cpp \ + Public.cpp \ + PulseNumFix.cpp \ + SysPara.cpp \ + SystemManage.cpp \ + SystemSetting.cpp \ + TextEditOption.cpp \ + TimeSettingDialog.cpp \ + TriggerCtrl.cpp \ + ZkEdit.cpp \ + dlgdrawinit.cpp \ + zkWidget.cpp \ + qextserialbase.cpp \ + posix_qextserialport.cpp \ + dlginputaddr.cpp \ + dlgshowmsg.cpp \ + QBarCode.cpp \ + dlgQrCode.cpp \ + BarCode/ps.c \ + BarCode/plessey.c \ + BarCode/pcl.c \ + BarCode/msi.c \ + BarCode/library.c \ + BarCode/i25.c \ + BarCode/ean.c \ + BarCode/code128.c \ + BarCode/code93.c \ + BarCode/code39.c \ + BarCode/codabar.c \ + BarCode/cmdline.c \ + QtQREnCode/mask.cpp \ + QtQREnCode/bitstream.cpp \ + QtQREnCode/qrspec.cpp \ + QtQREnCode/split.cpp \ + QtQREnCode/qrinput.cpp \ + QtQREnCode/qrencode_inner.cpp \ + QtQREnCode/qrencode.cpp \ + QtQREnCode/rscode.cpp \ + Matrix/common.cpp \ + Matrix/reedsol.cpp \ + Matrix/dm200.cpp \ + Matrix/drawmatrix.cpp \ + DialogInputTxt.cpp \ + dlgmutilanguage.cpp \ + dlgmywarring.cpp \ + dlgselectinputlanguage.cpp \ + DialogSaveFile.cpp \ + dlgvarlength.cpp \ + scene/picscene.cpp \ + scene/pictextitem.cpp \ + scene/SceneEditOption.cpp \ + scene/sceneviewwidget.cpp \ + Network/NetworkManager.cpp \ + modbus/modbus/mb.c \ + modbus/modbus/functions/mbfunccoils.c \ + modbus/modbus/functions/mbfuncdiag.c \ + modbus/modbus/functions/mbfuncdisc.c \ + modbus/modbus/functions/mbfuncholding.c \ + modbus/modbus/functions/mbfuncinput.c \ + modbus/modbus/functions/mbfuncother.c \ + modbus/modbus/functions/mbutils.c \ + modbus/port/portevent.c \ + modbus/port/portother.c \ + Tftp/filetranseceiver.cpp \ + modbus/port/portserial.c \ + modbus/port/porttimer.c \ + modbus/modbus/rtu/mbcrc.c \ + modbus/modbus/rtu/mbrtu.c \ + dialogmodifypasswd.cpp \ + logo_form.cpp \ + dialogshowcounter.cpp \ + dialogcycleprint.cpp \ + print_net.cpp \ + scene/myview.cpp \ + moveinput.cpp \ + Log/dualfilelogger.cpp \ + Log/filelogger.cpp \ + Log/logger.cpp \ + Log/logmessage.cpp \ + modbus/modbustcp.cpp \ + modbus/modbus/tcp/mbtcp.c \ + modbus/port/porttcp.c + +#RESOURCES +=image.qrc EN/image.qrc +RESOURCES += \ + image.qrc +##ifdef VNLG +#TRANSLATIONS +=./../V0211X86QRVN/chinese.ts ./../V0211X86QRVN/vena.ts ./../V0211X86QRVN/english.ts +TRANSLATIONS += ./vena.ts ./chinese.ts ./turkey.ts ./spanish.ts ./thai.ts ./english.ts +#./../V0211X86QRVN/english.ts +##else +#TRANSLATIONS +=./../V0211X86QR/chinese.ts ./../V0211X86QR/english.ts +##endif + +OTHER_FILES += \ + buge_record.txt + + +if(contains(DEFINES,__VX__)) +{ + #DEFINES += CONFIG_CTRL_IFACE + #DEFINES += CONFIG_CTRL_IFACE_UNIX + #SOURCES += ../../src/utils/os_unix.c + #SOURCES += /home/student/newDisk/335x/original/am335x_src/third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils/os_unix.c + #SOURCES += /home/student/newDisk/335x/original/am335x_src/third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/common/wpa_ctrl.c + #INCLUDEPATH += /home/student/newDisk/335x/original/am335x_src/third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src + #INCLUDEPATH += /home/student/newDisk/335x/original/am335x_src/third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils +} +if(contains(DEFINES,__CONVERTERWIFI__)) +{ + DEFINES += CONFIG_CTRL_IFACE + DEFINES += CONFIG_CTRL_IFACE_UNIX + #SOURCES += ../../src/utils/os_unix.c + SOURCES += /third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils/os_unix.c + SOURCES += /third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/common/wpa_ctrl.c + INCLUDEPATH += /third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src + INCLUDEPATH += /third_part/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils +} +if(contains(DEFINES,MODBUS)) +{ + INCLUDEPATH += $$PWD/modbus/port + INCLUDEPATH += $$PWD/modbus/modbus/include + INCLUDEPATH += $$PWD/modbus/modbus/rtu + INCLUDEPATH += $$PWD/modbus/modbus/tcp + #HEADERS += modbus/modbustcp.h + #SOURCES += modbus/modbustcp.cpp +} + +if(contains(DEFINES,__2451WIFI__)) +{ + #DEFINES += CONFIG_CTRL_IFACE + #DEFINES += CONFIG_CTRL_IFACE_UNIX + ##SOURCES += ../../src/utils/os_unix.c + #SOURCES += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils/os_unix.c + #SOURCES += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/common/wpa_ctrl.c + #INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src + #INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils +} + + + + + + + + + + + + + + + diff --git a/SecondThread/SecondThread.cpp b/SecondThread/SecondThread.cpp new file mode 100644 index 0000000..9b2b594 --- /dev/null +++ b/SecondThread/SecondThread.cpp @@ -0,0 +1,107 @@ +#include +#include +#include "SecondThread.h" +#include "VerBVersion.h" + +SecondThread::SecondThread(QObject* par) : QThread(par) +,m_runCount(20) +{ + pDdlgShowMsg = new DlgShowMsg; + pDdlgShowMsg->hide(); + pTimer10s = new QTimer(); + pTimer10s->setInterval(10000); + //connect(pTimer10s, SIGNAL(timeout()), this, &SecondThread::timeoutSlot); + connect(pTimer10s, SIGNAL(timeout()), this, SLOT(timeoutSlot()),Qt::QueuedConnection); + pUpLicManager = new LicenseManger(); + licState = pUpLicManager->getLicState(); + if(licState) + { + //pDdlgShowMsg->showMsg(tr("license file was invalid,error code:%1").arg(licState)); + emit printerLicErr(licState); + qDebug()<<"asdfsdf"; + } + bLicFileUpdating = false; +} + +SecondThread::~SecondThread() +{ + qDebug() << "SecondThread::~SecondThread()"; +} + +void SecondThread::setSomething() +{ + msleep(500); + QString str = QString("%1->%2,thread id:%3").arg(__FUNCTION__).arg(__FILE__).arg((int)QThread::currentThreadId()); + emit message(str); +} + +void SecondThread::getSomething() +{ + msleep(500); + emit message(QString("%1->%2,thread id:%3").arg(__FUNCTION__).arg(__FILE__).arg((int)QThread::currentThreadId())); +} + +void SecondThread::setRunCount(int count) +{ + m_runCount = count; + emit message(QString("%1->%2,thread id:%3").arg(__FUNCTION__).arg(__FILE__).arg((int)QThread::currentThreadId())); +} + +void SecondThread::timeoutSlot() +{ + QTime curTime=QTime::currentTime(); + qDebug()<CheckRemainingTime(); + if(remaining_time <= 3) + { + licState = -LICENSE_STATE_REMAIN_TIME_REARCH; + emit printerLicErr(licState); + } + } + emit printerLicErr(licState); + } +} +void SecondThread::update_license_file() +{ + pUpLicManager->UpdateLicenseFileData(); + licState = pUpLicManager->getLicState(); +} +void SecondThread::update_license_process() +{ + qint8 updateFileState = pUpLicManager->CheckUpdateFileState(); + if(updateFileState != UPDATE_LICENSE_FILE_OK) + { + //QMessageBox::critical(this,tr("错误"),tr("升级软件错误,错误码:%1").arg(updateState)); + emit update_license_complete(updateFileState); + } + else + { + bLicFileUpdating = true; + update_license_file(); + emit update_license_complete(UPDATE_LICENSE_FILE_OK); + bLicFileUpdating = false; + } +} + +void SecondThread::set_serial_number_process(quint32 serial_number) +{ + qDebug()<<"set_serial_number_process"<setMachineInfo(serial_number); +} +void SecondThread::run() +{ + qDebug()<<"second thread run"; + pTimer10s->start(); + this->exec(); +} + +void SecondThread::doSomething() +{ + msleep(500); + emit message(QString("%1->%2,thread id:%3").arg(__FUNCTION__).arg(__FILE__).arg((int)QThread::currentThreadId())); +} diff --git a/SecondThread/SecondThread.h b/SecondThread/SecondThread.h new file mode 100644 index 0000000..3660230 --- /dev/null +++ b/SecondThread/SecondThread.h @@ -0,0 +1,44 @@ +#ifndef SECONDTHREADFROMQTHREAD_H +#define SECONDTHREADFROMQTHREAD_H +#include +#include +#include "LicenseManger/LicenseManger.h" +#include "dlgshowmsg.h" + +#include + +class SecondThread : public QThread +{ + Q_OBJECT +signals: + void message(const QString& info); + void progress(int present); + void printerLicErr(qint8); + void update_license_complete(qint8); + +public: + SecondThread(QObject* par); + ~SecondThread(); + void setSomething(); + void getSomething(); + void setRunCount(int count); + void run(); + void doSomething(); + void update_license_file(); +private: + int m_runCount; + QTimer *pTimer10s; + LicenseManger *pUpLicManager; + QDate curDate; + TAesClass *pAes; + qint8 licState; + DlgShowMsg *pDdlgShowMsg; + bool bLicFileUpdating; + +private slots: + void timeoutSlot(); + void update_license_process(); + void set_serial_number_process(quint32); +}; + +#endif // THREADFROMQTHREAD_H diff --git a/SysPara.cpp b/SysPara.cpp new file mode 100644 index 0000000..0d78dbb --- /dev/null +++ b/SysPara.cpp @@ -0,0 +1,682 @@ +/* + * SysPara.cpp + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + * + * 2013-9-29 高压 + */ + + +#include "SysPara.h" +#include +#include +#include +#include +#include +#include +//#include +#include "LogInfo.h" +#define VNLG +SysPara::SysPara(void): + devOp(new DevOp(this)){ + + + memset(¶,0,sizeof(para)); + memset(&status,0,sizeof(status)); + //qDebug("start to loadParaFromFile."); + loadParaFromFile(); + //qDebug("loadParaFromFile ok."); + + //para.HVFaultCloseEn= 0; + + if(para.ReadFileErrorCnt<10) para.ReadFileErrorCnt++; + if(para.PowerOnErrorCnt<10) para.PowerOnErrorCnt++; + // PowerOnErrorCnt + //qDebug()<<"cnt ++:"<3 || para.PowerOnErrorCnt>4) { + //loadDefaultPara(); + memset( para.lastOpenedFileName,0,sizeof(para.lastOpenedFileName)); + if(para.ReadFileErrorCnt>=4 ) + para.ReadFileErrorCnt=0; + if(para.PowerOnErrorCnt>=4) + para.PowerOnErrorCnt=0; + //qDebug()<<"sys Star Error, cnt :"<writeFpgaPrintPara(true)会调用这个,所以忽略 + + //para.HVFaultCloseEn= 1; //开机默认为1,允许高压故障自动关闭回收功能 + + devOp->writeFpgaPrintPara(true); //系统起来的时候,将上次记录的配置写入fpga,比如晶振分频等信息 + devOp->writeFpgaVariCtrl(); + devOp->resumeFault(); + + status.lastProductCnt = status.productCnt ; //这会让产品计数显示出来 + status.gearPumpRunStopFlag = false; + status.detectBestOscillatorFreqAppending = false; + status.isPumpValveControledByHand = false; //初始化为自动模式 + status.forTemplateUse = false; + status.lastHighVoltageFault = false; + status.needPowerOffTimerout = 0; + status.circleProductCnt = false; +} + +void SysPara::loadParaFromFile(){ + QFile file(PARA_FILE_PATH); + QFile DeviceCodefile(DeviceCode_FILE_PATH); + QDir dir; + char buf[200]; + //qDebug()<<"loadParaFromFile"; + if(!dir.exists(DOC_ROOT_DIR)){ + snprintf(buf,sizeof(buf),"mkdir -p %s",DOC_ROOT_DIR); + system(buf); + } + if(!dir.exists(PARA_ROOT_DIR)){ + snprintf(buf,sizeof(buf),"mkdir -p %s",PARA_ROOT_DIR); + system(buf); + } + if(!dir.exists(PARA_ROOT_DIR)){ + QMessageBox::warning(0,QString("warnning"),QString("Path") + PARA_ROOT_DIR + QString("not Found.")); + return ; + } + if(file.exists(PARA_FILE_PATH)){ + //qDebug("PARA_FILE_PATH"); + if(!file.open(QIODevice::ReadOnly)){ + //QMessageBox::warning(0,("警告"),QString("无法打开配置文件 ") + PARA_FILE_PATH); + loadDefaultPara(); + } + else { + //qDebug("PARA_FILE_PATH1"); +#if 0 + QMessageBox::StandardButton ret = QMessageBox::Ok; + qint32 copy_len; + if(file.size() != sizeof(para)){ +#ifdef VNLG + ; +#else + ret = QMessageBox::warning(NULL,QString("警告"),QString("配置文件大小不一致,按 确定 将采取兼容方式读取配置文件,否则将恢复成默认设置"), + QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok ); + +#endif + if(ret == QMessageBox::Ok){ + if(file.size()>sizeof(print)) + copy_len = sizeof(print); + else + copy_len = file.size(); + file.seek(0); + file.read((char *)¶,copy_len); + file.close(); + //qDebug("normal load para"); + } + else if(ret == QMessageBox::Cancel){ + loadDefaultPara();//qDebug("loadDefaultPara"); + file.close(); + } + + } + else +#endif + { + file.seek(0); + file.read((char *)¶,(long long int)sizeof(para)); + file.close(); + //////////////////// + if (DeviceCodefile.isOpen()) { + DeviceCodefile.close(); + } + //jdDataRwLock.lockForRead(); + if(!DeviceCodefile.open(QIODevice::ReadOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + //QMessageBox::warning(0,"警告",QString("无法打开文件") ); + } + else { + DeviceCodefile.seek(0); + //file.read((char *)&jd.addr,(long long int)sizeof(jd)); + DeviceCodefile.read((char *)¶.Json_device_code,(qint64)sizeof(para.Json_device_code)); + DeviceCodefile.close(); + } + ////////////// + } + } + } + else { +#ifdef VNLG + ; +#else + QMessageBox::information(0,QString("提示"),QString("这可能是你设备第一次上电,或是进行了出厂设置,我们将使用系统默认配置")); +#endif + + loadDefaultPara(); + //loadDefaultPara();//qDebug("loadDefaultPara2"); + } + //qDebug()<<"SYSPrar:"<sizeof(print)) + copy_len = sizeof(print); + else + copy_len = file.size(); + file.seek(0); + file.read((char *)&print,copy_len); + file.close(); + } + else { + file.seek(0); + file.read((char *)&print,(long long int)sizeof(print)); + file.close(); + memcpy( (char *)¶.alterPrint,(char *)&print.alterPrint,sizeof(alterPrint_t)) ; + para.charBold = print.charBold ; + +#ifndef CABLEUSER + para.SynCntEn = 0 ; + para.autoSynSpeedEn =0 ; + para.cnt1CurrValue =0 ; + para.cnt1EndValue = 0 ; + para.Cnt1NatureValue =0 ; +#else + para.SynCntEn = print.SynCntEn ; + para.autoSynSpeedEn = print.autoSynSpeedEn ; + para.cnt1CurrValue = print.cnt1CurrValue; // 20170313 cnt1StartValue;20191226 cnt1CurrValue + para.cnt1EndValue = print.cnt1EndValue ; + para.Cnt1NatureValue = print.Cnt1NatureValue ; +#endif + + para.mixValveisNewVersion = 1; + para.cnt1RepeateValue = print.cnt1RepeateValue ; + para.cnt1StartValue = print.cnt1StartValue ; + para.cnt1StepValue = print.cnt1StepValue ; + para.cnt2CurrValue = print.cnt2CurrValue;//20170313 cnt2StartValue ; /// 20191226cnt2CurrValue + para.cnt2EndValue = print.cnt2EndValue ; + para.cnt2RepeateValue = print.cnt2RepeateValue ; + para.cnt2StartValue = print.cnt2StartValue ; + para.cnt2StepValue = print.cnt2StepValue ; + + para.cnt3CurrValue = print.cnt3CurrValue;//20170313 cnt2StartValue ; /// 20191226cnt2CurrValue + para.cnt3EndValue = print.cnt3EndValue ; + para.cnt3RepeateValue = print.cnt3RepeateValue ; + para.cnt3StartValue = print.cnt3StartValue ; + para.cnt3StepValue = print.cnt3StepValue ; + + para.currPrintMode = print.currPrintMode ; + para.elecEyeTriggerInterval = print.elecEyeTriggerInterval ; + para.eleEyeClearCntInSynMode = print.eleEyeClearCntInSynMode ; + para.eleEyeTriggerPrintDelay = print.eleEyeTriggerPrintDelay ; + para.eleEyeTriggerSynPrintEn = print.eleEyeTriggerSynPrintEn ; + para.endVoltage = print.endVoltage ; + para.extClearAllCntEnable = print.extClearAllCntEnable ; + para.HighVoltageAmplitude = print.HighVoltageAmplitude ; + para.lastLineEndPointFixedDACValue = print.lastLineEndPointFixedDACValue ; + para.lastLineEndPointFixedValue = print.lastLineEndPointFixedValue ; + para.FullColFixVal = print.FullColFixVal ; + + para.leftRightInverse = print.leftRightInverse ; + para.lineEndAdjustPointCnt = print.lineEndAdjustPointCnt ; + para.lineEndAdjustPointDelay = print.lineEndAdjustPointDelay ; + para.outputPulseDelayMs = print.outputPulseDelayMs ; + para.photoElectricityRepeateNum = print.photoElectricityRepeateNum ; + para.pixNumPerCol = print.pixNumPerCol ; + para.pointVoltageAdjustPos = print.pointVoltageAdjustPos ; + para.PointVoltageAdjustValue = print.PointVoltageAdjustValue ; + para.printColDelay = print.printColDelay ; + para.printDelayMs = print.printDelayMs ; + para.printDirection = print.printDirection ; + para.printRowDelay = print.printRowDelay ; + para.printTotalColNum = print.printTotalColNum ; + para.printTriggerMode = print.printTriggerMode ; //打印触发模式 + para.productCntPerOutputPulse = print.productCntPerOutputPulse ; + para.productNumToGenerateOutputPulse = print.productNumToGenerateOutputPulse ; + para.pulseOutputEnable = print.pulseOutputEnable ; + para.reducedPixelMode = print.reducedPixelMode ; + para.reducedPixelNum = print.reducedPixelNum ; + para.reducedPixelNumRatio = print.reducedPixelNumRatio ; + para.scanInverse = print.scanInverse ; + para.startVoltage = print.startVoltage ; + //print.stepPrint = print.stepPrint ; + memcpy( (char *)¶.stepPrint,(char *)&print.stepPrint,sizeof(stepPrint_t)) ; + memcpy( (char *)¶.adjVolDacRate,(char *)&print.adjVolDacRate,sizeof(print.adjVolDacRate)) ; + + para.synCharWidthRatio = print.synCharWidthRatio ; + para.synClearCntInEleEyeMode = print.synClearCntInEleEyeMode ; +#if 0 //不需要每个文件都存相位的参数 + para.synPulseNumPerMm = print.synPulseNumPerMm ; + para.synPulsePerMmX8 = print.synPulsePerMmX8 ; +#endif + para.synTriggerPrintLenMm = print.synTriggerPrintLenMm ; //喷印间隔 + //para.synTriggerPrintLenRatio = print.synTriggerPrintLenRatio ; + para.sysTriggerPrintMode = print.sysTriggerPrintMode ; + para.timeTriggerPrintDelayMs = print.timeTriggerPrintDelayMs ; + para.timeTriggerPrintMode = print.timeTriggerPrintMode ; + //para.totalSynPulseNum = print.totalSynPulseNum ; + para.upDownInverse = print.upDownInverse ; + + para.varLen = print.varLen; + print.varLen1 = para.varLen1; + para.varLenEn = print.varLenEn?1:0; + para.headLen = print.headLen; + para.endLen = print.endLen; + + para.set_HVData_Flag = 0; + + para.eleMaskTime = print.eleMaskTime; + para.AltMirrorGap = print.AltMirrorGap; + //para.weihu = print.wehu; + //qDebug()<<"sysFile3:"<spinBoxHighLowRatio->value(); + para.phaseHighLowRatio = print.phaseHighLowRatio; + para.phaseShift = print.phaseShift; + para.OuputPulseCol = print.OuputPulseCol; +#ifndef FOR_PHASE_ADJUST + print.phase_detect_pulse_num = 7; + para.phaseDetectVol = 40; + print.phaseDetectDelay = 100; +#else + para.phase_detect_pulse_num = print.phase_detect_pulse_num; + if (print.phase_detect_pulse_num<3 || print.phase_detect_pulse_num>10) { + print.phase_detect_pulse_num = 7; + } + + para.phaseDetectVol = print.phaseDetectVol; + if (print.phaseDetectVol < 28 || print.phaseDetectVol > 70) + print.phaseDetectVol = 35; + + para.phaseDetectDelay = print.phaseDetectDelay;//120;// ui->spinBoxPhaseDetectDelay->value(); + if (print.phaseDetectDelay < 70 || print.phaseDetectDelay > 150) + print.phaseDetectDelay = 100; +#endif + para.enableChargeFullTime = 1; +#endif + } + } + +} + +void SysPara::loadDefaultPrintPara(){ +// memset(&print,0,sizeof(print)); +// print.alterPrint.enable = 0; +// print.stepPrint.enbale = 0; + loadDefaultPara(); +} + +void SysPara::savePrintParaToFile(){ +qDebug()<<"savePrintParaToFile"; + if(sysFile=="") return; + QString fileName = QString( PARA_ROOT_DIR+QFileInfo( sysFile).baseName()+".dpn"); + //qDebug()<<"savePrintParaToFile1:"<> 12; + if(mode == FAST_PRINT ) + { + volParaFilePath = ":/conf/VoltParaHi.bin"; + } + else if(mode == STANDARD_PRINT) + { + volParaFilePath = PARA_ROOT_DIR"VoltParaStd.bin"; + } + if(status.build_dat.builTime == 73) + volParaFilePath = ":/conf/VoltePara_No73.bin"; + else if(type == 6){ + if(status.currPrintRow<=21){ + volParaFilePath = ":/conf/VoltDataStd21.bin"; + } + else if(status.currPrintRow <=25){ + volParaFilePath = ":/conf/VoltDataStd25.bin"; + } + else + volParaFilePath = ":/conf/VoltDataStd32.bin"; + } + QFile file(volParaFilePath); +#if 1 + QDir dir; + char buf[200]; + if (!dir.exists(DOC_ROOT_DIR)){ + snprintf(buf, sizeof(buf), "mkdir -p %s", DOC_ROOT_DIR); + system(buf); + } + if (!dir.exists(PARA_ROOT_DIR)){ + snprintf(buf, sizeof(buf), "mkdir -p %s", PARA_ROOT_DIR); + system(buf); + } + if (!dir.exists(PARA_ROOT_DIR)){ + QMessageBox::warning(0, QString("warnning"), QString("Path") + PARA_ROOT_DIR + QString("not Found.")); + return; + } +#endif + if (file.exists(volParaFilePath)){ + if (!file.open(QIODevice::ReadOnly)){ + } + else { + QMessageBox::StandardButton ret = QMessageBox::Ok; + qint32 copy_len; + char *volteStruct = (char *)&voltePara; + size_t sizeofVolteParaStruct = sizeof(voltePara); + if(status.build_dat.builTime == 73){ + volteStruct = (char *)&voltePara_No73; + sizeofVolteParaStruct = sizeof(voltePara_No73); + } + else if(type == 6){ + memset(&voltePara_25Dots,0,sizeof(voltePara_25Dots)); + volteStruct = (char *)&voltePara_25Dots; + sizeofVolteParaStruct = sizeof(voltePara_25Dots); + } + if (file.size() != sizeofVolteParaStruct){ + qDebug()<<"注意,电压文件大小不对!"; + // LogInfo::setRunStatusText(QString("注意,电压文件大小不对!")); +#ifdef VNLG + ; +#else + ret = QMessageBox::warning(NULL, QString("警告"), QString("配置文件大小不一致,按 确定 将采取兼容方式读取配置文件"), + QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok); + +#endif + if (ret == QMessageBox::Ok){ + copy_len = file.size() < sizeofVolteParaStruct?file.size():sizeofVolteParaStruct; + file.seek(0); + file.read(volteStruct, copy_len); + file.close(); + } + else if (ret == QMessageBox::Cancel){ + file.close(); + } + } + else { + file.seek(0); + file.read(volteStruct, (long long int)sizeofVolteParaStruct); + file.close(); + } + } + } + else{ + qDebug()<<"There is no Volte Para File."; + LogInfo::setRunStatusText(QString("There is no Volte Para File.")); + } +} + + diff --git a/SysPara.h b/SysPara.h new file mode 100644 index 0000000..b2ffbd8 --- /dev/null +++ b/SysPara.h @@ -0,0 +1,1146 @@ +/* + * SysPara.h + * + * Created on: Jun 25, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + * 2013-11-09 聂雄 + * 修改了para 结构,增加了 alterPrint_t,setepPrint_t两组参数,放在0x3C~0x43传替给FPGA + * 占用的原来预留的17个字(68B)中的8字节,故预留空间改为 15字(60字节) + */ + +#ifndef SYSPARA_H_ +#define SYSPARA_H_ + + +#include "DevOp.h" +#include + +#ifndef SYS1 +#define PARA_ROOT_DIR "/home/plg/conf/" +#define DOC_ROOT_DIR "/home/plg/doc/" +#define UDISK_DOC_ROOT_DIR "/udisk/doc/" +#define UDISK_CONF_ROOT_DIR "/udisk/conf/" +#define TESTDIR "/home/plg/r_conf/" +#else +#define PARA_ROOT_DIR "./conf/" +#define DOC_ROOT_DIR "./doc/" +#define UDISK_DOC_ROOT_DIR "./udisk/doc/" +#define TESTDIR "./r_conf/" +#endif + +#define SPACEFLAG // 增加空列 2017.3.8 + +#define TESTFILES TESTDIR"UP.png" +#define TESTFILED DOC_ROOT_DIR"UP.png" +#define TESTFILECS TESTDIR"UP.dpn" +#define TESTFILECD PARA_ROOT_DIR"UP.dpn" + +#define PARA_FILE_PATH PARA_ROOT_DIR"sysPara.bin" +#define DeviceCode_FILE_PATH "/home/plg/conf/deviceCode.bin" + +#define FPGA_PRINT_PARA_BYTE_NUM 0x3C // + +#define BATCHLEN 3 +#define VOLUMELEN 2 + +#define AUTH_NONE 0 +#define AUTH_DISPLAY_SYSTEM_SETTING (1<<0) +#define AUTH_DISPLAY_SYSTEM_MANAGE (1<<1) +#define AUTH_DISPLAY_LOG_INFO (1<<2) +#define AUTH_DISPLAY_OTHER_INFO (1<<3) + +#define AUTH_SUPER_USER1 (1<<16) +#define AUTH_SUPER_USER2 (1<<17) +#ifdef __STC_POWER__ +#define POWER_SOURCE_KEY 0x01 +#define POWER_SOURCE_TIMER 0x02 + +#define WAKEUP_TIMER_15DAYS 0x01 +#define WAKEUP_TIMER_30DAYS 0x02 +#endif +typedef enum { + PRINT_TRIGGER_TIME = 0, + PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL = 1, + PRINT_TRIGGER_ELEC_EYE_EDGE =2, + PRINT_TRIGGER_SYNCHRONIZER = 3, + PRINT_TRIGGER_NONE = 4, + PRINT_TRIGGER_EYESYN =5 + }print_trigger_mode_t; +typedef enum { + OSCILLATTOR_FREQ_64K = 0, + OSCILLATTOR_FREQ_76K = 1, + OSCILLATTOR_FREQ_96K =2, + OSCILLATTOR_FREQ_128K =3 +}oscillator_freq_t; + +#define TIME_TRIGGER_PRINT_MODE_END_TO_HEAD 0 +#define TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD 1 + +#define SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH 0 +#define SYN_PRINT_MODE_ACCORDING_RATIO 1 + +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) +#define MAX_QVARI_NUM 4 +#define MAX_CNT1_GROUPS_NUM 50 + +typedef struct { + unsigned int second:6; + unsigned int minute:6; + unsigned int hour:5; + unsigned day:9; + unsigned month:4; + unsigned dummy:2; + unsigned dayofweek:3; + unsigned year:12; + + unsigned int leap_year:1; //标记当年是否是闰年 + unsigned int cntCurrValueInitEnable:8; //{[0] -> cnt1CurrValue [1] ->cun2CurrValue [2] ->cun3CurrValue} + unsigned int week:8; + unsigned int cnt1CurrValue;// BCD码 + unsigned int cnt2CurrValue; // 0x0f + + unsigned int cnt1End; //0x10 + unsigned int cnt2End; //0x14 + + unsigned short cnt1Repeat;//0x18 + unsigned short cnt2Repeat;//0x1a + + unsigned int cnt1Step;//0x1c + unsigned int cnt2Step;//0x20 + + unsigned int cnt1InitValue; //0x24 + unsigned int cnt2InitValue; //0x28 + + unsigned int RandomValue1; //0x2c + unsigned int RandomValue2; //0x30 + +}calandar_and_dat_t; + +typedef struct { + unsigned int cnt3CurrValue;// BCD码 + unsigned int cnt3End; + unsigned int cnt3Repeat; + unsigned int cnt3Step; + unsigned int cnt3InitValue; + +}stru_counter3; + + +typedef struct +{ + unsigned short builTime; + unsigned short inkDot; // + unsigned char year; + unsigned char month; + unsigned char day; + +}build_dat_t; + +typedef struct +{ + quint8 print_data_xor; + quint8 counter1_current_value; + quint64 sync_counter_at_zero; + +}xor_sync_couter; + +#ifdef ALT16 +typedef struct + { + unsigned short startValue; // 起始值 + unsigned short StepValue; // 跳米间隔 + unsigned short endValue; // 结束值 + unsigned char enbale; // + unsigned char nncc; // 实际跳米数 + }stepPrint_t; // 8Byte + +typedef struct + { + unsigned short startValue; // 起始值 + unsigned short repeatValue; // 重复间隔 + unsigned short repeatPrintTimes; //重复打印次数 + unsigned char DistanceTail; //距离尾部 + unsigned char enable:2; // 交替便能 + unsigned char lineSpace:6; //行距 + //unsigned int bak[10]; // 保留参数 + }alterPrint_t; // 8Byte + +typedef struct + { + unsigned char SpecialVarEnable; //特殊变量便能 + unsigned char Reverse; // + unsigned short SpecialVarCountStart; // 特殊变量起始值 + unsigned short SpecialVarCountEnd; //特殊变量结束值 + unsigned short SpecialVarColStart; //特殊变量开始列 + unsigned short SpecialVarColEnd; // 特殊变量结束列 + unsigned char SpecialVarRowStart; //特殊变量开始行 + unsigned char SpecialVarRowEnd; // 特殊变量结束列 + }SpecialVarPrint; // 8Byte + +#else +typedef struct + { + unsigned char startValue; // 起始值 + unsigned char StepValue; // 跳米间隔 + unsigned char endValue; // 结束值 + unsigned char enbale; // + }stepPrint_t; // 4Byte + +typedef struct + { + unsigned char startValue; // 起始值 + unsigned char repeatValue; // 重复间隔 + unsigned char repeatPrintTimes; //重复打印次数 + unsigned char enable; // 交替便能 + }alterPrint_t; // 4Byte +#endif + +typedef struct // BarCodeOption +{ + unsigned char xpos; + unsigned char font; + unsigned char width; + unsigned char height; + unsigned char scale; + unsigned char type:6; + unsigned char InkColor:1; + unsigned char autoFlash:1; + + unsigned char RecFromHost:1;// RecFromHost + unsigned char DisplayUpdate:1; //变量更新标志 + unsigned char AutoCount:1; // 自动变化 + unsigned char var1En:1; //变量1使用 + unsigned char var2En:1; //变量2使用 + + unsigned char barType;// 条形码类型 + + unsigned short var1Type;// 变量1类型 + unsigned short var2Type;// 变量2类型 + unsigned char var1Num;// 变量1位数 + unsigned char var2Num;// 变量2位数 + + + unsigned char NC2[11]; + char text[80]; + char TxtModule[40]; + char TxtLine[30]; + char TxtLine1[30]; +// unsigned char var3Num;// 变量3位数 +}bcOption_t; + +typedef struct { + unsigned int posx; + unsigned char cntNum; + unsigned char width; + unsigned char height; + unsigned char VarNum:3; //1 + unsigned char AutoRefresh:1; + unsigned char AutoCount:1; + unsigned char InkColor:1; + unsigned char RecFromHost:1;// RecFromHost + unsigned char DisplayUpdate:1; //变量更新标志 + unsigned char type; //0-DataMatrix, 1-QRCode,2-BAR + unsigned long counter; + char text[100]; + char textCnt[10]; + char text2[80]; + char text3[8]; + unsigned short CntInc; + unsigned char barCodeFlag:1;//条形码 +}qrOption_t; + +typedef struct { + int type; + int width; + int height; + int startColPos; + int endRowPos; + int startRowPos; + unsigned int Counter; // + unsigned char countEn; + unsigned char TimeEn; + unsigned char cntNum; // 未使用 + unsigned char NNC2; // 未使用 + //--------------------- + char text[100]; //指向申请内存的空间 生成字模数据 + char textCnt[10]; + char text2[90]; + bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放 +}QRvars_t; + +/* 分段计米相关设定 */ +typedef struct { + unsigned char cnt1GroupCnt; //总共组数 + struct{ + int StartValue; + int EndValue; + //int StepValue; + //int RepeateValue; + int LoopTimes; + }cnt1GroupSettings[MAX_CNT1_GROUPS_NUM]; +}Cnt1ByGroup_t; + +typedef struct +{ + int type;// + int width; + int height; + int startColPos; + int endRowPos; + int startRowPos; + unsigned int year; // + unsigned char month; + unsigned char day; + unsigned char separate[3]; + unsigned char bold; + unsigned char letterSpace; + unsigned char splitMode;// '-','/',年05月24日 + //unsigned int addDays; // + //--------------------- + char text2[20]; + //bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放 +}EXPIRYVAR_t; +// 打印参数 +typedef struct { + /* 打印参数 */ + unsigned int printTotalColNum:16; // 0,1 + unsigned int printDirection:8; // 2[0] 上下颠倒 [1] 左右颠倒 [2] 扫描颠倒 + unsigned int reducedPixelNum:6; // 3 冗余点数 + unsigned int reducedPixelMode:2; // 冗余点比例 + + unsigned int printRowDelay:8; //4 打印模式 + unsigned int printColDelay:24; // 打印设置下的 5,6,7 字宽 + + unsigned char charBold; //8 字体加宽 + unsigned char pixNumPerCol; // 9 每列点阵数 + unsigned int timeTriggerPrintDelayMs:16; //a,b + unsigned int photoElectricityRepeateNum:16; //c,d + unsigned short eleEyeTriggerPrintDelay; // e,f + + unsigned int printTriggerMode:8; // 10 + unsigned int totalSynPulseNum:24; //11,12,13 + unsigned int elecEyeTriggerInterval:32; //14,15,16,17 + unsigned char lineEndAdjustPointCnt; //18 + unsigned char lineEndAdjustPointDelay; //19 + short lastLineEndPointFixedDACValue; //1a 1b + unsigned char extClearAllCntEnable; // 1c --- 通过外部(同步器或电眼)清零 0x3a + unsigned char HighVoltageAmplitude; //0x1d 字高// 字高电压系数 + unsigned char mmmee[2]; + //unsigned short timeTriggerPrintDelayMsH:16; // no use 1e,1f + + // FPGA ADDR 0x60~0x63 + unsigned short productNumToGenerateOutputPulse; //0x1d,1e num产品 out put a pulse + unsigned short outputPulseDelayMs; // 0x1f,0x20 + + // FPGA ADDR 0x44~ + alterPrint_t alterPrint; // 8Byte FPAG由地址0x44~0x4B + unsigned char Cnt1NatureValue:1; //0自然数 + unsigned char eleEyeTriggerSynPrintEn:1; //1电眼触发的同步打印使能 + unsigned char autoSynSpeedEn:1; //2同步打印自动模式 + unsigned char speedoverPaushPrint:1; // 3速度超速不打印标志 + unsigned char SynCntEn1:1; // 4 不打印走米 + unsigned char Vol1of8En:1; // 5 1/8电压打印 + unsigned char eleEyeReTrigDisable:1; // 6 + unsigned char set_HVData_Flag:1; // checkBoxYH + + unsigned char rrr_nc[1]; // 0x4d + unsigned short synPulsePerMmX8 ;// 0x4e~4f + + + bool leftRightInverse; + bool upDownInverse; + bool scanInverse; + int currPrintMode; + + int cnt1EndValue; + int cnt1StartValue; + int cnt1StepValue; + int cnt1RepeateValue; + int cnt1CurrValue; + int cnt2EndValue; + int cnt2StartValue; + int cnt2StepValue; + int cnt2RepeateValue; + int cnt2CurrValue; + +#ifdef SYNLENFLOAT + float +#else + int +#endif + synTriggerPrintLenMm; + + int synTriggerPrintLenRatio; + + int timeTriggerPrintMode; + int printDelayMs; + int sysTriggerPrintMode; //在同步模式下选择按字宽或时喷印比例进行打印 + int synCharWidthRatio; + int rowSequenceMode; + int pointVoltageAdjustPos; + int PointVoltageAdjustValue; + + int synClearCntInEleEyeMode; //在电眼触发模式下通过同步器清零 + int eleEyeClearCntInSynMode; + int reducedPixelNumRatio; + int lastLineEndPointFixedValue; //对高压部分点的修正 + int pulseOutputEnable; // 脉冲使能输出 + int productCntPerOutputPulse;// + + int startVoltage; //首行电压 + int endVoltage; //行末电压 + + float synPulseNumPerMm;// 同步器参数 脉冲/毫米 + // 添加参数 + unsigned char adjVolDacRate[40]; //增加了DAC电压间隔调整比例 + int FullColFixVal; + unsigned char SynCntEn:1; + unsigned char ENNCC:7; + unsigned char NCCC22; + unsigned short eleMaskTime; // 16bit + unsigned short AltMirrorGap;// 镜像打印间隔 Mirror image alternation + unsigned short headLen; + unsigned short endLen;//6 + unsigned char varLenEn;// + short varLen; // 可变长 + short varLen1; // 可变长 + unsigned char NCCC; + QRvars_t QRvars[MAX_QVARI_NUM]; + //BCvars_t BCvars[MAX_QVARI_NUM]; + stepPrint_t stepPrint; // 8Byte + int phaseHighLowRatio; //保存相检 + short phaseShift; //相位偏移 + unsigned short OuputPulseCol; //桂林客户,精准控制输出脉冲的位置,精确到打印的列数 + int phaseDetectVol; + unsigned int phase_detect_pulse_num:4; // 检测个数 + unsigned int phase_detect_voltage:12; // 相检电压阀值 + unsigned short phaseDetectDelay; + unsigned char rrrccc[2]; + quint16 phaseHighCnt; +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + Cnt1ByGroup_t Cnt1ByGroup; +#endif + EXPIRYVAR_t ExpiryVar; //有效期变量 2018.5.24 + EXPIRYVAR_t CurDateVar; + EXPIRYVAR_t ClassVari; + int ExpiryDay; //有效期天数 + //unsigned char ExpirySplitMode; + + int cnt3EndValue; + int cnt3StartValue; + int cnt3StepValue; + int cnt3RepeateValue; + int cnt3CurrValue; +}printPara_t; + +typedef struct { + + unsigned int printTotalColNum:16; + unsigned int printDirection:8; //[0] 上下颠倒 [1] 左右颠倒 [2] 扫描颠倒 + unsigned int reducedPixelNum:6; + unsigned int reducedPixelMode:2; + + unsigned int printRowDelay:8; + unsigned int printColDelay:24; + + unsigned char oscillatorVoltage; //0x08 + unsigned char phaseByHand; + unsigned char charBold; + unsigned char pixNumPerCol; + + unsigned int timeTriggerPrintDelayMs:16; + unsigned int photoElectricityRepeateNum:16; + + unsigned int printTriggerMode:8; //0x10 + unsigned int totalSynPulseNum:24; + + + unsigned int elecEyeTriggerInterval:32; + + unsigned short divideRatio; //0x18 + unsigned char lineEndAdjustPointCnt; // 0x1a + unsigned char lineEndAdjustPointDelay; // 0x1b + unsigned char enableChargeFullTime; // 0x1c + unsigned char timeTriggerPrintDelayMsH:8; // 0x1 + //unsigned char phaseGroupCount:8; // 0x1 + short lastLineEndPointFixedDACValue; + + unsigned int synNumPerCol:16; //0x20,小数位占8位 //每列同步起脉冲数 + unsigned int dotNumPerCol:16; // 平均每列的像素点(减去冗余的点后) + 列延迟(即打印设置界面中的字体宽度printColDelay) + + unsigned short phase_detect_high_cnt; // + unsigned int phase_detect_pulse_num:4; // 检测个数 + unsigned int phase_detect_voltage:12; // 相检电压阀值 + + unsigned short maxHighVoltageDAC;//0x28 + + unsigned short phaseDetectDelay; //相检延迟 //可以认为是相检的间隔, 以墨点为单位 + short phaseShift; // 相位偏移 + unsigned char HighVoltageAmplitude; + unsigned char magicNum; + + unsigned short productNumToGenerateOutputPulse; //产生一个脉冲所需的产品计数个数//0x30 + unsigned short outputPulseDelayMs; + unsigned short septalPostion; //设置的隔膜位置 + unsigned short blinkLightPeriod; //频闪灯周期,以墨点为单位 + unsigned short eleEyeTriggerPrintDelay; // 0x38 + unsigned char extClearAllCntEnable; //通过外部(同步器或电眼)清零 0x3a + unsigned char FullColFixDacVal; // 0x3b + // 0x3C 0x3D 3E 3F USEING + +#ifdef ALT16 + alterPrint_t alterPrint; // 8Byte +#else + stepPrint_t stepPrint; // 4Byte FPAG地址0x44~0x4B + alterPrint_t alterPrint; // 4Byte +#endif + unsigned char Cnt1NatureValue:1; //自然数 + unsigned char eleEyeTriggerSynPrintEn:1; //电眼触发的同步打印使能 + unsigned char autoSynSpeedEn:1; //同步打印自动模式 + unsigned char speedoverPaushPrint:1; // 速度超速不打印标志 + unsigned char SynCntEn1:1; // 不打印走米 + unsigned char Vol1of8En:1; //打印优化 + unsigned char eleEyeReTrigDisable:1; // 6 + unsigned char set_HVData_Flag:1; // +#if 0 + unsigned char rrr_nc[1]; // 0x4d +#else + unsigned char mode0211:1; //0211 模式 + unsigned char synchronizorActType:2; // 0b00:同步器正反转打印; 0b01:同步器只正转打印; 0b10:同步器只反转打印 + unsigned char cnt1ResetToInitValue:1; // 电眼复位时,选择复位到起始值还是当前值 + unsigned char flagOfFastMode:1; + //unsigned char rrr_nc:4; +// unsigned char printOnce:1; // 0x4D :[4:4]0-信息重复打印;1-每条信息只打印一次 + unsigned char rrr_nc:3; // 0x4D :[7:5] +#endif + unsigned short synPulsePerMmX8 ;// 0x4e~4f + /*-------------------------------cut line--------------------------------------*/ +#ifdef ALT16 + stepPrint_t stepPrint; // 8Byte + unsigned int reserved_reg[12]; // 4*(12)=48Byte // 地址: ~0x7F +#else + unsigned int reserved_reg[14]; // 4*(14)=56Byte // 地址: ~0x7F +#endif + unsigned short highVoltageRecord[10]; // 0x80 = 128开始 + int reclaimPumpPWMWidth; + bool leftRightInverse; + bool upDownInverse; + bool scanInverse; + int currPrintMode; + float synPulseNumPerMm; + int cnt1EndValue; + int cnt1StartValue; + int cnt1StepValue; + int cnt1RepeateValue; + int cnt1CurrValue; + int cnt2EndValue; + int cnt2StartValue; + int cnt2StepValue; + int cnt2RepeateValue; + int cnt2CurrValue; + + int startVoltage; + int endVoltage; +#ifdef SYNLENFLOAT + float +#else + int +#endif + synTriggerPrintLenMm; + + int highVoltageLevel; + int pressure; + int viscosityPumpInterval; + int reclaimTankTime; + int temperature;//喷头温度 + int viscosity; + int viscosityAdjust; + bool stopCounterMeterAfterFault; + bool suspendAfterPhaseFault; + int oscillatoFreq; + int synTriggerPrintLenRatio; + char lastOpenedFileName[100]; + int phaseHighLowRatio; //相位高电平占空比 + int phaseDetectVol; //因为和实际的值有一个转换过程,所以用此变量做中转 + int oscillatorFreqFix; + unsigned int totalProductCnt; + int timeTriggerPrintMode; + int printDelayMs; + int sysTriggerPrintMode; //在同步模式下选择按字宽或时喷印比例进行打印 + int synCharWidthRatio; //字符宽度 或 喷印比例 触发设置界面 + int rowSequenceMode; + int pointVoltageAdjustPos; // 点距电压调整位置 + int PointVoltageAdjustValue; //点距调压调整值, 超过调整位置就需要增加充电电压 + int RecycleWarnAction; + int powerOffAfterPhaseFault; + int synClearCntInEleEyeMode; //在点眼触发模式下通过同步器清零 + int eleEyeClearCntInSynMode; // CNT2 D5=0选择电眼复位 D5=1选择电眼加1 ; + // CNT1 D4=0选择电眼复位 D4=1选择电眼加1 ; + // D2D1D0 =00 禁止电眼操作,01 电眼复位,打印完成,10 电眼立即复位 + + int fontPixelSize; //用来记录上一次设置的字体大小 + //int septalPostion; + int mixValveisNewVersion; //混和阀是否是新管路 + int lastLineEndPointFixedValue; //对高压部分点的修正 + int textEditLineSpace; + int textEditCharSpace; + int industryIndex; + int recommendedPrintSpeed; + int pulseOutputEnable; + int productCntPerOutputPulse; + int reducedPixelNumRatio; + int EditMode; //编辑模式 0 txt , 1 dot, 2 场景 + //int nncc:31; + int AlterMode; // 交替状态 0,1,2 + int SynCntEn:1; + int ResetProductCntEn:1; // 复位产品计数器 + int ResetAllProductCntEn:1;// 复位总产品计数器 + int HVFaultCloseEn:1;// 高压故障关回收槽 + int MirrABCEnable:2; // 0 无镜像,1 水平,2 垂直 + int checkSpace:1; //使用空列 + int varLenEn:1;// + int ExtScreenType:3;// 外接屏类型 + int ExtMeterType:3; // 显示屏显示米数类型 + int unc:15; // + int FullColFixVal; + unsigned char ReadFileErrorCnt; // + unsigned char PowerOnErrorCnt; // + unsigned char NozzleType; // 0 -- 小,1- 大 + unsigned char NNCC; //预留,这样可以保证每次的配置文件大小一致 + short varLen; // 头部可变长 + short varLen1; // 尾部可变长 + unsigned short OuputPulseCol; //桂林客户,精准控制输出脉冲的位置,精确到打印的列数-->现在用作充电脉宽 + // short reverse; //留,这样可以保证每次的配置文件大小一致 + unsigned char diameter:3; + unsigned char Reciclar:1; + unsigned char ResetSendData:1; + unsigned char reverse:2; + bool isCheckInsertTime; + calandar_and_dat_t calandar_and_dat; + // 添加参数 + unsigned char adjVolDacRate[40]; //增加了DAC电压间隔调整比例 + + bcOption_t bcOption; + qrOption_t qrOption; + unsigned short eleMaskTime; //0x3C,3D 电眼锁定(屏蔽)间隔ms + unsigned short AltMirrorGap;// 镜像打印间隔 Mirror image alternation + long long openInkLineTime; //记录墨线开关时间 136年 以秒为单位 + long TrunOnPowerCnt; // 开机次数 20151218 +// int varLenEn:1;// +// unsigned char varLen; // 可变长 + unsigned short headLen; + unsigned short endLen; + int ExpiryDay; //有效期天数 + unsigned char ExpirySplitMode; + quint16 diaphramOffset; // 隔膜位置偏移,当隔膜位置低于(设定的隔膜位置-偏移),主墨泵就开启 + unsigned char gearPumpEnable:1; + + quint16 gearPumpValue; + quint16 steal_dac_row; + quint16 phaseHighCnt; + int reserved2[13];// 23 -1预留,这样可以保证每次的配置文件大小一致 + unsigned short reverse3; + bool isCheckBarDate; //条形码加入日期 + bool isCheckBarTime; //条形码加入时间 + bool cnt1ByGroupEnalbe; +#ifdef COUNTER1_BY_GROUP /* 分段计米 */ + Cnt1ByGroup_t Cnt1ByGroup; +#endif + quint16 printed_adj_dac[40]; + quint16 printed_continue_col_dac[40]; + quint16 printed_full_col_dac[40]; + quint16 dacScale; + unsigned int pulse_sinal_value:16; + + int cnt3EndValue; + int cnt3StartValue; + int cnt3StepValue; + int cnt3RepeateValue; + int cnt3CurrValue; + stru_counter3 Counter3; + + + //quint16 Json_device_code; + unsigned char Json_IP[4]; + quint16 Json_server_port; + bool charWidthSetEnable; + bool isCheckMagnet;//检测喷头盖磁铁 + bool isRemoveCode;//不显示二维码 + bool isCheckPrintLight;// + bool isEnableGetDataButton;//使能获取数据按钮 + bool isRemoveDigitCode;//不显示数字码 + bool isCntSaveStateValue;//计数器保存关机值 + bool isCheckBarCodeAddText; + char FanTemperature; + char Json_device_code[10]; + unsigned int ModbusTCPPort; + bool flagOfReclaimPumEnable; + unsigned int gearPumpSpeedAlarm; + + /* */ + // 1108Bytes +}sysPara_t; + +typedef struct +{ + quint8 header[32]; + qint16 pixel_full_table[40]; + qint16 pixel_1_table[40]; + qint16 pixel_2_table[40][2]; + qint16 pixel_3_table[40][3]; + qint16 pixel_4_table[40][4]; + qint16 pixel_para_table[16]; + qint16 pixel_5_table[40][5]; + qint16 pixel_gap_table[48][5]; + qint16 pixel_pre_table[16][5]; + qint16 pixel_c_table[32][4]; +}voltePara_t; + +typedef struct +{ + quint16 matchTotalTableDACArray1[64]; + quint16 matchTotalTableDACArray2[64][2]; + quint16 matchTotalTableDACArray3[64][3]; + quint16 matchTotalTableDACArray4[64][4]; + quint16 matchTotalTableDACArray5[64][5]; + quint16 matchContinousDACArray[64]; + qint8 matchTotalDiffVoltageValue[50][64]; + quint8 matchExtraLineDACArray[64]; + qint8 matchFirstOnePointExtraLineDACArray[64]; + qint8 matchAdjustParaDACArray[8]; + qint8 matchGiantPointVoltageValue[16][64]; + quint16 matchTotalTableDACArrayFirst1[64]; //调一列的第一个单点 +}voltePara_t_25Dots; +typedef struct +{ + quint8 header[32]; + qint16 pixel_full_table[48]; + qint16 pixel_steal_table[48]; + qint16 pixel_head2_table[48]; + qint16 pixel_head3_table[48]; + + qint16 pixel_1_table[48]; + qint16 pixel_tail2_table[48]; + qint16 pixel_2_table[48][2]; + qint16 pixel_3_table[48][3]; + qint16 pixel_4_table[48][4]; + qint16 pixel_para_table[16]; + qint16 pixel_5_table[48][5]; + qint16 pixel_continous_table[48]; + qint16 pixel_gap_table[48][5]; // kongdian + qint8 pixel_big_table[8][8]; + qint16 pixel_gap_post_3dot_table[48][5]; // 3 kongdian + + qint16 row_delay_table[48]; + qint16 head1_row_delay_table[48]; + qint16 pixel_general_dac_parameter[64]; +}voltePara_t_No73; + + +#define MDT 0 +#define QR 1 +#define BAR 2 + +#define MAX_SELF_CHECK_CNT 6000 //60S,以10ms为单位s +#define MIX_VALVE_OPEN_DELAY 90 //混合阀打开的时间 +#define RECYCLE_WARN_DELAY 50 //回收故障延时,以300ms为单位 +#define MAX_VISCOSITY_WORK_TIME 500 //10ms为单位 +#define MAX_MAIN_INK_PUMP_RUN_TIME 1000 //10s +#define MAX_HEATER_TIME 3000 //300s +#define MAX_COMPRESS_PUMP_RUN_TIME 6000 //60 + +#define FPGA_MAGIC_NUM_AFTER_CONF 0x73 +#define MAX_CYCLEVALVE_OPEN_TIME_AFTER_SWITN_OFF 280 // 以10ms为单位 230 + + + +#define FPGA_STATUS_BYTE_NUM 0x44 + +#define MAX_PRINT_COL_NUM_Wide (1000*8 - 1) +#define MAX_PRINT_COL_NUM_Normal (500*8 - 1) +//#define MAX_PRINT_COL_NUM (30) +#define MAX_PRINT_ROW_NUM 40 +#define MAX_PRINT_ROW_BYTE_NUM 5 +#define BLANK_COL_NUM 3 //信息前空3列 +#define RECLAIM_PUMP_FULL_SPEED_CNT 5300 //5s钟 +#define MAX_VARI_NUM 8 + + +#define CALANDAR_YEAR 0 +#define CALANDAR_MONTH 1 +#define CALANDAR_DAY 2 +#define CALANDAR_WEEK 3 +#define CALANDAR_HOUR 4 +#define CALANDAR_MINUTE 5 +#define CALANDAR_SECOND 6 +#define CALANDAR_CNT1 7 +#define CALANDAR_CNT2 8 +#define CALANDAR_CNT3 13 + +#define RANDOMNUM 12 +#define EXPIRYDATE 80 +#define CURDATE 81 +#define CURCLASS 82 + +#define MAX_INK_SOLV_EMTYTIME 10800 // s 3hour 3*60*60 = 10800s + +#define AUTOCLEAN_STATUS_NONE 0 +#define AUTOCLEAN_STATUS_STEP1 1 +#define AUTOCLEAN_STATUS_STEP2 2 +#define AUTOCLEAN_STATUS_STEP3 3 +#define AUTOCLEAN_STATUS_STEP1_TIME 60 +#define AUTOCLEAN_STATUS_STEP2_TIME (60*3) +#define AUTOCLEAN_STATUS_STEP3_TIME (5) + +typedef struct { + int type; + int digitalNum; + int width; // 字模的宽度 + int height; // 字模的高度 + int startColPos; + int endRowPos; + int startRowPos; + int bassAddr; // 字模的地址, 从0开始,不同类型会一直增加 + int currVal; + int bold; + int letterSpace; + //int chartype;// 字体类型:0 常规,1 左横,2 右横, 4 倒立(Nc) + //--------------------- + unsigned char *dat; //指向申请内存的空间 生成字模数据 + int datWidth; //datWidth * datHeight为像素的数目,申请空间的大小为datWidth*rowByteNum; + int datHeight; // 变量的高度 + int rowByteNum; + bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放 +}vars_t; + + +typedef struct{ + unsigned int VREF:16; + unsigned int MOTOR_ISEN:16; + + unsigned int TEMP_ADIN:16; + unsigned int HV_DETOUT:16; + + unsigned int AD_FIXED:16; + unsigned int SEPTAL_POSITION:16; + + unsigned int PRESSURE:16; + unsigned int AD_UNUSED:16; + + unsigned int maginNum:8; //0x10 + unsigned int statWarn:8; //0x11 + unsigned int flightTm:16; + + unsigned int phase:16; + unsigned int viscosity:16; + + unsigned char phaseChargeResult[8]; + +/* + unsigned short ink_dot_num:6; //飞过相检头上的墨点数 0x20 + unsigned short detect_phase_error:1; + unsigned short flight_tm_error:1; + unsigned short synPulseCntPer1sH:8; + unsigned short synPulseCntPer1s:16; +*/ + unsigned int ink_dot_num:6; //飞过相检头上的墨点数 0x20 + unsigned int detect_phase_error:1; + unsigned int flight_tm_error:1; + unsigned int synPulseCntPer1s:24; + + unsigned int productCnt; + + unsigned int synColDelay:16; //0x28 + unsigned char phasePosEdge; //0x2a + unsigned char phaseNegEdge; //0x2b + + unsigned int synTotalPulseCnt; //0x2c~2f + + unsigned int warm_InkPump:1; // 0x30 + unsigned int ink_Ctrl:1; + unsigned int adj_warn:1; // 自动调速状态 NC 20140305 + unsigned int lesslen_warn:1; // 喷印不完整报警 20140305 + unsigned int wait_phdetect_ok:1; // 等待相检完成 V3W 版还没有对此作修改。 原V6S的参数 + unsigned int set_HVData_Flag:1; // 设置高压包电流标志 + unsigned int dummy:2; + unsigned char reclaimTankstatus; // 0x31 130113 + unsigned short curr_reclaimTankTime; // 0x32 33 电机当前开关时长(s) 130113 + unsigned char read_nc11[2]; //34,35 // no use + unsigned char ele_product_cnt_reset; //36 {ele_product_cnt_reset[1:0]}; + unsigned char RandomNum; // 目前实际只[4:0] 37 + unsigned int totalProductCnt ; // 总产品计数器 38393A3B // [1:0] 11立即清零, [2]计数器1单独清零 [3]计数2单独清零 [4]总产品计数器清零 + unsigned int total_syn_pulse_num ; // +#if(0) + unsigned int volGap_pulse_num; // +#else + unsigned int volGap_pulse_num:24; // + unsigned int AlterMode:8; // 交替状态 0,1,2; //0x43 共 0x44个字节 +#endif + //unsigned char read_ncba[6]; // 不用 3C + + + /*----------------------------cut line----------------------------*/ + unsigned short phaseDetectHighTm[64]; //每一个相位的高电平时间 + + unsigned char RandomDigitNum;// 随机码长度 + unsigned char RandomBackCnt; // 0不需要备份,>0需要备份 + + bool isPumpValveControledByHand; //0x20 + bool isCleanUp; + int reclaimCloseCnt; + bool selfCheckDone; + int selfCheckCnt; + int viscosityDelayCnt; + int viscosityFaultCnt; + int rWarnViscoReady; + int viscosityMaxFaultCnt; + int reclaimPumpFullSpeedCnt; //全速开 + bool mainInkPumpError; //主墨泵故障 + int mainInkPumpRunTmCnt; + bool compressPumpError; + int compressPumpRunTmCnt; + int currPrintCol; + int currPrintRow; + unsigned char printDat[MAX_PRINT_COL_NUM_Wide*MAX_PRINT_ROW_BYTE_NUM]; + unsigned char printDat_Normal[MAX_PRINT_COL_NUM_Normal*MAX_PRINT_ROW_BYTE_NUM]; + int currAlterPrintCol; + int currAlterPrintRow; + // unsigned char printAlterDat1[MAX_PRINT_COL_NUM*MAX_PRINT_ROW_BYTE_NUM]; + // unsigned char printAlterDat2[MAX_PRINT_COL_NUM*MAX_PRINT_ROW_BYTE_NUM]; + int delay10ms; + int delay100ms; + int delay1s; + int delay10s; + int delay100s; + int viscosityFault;// 0 正常,1-粘度值高,2-粘度值低 + int lastViscosityFault; //用来记录上一次的粘度错误状态 + int lastStatWarn; + int lastPhaseFault; + int phaseErrorCnt; + + /* Yang */ + int lastRecycleWarn; //记录上一次的回收故障状态 + int RecycleWarnCnt; + int LightUpCnt; + + bool gearPumpRunStopFlag; + unsigned short gearPumpRunSpeed; //齿轮泵转速 + int visocityValueOverflowNum; /*记录粘度溢出次数*/ + unsigned int lastProductCnt; + unsigned int lastSynPulseCntPer1s; // + int lastSynColDelay; + int configDone; //配置完成 + int currentRunStatus; + unsigned int fpgaVersionNum; + unsigned char FPGAChipType; + bool detectHighVoltageAppending; //检测高压 + bool detectedValidHighVoltage; //是否检测到高压 + unsigned int detectHighVoltageCnt; //检测高压的次数 + int lastwarmInkPump; + int variNum,QRvariNum,BCvariNum,ExpiryVarNum,ExpiryDispUpdate,CurrDateVariNum,classVariNum; + vars_t vars[MAX_VARI_NUM]; + //QRvars_t QRvars[MAX_QVARI_NUM]; + calandar_and_dat_t calandar_and_dat; + + /*---------------回收槽控制相关----------------------*/ + int currReclaimTankPos; + int currReclaimOperationCnt; + bool reclainTankReachEnd; //完全打开 + bool reclainOpenAppending; + bool reclainCloseAppending; + bool canRunAirPushing; + + int currMsCnt; + /*---------------------------------------------*/ + bool cnt1CurrentValueInitDoneFlag; // 将这两个值设为false,会另cnt1和cnt2的当前值初始化 + bool cnt2CurrentValueInitDoneFlag; // + /*----------------------------------------------*/ + /*----------------------------------------------*/ + bool RedLightOnFlag; + bool GreenLightOnFlag; + bool YellowLightOnFlag; + + bool beeperOnFlag; + /*--------------------------------------------*/ + int heaterONTimeCnt; //连续加热有时间限制 + + bool lostCommuFlag; //失去通信 + + bool isPrinting; // + + int cycleValveOpenCntAfterSWintOff; //墨线关掉的时候关循环阀的时间 + int cycleValveOpenCntAfterSWintOn; //墨线开启的时候开循环阀的时间 + + //2019/10/26 + bool autoCtlReclaimAfterSWintOff; + int reclaimOpenCntAfterSWintOff; //墨线关掉的时候关回收阀的时间 + bool byHandStore; // 为了控制主墨泵, 保存当前是否在手动状态,然后切换手动状态, + + bool powerOffAppending; //按下快速关机 + + bool reclaimTankBlockedAppending; //回收槽被卡住 + int airPushingOnTime; // 排气的运行时间 + bool airPushing; // 开回收槽执行排气动作 + bool airPushingDone; // 开回收槽执行排气动作完成 + + bool DACDisable; //相位故障,DAC被disable + bool WorkTimeOut; + bool detectBestOscillatorFreqAppending; //检测最佳晶振频率 + bool detectBestOscillatorVoltageAppending; //检测最佳晶振频率 + int currentDetectBestOscillatorCnt; + int longestPhaseHightLevelTm; //最长的相位高电平时间 + int detectedBestOscillatorFreq; // + int detectedStartOscillatorFreq; + int detectedBestOscillatorVoltage; // + int releaseValveDelayCnt; //开泄压阀后立刻关掉,等一定间隔在检测 + int reclaimBlockedCnt; + bool releaseValveOpenApending; + int powerOffAfterPhaseFaultAppending; + unsigned int pressureOverFlowCnt; + unsigned int septalPositionOverFlowCnt; + bool powerOffAfterInkOrSOLVEmptyAppending; //墨水或溶剂空3小时标志 + // + alterPrint_t alterPrint; // 交替打印 + stepPrint_t stepPrint; // 跳米打印 + build_dat_t build_dat; + xor_sync_couter xor_sync; + unsigned int InkOrSOLVEmptyCnt; + unsigned char EditMode; // + + unsigned char updateSoftEN:1; + unsigned char adjHightVolInitEN:1; + unsigned char FileChangeRestCntFlag:1; // 更换文件,清除计数器 + unsigned char HVFaultCloseEn:1;// 高压故障关回收槽 + unsigned char ExtScreenEn; // 外接屏连接正常 + unsigned char waitHightVolOff,waitHightVolOn; // + unsigned char addSpace;//sysPara->para.checkSpace + unsigned char autoCleanStatus; // clean status, 0: NONE,1: Step1 ... + unsigned int autoCleanTime; // clean time + + unsigned int cnt1GroupCurrentLoop; //分段计米 计数器1当前第几次循环 + unsigned char cnt1GroupRunningIndex; //分段计米 计数器1当前第几次段 + unsigned int indoorTemperature; //开机记录喷头温度,作为是否调整粘度的根据 + unsigned int needPowerOffTimerout; +#ifdef __STC_POWER__ + unsigned int powerSource; + unsigned int powerOnTimer; + unsigned int waitPowerOffTime; +#endif +#ifdef __ADC_INPUT__ + unsigned char boardTemp; //机箱温度 +#endif + unsigned char bLanConfigManual; //手动设定有线ip 地址 + quint16 r_print_q; + quint8 col_state; + quint8 r_row_sequcence; + quint8 dot_num; + quint8 curr_index; + quint16 RowADC; + quint16 w_curr_DAC; + quint16 curr_DAC; + quint16 printed_column; + + quint16 printed_adj_dac[40]; + bool cnt3CurrentValueInitDoneFlag; + stru_counter3 Status_Counter3; + bool printDoneFlag; + bool oneCodePrintOnce; + bool forTemplateUse; + SpecialVarPrint specialVarPrint; + bool lastHighVoltageFault; //高压错误 + bool circleProductCnt; + + bool flagOfAdjustWidth_1; + unsigned char splitMode_Adjust_1; + bool flagOfAdjustWidth_2; + unsigned char splitMode_Adjust_2; + + bool flagOfNo67FPGA; //识别67版本,67版本使用4000列,其他版本使用8000列 + short FPGAVersionType; //兼容旧的FPGA版本,0=新FPGA. 旧FPGA: 1=No66,2=No67,3=No72,4=No73,5=其他低于67版本的旧软件(主要针对V5的板子) + bool flagOfPressureFault; + bool logflag; + bool flagOfSpeedAlarm; + bool flagOfStirrer; + int stirrerCnt; + +}sysStatus_t; + +#define RUN_STATUS_IDLE 0 +#define RUN_STATUS_LOST_COMMUNICATION_WITH_FPGA 1 +#include + +/* input registers */ +typedef struct { + uint16_t printFinishFlag;//(0) + uint16_t orderCode;//顺序号(1) + + uint8_t usedFileName[100];//(2-51) + uint16_t printStatus;// 1:正在打印, 2:暂停打印, 3:停止打印(52) + uint16_t statWarn;//(53) + calandar_and_dat_t curCalendarAndDate;//(54-79) + uint32_t mbCurrPrintRow;//(80-81) + uint32_t mbCurrPrintCol;//(82-83) + uint32_t productCnt; //产品计数器(84-85) + uint16_t receiveEnbleFlag;//(86) +}ModbusPrintStatus; + +/* holding registers */ +typedef struct { + uint8_t QRcode_buf[110]; //存二维码的buf(0-54) + uint16_t printCommand; // 1:开始打印, 2:暂停打印, 3:停止打印(55) + uint8_t selectFileName[100]; // 选择要打印的文件(56-105) + uint16_t faultRusume;//(106) + calandar_and_dat_t setCalendar;//(107-133) + uint32_t lineSpaceAndCharSpace; //高16作为行间距,低16位作为字符间距(134-135) + uint16_t clearProductCnt; //产品计数器(136) + uint16_t printContent;//2位数的打印内容(137) +}ModbusPrintParas; + + +/* net data */ +typedef struct { + //get data + char PrintingContent[2048]; + int ProductPlanQty; + char ProductUniqueCode[110];// 产品唯一编码 + int ProductionTask; + char QRCodeContent[110]; + int StartMetre; + bool TasdNeedConfirm; + int TaskSwitchingMode; +}JSON_DATA; + +class SysPara{ + //Q_OBJECT +public : + + SysPara(void); + QString sysFile; + printPara_t print; + sysPara_t para; + voltePara_t voltePara; + voltePara_t_25Dots voltePara_25Dots; + voltePara_t_No73 voltePara_No73; + + sysStatus_t status; + ModbusPrintStatus modbusStatus; + ModbusPrintParas modbusParas; + JSON_DATA Get_JSON_DATA; + DevOp *devOp; /*设备操作*/ + void loadParaFromFile(); + void saveParaToFile(); + void loadDefaultPara(); + void loadDefaultPrintPara(); + void loadPrintParaFromFile(QString fileName); + void savePrintParaToFile(); + void showDebug(QString s); + void showDebug(int s); + void loadVolteParaFromFile(PRINT_MODE mode); + private: + +}; + +#endif /* SYSPARA_H_ */ diff --git a/SystemManage.cpp b/SystemManage.cpp new file mode 100644 index 0000000..da98956 --- /dev/null +++ b/SystemManage.cpp @@ -0,0 +1,1464 @@ +#include "SystemManage.h" +#include "ui_systemmanage.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SysPara.h" +#include "DevOp.h" +#include "myinclude.h" +#include "Public.h" +#include "dlginputaddr.h" +#include "qprogressdialog.h" +#include "LogInfo.h" +#define RECLAIN_TANK_TEST_MAX_COUNT 10 +enum ReclainTankTestEnum{ReclainTankTest_eNotStart,ReclainTankTest_eOpenning,ReclainTankTest_eOpened,ReclainTankTest_eClosing,ReclainTankTest_Closed}; +SystemManage::SystemManage(QWidget *parent) : + QWidget(parent), + ui(new Ui::SystemManage),timeDia(0) +{ + ui->setupUi(this); + timeDia.hide(); + setPumpValveBottonEnable(false); + ui->pushButtonCompressPump->setEnabled(false); + ui->pushButtonMainInkPump->setEnabled(false); + ui->pushButtonReleaseValve->setEnabled(false); + ui->pushButtonReclaimPump->setEnabled(false); + ui->pushButtonGearPump->setEnabled(false); + ui->pushButtonGearPumpOff->setEnabled(false); + + ui->pushButtonPushAir->setEnabled(true); //2019-10-23 排气按钮始终使能 by kun + timer = new QTimer(); + connect(timer, SIGNAL(timeout()), this, SLOT(timerHandler())); + timer2 = new QTimer(); + connect(timer2, SIGNAL(timeout()), this, SLOT(timerHandler2())); + autoCleanTimer = new QTimer(); + connect(autoCleanTimer, SIGNAL(timeout()), this, SLOT(autoCleanTimerHandler())); + connect(this,SIGNAL(autoCleanStart(void)),this,SLOT(onAutoCleanStart(void))); + + reclaimTankTestTimer = new QTimer(); + connect(reclaimTankTestTimer, SIGNAL(timeout()), this, SLOT(reclainTankTestHandler())); + manualControl = new QTimer(); + connect(manualControl,SIGNAL(timeout()),this,SLOT(changeToManualControl())); + +/***2019/10/22 start*****/ + inkcloseCountTimer = new QTimer(); + connect(inkcloseCountTimer, SIGNAL(timeout()), this, SLOT(inkcloseCountHandler())); + inkcloseCountTimer->start(1000); +/****2019/10/22 end****/ + +/***2019/10/23 start*****/ + MainnkCmpSepetalTimer = new QTimer(); + connect(MainnkCmpSepetalTimer, SIGNAL(timeout()), this, SLOT(MainInkCmpSepetalHandler())); + // MainnkCmpSepetalTimer->start(100); +/***2019/10/23 *****/ + +#ifdef MIMA + dialogUpateMm =new DialogAuthorization; + connect(dialogUpateMm,SIGNAL(accepted()),this,SLOT(ondialogAuthorizationAccepted())); + + dialogTimeSetAuthorization = new DialogAuthorization; + connect(dialogTimeSetAuthorization,SIGNAL(accepted()),this,SLOT(on_dialogTimeSetAuthorizationAccepted())); + + dialogSysUpdateAuthorization = new DialogAuthorization; + connect(dialogSysUpdateAuthorization,SIGNAL(accepted()),this,SLOT(on_dialogSysUpdateAuthorizationAccepted())); +dialogFactorySetAuthorization = new DialogAuthorization; +connect(dialogFactorySetAuthorization,SIGNAL(accepted()),this,SLOT(on_dialogFactorySetAuthorizationAccepted())); + dlgInputAddr_TimeSet = new DlgInputAddr(parent); + dlgInputAddr_TimeSet->GetAddr(); + dlgInputAddr_TimeSet->vpnConnect(); + dlgInputAddr_TimeSet->hide(); + +#endif + connect(ui->spinBoxGearPumpValue,SIGNAL(valueChanged(int)),this,SLOT(updateGearPumpValue(int))); +#if 0 + dialogAutoClean = new QProgressDialog(this); + + dialogAutoClean->setWindowModality(Qt::WindowModal); + dialogAutoClean->setMinimumDuration(2); + dialogAutoClean->setCancelButtonText(tr("Cancel")); + dialogAutoClean->setWindowTitle(tr("(1/2) Cleaning, please wait... ")); + dialogAutoClean->setRange(0, AUTOCLEAN_STATUS_STEP1_TIME); + dialogAutoClean->setAutoClose(true); + dialogAutoClean->setAutoReset(true); +#endif + //ui->pushButtonCleanUP->hide(); + ui->pushButtonExportConfToUDisk->setDisabled(true); + ui->pushButtonImportConfFromUdisk->setDisabled(true); + ui->pushButtonFactorySetting->setDisabled(true); + ui->labelControlByHand->setText(tr("自动")); +} + +void SystemManage::bindDlgInputAddr(DlgInputAddr *dlgInputAddr) +{ + dlgInputAddr_TimeSet = dlgInputAddr; + dlgInputAddr_TimeSet->GetAddr(); + dlgInputAddr_TimeSet->vpnConnect(); + dlgInputAddr_TimeSet->hide(); +} + +SystemManage::~SystemManage() +{ + delete ui; + delete timer2; + delete timer; + delete autoCleanTimer; + /***2019/10/22 start*****/ + delete inkcloseCountTimer; + /****2019/10/22 end****/ + + /***2019/10/23 start*****/ + delete MainnkCmpSepetalTimer; +} + +void SystemManage::on_pushButtonReleaseValve_pressed() +{ + if(sysPara){ + sysPara->devOp->controlReleaseValve(!sysPara->devOp->isReleaseValveOpen()); + ui->labelCompressPump->setText(sysPara->devOp->isReleaseValveOpen()?tr("开"):tr("关")); + sysPara->devOp->pumpValveCtrl(); + } +} +void SystemManage::on_pushButtonCompressPump_pressed() +{ + if(sysPara){ + sysPara->devOp->controlCompressPump(!sysPara->devOp->isCompressPumpOpen()); + ui->labelCompressPump->setText(sysPara->devOp->isCompressPumpOpen()?tr("开"):tr("关")); + } +} + +void SystemManage::on_pushButtonCycleValve_pressed() +{ + if(sysPara){ + sysPara->devOp->controlCycleValve(!sysPara->devOp->isCycleValveOpen()); + ui->labelCycleValve->setText(sysPara->devOp->isCycleValveOpen()?tr("开"):tr("关")); + } +} + +void SystemManage::updateGearPumpValue(int) +{ + if(sysPara->status.isPumpValveControledByHand) + { + if(sysPara->para.gearPumpEnable) + { + ui->pushButtonGearPump->setEnabled(true); + } + } +} + +void SystemManage::on_pushButtonGearPump_pressed() +{ + ui->pushButtonGearPump->setEnabled(false); + sysPara->para.gearPumpValue = ui->spinBoxGearPumpValue->value(); + sysPara->devOp->WriteMoterPump(); + if(sysPara->para.flagOfReclaimPumEnable) + manualControl->start(1000); + ui->pushButtonGearPumpOff->setEnabled(true); +} + +void SystemManage::changeToManualControl(){ + if(sysPara->status.PRESSURE > sysPara->para.pressure*1.1){ + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + } + else if(sysPara->status.PRESSURE < sysPara->para.pressure*0.9){ + sysPara->para.gearPumpValue = ui->spinBoxGearPumpValue->value(); + sysPara->devOp->WriteMoterPump(); + } +} + +void SystemManage::on_pushButtonInkValve_pressed() +{ + if(sysPara){ + //2019/10/22 + //2019/11/20 + //开供墨阀之前要判断回收泵有没有开,没开就提前打开;手动模式下,不需要提前开回收泵 + if((!sysPara->devOp->isInkValveOpen()) && (!sysPara->devOp->isReclaimPumpOpen()) && (!sysPara->status.isPumpValveControledByHand)) + { + sysPara->devOp->controlReclaimPump(true, false); // 回收泵开 + } + sysPara->devOp->controlInkValve(!sysPara->devOp->isInkValveOpen()); + ui->labelInkValve->setText(sysPara->devOp->isInkValveOpen()?tr("开"):tr("关")); + } +} + +void SystemManage::on_pushButtonMainInkPump_pressed() +{ + if(sysPara){ + sysPara->devOp->controlMainInkPump(!sysPara->devOp->isMainInkPumpOpen()); + ui->labelMainInkPump->setText(sysPara->devOp->isMainInkPumpOpen()?tr("开"):tr("关")); + sysPara->devOp->mainInkCtrl(); + } +} + +void SystemManage::on_pushButtonMixValve_pressed() +{ + if(sysPara){ + sysPara->devOp->controlMixValve(!sysPara->devOp->isMixValveOpen()); + ui->labelMixValve->setText(sysPara->devOp->isMixValveOpen()?tr("开"):tr("关")); + } +} + +void SystemManage::on_pushButtonReclaimPump_pressed() +{ + if(sysPara){ + sysPara->devOp->controlReclaimPump(!sysPara->devOp->isReclaimPumpOpen(),false); + ui->labelReclaimPump->setText(sysPara->devOp->isReclaimPumpOpen()?tr("开"):tr("关")); + } +} + +void SystemManage::on_pushButtonViscosityPump_pressed() +{ + if(sysPara){ + sysPara->devOp->controlViscosityPump(!sysPara->devOp->isViscosityPumpOpen()); + ui->labelViscosityPump->setText(sysPara->devOp->isViscosityPumpOpen()?tr("开"):tr("关")); + } +} + + +void SystemManage::setPumpValveBottonEnable(bool enable){ + if(sysPara) + { + if(sysPara->para.gearPumpEnable) + { + ui->pushButtonCompressPump->setEnabled(false); + ui->pushButtonMainInkPump->setEnabled(false); + ui->pushButtonReleaseValve->setEnabled(false); + ui->pushButtonReclaimPump->setEnabled(false); + } + else + { + ui->pushButtonCompressPump->setEnabled(enable); + ui->pushButtonMainInkPump->setEnabled(enable); + ui->pushButtonReleaseValve->setEnabled(enable); + ui->pushButtonReclaimPump->setEnabled(enable); + } + if(sysPara->para.flagOfReclaimPumEnable) + ui->pushButtonReclaimPump->setEnabled(enable); + } + ui->pushButtonCycleValve->setEnabled(enable); + ui->pushButtonInkValve->setEnabled(enable); + ui->pushButtonMixValve->setEnabled(enable); + ui->pushButtonViscosityPump->setEnabled(enable); + ui->pushButtonAutoClean->setEnabled(enable); + ui->pushButtonMotorTest->setEnabled(enable); + ui->pushButtonPushAir->setEnabled(enable); + if(sysPara) + { + if(sysPara->para.gearPumpEnable) + { + ui->pushButtonGearPump->setEnabled(enable); + ui->pushButtonGearPumpOff->setEnabled(enable); + } + else + { + ui->pushButtonGearPump->setEnabled(false); + ui->pushButtonGearPumpOff->setEnabled(false); + } + if(enable) + { + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + } + else + { + if(sysPara->para.flagOfReclaimPumEnable) + sysPara->para.gearPumpValue = 230; + else + sysPara->para.gearPumpValue = 300; + sysPara->para.gearPumpValue = 300; + sysPara->devOp->WriteMoterPump(); + } + } + + if(enable){ + if(sysPara){ + sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlInkValve(false); + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->controlMixValve(false); + sysPara->devOp->controlReclaimPump(true,true); + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlReleaseValve(false); + timer->start(2000); + } + } +} + + +void SystemManage::on_pushButtonControlByHand_pressed() +{ + if(sysPara){ + +#ifdef DEBUG1 + sysPara->status.statWarn =0| WARN_STATUS_HDINT;//sysPara->status.statWarn; +#endif + + if(!sysPara->status.isPumpValveControledByHand){ +#if 0 + if(!(sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::warning(this, tr("警告"), + tr("请先移开喷头盖!")); + return ; + } +#endif + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认进入手动模式?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret != QMessageBox::Ok){ + return; + }else + { + if(inkcloseCountTimer->isActive()) inkcloseCountTimer->stop(); + } + } + else { + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("请先确认已经关闭回收槽,确认进入自动模式?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret != QMessageBox::Ok){ + + return; + }else + { + inkcloseCountTimer->start(1000); + } + } + if(timer2->isActive()) timer2->stop(); + if(manualControl->isActive()) manualControl->stop(); + sysPara->status.isPumpValveControledByHand = !sysPara->status.isPumpValveControledByHand; + setPumpValveBottonEnable(sysPara->status.isPumpValveControledByHand); + ui->pushButtonPushAir->setEnabled(true); //2019-10-20 自动还是手动模式,排气按钮都要使能 by kun + ui->labelControlByHand->setText(sysPara->status.isPumpValveControledByHand?tr("手动"):tr("自动")); + sysPara->devOp->mainInkCtrl(); + emit enableReclaimButton(!sysPara->status.isPumpValveControledByHand); + } +} + +void SystemManage::on_pushButtonReclaimTankOpen_pressed() +{ + if(sysPara){ +#ifdef DEBUG1 + sysPara->status.statWarn =0| WARN_STATUS_HDINT;//sysPara->status.statWarn; +#endif + if(!sysPara->para.isCheckMagnet) + { + if(!(sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::warning(this, tr("警告"), + tr("请先移开喷头盖!")); + return ; + } + } + sysPara->devOp->controlReclaimTankOpen(!sysPara->devOp->isReclaimTankOpenEnable()); + ui->labelReclaimTankOpen->setText(sysPara->devOp->isReclaimTankOpenEnable()?tr("启动"):tr("停止")); + sysPara->devOp->highVoltageCtrl(0); + sysPara->status.reclainOpenAppending = true; + sysPara->status.reclainCloseAppending = false; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + } +} + +void SystemManage::on_pushButtonReclaimTankClose_pressed() +{ + if(sysPara){ +#ifdef DEBUG1 + sysPara->status.statWarn =0| WARN_STATUS_HDINT;//sysPara->status.statWarn; +#endif + if(!sysPara->para.isCheckMagnet) + { + if(!(sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::warning(this, tr("警告"), + tr("请先移开喷头盖!")); + return ; + } + } + sysPara->devOp->controlReclaimTankClose(!sysPara->devOp->isReclaimTankCloseEnable()); + ui->labelReclaimTankClose->setText(sysPara->devOp->isReclaimTankCloseEnable()?tr("启动"):tr("停止")); + sysPara->devOp->highVoltageCtrl(0); + sysPara->status.reclainOpenAppending = false; + sysPara->status.reclainCloseAppending = true; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + } +} +#include +void adjustdate(int year, int mon, int mday, int hour, int min, int sec) { + time_t t; + struct tm nowtime; + nowtime.tm_sec = sec; // Seconds.[0-60] (1 leap second) + nowtime.tm_min = min; // Minutes.[0-59] + nowtime.tm_hour = hour; // Hours. [0-23] + nowtime.tm_mday = mday; // Day.[1-31] + nowtime.tm_mon = mon - 1; // Month. [0-11] + nowtime.tm_year = year - 1900; // Year- 1900. + nowtime.tm_isdst = -1; // DST.[-1/0/1] + t = mktime(&nowtime); + +#ifdef SYS_LINUX + stime(&t); +#endif + +} + +void SystemManage::on_dialogTimeSetAuthorizationAccepted() +{ + QString authString= dialogTimeSetAuthorization->getAuth(); + qDebug()<<"authString"<checWhJmDate(authString)) // 0xa001 + { + QTime tm = QTime::currentTime(); + QDate date = QDate::currentDate(); + timeDia.setYear(date.year()); + timeDia.setMonth(date.month()); + timeDia.setDay(date.day()); + timeDia.setHour(tm.hour()); + timeDia.setMinute(tm.minute()); + timeDia.setSecond(tm.second()); + timeDia.hide(); + timeDia.show(); + connect(&timeDia,SIGNAL(accepted()),this,SLOT(onTimeSettingDone())); + }else + { + QMessageBox::about(this, tr("提示"), tr("密码不正确!")); + return; + } + +} + +void SystemManage::on_pushButtonTimeSetting_clicked() +{ + dialogTimeSetAuthorization->clearAuth(); + dialogTimeSetAuthorization->show(); +// QTime tm = QTime::currentTime(); +// QDate date = QDate::currentDate(); +// timeDia.setYear(date.year()); +// timeDia.setMonth(date.month()); +// timeDia.setDay(date.day()); +// timeDia.setHour(tm.hour()); +// timeDia.setMinute(tm.minute()); +// timeDia.setSecond(tm.second()); +// timeDia.hide(); +// timeDia.show(); +// connect(&timeDia,SIGNAL(accepted()),this,SLOT(onTimeSettingDone())); +} + +void SystemManage::onTimeSettingDone(){ + adjustdate(timeDia.getYear(), timeDia.getMonth(), timeDia.getDay(), timeDia.getHour(), timeDia.getMinute(), timeDia.getSecond()); + system("hwclock --systohc"); + // qDebug() << "time setting done!"; +// QString authString= dialogTimeSetAuthorization->getAuth(); +// dlgInputAddr_TimeSet->checWhJmDate(authString); //再执行一次,不然时间改不过来 +} + + +void SystemManage::on_pushButtonUpdateCharLib_pressed() +{ + char cmd[500]; + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("Application"), + tr("是否确认更新字库?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + snprintf(cmd,sizeof(cmd),"rm /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/*.ttf"); + system(cmd); + snprintf(cmd,sizeof(cmd),"rm /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/*.ttc"); + system(cmd); + QDir FontsFile("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"); + if(FontsFile.exists("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"))//2451 + { + snprintf(cmd,sizeof(cmd),"cp /udisk/*.qpf2 /udisk/*.qpf /udisk/*.ttf /udisk/*.ttc /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/"); + system(cmd); + } + if(FontsFile.exists("/usr/lib/fonts/"))//am335x + { + snprintf(cmd,sizeof(cmd),"cp /udisk/*.qpf2 /udisk/*.qpf /udisk/*.ttf /udisk/*.ttc /usr/lib/fonts/"); + system(cmd); + } + + snprintf(cmd,sizeof(cmd),"chmod a+x /udisk/ss"); + system(cmd); + snprintf(cmd,sizeof(cmd),"/udisk/ss"); + system(cmd); + snprintf(cmd,sizeof(cmd),"mkdir /opt/zk/"); + system(cmd); + snprintf(cmd,sizeof(cmd),"cp -f /udisk/zk/* /opt/zk/"); + system(cmd); + snprintf(cmd,sizeof(cmd),"cp -rf /udisk/*_utf8.txt /home/plg/"); + system(cmd); + + QDir dir("/udisk/"); + QStringList filter; + filter<<"*.qpf2"<<"*.qpf"<<"*.ttf"; + QFileInfoList infolist = dir.entryInfoList(filter); + if(infolist.isEmpty()) + { + infolist.clear(); + QMessageBox::information(this, tr("提示"), tr("没找到对应字库,更新失败!")); + } + else + { + QMessageBox::information(this, tr("提示"), + tr("更新字库成功,重启后生效!")); + } + } +} + +void SystemManage::on_pushButtonFactorySetting_pressed() +{ + dialogFactorySetAuthorization->clearAuth(); + dialogFactorySetAuthorization->show(); +} + +void SystemManage::on_dialogFactorySetAuthorizationAccepted() +{ + QString authString= dialogFactorySetAuthorization->getAuth(); + qDebug()<<"authString"<checWhJmDate(authString)) + { + sysPara->loadDefaultPara(); + sysPara->saveParaToFile(); + QMessageBox::information(this,"提示",tr("恢复出厂设置成功,请重新关机上电")); + } + else + { + //QMessageBox::warning(this,tr("提示"),tr(+"密码不正确!"),QMessageBox::Ok); + QMessageBox::about(this, tr("提示"), tr("密码不正确!")); + return; + } +} + +void SystemManage::on_pushButtonScreenAdjust_pressed() +{ + QMessageBox::StandardButton ret; +ret = QMessageBox::information(NULL,tr("校准触摸屏"), tr("是否确认开始校准程序?请小心进行校准!"), + QMessageBox::Ok | QMessageBox::Cancel); +char buf [] = +"#!/bin/sh\n\ +TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent \n\ +TS_INFO_FILE1=/sys/class/input/input0/uevent \n\ +if [ -e $TS_INFO_FILE -a \"/bin/grep -q TouchScreen < $TS_INFO_FILE\" ]; then \n\ +export TSLIB_TSDEVICE=/dev/input/event0 \n\ +export TSLIB_CONFFILE=/usr/local/etc/ts.conf \n\ +export TSLIB_PLUGINDIR=/usr/local/lib/ts \n\ +export TSLIB_CALIBFILE=/etc/pointercal \n\ +export LD_LIBRARY_PATH=/usr/local/lib \n\ +export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin \n\ +export QWS_DISPLAY=:1 \n\ +export QWS_MOUSE_PROTO=\"Tslib:/dev/input/event0 MouseMan:/dev/input/mice\" \n\ +\#rm -f /etc/pointercal \n\ +\#if [ ! -s /etc/pointercal ] ; then \n\ + /usr/local/bin/ts_calibrate \n\ +\#fi \n\ +else \n\ +TS_INFO_FILE1=/sys/class/input/input0/uevent \n\ +if [ -e $TS_INFO_FILE1 -a \"/bin/grep -q tsc < $TS_INFO_FILE1\" ]; then \n\ + export QWS_MOUSE_PROTO=\"Tslib:/dev/input/event0 MouseMan:/dev/input/mice\" \n\ + /usr/local/bin/ts_calibrate \n\ +else \n\ + export QWS_MOUSE_PROTO=\"MouseMan:/dev/input/mice\" \n\ +fi \n\ +fi\n" ; + QFile file("./calibrate"); + ui->pushButtonFactorySetting->setEnabled(0); + ui->pushButtonGhost->setEnabled(0); + ui->pushButtonImportConfFromUdisk->setEnabled(0); + ui->pushButtonExportConfToUDisk->setEnabled(0); + ui->pushButtonTimeSetting->setEnabled(0); + ui->pushButtonScreenAdjust->setEnabled(0); + ui->pushButtonUpdateCharLib->setEnabled(0); + ui->pushButtonUpdateSoftware->setEnabled(0); + ui->pushButtonReclaimTankOpen->setEnabled(0); + ui->pushButtonReclaimTankClose->setEnabled(0); + ui->pushButtonControlByHand->setEnabled(0); + + + if (ret == QMessageBox::Ok){ + if(!file.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + QMessageBox::warning(0,tr("警告"),tr("无法生成脚本 ")); + return ; + } + else { + file.write(buf,(long long int)sizeof(buf)); +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); + system("chmod a+x ./calibrate"); + system("./calibrate &"); + } + } + + ui->pushButtonFactorySetting->setEnabled(1); + ui->pushButtonGhost->setEnabled(1); + ui->pushButtonImportConfFromUdisk->setEnabled(1); + ui->pushButtonExportConfToUDisk->setEnabled(1); + ui->pushButtonTimeSetting->setEnabled(1); + ui->pushButtonScreenAdjust->setEnabled(1); + ui->pushButtonUpdateCharLib->setEnabled(1); + ui->pushButtonUpdateSoftware->setEnabled(1); + ui->pushButtonReclaimTankOpen->setEnabled(1); + ui->pushButtonReclaimTankClose->setEnabled(1); + ui->pushButtonControlByHand->setEnabled(1); +} + +void SystemManage::on_pushButtonUpdateSoftware_pressed() +{ +#ifdef MIMA + if(sysPara->status.updateSoftEN==0){ + dialogUpateMm->clearAuth(); + dialogUpateMm->show(); + } + else ondialogAuthorizationAccepted(); + +#else + ondialogAuthorizationAccepted(); +#endif + +} +void SystemManage::ondialogAuthorizationAccepted() + { +#ifdef MIMA + QString authString= dialogUpateMm->getAuth(); + QString strDay; + strDay.sprintf("%02d", QDate::currentDate().day()); + if(sysPara->status.updateSoftEN==0 && !TEST_MODE)// + { + if(authString.left(5) != "39305" || authString.right(2)!=strDay.left(2) || authString.length()<7) + { + //QMessageBox::warning(this,tr("提示"),tr(+"密码不正确!"),QMessageBox::Ok); + QMessageBox::about(this, tr("提示"), tr("密码不正确!")); + return; + } + sysPara->status.updateSoftEN=1; + } + +#endif + char cmd[200]; + int res=0; + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("是否确认更新软件?"), + QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok); + if (ret == QMessageBox::Ok){ + QFile file("/udisk/QtUI"); + if(file.exists()) + { + + //snprintf(cmd,sizeof(cmd),"cp -f /udisk/QtUI /udisk/*.qm /home/plg/"); + system("cp -f /udisk/*.qm /home/plg/"); + +// res = system("cp -f /udisk/QtUI /home/plg/"); + + file.remove("/home/plg/QtUI"); + + if(!QFile::copy("/udisk/QtUI", "/home/plg/QtUI")) + { + QMessageBox::about(this, tr("错误"), tr("更新失败!")); + return; + } + + //qDebug()<<"update Software."<clearAuth(); + dialogSysUpdateAuthorization->show(); + +// QMessageBox::StandardButton ret; +// ret = QMessageBox::information(this, tr("警告"), +// tr("是否确认备份系统文件?"), +// QMessageBox::Ok | QMessageBox::Cancel); +// if (ret == QMessageBox::Ok){ +// QFile file("/home/plg/conf/sysPara.bin"); +// if(file.exists()){ +// Public::backupPara(); +// QMessageBox::information(this, tr("系统备份"), +// tr("系统备份成功!")); +// } +// else { +// QMessageBox::critical(this, tr("错误"), tr("备份操作失败!")); +// } +// } +} + +void SystemManage::on_dialogSysUpdateAuthorizationAccepted() +{ + +#ifdef MIMA + QString authString= dialogSysUpdateAuthorization->getAuth(); + QString strDay; + strDay.sprintf("%02d", QDate::currentDate().day()); + + if(authString.left(5) != "39305" || authString.right(2)!=strDay.left(2) || authString.length()<7) + { + //QMessageBox::warning(this,tr("提示"),tr(+"密码不正确!"),QMessageBox::Ok); + QMessageBox::about(this, tr("提示"), tr("密码不正确!")); + return; + } + +#endif + + char cmd[200]; + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("是否确认更新系统?"), + QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok); + if (ret == QMessageBox::Ok) + { + QFile file("/udisk/uImage_am335x"); + if(file.exists()) + { + qDebug()<<"start update..."; + snprintf(cmd,sizeof(cmd),"flash_erase /dev/mtd6 0x0 40;nandwrite -n -p -s 0 /dev/mtd6 /udisk/uImage_am335x"); + system(cmd); + QMessageBox::information(this, tr("提示"), tr("系统更新成功,重启后生效!")); + }else + { + QMessageBox::about(this, tr("提示"), tr("文件不存在!")); + } + } +} + +void SystemManage::on_pushButtonCleanUP_pressed() +{ + if(sysPara){ + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗")); + QPushButton *cleanButton = msgBox.addButton(tr("开始清洗"), QMessageBox::ActionRole); + QPushButton *cancleCleanButton = msgBox.addButton(tr("停止清洗"), QMessageBox::ActionRole); + msgBox.addButton(QMessageBox::Cancel); + msgBox.exec(); + if (msgBox.clickedButton() == cleanButton) { + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlViscosityPump(true); + sysPara->devOp->controlReclaimPump(false,false); + timer2->start(60000); + //qDebug()<devOp->controlCycleValve(false); + //sysPara->devOp->controlViscosityPump(false); + timerHandler2(); + //emit timer2->timeout(); + + + } + } +} + + +void SystemManage::updateSysStatusToUI(){ + if(sysPara){ + ui->labelCompressPump->setText((sysPara->devOp->isCompressPumpOpen()?tr("开"):tr("关")) + QString("\n%1").arg(sysPara->status.PRESSURE)); + ui->labelCycleValve->setText(sysPara->devOp->isCycleValveOpen()?tr("开"):tr("关")); + ui->labelInkValve->setText(sysPara->devOp->isInkValveOpen()?tr("开"):tr("关")); + if(((PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV3) + || (PRODUCT_VERSION(sysPara->status.fpgaVersionNum) >= JETV23) //20170830修改主板硬件版本号,以便与主板硬件版本编号对应 + //|| (PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV32) + )&& (!sysPara->status.isPumpValveControledByHand)){ + if(sysPara->para.gearPumpEnable) + { + ui->labelMainInkPump->setText(tr("关")); + } + else + { + if(sysPara->status.ink_Ctrl == 1){ + ui->labelMainInkPump->setText(tr("关") + QString("\n%1").arg(sysPara->status.SEPTAL_POSITION)); + + } + if(sysPara->status.ink_Ctrl == 0){ + ui->labelMainInkPump->setText(tr("开") + QString("\n%1").arg(sysPara->status.SEPTAL_POSITION)); + + } + } + } + else{ + ui->labelMainInkPump->setText((sysPara->devOp->isMainInkPumpOpen()?tr("开"):tr("关")) + QString("\n%1").arg(sysPara->status.SEPTAL_POSITION)); + + } + ui->labelMixValve->setText(sysPara->devOp->isMixValveOpen()?tr("开"):tr("关")); + ui->labelReclaimPump->setText(sysPara->devOp->isReclaimPumpOpen()?tr("开"):tr("关")); + ui->labelReleaseValve->setText(sysPara->devOp->isReleaseValveOpen()?tr("开"):tr("关")); + ui->labelViscosityPump->setText(sysPara->devOp->isViscosityPumpOpen()?tr("开"):tr("关")); + ui->labelReclaimTankOpen->setText(sysPara->devOp->isReclaimTankOpenEnable()?tr("启动"):tr("停止")); + ui->labelReclaimTankClose->setText(sysPara->devOp->isReclaimTankCloseEnable()?tr("启动"):tr("停止")); + + ui->labViscoCnt->setText( QString::number(sysPara->status.viscosityDelayCnt/100,10) );//labViscoCnt + //ui->labViscoFaultCnt->setText( QString::number(sysPara->status.viscosityFaultCnt,10) );//labViscoCnt + + if(sysPara->para.gearPumpEnable) + { + ui->pushButtonCompressPump->setText(tr("压力")); + } + else + { + ui->pushButtonCompressPump->setText(tr("压缩机")); + } + } +} + + +void SystemManage::timerHandler(){ + if(sysPara){ + if(sysPara->status.isPumpValveControledByHand){ //进入手动模式后,延时一点再关闭相关的泵阀 + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlReclaimPump(false,false); + timer->stop(); + } + } +} + + +void SystemManage::timerHandler2(){ + if(sysPara){ + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlViscosityPump(false); + timer2->stop(); + //sysPara->SysPara.showDebug(" timer2 stop"); + } +} +static int mainInkPumpCtrlStatus = 0; +static int mainInkPumpCtrlCnt = 0; +static int cycleValveOnCountInAirPush = 0; +void SystemManage::autoCleanTimerHandler(){ + static bool cleanDone = false; + static int lastCycleValveOpen = 0; + static int mainValve = 5; + if(sysPara){ + if (sysPara->status.airPushing) { + +// if (sysPara->status.SEPTAL_POSITION > sysPara->para.septalPostion + 50) { +// sysPara->devOp->controlCycleValve(true); +// } +// else if (sysPara->status.SEPTAL_POSITION < sysPara->para.septalPostion - 50) { +// sysPara->devOp->controlCycleValve(false); +// } + ++sysPara->status.airPushingOnTime; + // 以500ms 间隔开关循环阀 + if (sysPara->status.airPushingOnTime%10 >= 5) { + sysPara->devOp->controlCycleValve(true); + } + else { + sysPara->devOp->controlCycleValve(false); + } + + + if (mainInkPumpCtrlStatus == 0) { + if(++mainInkPumpCtrlCnt>16) { //90ms 为单位, 时间到关闭 + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 1; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 1) { //90ms 为单位, 时间到开启 + sysPara->devOp->controlMainInkPump(true); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 2; + } + else if (mainInkPumpCtrlStatus == 2) { + if(++mainInkPumpCtrlCnt>8) { + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 3; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 3) { + if(++mainInkPumpCtrlCnt>8) { + sysPara->devOp->controlMainInkPump(true); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 4; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 4) { + if(++mainInkPumpCtrlCnt>8) { + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 3; + mainInkPumpCtrlCnt = 0; + } + } + return; + } + if(dialogAutoClean->wasCanceled()||sysPara->status.autoCleanStatus == AUTOCLEAN_STATUS_NONE) + { + if(autoCleanTimer->isActive()) + autoCleanTimer->stop(); + sysPara->status.autoCleanStatus=AUTOCLEAN_STATUS_NONE; + sysPara->status.autoCleanTime=0; + dialogAutoClean->hide(); + delete dialogAutoClean; + //sysPara->devOp->controlReclaimTankOpen(false); // 停止回收槽 + // step2 完成后进入自动模式,参考了on_pushButtonControlByHand_pressed + if(cleanDone) + { + if(timer2->isActive()) + timer2->stop(); + sysPara->status.isPumpValveControledByHand = !sysPara->status.isPumpValveControledByHand; + sysPara->status.isPumpValveControledByHand = false; + setPumpValveBottonEnable(sysPara->status.isPumpValveControledByHand); + ui->pushButtonPushAir->setEnabled(true); //2019-10-20 自动还是手动模式,排气按钮都要使能 by kun + ui->labelControlByHand->setText(sysPara->status.isPumpValveControledByHand?tr("手动"):tr("自动")); + sysPara->devOp->mainInkCtrl(); + cleanDone = false; + } + qDebug()<status.autoCleanStatus; + return; + } + + //qDebug()<status.autoCleanTime; + //qDebug()<status.autoCleanStatus; + + if(sysPara->status.autoCleanStatus != AUTOCLEAN_STATUS_NONE) + { + dialogAutoClean->setValue(sysPara->status.autoCleanTime); + QCoreApplication::processEvents(); + + ++sysPara->status.autoCleanTime; + if(sysPara->status.autoCleanStatus == AUTOCLEAN_STATUS_STEP1) + { + if(sysPara->status.autoCleanTime >= AUTOCLEAN_STATUS_STEP1_TIME) + { + sysPara->status.autoCleanStatus = AUTOCLEAN_STATUS_STEP2; + sysPara->status.autoCleanTime=0; + dialogAutoClean->setRange(0, AUTOCLEAN_STATUS_STEP2_TIME); + dialogAutoClean->setWindowTitle(tr("(2/3) Cleaning")); +#if 1 + //打开粘度泵,循环阀,墨水阀,主墨泵 + { + //sysPara->devOp->controlCompressPump(false); + if(!sysPara->devOp->isReclaimPumpOpen()) //开供墨阀之前要判断回收泵有没有开,没开就提前打开 + { + sysPara->devOp->controlReclaimPump(true, false); // 回收泵开 + } + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlInkValve(true); + sysPara->devOp->controlMainInkPump(true); + //sysPara->devOp->controlMixValve(false); + //sysPara->devOp->controlReclaimPump(false,true); + sysPara->devOp->controlViscosityPump(true); + //sysPara->devOp->controlReleaseValve(false); + sysPara->devOp->mainInkCtrl(); + } +#endif + } + + } + else if(sysPara->status.autoCleanStatus == AUTOCLEAN_STATUS_STEP2) + { + if(sysPara->status.autoCleanTime >= AUTOCLEAN_STATUS_STEP2_TIME) + { + sysPara->status.autoCleanStatus = AUTOCLEAN_STATUS_STEP3; + sysPara->status.autoCleanTime=0; + + dialogAutoClean->setRange(0, (AUTOCLEAN_STATUS_STEP3_TIME-1)); + dialogAutoClean->setWindowTitle(tr("(3/3) Cleaning")); +#if 1 + //打开粘度泵,混合阀 + { + //--sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(false); //关循环阀,墨水阀,主墨泵 +LogInfo::setRunStatusText(tr("混合阀打开3:")+QString::number(sysPara->status.viscosity)); + sysPara->devOp->controlInkValve(false); + sysPara->devOp->controlMainInkPump(false); + //--sysPara->devOp->controlReclaimPump(false,true); + //--sysPara->devOp->controlReleaseValve(false); + sysPara->devOp->controlMixValve(true); //开混合阀 + sysPara->devOp->controlViscosityPump(true);//开粘度泵 + sysPara->devOp->mainInkCtrl(); + } +#endif +#if 0 + if(sysPara->status.currReclaimTankPos<45){ + sysPara->devOp->controlReclaimTankOpen(1); // 开回收槽,下一个定时器(1s后)进来的时候会停止, + } + else + { + sysPara->devOp->controlReclaimTankClose(1); // 关回收槽,下一个定时器(1s后)进来的时候会停止 + } +#endif + + } + } + else if(sysPara->status.autoCleanStatus == AUTOCLEAN_STATUS_STEP3) + { + if(sysPara->status.autoCleanTime >= AUTOCLEAN_STATUS_STEP3_TIME) + { + sysPara->status.autoCleanStatus = AUTOCLEAN_STATUS_NONE; + sysPara->status.autoCleanTime=0; + cleanDone = true; + } + } + } + } +} + +void SystemManage::reclainTankTestHandler() +{ + static unsigned int waitTime = 0; + if(!sysPara) + { + return; + } + if(reclainTankTestProcess->wasCanceled()||reclainTankTestState == ReclainTankTest_eNotStart) + { + if(reclaimTankTestTimer->isActive()) + reclaimTankTestTimer->stop(); + //sysPara->status.autoCleanStatus=AUTOCLEAN_STATUS_NONE; + reclainTankTestState = ReclainTankTest_eNotStart; + reclainTankTestCount = 0; + reclainTankTestProcess->hide(); + reclainTankTestProcess->deleteLater(); + return; + } + if(reclainTankTestState == ReclainTankTest_eOpenning) { + if(sysPara->status.reclaimTankstatus == 0x05||sysPara->status.reclainTankReachEnd) { //open complete + reclainTankTestState = ReclainTankTest_eOpened; + waitTime = 4; + //qDebug()<<"ReclainTankTest_eOpened"; + } + } + else if(reclainTankTestState == ReclainTankTest_eOpened) { + if(waitTime > 0) + { + --waitTime; + return; + } + sysPara->devOp->controlReclaimTankClose(!sysPara->devOp->isReclaimTankCloseEnable()); + ui->labelReclaimTankClose->setText(sysPara->devOp->isReclaimTankCloseEnable()?tr("启动"):tr("停止")); + sysPara->status.reclainOpenAppending = false; + sysPara->status.reclainCloseAppending = true; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + reclainTankTestState = ReclainTankTest_eClosing; + } + else if(reclainTankTestState == ReclainTankTest_eClosing) { + if(sysPara->status.reclaimTankstatus == 0x06||sysPara->status.reclainCloseAppending==false) { //close complete + reclainTankTestState = ReclainTankTest_Closed; + } + } + else if(reclainTankTestState == ReclainTankTest_Closed) { + reclainTankTestCount++; + if(reclainTankTestCount>=RECLAIN_TANK_TEST_MAX_COUNT) { + reclainTankTestState = ReclainTankTest_eNotStart; + reclaimTankTestTimer->stop(); + reclainTankTestProcess->hide(); + reclainTankTestProcess->deleteLater(); + } + else { + reclainTankTestProcess->setWindowTitle(QString("(%1/%2) reclain tank test").arg(reclainTankTestCount).arg(RECLAIN_TANK_TEST_MAX_COUNT)); + reclainTankTestProcess->setValue(reclainTankTestCount); + sysPara->devOp->controlReclaimTankOpen(!sysPara->devOp->isReclaimTankOpenEnable()); + ui->labelReclaimTankOpen->setText(sysPara->devOp->isReclaimTankOpenEnable()?tr("启动"):tr("停止")); + sysPara->status.reclainOpenAppending = true; + sysPara->status.reclainCloseAppending = false; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + reclainTankTestState = ReclainTankTest_eOpenning; + } + } + else { + reclaimTankTestTimer->stop(); + } + +} + +void SystemManage::inkcloseCountHandler() +{ + if(false == sysPara->devOp->isInkValveOpen()) + { + if(sysPara->devOp->isReclaimPumpOpen()) + { + + sysPara->status.reclaimOpenCntAfterSWintOff++; + if(sysPara->status.reclaimOpenCntAfterSWintOff >= 60) //等待60s + { + sysPara->devOp->controlReclaimPump(false,false); // 墨线关闭一分钟后,回收阀再关闭 + sysPara->status.autoCtlReclaimAfterSWintOff = true; + } + } + }else + { + sysPara->status.reclaimOpenCntAfterSWintOff = 0; + sysPara->status.autoCtlReclaimAfterSWintOff = false; + } +} +void SystemManage::MainInkCmpSepetalHandler() +{ + +// static unsigned int waitTime +// qDebug()<<"sysPara->status.SEPTAL_POSITION" << sysPara->status.SEPTAL_POSITION; + //2019/10/24 主泵由隔膜位置联动 + if(!sysPara->status.isPumpValveControledByHand) + { + if(sysPara->status.SEPTAL_POSITION >= 200) + { + if(true == sysPara->devOp->isMainInkPumpOpen()) + { + sysPara->devOp->controlMainInkPump(false); + } + }else + { + if(false == sysPara->devOp->isMainInkPumpOpen()) + { + sysPara->devOp->controlMainInkPump(true); + } + } + } +} + + +void SystemManage::on_pushButtonExportConfToUDisk_clicked() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("是否确认导出配置到U盘?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QDir dir("/udisk"); + if(!dir.exists()){ + QMessageBox::warning(this, tr("错误"), + tr("检测不到U盘")); + return; + } + system((char *)((QString("cp /home/plg/conf/sysPara.bin /udisk/")).toAscii().data())); + QMessageBox::information(this, tr("提示"), + tr("成功导出配置到U盘")); + } +} + + +void SystemManage::on_pushButtonImportConfFromUdisk_clicked() +{ + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("是否确认从U盘导入配置?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + QFile file("/udisk/sysPara.bin"); + if(!file.exists()){ + QMessageBox::warning(this, tr("错误"), + tr("配置文件/udisk/sysPara.bin不存在!")); + return; + } + system((char *)((QString("cp /udisk/sysPara.bin /home/plg/conf/ ")).toAscii().data())); + QMessageBox::information(this, tr("提示"), + tr("从U盘成功导入配置,重启后生效!")); + emit configChanged(); + } +} + +void SystemManage::onAutoCleanStart(void) +{ + if(sysPara){ + /* into manual control mode */ + // step 1:只开粘度泵; step 2:开粘度泵,循环阀,墨水阀,住墨泵 + //r_PumpValveControledByHand = sysPara->status.isPumpValveControledByHand; + //ui->label_status->setText(tr("正在进入手动模式......")); + //sysPara->status.isPumpValveControledByHand=true; + sysPara->devOp->highVoltageCtrl(0); //关闭高压 + sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlInkValve(false); + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->controlMixValve(false); + sysPara->devOp->controlReclaimPump(false,false); + sysPara->devOp->controlViscosityPump(true);//只开粘度泵 + sysPara->devOp->controlReleaseValve(false); + sysPara->devOp->mainInkCtrl(); + // 关闭回收槽 + { + sysPara->devOp->controlReclaimTankClose(!sysPara->devOp->isReclaimTankCloseEnable()); + ui->labelReclaimTankClose->setText(sysPara->devOp->isReclaimTankCloseEnable()?tr("启动"):tr("停止")); + sysPara->status.reclainOpenAppending = false; + sysPara->status.reclainCloseAppending = true; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + } + + sysPara->status.autoCleanStatus = AUTOCLEAN_STATUS_STEP1; + sysPara->status.autoCleanTime = 0; + qDebug()<setWindowModality(Qt::WindowModal); + dialogAutoClean->setMinimumDuration(2); + dialogAutoClean->setCancelButtonText(tr("Cancel")); + dialogAutoClean->setWindowTitle(tr("(1/3) Cleaning")); + dialogAutoClean->setRange(0, AUTOCLEAN_STATUS_STEP1_TIME); + dialogAutoClean->setAutoClose(true); + dialogAutoClean->setAutoReset(true); +#endif + + emit autoCleanStart(); + autoCleanTimer->start(1000); // 1000 ms + + dialogAutoClean->show(); + /* + if(dialogAutoClean->wasCanceled()) + { + if(autoCleanTimer->isActive()) + autoCleanTimer->stop(); + dialogAutoClean->hide(); + sysPara->status.autoCleanStatus=AUTOCLEAN_STATUS_NONE; + sysPara->status.autoCleanTime=0; + qDebug()<status.autoCleanStatus; + return; + } + */ + } + } +} + + +void SystemManage::on_pushButtonFontToUdisk_pressed() +{ + // + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("是否确认导出字库到U盘?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok) + { + QFile file("/udisk"); + if(!file.exists()){ + QMessageBox::warning(this, tr("错误"), + tr("U盘不可识别!")); + return; + } + + system((char *)((QString("cp /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/* /udisk/.")).toAscii().data())); + system((char *)((QString("cp /usr/lib/fonts/* /udisk/.")).toAscii().data()));//am335x + system((char *)((QString("cp /usr/lib/fonts/* /udisk/.")).toAscii().data())); + system((char *)((QString("mkdir /udisk/zk")).toAscii().data())); + system((char *)((QString("cp /opt/zk/* /udisk/zk/ ")).toAscii().data())); + QMessageBox::information(this, tr("提示"), + tr("字库导出完成!")); + //emit configChanged(); + } + +} + +void SystemManage::on_pushButtonMotorTest_pressed() +{ + QMessageBox::StandardButton ret; + if(!sysPara->para.isCheckMagnet) + { + if(!(sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::warning(this, tr("警告"), + tr("请先移开喷头盖!")); + return ; + } + } + ret = QMessageBox::information(this, tr("警告"), + tr("是否开始电机测试?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + if(sysPara){ + reclainTankTestCount = 0; + reclainTankTestProcess = new QProgressDialog(this); + reclainTankTestProcess->setWindowModality(Qt::WindowModal); + reclainTankTestProcess->setMinimumDuration(2); + reclainTankTestProcess->setCancelButtonText(tr("Cancel")); + reclainTankTestProcess->setWindowTitle(QString("(%1/%2) reclain tank test").arg(reclainTankTestCount).arg(RECLAIN_TANK_TEST_MAX_COUNT)); + reclainTankTestProcess->setRange(0, RECLAIN_TANK_TEST_MAX_COUNT); + reclainTankTestProcess->setValue(reclainTankTestCount); + reclainTankTestProcess->setAutoClose(true); + reclainTankTestProcess->setAutoReset(true); + reclainTankTestProcess->show(); + + sysPara->devOp->controlReclaimTankOpen(!sysPara->devOp->isReclaimTankOpenEnable()); + ui->labelReclaimTankOpen->setText(sysPara->devOp->isReclaimTankOpenEnable()?tr("启动"):tr("停止")); + sysPara->status.reclainOpenAppending = true; + sysPara->status.reclainCloseAppending = false; + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + reclainTankTestState = ReclainTankTest_eOpenning; + reclaimTankTestTimer->start(1000); + } + } +} + +void SystemManage::on_pushButtonPushAir_pressed() +{ + sysPara->status.byHandStore = sysPara->status.isPumpValveControledByHand; + sysPara->status.isPumpValveControledByHand = true; + sysPara->devOp->mainInkCtrl(); + //ui->label_status->setText(tr("正在进入手动模式......")); + + sysPara->status.airPushing = 1; + sysPara->status.airPushingOnTime = 0; + cycleValveOnCountInAirPush = 0; + sysPara->devOp->controlCycleValve(true); + +#ifdef __AIR_RELEASE_OLD__ + // 粘度泵跟随循环阀动作 + sysPara->devOp->controlViscosityPump(true); +#else + sysPara->devOp->controlViscosityPump(true);//关闭粘度泵 + sysPara->devOp->controlMixValve(false); +#endif + + sysPara->devOp->controlMainInkPump(true);//主墨泵敞开 + sysPara->devOp->mainInkCtrl(); + sysPara->devOp->controlReclaimPump(true, false); // 回收泵开 + sysPara->devOp->controlInkValve(true); //墨水阀 + + mainInkPumpCtrlStatus = 0; + mainInkPumpCtrlCnt = 0; + autoCleanTimer->start(90); // 90 ms + QMessageBox::StandardButton ret = QMessageBox::information(this, tr("提示"), + tr("正在排气,是否停止?"), + QMessageBox::Ok); + if (ret == QMessageBox::Ok) { + autoCleanTimer->stop(); + sysPara->status.airPushing = 0; + cycleValveOnCountInAirPush = 0; + // 还原当前模式 + sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlInkValve(false); + if(sysPara->status.SEPTAL_POSITION >= (sysPara->para.septalPostion - 10)) + { + sysPara->devOp->controlMainInkPump(false); + } + if(sysPara->status.isPumpValveControledByHand == true) + { + sysPara->devOp->controlMainInkPump(false); //Controled by hand mode, mainInkPump need to stop + } + + sysPara->devOp->controlMixValve(false); + sysPara->devOp->controlReclaimPump(false,false); + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlReleaseValve(false); + sysPara->status.isPumpValveControledByHand = sysPara->status.byHandStore;// 还原到之前的模式 + sysPara->devOp->mainInkCtrl(); + + + } + +} + +void SystemManage::on_pushButtonGearPumpOff_pressed() +{ + ui->pushButtonGearPumpOff->setEnabled(false); + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + ui->pushButtonGearPump->setEnabled(true); + if(manualControl->isActive()) + manualControl->stop(); +} + diff --git a/SystemManage.h b/SystemManage.h new file mode 100644 index 0000000..bf05d64 --- /dev/null +++ b/SystemManage.h @@ -0,0 +1,126 @@ +#ifndef SYSTEMMANAGE_H +#define SYSTEMMANAGE_H + +#include +#include "ParaSettingUI.h" +#include "TimeSettingDialog.h" +#include +#include "DialogAuthorization.h" +#include "qprogressdialog.h" +#include "PrintSetting.h" +#include "dlginputaddr.h" + +namespace Ui { +class SystemManage; +} + +class SystemManage : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit SystemManage(QWidget *parent = 0); + ~SystemManage(); + void updateSysStatusToUI(); //重载 + void bindDlgInputAddr(DlgInputAddr *dlgInputAddr);//绑定时间权限管理对象 + +private slots: + void on_pushButtonCompressPump_pressed(); + void on_pushButtonGhost_pressed(); + void on_pushButtonCycleValve_pressed(); + + void updateGearPumpValue(int); + void on_pushButtonGearPump_pressed(); + + void on_pushButtonInkValve_pressed(); + + void on_pushButtonMainInkPump_pressed(); + + void on_pushButtonMixValve_pressed(); + + void on_pushButtonReclaimPump_pressed(); + + void on_pushButtonViscosityPump_pressed(); + + void on_pushButtonControlByHand_pressed(); + + void on_pushButtonReclaimTankOpen_pressed(); + + void on_pushButtonReclaimTankClose_pressed(); + + void on_pushButtonTimeSetting_clicked(); + + void onTimeSettingDone(); //时间设置完成 + + void on_pushButtonUpdateCharLib_pressed(); + + void on_pushButtonFactorySetting_pressed(); + + void on_pushButtonScreenAdjust_pressed(); + + void on_pushButtonUpdateSoftware_pressed(); + + void on_pushButtonCleanUP_pressed(); + + void on_pushButtonReleaseValve_pressed(); + + + void timerHandler(); + void timerHandler2(); + void autoCleanTimerHandler(); + + void on_pushButtonExportConfToUDisk_clicked(); + + void on_pushButtonImportConfFromUdisk_clicked(); + void ondialogAuthorizationAccepted(); + + void on_pushButtonAutoClean_pressed(); + void onAutoCleanStart(); + void reclainTankTestHandler(); + + void changeToManualControl(); + + /***2019/10/22 start*****/ + void inkcloseCountHandler(); + /***2019/10/22 end*****/ + /***2019/10/23 start*****/ + void MainInkCmpSepetalHandler(); + /***2019/10/23 */ + //void on_pushButtonAutoClean_clicked(); + + void on_pushButtonFontToUdisk_pressed(); + + void on_pushButtonMotorTest_pressed(); + + void on_pushButtonPushAir_pressed(); + + void on_dialogTimeSetAuthorizationAccepted();//2020/1/6 + void on_dialogFactorySetAuthorizationAccepted(); + void on_dialogSysUpdateAuthorizationAccepted(); + + void on_pushButtonGearPumpOff_pressed(); + +Q_SIGNALS: + void configChanged(); + void autoCleanStart(); + void enableReclaimButton(bool flag); +private: + Ui::SystemManage *ui; + + void setPumpValveBottonEnable(bool enable); + TimeSettingDialog timeDia; + QTimer *timer,*timer2,*autoCleanTimer,*reclaimTankTestTimer,*inkcloseCountTimer,*MainnkCmpSepetalTimer; + int reclainTankTestState; + int reclainTankTestCount;//测试次数 + DialogAuthorization *dialogUpateMm; + DialogAuthorization *dialogTimeSetAuthorization; //2020/1/6 + DialogAuthorization *dialogSysUpdateAuthorization; + DlgInputAddr *dlgInputAddr_TimeSet;//2020/1/6 + QProgressDialog *dialogAutoClean; + QProgressDialog *reclainTankTestProcess; + int pushAir;// 正在排气 + DialogAuthorization *dialogFactorySetAuthorization; + QTimer *manualControl; +}; + +#endif // SYSTEMMANAGE_H diff --git a/SystemSetting.cpp b/SystemSetting.cpp new file mode 100644 index 0000000..1eef560 --- /dev/null +++ b/SystemSetting.cpp @@ -0,0 +1,880 @@ +#include "SystemSetting.h" +#include "ui_systemsetting.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "LogInfo.h" +#include "myinclude.h" +#include "QInputDialog" +#include "dlgmutilanguage.h" +//#define FINDVOL +#include "InputMethod.h" +static int detectValidHVCnt = 0; +SystemSetting::SystemSetting(QWidget *parent) : + QWidget(parent),progressBar(0), + ui(new Ui::SystemSetting) +{ + + ui->setupUi(this); + progressBar.setGeometry(200,200,300,40); //将其放在最中间 + progressBar.hide(); + timer = new QTimer(); + connect(timer, SIGNAL(timeout()), this, SLOT(timerHandler())); + timer2 = new QTimer(); + connect(timer2, SIGNAL(timeout()), this, SLOT(timerHandler2())); + timerAuto = new QTimer(); + connect(timerAuto,SIGNAL(timeout()),this,SLOT(autoControlPressure())); + + //setInterfaceMode(); + + enCleanUpAppendFlag=0; // 0空闲,1关开回收槽,2手动,3清洗,4恢复,5停止,6 +//ui->label_PulseCounterZero->hide();//隐藏界面无用信息 +//ui->labelPulseCounterAtZero->hide();//隐藏界面无用信息 +#ifdef SYSMIMA + dialogUpateMm =new DialogAuthorization; + connect(dialogUpateMm,SIGNAL(accepted()),this,SLOT(ondialogAuthorizationAccepted())); +#endif + // ui->pushButtonCleanUP->hide(); +} + +SystemSetting::~SystemSetting() +{ + delete ui; + delete timer; + delete timer2; + +} + +void SystemSetting::SystemupdateSysParaToUI(){ + updateSysParaToUI(); +} + +void SystemSetting::on_pushButtonApply_pressed() +{ + applyUIPara(); +} + + + + +void SystemSetting::updateSysParaToUI(){ + if(sysPara){ + ui->spinBoxHighVoltageLevel->setValue(sysPara->para.highVoltageLevel); + ui->spinBoxOscillatorVoltage->setValue((sysPara->para.oscillatorVoltage)); + ui->spinBoxPressure->setValue(sysPara->para.pressure); + ui->spinBoxPumpInterval->setValue(sysPara->para.viscosityPumpInterval); + ui->spinBoxReclaimPumpPower->setValue(sysPara->para.reclaimPumpPWMWidth); + ui->spinBoxReclaimTankTime->setValue(sysPara->para.reclaimTankTime); + ui->spinBoxTemperature->setValue(sysPara->para.temperature); + ui->spinBoxFanTemperature->setValue(sysPara->para.FanTemperature); + + ui->spinBoxVIscosity->setValue( sysPara->para.viscosity); + //ui->spinBoxViscosityAdjust->setValue(sysPara->para.viscosityAdjust); + ui->ViscosityAdujstSelect->setCurrentIndex(sysPara->para.viscosityAdjust); + ui->comboBoxOscillatorFreq->setCurrentIndex(sysPara->para.oscillatoFreq); + ui->spinBoxOscillatorFreqFix->setValue(sysPara->para.oscillatorFreqFix); + ui->spinBoxSeptalPostion->setValue(sysPara->para.septalPostion); + //ui->comboBoxDiameter->setCurrentIndex(sysPara->para.diameter); + ui->comboBoxDiaphramOffset->setCurrentIndex(sysPara->para.diaphramOffset/5-1); + //ui->radioButtonMixValveNewVersion->setChecked(sysPara->para.mixValveisNewVersion); + //ui->radioButtonMixValveOldVersion->setChecked(!sysPara->para.mixValveisNewVersion); + if(sysPara->para.EditMode>SCENE)sysPara->para.EditMode=TXTFILE; + + ui->comboBoxEditMode->setCurrentIndex(sysPara->para.EditMode); + } +} + +int convertFreq(int index){ +// qDebug()<<"index="<para.highVoltageLevel = ui->spinBoxHighVoltageLevel->value(); + sysPara->para.oscillatorVoltage = ui->spinBoxOscillatorVoltage->value(); + sysPara->para.pressure = ui->spinBoxPressure->value(); + gearPumpRunNormalFlag = false;//重新设置压力标志设置 + sysPara->para.viscosityPumpInterval = ui->spinBoxPumpInterval->value(); + sysPara->para.reclaimPumpPWMWidth = ui->spinBoxReclaimPumpPower->value(); + sysPara->para.reclaimTankTime = ui->spinBoxReclaimTankTime->value(); + sysPara->para.temperature = ui->spinBoxTemperature->value(); + sysPara->para.viscosity = ui->spinBoxVIscosity->value(); + //sysPara->para.viscosityAdjust = ui->spinBoxViscosityAdjust->value(); + sysPara->para.viscosityAdjust = ui->ViscosityAdujstSelect->currentIndex(); + sysPara->para.oscillatoFreq = ui->comboBoxOscillatorFreq->currentIndex(); + sysPara->para.oscillatorFreqFix = ui->spinBoxOscillatorFreqFix->value(); + sysPara->para.EditMode = ui->comboBoxEditMode->currentIndex(); + //sysPara->para.diameter = ui->comboBoxDiameter->currentIndex();// qDebug()<<"EditMode1"<para.EditMode; + int freq = sysPara->para.oscillatorFreqFix+ convertFreq(sysPara->para.oscillatoFreq); + + if(freq > 0){ + sysPara->para.divideRatio = (FPGA_SYS_HZ/freq)/2; + } + else { + QMessageBox::critical(this,tr("错误"),tr("实际频率不能为%1").arg(freq)); + } + sysPara->para.FanTemperature = ui->spinBoxFanTemperature->value(); + sysPara->para.septalPostion = ui->spinBoxSeptalPostion->value(); + quint16 diaphramOffset = 5*(ui->comboBoxDiaphramOffset->currentIndex()+1); + sysPara->para.diaphramOffset = diaphramOffset; + //sysPara->para.mixValveisNewVersion = ui->radioButtonMixValveNewVersion->isChecked(); + if(sysPara->devOp->writeFpgaPrintPara() != -1){ + QMessageBox::information(this,tr("提示"),tr("应用成功")); + } + emit changeEditMode(sysPara->para.EditMode); + //qDebug()<<"EditMode"<para.EditMode; + } +} + +void SystemSetting::updateSysStatusToUI(){ + if(sysPara){ + ui->pushButtonHighVoltageData->setEnabled( sysPara->status.currReclaimTankPos <5 ); + //ui->pushButtonHighVoltageData->setEnabled( !sysPara->status.isPrinting); + ui->spinBoxPressure->setEnabled( !sysPara->status.isPrinting); + + ui->labelHighVoltageValue->setText(QString::number(sysPara->status.HV_DETOUT) + "/" + QString::number(sysPara->para.maxHighVoltageDAC)); + //ui->labelHighVoltageValue->setText(QString::number(sysPara->status.HV_DETOUT) + "/" + "600");//FPGA那边已固定600 + ui->labelMotorCurrent->setText(QString::number(sysPara->status.MOTOR_ISEN)); + ui->labelPressure->setText(QString::number(sysPara->status.PRESSURE)); + ui->labelTemperature->setText(QString::number(sysPara->status.TEMP_ADIN/4)); + ui->labelPulseCounter->setText(QString::number(sysPara->status.synTotalPulseCnt)); + //ui->label_PulseCounterZero->setText(QString::number(sysPara->status.xor_sync.sync_counter_at_zero)); +// if( sysPara->status.viscosityFaultCnt || sysPara->status.rWarnViscoReady ) +// sysPara->status.viscosity = 0;//sysPara->status.rWarnViscoReady + ui->labelVIscosity->setText(QString::number(sysPara->status.viscosity)); + ui->labelReclaimTankCloseTime->setText(QString::number(sysPara->status.currReclaimTankPos/10)); + //ui->labelTotalPulseNum->setText(QString::number(sysPara->status.synTotalPulseCnt));//不需要显示 + ui->labelSpetalPosition->setText(QString::number(sysPara->status.SEPTAL_POSITION)); + if(sysPara->para.gearPumpEnable) + { + setSpinBoxPressureMaxValue(900); + } + else + { + setSpinBoxPressureMaxValue(5000); + } + if(!sysPara->para.isCheckMagnet) + { + ui->pushButtonCleanUP->setEnabled( (sysPara->status.currReclaimTankPos<70) && (sysPara->status.statWarn & WARN_STATUS_HDINT)); // sysPara->status.currReclaimTankPos + } + else + { + ui->pushButtonCleanUP->setEnabled( (sysPara->status.currReclaimTankPos<70) ); + } + if(sysPara->status.currReclaimTankPos<55 && sysPara->status.currReclaimTankPos>44 && enCleanUpAppendFlag==2) + { + if(timer2->isActive()) timer2->stop(); + enCleanUpAppendFlag=3; + sysPara->devOp->controlReclaimTankOpen(0); + emit onCleanUPNow();// start cleanup + } + else if(sysPara->status.currReclaimTankPos >0 && enCleanUpAppendFlag==4) //? + { + enCleanUpAppendFlag=5; + //sysPara->devOp->controlReclaimTankClose(1); + //ui->label_status->setText(tr("正在关回收槽......")); + } + else if(sysPara->status.currReclaimTankPos ==0 && (enCleanUpAppendFlag==5 ||enCleanUpAppendFlag==4)) //? + { + if(sysPara->status.reclaimCloseCnt)sysPara->status.reclaimCloseCnt--; + else { + sysPara->devOp->controlReclaimTankOpen(0); + timerHandler2(); + if(timer2->isActive()) timer2->stop(); + enCleanUpAppendFlag=0; + } + } + else + { + + } + } +} + +void SystemSetting::on_pushButtonCleanUP_pressed() +{ + if(sysPara){ + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("自动清洗时间约为一分钟,然后自动停止")); + QPushButton *cleanButton; + QPushButton *cancleCleanButton; + cleanButton=NULL; + cancleCleanButton=NULL; + r_PumpValveControledByHand = false; + if( enCleanUpAppendFlag==0) cleanButton = msgBox.addButton(tr("开始清洗"), QMessageBox::ActionRole); + else cancleCleanButton = msgBox.addButton(tr("停止清洗"), QMessageBox::ActionRole); + msgBox.addButton(QMessageBox::Cancel); + msgBox.exec(); + if (msgBox.clickedButton() == cleanButton) + { + r_PumpValveControledByHand = sysPara->status.isPumpValveControledByHand; + //ui->label_status->setText(tr("正在进入手动模式......")); + sysPara->status.isPumpValveControledByHand=true; + sysPara->devOp->controlCompressPump(false); + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlInkValve(false); + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->controlMixValve(false); + sysPara->devOp->controlReclaimPump(true,true); + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlReleaseValve(false); + + if(sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable){ + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlViscosityPump(true); + sysPara->devOp->controlReclaimPump(true,false); + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + sysPara->devOp->controlInkValve(false); + } + + + enCleanUpAppendFlag=1;// 开始启动手动模式 + sysPara->devOp->mainInkCtrl(); + timer2->start(2000); // 暂时循环一下2s + } + else if (msgBox.clickedButton() == cancleCleanButton) { + enCleanUpAppendFlag=3; + timerHandler2(); + return ; + } + } + +} +void SystemSetting::onCleanUPNow() +{ + if(sysPara){ + emit setRunStatus(tr("正在喷嘴逆清洗......")); + if(!(sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable)){ + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlViscosityPump(true); + sysPara->devOp->controlReclaimPump(true,false); + } + timer2->start(60000); + } +} + +void SystemSetting::autoControlPressure(){ + emit pressureAdjust(); +} + +void SystemSetting::timerHandler2(){ + if(sysPara){ + if(enCleanUpAppendFlag==1) + { + //2s循环结束 +// sysPara->devOp->controlCycleValve(false); +// sysPara->devOp->controlReclaimPump(false,false); + if(timer2->isActive()) timer2->stop(); + // 已经进入手动模式了 + // 判断回收槽位置,并控制回收槽打开10mm以上; + enCleanUpAppendFlag=2; + if(sysPara->status.currReclaimTankPos<45) + { + sysPara->devOp->controlReclaimTankOpen(1); + //ui->label_status->setText(tr("正在开回收槽......")); + } + else if(sysPara->status.currReclaimTankPos>55){ + sysPara->devOp->controlReclaimTankClose(1); + //ui->label_status->setText(tr("正在关回收槽......")); + } + timer2->start(5500); + } + else if(enCleanUpAppendFlag==2) // 正在开回收槽 + { + if(timer2->isActive()) timer2->stop(); + enCleanUpAppendFlag=3; + sysPara->devOp->controlReclaimTankOpen(0); + emit onCleanUPNow();// start cleanup + } + else if(enCleanUpAppendFlag==3){// 清洗完成 + enCleanUpAppendFlag=4; +// emit setRunStatus(tr("清洗完成")); + sysPara->devOp->controlCycleValve(false); + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlReclaimTankClose(1); + sysPara->status.reclaimCloseCnt=10; + if(timer2->isActive()) timer2->stop(); + timer2->start(8300); // close reclaimTandk + if(sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable){ + timerAuto->start(500); + } + } + else if(enCleanUpAppendFlag==4){ + emit setRunStatus(tr("清洗完成")); + if(sysPara->status.currReclaimTankPos==0){ + enCleanUpAppendFlag=0; + if(timer2->isActive()) timer2->stop(); + sysPara->devOp->controlReclaimTankClose(0); + } + sysPara->status.isPumpValveControledByHand = false; + if(timerAuto->isActive()) timerAuto->stop(); + sysPara->devOp->mainInkCtrl(); + } + else if(enCleanUpAppendFlag==5){ + if(timer2->isActive()) timer2->stop();enCleanUpAppendFlag=0; + //ui->label_status->setText(""); + sysPara->devOp->controlReclaimTankClose(0); + sysPara->status.isPumpValveControledByHand =false; + sysPara->devOp->mainInkCtrl(); + } + else if(enCleanUpAppendFlag==6){ + if(timer2->isActive()) timer2->stop();enCleanUpAppendFlag=0; + //ui->label_status->setText(""); + sysPara->status.isPumpValveControledByHand =false ; + } + else {if(timer2->isActive()) timer2->stop();} + } +} + +void SystemSetting::on_spinBoxReclaimPumpPower_valueChanged(int arg1) +{ + Q_UNUSED(arg1); + if(sysPara){ + if(sysPara->devOp->isReclaimPumpOpen()){ //在当前是开的情况下重设pwm + sysPara->para.reclaimPumpPWMWidth = ui->spinBoxReclaimPumpPower->value(); + sysPara->devOp->controlReclaimPump(true,false); + } + } +} + + + +void SystemSetting::on_pushButtonHighVoltageData_pressed() +{ +#if 0//def SYSMIMA + if(sysPara->status.adjHightVolInitEN==0){ + dialogUpateMm->clearAuth(); + dialogUpateMm->show(); + } + else ondialogAuthorizationAccepted(); +#else + ondialogAuthorizationAccepted(); +#endif +} +//void ondialogAuthorizationAccepted(); +void SystemSetting::ondialogAuthorizationAccepted() +{ + if(sysPara){ + QMessageBox::StandardButton ret; +#ifdef SYSMIMA + if(sysPara->status.adjHightVolInitEN==0){ + //QString authString= dialogUpateMm->getAuth(); + //if(authString == "07710665") + { + sysPara->status.adjHightVolInitEN =1; + } +// else { +// QMessageBox::warning(this,tr("提示"),tr(+"密码不正确!"),QMessageBox::Ok); +// sysPara->status.adjHightVolInitEN =0; +// return ; +// } + } + + //if(sysPara->status.adjHightVolInitEN==0) return; + +#endif + + ret = QMessageBox::information(this, tr("Application"), + tr("是否更新高压包电流数据?"), + QMessageBox::Ok | QMessageBox::Cancel); + + + + if (ret == QMessageBox::Ok){ + + if((sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::information(this,tr("错误"),tr("喷头盖未关,请先关喷头盖!")); + return ; + } + + sysPara->status.detectHighVoltageAppending = true; + sysPara->status.detectedValidHighVoltage = false; + sysPara->status.detectHighVoltageCnt = 0; + detectValidHVCnt = 0; + progressBar.setMaximum (ARRAY_SIZE(sysPara->para.highVoltageRecord)); + progressBar.setMinimum (0); + progressBar.setValue(sysPara->status.detectHighVoltageCnt); + progressBar.show(); + timer->start(1000); + //ui->label_HVFlag->setText(tr("")); + sysPara->para.set_HVData_Flag = 1; // + sysPara->devOp->writeFpgaPrintPara(true); + //--sysPara->devOp->setCtrlFlags(); + //qDebug()<<"set_HVData_Flag"<para.set_HVData_Flag ; + + } + } +} +//#define VOLDIV 5 // 原来的值 +//#define VOLNUM 20 // 原来的值 +#define VOLDIV 2 // 测试的值 +#define VOLNUM 50 // 测试的值 +void SystemSetting::on_pushButtonSearchBestOscillatorVoltage_pressed() +{ + if(sysPara){ + if((sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){ + QMessageBox::information(this,tr("错误"),tr("墨线开关未开,请先打开墨线开关!")); + return ; + } + if((sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::information(this,tr("错误"),tr("喷头盖未关,请先关喷头盖!")); + return ; + } + if(!sysPara->status.reclainTankReachEnd){ + QMessageBox::information(this,tr("错误"),tr("回收槽未全部打开!")); + return ; + } + + QMessageBox::StandardButton ret; + + ret = QMessageBox::information(this, tr("Application"), + tr("自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->devOp->printCtrl(PRINT_CTRL_STOP); //停止打印 + sysPara->devOp->highVoltageCtrl(0); // 关高压 + progressBar.setMaximum (VOLNUM); + progressBar.setMinimum (0); + progressBar.setValue(0); + progressBar.show(); + sysPara->status.detectBestOscillatorVoltageAppending = true; + sysPara->status.currentDetectBestOscillatorCnt = 0; + sysPara->status.longestPhaseHightLevelTm = 0; + sysPara->status.detectedBestOscillatorVoltage = 0; + sysPara->devOp->setOscillatorVoltage(0); + timer->start(6000); + } + } +} + +void SystemSetting::on_pushButtonSearchBestOscillatorFreq_pressed() +{ + if(sysPara){ + if((sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){ + QMessageBox::information(this,tr("错误"),tr("墨线开关未开,请先打开墨线开关!")); + return ; + } + if((sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::information(this,tr("错误"),tr("喷头盖未关,请先关喷头盖!")); + return ; + } + if(!sysPara->status.reclainTankReachEnd){ + QMessageBox::information(this,tr("错误"),tr("回收槽未全部打开!")); + return ; + } + + QMessageBox::StandardButton ret; + + ret = QMessageBox::information(this, tr("Application"), + tr("自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->devOp->printCtrl(PRINT_CTRL_STOP); //停止打印 + sysPara->devOp->highVoltageCtrl(0); // 关高压 + progressBar.setMaximum (20); + progressBar.setMinimum (0); + progressBar.setValue(0); + progressBar.show(); + + if(sysPara->para.divideRatio){ + sysPara->status.detectedStartOscillatorFreq = FPGA_SYS_HZ/(2*sysPara->para.divideRatio); + sysPara->status.detectedStartOscillatorFreq -= 2000; + } + else { + sysPara->status.detectedStartOscillatorFreq = 63000; + } + if(sysPara->status.detectedStartOscillatorFreq < 50000 || sysPara->status.detectedStartOscillatorFreq > 110000){ + QMessageBox::critical(this, tr("错误"), + tr("搜索的起始频率%1 HZ超出范围?").arg(sysPara->status.detectedStartOscillatorFreq)); + return ; + } + sysPara->status.detectBestOscillatorFreqAppending = true; + sysPara->status.currentDetectBestOscillatorCnt = 0; + sysPara->status.longestPhaseHightLevelTm = 0; + sysPara->status.detectedBestOscillatorFreq = sysPara->status.detectedStartOscillatorFreq; + sysPara->devOp->setDivideRatio(0); + timer->start(6000); + } + } +} + +//排序函数 +void bubbleSort(unsigned short arr[], int n) { + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (arr[j] > arr[j + 1]) { + int temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + } +} + +void SystemSetting::timerHandler(){ + if(sysPara){ + /*-------------------------------------高压检测-----------------------------------*/ + if(sysPara->status.detectHighVoltageAppending){ +#if 1 + if(sysPara->status.detectHighVoltageCnt < ARRAY_SIZE(sysPara->para.highVoltageRecord)-1){ + sysPara->para.highVoltageRecord[sysPara->status.detectHighVoltageCnt] = + sysPara->status.detectHighVoltageCnt?sysPara->status.HV_DETOUT:0; + sysPara->devOp->maxHighVoltageDACCtrl(0); //将其detectHighVoltageCnt设置为零,不处理高压故障 + sysPara->devOp->resumeFault(); //如果有高压故障,恢复高压故障 + progressBar.setValue(sysPara->status.detectHighVoltageCnt); + /* 应要求去掉多余到信息*/ + LogInfo::setRunStatusText(QString("High voltage %1 --- value %2") + .arg(sysPara->status.detectHighVoltageCnt).arg(sysPara->para.highVoltageRecord[sysPara->status.detectHighVoltageCnt])); + + if(sysPara->para.highVoltageRecord[sysPara->status.detectHighVoltageCnt] > 30) //起始电压太小不算 + { + if(sysPara->status.detectedValidHighVoltage) + sysPara->status.detectHighVoltageCnt ++; + else{ //从无到有第一次检测高压的话,计数不加1 + + } + sysPara->status.detectedValidHighVoltage = true; + } + else + sysPara->status.detectHighVoltageCnt ++; +#ifdef __HV_FOR_WANG_DEBUG__ + int actHvAmp = sysPara->status.detectHighVoltageCnt*10; +#if 0 + float tempHvAmp;// = sysPara->para.HighVoltageAmplitude * 1.73; + if(sysPara->status.detectHighVoltageCnt*10 == 0) { + tempHvAmp = 0; + } + else if(sysPara->status.detectHighVoltageCnt*10 == 1) { + tempHvAmp = 63.5; + } + else { + tempHvAmp = 63.5 + (sysPara->status.detectHighVoltageCnt*10 - 1) * 0.51; + } + sysPara->devOp->highVoltageCtrl(tempHvAmp); +#endif + //sysPara->para.HighVoltageAmplitude = (unsigned char)tempHvAmp; + sysPara->devOp->highVoltageCtrl(actHvAmp); + sysPara->para.HighVoltageAmplitude = actHvAmp; +#else + sysPara->devOp->highVoltageCtrl(sysPara->status.detectHighVoltageCnt*10); +#endif +#else + if(detectValidHVCnt < ARRAY_SIZE(sysPara->para.highVoltageRecord) && sysPara->status.detectHighVoltageCnt<16){ +// sysPara->para.highVoltageRecord[detectValidHVCnt] = +// detectValidHVCnt?sysPara->status.HV_DETOUT:0; + sysPara->para.highVoltageRecord[detectValidHVCnt] = sysPara->status.HV_DETOUT; + sysPara->devOp->maxHighVoltageDACCtrl(0); //将其detectHighVoltageCnt设置为零,不处理高压故障 + sysPara->devOp->resumeFault(); //如果有高压故障,恢复高压故障 + progressBar.setValue(detectValidHVCnt); + /* 应要求去掉多余到信息 + LogInfo::setRunStatusText(QString("High voltage %1 --- value %2") + .arg(sysPara->status.detectHighVoltageCnt).arg(sysPara->para.highVoltageRecord[sysPara->status.detectHighVoltageCnt])); + */ + //if(sysPara->para.highVoltageRecord[detectValidHVCnt] > 30) //起始电压太小不算 + if(sysPara->status.HV_DETOUT > 30) //起始电压太小不算 + { +// if(sysPara->status.detectedValidHighVoltage) +// detectValidHVCnt ++; +// else{ //从无到有第一次检测高压的话,计数不加1 + +// } +// sysPara->status.detectedValidHighVoltage = true; + detectValidHVCnt ++; + } + //else + sysPara->status.detectHighVoltageCnt ++; + + sysPara->devOp->highVoltageCtrl(sysPara->status.detectHighVoltageCnt*6); + +#endif + }else { + sysPara->para.highVoltageRecord[9] = sysPara->para.highVoltageRecord[8]; + sysPara->status.detectHighVoltageAppending = 0; + LogInfo::setRunStatusText(tr("高压设置完成")); + sysPara->para.set_HVData_Flag = 0; // + sysPara->devOp->writeFpgaPrintPara(true); //在这里面不能产生阻塞 + progressBar.hide(); + timer->stop(); + } + } + else if(sysPara->status.detectBestOscillatorFreqAppending){ + sysPara->devOp->readPhaseDetectHighTm(); + int longestPhaseHightLevelTm = 0; + if(!sysPara->status.detect_phase_error && !sysPara->status.flight_tm_error ){ +#if 0 + for(unsigned int i = 0; i < ARRAY_SIZE(sysPara->status.phaseDetectHighTm); i++){ + if(sysPara->status.phaseDetectHighTm[i] > longestPhaseHightLevelTm){ + longestPhaseHightLevelTm = sysPara->status.phaseDetectHighTm[i]; + } + } +#else + int n = ARRAY_SIZE(sysPara->status.phaseDetectHighTm); + bubbleSort(sysPara->status.phaseDetectHighTm, n); + + int sum = 0; + for (int i= 1; i < n -1; i++) + { + sum += sysPara->status.phaseDetectHighTm[i]; + } + longestPhaseHightLevelTm = sum / (n-2); + +#endif + } + LogInfo::setRunStatusText(tr("Oscillator Freq %1 --- 最长高电平时钟 %2") + .arg( sysPara->status.detectedStartOscillatorFreq + sysPara->status.currentDetectBestOscillatorCnt*200).arg(longestPhaseHightLevelTm)); + + if(longestPhaseHightLevelTm > sysPara->status.longestPhaseHightLevelTm){ + sysPara->status.longestPhaseHightLevelTm = longestPhaseHightLevelTm; + sysPara->status.detectedBestOscillatorFreq = sysPara->status.detectedStartOscillatorFreq + sysPara->status.currentDetectBestOscillatorCnt*200; + } + sysPara->status.currentDetectBestOscillatorCnt++; + sysPara->devOp->setDivideRatio((FPGA_SYS_HZ/(sysPara->status.detectedStartOscillatorFreq + sysPara->status.currentDetectBestOscillatorCnt*200))/2); + progressBar.setValue(sysPara->status.currentDetectBestOscillatorCnt); + if(sysPara->status.currentDetectBestOscillatorCnt == 20){ //100分了20份 + sysPara->status.detectBestOscillatorFreqAppending= false; + int bestRatio = (FPGA_SYS_HZ/(sysPara->status.detectedBestOscillatorFreq))/2; + /*------------------------------------------------------------------------------------*/ + ui->spinBoxOscillatorFreqFix->setValue(sysPara->status.detectedBestOscillatorFreq - convertFreq(sysPara->para.oscillatoFreq)); + sysPara->para.oscillatorFreqFix = sysPara->status.detectedBestOscillatorFreq - convertFreq(sysPara->para.oscillatoFreq); + /*------------------------------------------------------------------------------------*/ + sysPara->devOp->setDivideRatio(bestRatio); + sysPara->para.divideRatio = bestRatio; + progressBar.hide(); + timer->stop(); + LogInfo::setRunStatusText(tr("最佳晶振频率完成")); + } + } +#ifdef FINDVOL + else if(sysPara->status.detectBestOscillatorVoltageAppending){// 最佳晶振电压 + sysPara->devOp->readPhaseDetectHighTm(); + int longestPhaseHightLevelTm = 0; + if(!sysPara->status.detect_phase_error && !sysPara->status.flight_tm_error ){ + for(int i = 0; i < ARRAY_SIZE(sysPara->status.phaseDetectHighTm); i++){ + if(sysPara->status.phaseDetectHighTm[i] > longestPhaseHightLevelTm){ + longestPhaseHightLevelTm = sysPara->status.phaseDetectHighTm[i]; + } + } + } + LogInfo::setRunStatusText(tr("Oscillator voltage %1 --- 最长高电平时钟 %2") + .arg(sysPara->status.currentDetectBestOscillatorCnt*3).arg(longestPhaseHightLevelTm)); + + if(longestPhaseHightLevelTm > sysPara->status.longestPhaseHightLevelTm){ + sysPara->status.longestPhaseHightLevelTm = longestPhaseHightLevelTm; + sysPara->status.detectedBestOscillatorVoltage = sysPara->status.currentDetectBestOscillatorCnt*3; + } + sysPara->status.currentDetectBestOscillatorCnt++; + sysPara->devOp->setOscillatorVoltage(sysPara->status.currentDetectBestOscillatorCnt*3); + progressBar.setValue(sysPara->status.currentDetectBestOscillatorCnt); + if(sysPara->status.currentDetectBestOscillatorCnt == 32){ //分了32份 + sysPara->status.detectBestOscillatorVoltageAppending = false; + ui->spinBoxOscillatorVoltage->setValue(sysPara->status.detectedBestOscillatorVoltage); + sysPara->devOp->setOscillatorVoltage(sysPara->status.detectedBestOscillatorVoltage); + sysPara->para.oscillatorVoltage = sysPara->status.detectedBestOscillatorVoltage; + progressBar.hide(); + timer->stop(); + LogInfo::setRunStatusText(tr("最佳晶振电压完成")); + } + } +#else + else if(sysPara->status.detectBestOscillatorVoltageAppending){// 最佳晶振电压 + sysPara->devOp->readPhaseDetectHighTm(); + int longestPhaseHightLevelTm = 0; + if(!sysPara->status.detect_phase_error && !sysPara->status.flight_tm_error ){ + for(unsigned int i = 0; i < ARRAY_SIZE(sysPara->status.phaseDetectHighTm); i++){ + if(sysPara->status.phaseDetectHighTm[i] > longestPhaseHightLevelTm){ + longestPhaseHightLevelTm = sysPara->status.phaseDetectHighTm[i]; + } + } + } + LogInfo::setRunStatusText(tr("Oscillator voltage %1 --- 最长高电平时钟 %2") + .arg(sysPara->status.currentDetectBestOscillatorCnt*VOLDIV).arg(longestPhaseHightLevelTm)); + + if(longestPhaseHightLevelTm > sysPara->status.longestPhaseHightLevelTm){ + sysPara->status.longestPhaseHightLevelTm = longestPhaseHightLevelTm; + sysPara->status.detectedBestOscillatorVoltage = sysPara->status.currentDetectBestOscillatorCnt*VOLDIV; + } + sysPara->status.currentDetectBestOscillatorCnt++; + sysPara->devOp->setOscillatorVoltage(sysPara->status.currentDetectBestOscillatorCnt*VOLDIV); + progressBar.setValue(sysPara->status.currentDetectBestOscillatorCnt); + if(sysPara->status.currentDetectBestOscillatorCnt == VOLNUM){ //分了20份 + sysPara->status.detectBestOscillatorVoltageAppending = false; + ui->spinBoxOscillatorVoltage->setValue(sysPara->status.detectedBestOscillatorVoltage); + sysPara->devOp->setOscillatorVoltage(sysPara->status.detectedBestOscillatorVoltage); + sysPara->para.oscillatorVoltage = sysPara->status.detectedBestOscillatorVoltage; + progressBar.hide(); + timer->stop(); + LogInfo::setRunStatusText(tr("最佳晶振电压完成")); + } + } +#endif + + } +} + + + +void SystemSetting::updateReclaimTime(int time){ + if(sysPara){ + ui->spinBoxReclaimTankTime->setValue(time); + } +} +void SystemSetting::updateViscosityAdjust(int offset){ + if(sysPara){ + int viscostyRealValue; + if(offset>0) + { + if(offset>5) + offset = 5; + if(sysPara->para.viscosityAdjust==1)//0.6% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(offset*3)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(offset*3)/500; + } + else if(sysPara->para.viscosityAdjust==2)//1.0% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(offset*5)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*offset/100; + } + else if(sysPara->para.viscosityAdjust==3)//1.6% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(offset*8)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*offset*8/500; + } + else if(sysPara->para.viscosityAdjust==4)//2.0% + { + //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(offset*10)/5/100; + viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*offset*2/100; + } + else + { + viscostyRealValue = sysPara->para.viscosity; + } + } + else + { + viscostyRealValue = sysPara->para.viscosity; + } + if(sysPara->para.viscosityAdjust!=0) + { + ui->ViscosityAdjustText->setText(QString("%1").arg(viscostyRealValue)); + } + } +} + +void SystemSetting::updateAuthorization(int auth){ + Q_UNUSED(auth); + if(sysPara){ + //ui->labelMixValveVersion->setVisible(PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1); + //ui->radioButtonMixValveNewVersion->setVisible(PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1); + //ui->radioButtonMixValveOldVersion->setVisible(PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1); + + } +} + void SystemSetting::setSpinBoxPressureMaxValue(int pressureVal) + { + ui->spinBoxPressure->setMaximum(pressureVal); + } + +//简单的使用输入框值变化事件时,会在用户输入个位数(未输入完成时),就触发发送修改命令,造成断点不正常 +void SystemSetting::on_spinBoxOscillatorVoltage_valueChanged(int arg1) +{ + static int vol=0; // + if(sysPara){ + if(vol-1==arg1 || vol+1==arg1) + { + //qDebug()<<"OSCVOL:"<devOp->setOscillatorVoltage(ui->spinBoxOscillatorVoltage->value()); + } + vol = arg1; + } +} +#include "Public.h" + +void SystemSetting::on_pushButtonInterFace_pressed() +{ + + + QString s1 = Public::ReadLanguageName(); + if(s1 =="English") { + dlgLanguage.LangIndex =INPUT_METHOD_TYPE_ENGLISH; + } + //else if(s1 =="Vietnamese") { + // dlgLanguage.LangIndex =INPUT_METHOD_TYPE_VIETNAM; + // } + else{ + dlgLanguage.LangIndex =INPUT_METHOD_TYPE_CHINESE; + } + + dlgLanguage.setCurrentLanguage(); + dlgLanguage.show(); + + + +/* + QFile file(SYS_ROOT_DIR"UseEn"); + + QMessageBox::StandardButton ret; + ret = QMessageBox::information(this, tr("警告"), + tr("确定要切换显示语言吗?\r\n(重启才能生效)"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret != QMessageBox::Ok){ + return; + } + + QString s1 = Public::ReadLanguageName(); + + if(file.open(QIODevice::ReadWrite| QIODevice::Truncate)) { + QByteArray buf; + buf.clear(); + if(s1 =="English") {// English--> Vietnamese + QMessageBox::information(this,tr("提示"),tr("重启后切换到越南语界面")); + buf.append("Vietnamese\r\n"); + buf.append("YN_utf8.txt\r\n"); + } + else if(s1 =="Vietnamese") {// Vietnamese--> Chinese + QMessageBox::information(this,tr("提示"),tr("重启后切换到中文界面")); + buf.append("Chinese\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + else{// Chinese--> English + QMessageBox::information(this,tr("提示"),tr("重启后切换到英文界面")); + buf.append("English\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + file.write(buf); + file.close(); + setInterfaceMode(); + } +*/ +} + +void SystemSetting::setInterfaceMode() +{ + QString s1 = Public::ReadLanguageName(); + if(s1 =="English") {// English--> Vietnamese + ui->pushButtonInterFace->setText( tr("Tiếng Việt(Vietnamese interface)")); + } + else if(s1 =="Vietnamese") {// Vietnamese--> Chinese + ui->pushButtonInterFace->setText( tr("Chinese interface(中文界面)")); + } + else{// Chinese--> English + ui->pushButtonInterFace->setText( tr("English interface(英文界面)")); + } + +} diff --git a/SystemSetting.h b/SystemSetting.h new file mode 100644 index 0000000..c5d4ebd --- /dev/null +++ b/SystemSetting.h @@ -0,0 +1,68 @@ +#ifndef SSYSTEMSETTING_H +#define SSYSTEMSETTING_H + +#include +#include +#include "ParaSettingUI.h" +#include "TimeSettingDialog.h" +#include +#include "DialogAuthorization.h" +#include "dlgmutilanguage.h" + +#define SYSMIMA +namespace Ui { +class SystemSetting; +} + +class SystemSetting : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit SystemSetting(QWidget *parent = 0); + ~SystemSetting(); + + void updateSysParaToUI(); //重载 + void applyUIPara(); //重载 + void updateSysStatusToUI(); //重载 + QProgressBar progressBar; + void updateReclaimTime(int time); + void updateViscosityAdjust(int offset); + void updateAuthorization(int auth); + void setSpinBoxPressureMaxValue(int pressureVal); + +Q_SIGNALS: + void changeEditMode(int); + void setRunStatus(QString); + void pressureAdjust(); +private slots: + void setInterfaceMode(); + void SystemupdateSysParaToUI(); + + void on_spinBoxReclaimPumpPower_valueChanged(int arg1); + void on_pushButtonCleanUP_pressed(); + void on_pushButtonHighVoltageData_pressed(); + void on_pushButtonApply_pressed(); + void on_pushButtonSearchBestOscillatorVoltage_pressed(); + void on_pushButtonSearchBestOscillatorFreq_pressed(); + void timerHandler(); + void on_spinBoxOscillatorVoltage_valueChanged(int arg1); + void on_pushButtonInterFace_pressed(); + void ondialogAuthorizationAccepted(); + void onCleanUPNow(); + void timerHandler2(); + void autoControlPressure(); + + +private: + Ui::SystemSetting *ui; + DlgMutiLanguage dlgLanguage; + QTimer *timer,*timer2, *SetinkcloseCountTimer, *timerAuto; + unsigned char enCleanUpAppendFlag; // 0空闲,1关开回收槽,2手动,3清洗,4恢复,5停止,6 + bool r_PumpValveControledByHand; +#ifdef SYSMIMA + DialogAuthorization *dialogUpateMm; +#endif +}; + +#endif // SSYSTEMSETTING_H diff --git a/TextEditOption.cpp b/TextEditOption.cpp new file mode 100644 index 0000000..381ea1e --- /dev/null +++ b/TextEditOption.cpp @@ -0,0 +1,1499 @@ +#include "TextEditOption.h" +#include "ui_texteditoption.h" +#include "PicWidget.h" +#include "scene/picscene.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include "Public.h" +#include "myinclude.h" + +#include "QBarCode.h" +#include "dlgQrCode.h" + + +TextEditOption::TextEditOption(QWidget *parent) : + QWidget(parent), + ui(new Ui::TextEditOption) +{ + ui->setupUi(this); + fileDialog = 0; + fileName = ""; + textEdit = 0; + newFileAppending = false; + dialogFileOperation = new DialogFileOperation(0); + dialogInsertVari = new DialogInsertVari(0); + dialogFontSize = new DialogFontSize(0); + dialogLineSpace = new DialogLineSpace(0); + editMode=0; +#ifdef _2DCODE_ + dlgQrcode = new dlgQrCode(); + barcode= new QBarCode(); + connect(barcode,SIGNAL(onBarCodeClose()),this,SLOT(onBarCodeClose())); + connect(dlgQrcode,SIGNAL(onQRCodeCloseNow()),this,SLOT(onQRCodeClose())); +#endif + //textEdit->setFontFamily(Public::getFontFamily(12)); + //textEdit->clear(); +#ifdef MYSAVEFILEDLG + dialogSaveFile =new DialogSaveFile(0); +#endif + + sceneEditItem = false; +} + +TextEditOption::~TextEditOption() +{ + delete ui; + if(fileDialog) + delete fileDialog; + if(dialogInsertVari) + delete dialogInsertVari; + if(dialogFontSize) + delete dialogFontSize; + if(dialogLineSpace) + delete dialogLineSpace; +#if _2DCODE_ + if(dlgQrcode) + delete dlgQrcode; +#endif + //free(dlgQrCode); +#ifdef MYSAVEFILEDLG + if(dialogSaveFile) delete dialogSaveFile; + if(dialogFileOperation) delete dialogFileOperation; +#endif +} + +void TextEditOption::enableButtonSave(){ + if(!ui->bottonSave->isEnabled()) + ui->bottonSave->setEnabled(true); +} + +void TextEditOption::bindText(QTextEdit *textEdit){ + this->textEdit = textEdit; + + connect(textEdit,SIGNAL(textChanged ()),this,SLOT(enableButtonSave())); + + ui->bottonSave->setEnabled(false); + connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); +#ifdef MYSAVEFILEDLG + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); +#endif + + + +} +void TextEditOption::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; +#ifdef _2DCODE_ + if(sysPara) + { + barcode->bindSysPara(sysPara); + //qDebug()<<"TextEditOption bind by TextEdit."; + } +#endif + //else qDebug()<<"TextEditOption bind by TextEdit failure"; +} + +void TextEditOption::bindPicWidget(PicWidget *picwidget){ + this->picwidget = picwidget;// stackedWidgetOption + +// connect(textEdit,SIGNAL(textChanged ()),this,SLOT(enableButtonSave())); +// ui->bottonSave->setEnabled(false); +// connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + + +} +void TextEditOption::bindStackWidget(QStackedWidget *stackedWidgetOption,QStackedWidget *stackedWidgetText){ + this->stackedWidgetOption = stackedWidgetOption;// stackedWidgetOption + this->stackedWidgetText = stackedWidgetText; +// connect(textEdit,SIGNAL(textChanged ()),this,SLOT(enableButtonSave())); +// ui->bottonSave->setEnabled(false); +// connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + + +} +void TextEditOption::showDlg(){ + +if(editMode==PICFILE){ + + disconnect(textEdit,SIGNAL(textChanged()),0,0); + + connect(textEdit,SIGNAL(textChanged ()),this,SLOT(enableButtonSave())); + ui->bottonSave->setEnabled(false); + disconnect(dialogFileOperation,SIGNAL(openFile(QString,bool)),0,0); + connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + on_pushButtonFile_pressed(); + + // dialogFileOperation->show(); +} +} + +/* + * 和DialogFileOperation对接 + * */ +void TextEditOption::onFileOpen(QString filePath,bool insertFlag) +{ + if(editMode==PICFILE){ + if(filePath.endsWith(".png") )//||filePath.endsWith(".bmp") ) + { + if(insertFlag){ + emit PicfileNameOpen(filePath,insertFlag); + } + else { + // + emit PicfileNameOpen(filePath,0); + } + return ; + } + else{ + if(stackedWidgetOption) { + stackedWidgetOption->setCurrentIndex(1); + stackedWidgetText->setCurrentIndex(1); + } + } + } + else if(editMode==TXTFILE) { + if(filePath.endsWith(".gif") || filePath.endsWith(".jpeg") || filePath.endsWith(".jpg") + || filePath.endsWith(".bmp") || filePath.endsWith(".BMP") || filePath.endsWith(".png")) + { + QString html = ""; + QTextCharFormat fmt = textEdit->currentCharFormat (); + if(insertFlag){ + textEdit->insertHtml (html); + } + else { + textEdit->setHtml (html); + textEdit->moveCursor(QTextCursor::EndOfLine); //在插入图片的情况下,将图片至于末会导致格式还原 + } + textEdit->mergeCurrentCharFormat(fmt); + } + else if(filePath.endsWith(".xml")) + { + memset(sysPara->para.lastOpenedFileName,0,sizeof(sysPara->para.lastOpenedFileName)); + return; + } + else { + QFile file(filePath); + if(!file.open(QIODevice::ReadOnly)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + filePath); + } + else { + QByteArray data = file.readAll(); + QTextCodec *codec = Qt::codecForHtml(data); + QString str = codec->toUnicode(data); + // if (Qt::mightBeRichText(str)) { + // textEdit->setHtml(str); + // } else { + // str = QString::fromLocal8Bit(data); + // textEdit->setPlainText(str); + // } + // QTextStream in (&file);in.readAll() + if(filePath.startsWith(UDISK_DOC_ROOT_DIR)){ + str.replace(DOC_ROOT_DIR,UDISK_DOC_ROOT_DIR); //做相应处理 + } + + if(insertFlag){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("Application"), tr("是否确认将文件内容追加到打开的文件?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + textEdit->insertHtml(str); + } + } + else + { + updateFileVariWidth(str); + textEdit->setHtml(str); + fileName = filePath; + + if(sysPara){ + sysPara->sysFile =fileName; + sysPara->loadParaFromFile(); + //qDebug()<<"textedit txt mode onFileOpen" << sysPara->sysFile; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",fileName.toAscii().constData()); + } + emit fileNameChanged(QFileInfo(fileName).fileName()); + textEdit->moveCursor(QTextCursor::EndOfLine); + onDialogLineSpaceAccepted(); + } + } +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); + } + if(insertFlag) //在打开文件的时候不设置焦点 + textEdit->setFocus(); + if(stackedWidgetOption) { + stackedWidgetOption->setCurrentIndex(0); + stackedWidgetText->setCurrentIndex(0); + // textEdit->setFocus(); + } + } + else if(editMode==SCENE) { + //开机会调用到此,然后打开文件 + if(filePath.endsWith(".xml")) + { + memset(sysPara->para.lastOpenedFileName,0,sizeof(sysPara->para.lastOpenedFileName)); + emit scenefileOpen(filePath,false);//sceneeditoption 接收这个信号然后打开文件 + emit fileNameChanged(QFileInfo(filePath).fileName()); + } + else + { + if(sceneEditItem == true) + { + if(filePath.endsWith(".gif") || filePath.endsWith(".jpeg") || filePath.endsWith(".jpg") + || filePath.endsWith(".bmp") || filePath.endsWith(".BMP") || filePath.endsWith(".png")) + { + QString html = ""; + QTextCharFormat fmt = textEdit->currentCharFormat (); + if(insertFlag){ + textEdit->insertHtml (html); + } + else { + textEdit->setHtml(html); + textEdit->moveCursor(QTextCursor::EndOfLine); //在插入图片的情况下,将图片至于末会导致格式还原 + } + textEdit->mergeCurrentCharFormat(fmt); + } + else { + QFile file(filePath); + if(!file.open(QIODevice::ReadOnly)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + filePath); + } + else { + QByteArray data = file.readAll(); + QTextCodec *codec = Qt::codecForHtml(data); + QString str = codec->toUnicode(data); + if(filePath.startsWith(UDISK_DOC_ROOT_DIR)){ + str.replace(DOC_ROOT_DIR,UDISK_DOC_ROOT_DIR); //做相应处理 + } + + if(insertFlag){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("Application"), tr("是否确认将文件内容追加到打开的文件?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + textEdit->insertHtml(str); + } + } + else + { + textEdit->setHtml(str); + fileName = filePath; + + if(sysPara){ + sysPara->sysFile =fileName; + sysPara->loadParaFromFile(); + //qDebug()<<"onFileOpen"<sysFile; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",fileName.toAscii().constData()); + } + emit fileNameChanged(QFileInfo(fileName).fileName()); + textEdit->moveCursor(QTextCursor::EndOfLine); + } + } +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); + } + } + /* + if(stackedWidgetOption) { + stackedWidgetOption->setCurrentIndex(0); + stackedWidgetText->setCurrentIndex(0); + } + */ + } + } +} + + +void TextEditOption::onbottonInsertImgclicked() +{ + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onInsertImgFIle_select())); + fileDialog->showFileDialog(tr("插入图片"),QString("/"),QString("img (*.bmp *.jpg *.png *.gif)")); +} + +void TextEditOption::onInsertImgFIle_select(){ + QStringList files = fileDialog->selectedFiles(); + + for(int i = 0;i < files.size(); i++){ + QString html = ""; + textEdit->insertHtml (html); + + } +} + + +void TextEditOption::onbottonInsertTextclicked() +{ + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onInsertTextFIle_select())); + fileDialog->showFileDialog(tr("插入文本"),QString(DOC_ROOT_DIR),QString("text (*.html *.txt)")); +} + +void TextEditOption::onInsertTextFIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + QFile file(files.value(i)); + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + files.value(i)); + } + else{ + QTextStream in (&file); + textEdit->insertHtml(in.readAll()); + } +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); + } +} + + + +void TextEditOption::onbuttonOpenclicked() +{ + if(!textEdit){ + QMessageBox::critical(this,tr("错误"),tr("TextEditOption 构造函数参数textEdit 不应当为空")); // + } + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onOpenFIle_select())); + fileDialog->DontUseNativeDialog; + + fileDialog->showFileDialog(tr("打开文件"),QString(DOC_ROOT_DIR),QString("Text files (*.txt *.html)")); +} + + +void TextEditOption::openFIle(QString openFileName){ + QFile file(openFileName); + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + openFileName); + } + else{ + QTextStream in (&file); + textEdit->setText(in.readAll()); + fileName = openFileName; + if(sysPara){ + sysPara->sysFile =fileName; + sysPara->loadParaFromFile(); + //qDebug()<<"openFIle"<sysFile; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",fileName.toAscii().constData()); + } + emit fileNameChanged(QFileInfo(fileName).fileName()); + } + file.close(); +} + + +void TextEditOption::onOpenFIle_select(){ + + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + openFIle(files.value(i)); + } +} + + + +void TextEditOption::on_buttonSaveAS_clicked() +{ +#ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->refreshListView(editMode); + dialogSaveFile->show(); + dialogSaveFile->setEnterFileName(""); +#else + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + fileDialog->showFileDialog(tr("另存为"),QString(DOC_ROOT_DIR),QString("files (*.html *.txt)")); +#endif + +} + + +void TextEditOption::saveFile(){ + if(fileName.endsWith(".txt")){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("以.txt保存将丢失所有格式,你是否愿意保存为.html格式?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + fileName += ".html"; + } + } + QString html = textEdit->toHtml(); + QString pattern = "setHtml(html.replace(UDISK_DOC_ROOT_DIR,DOC_ROOT_DIR)); + } + QTextDocumentWriter writer(fileName); + + //writer.setFormat("html"); + bool success = writer.write(textEdit->document()); + if (success){ + textEdit->document()->setModified(false); + ui->bottonSave->setEnabled(false); + if(sysPara){ + sysPara->sysFile =fileName; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",fileName.toAscii().constData()); + } + } + else { + QMessageBox::warning(this,tr("警告"),tr("无法保存文件") + fileName); + } + emit fileNameChanged(QFileInfo(fileName).fileName()); + checkNewFileAppending(); +} + + +void TextEditOption::onSaveAS_FIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + fileName = files[i]; + + if(!fileName.endsWith(".html",Qt::CaseInsensitive) && !fileName.endsWith(".txt",Qt::CaseInsensitive)) + fileName += ".html"; + saveFile(); + } +} + + +void TextEditOption::onSaveASFile(QString filename,bool Flag){// use for dialogSaveFile class + fileName = filename; + if(!fileName.endsWith(".html",Qt::CaseInsensitive) && !fileName.endsWith(".txt",Qt::CaseInsensitive)) + fileName += ".html"; + + saveFile(); + //emit fileNameChanged(QFileInfo(fileName).fileName()); + //qDebug()<clear(); + fileName = ""; + emit fileNameChanged(QFileInfo(fileName).fileName()); + setFontFormat(); + onDialogLineSpaceAccepted(); + } + newFileAppending = false; +} + +void TextEditOption::onSave_File_reject(){ + checkNewFileAppending(); +} + +void TextEditOption::on_bottonSave_clicked() +{ + if(sysPara->para.EditMode==SCENE){ + //在场景模式下,这个是确定按钮,切换到场景模式 + if(sceneEditItem) + { + editItemModeDone(); + emit editItemDone(); + } + + } + else + { + if(fileName.isEmpty()){ + #ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->refreshListView(editMode); + dialogSaveFile->show(); + dialogSaveFile->setEnterFileName(""); + #else + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + connect(fileDialog,SIGNAL(rejected()),this,SLOT(onSave_File_reject())); + fileDialog->showFileDialog(tr("保存..."),QString(DOC_ROOT_DIR),QString("HTML files (*.html)")); + #endif + } + else { + saveFile(); + newFileAppending = false; + } + } +} + + + +bool TextEditOption::maybeSave(){ + if (!textEdit->document()->isModified()) + return true; + if (fileName.startsWith(QLatin1String(":/"))) + return true; + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("文档已经改变,是否保存?")); + QPushButton *saveButton = msgBox.addButton(tr("保存"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("放弃保存"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + + msgBox.exec(); + + if (msgBox.clickedButton() == saveButton) { + newFileAppending = true; + on_bottonSave_clicked(); + return false; + } else if (msgBox.clickedButton() == cancleSaveButton) { + return true; + } + else + return false; + + return true; +} +void TextEditOption::on_bottonNew_pressed() +{ + if (maybeSave()) { + //setFontFormat(); + textEdit->clear(); + fileName = ""; + QFile file(fileName); + emit fileNameChanged(QFileInfo(fileName).fileName()); + } +#ifdef VARCOLOR + textEdit->insertHtml(QString("  ")); +#endif + +} + +void TextEditOption::onOpenNewFile() +{ + //if (maybeSave()) + { + //setFontFormat(); + textEdit->clear(); + fileName = ""; + QFile file(fileName); + emit fileNameChanged(QFileInfo(fileName).fileName()); + } +#ifdef VARCOLOR + textEdit->insertHtml(QString("  ")); +#endif + +} + +void TextEditOption::on_buttonInsertVari_pressed() +{ QString s,fontname=""; + if(sysPara) + { + + //s.sprintf("%s(%02dX%02d)",sysPara->para.qrOption.text,sysPara->para.qrOption.width,sysPara->para.qrOption.height); + s= sysPara->para.qrOption.text; + if(s.length()>120)s="string to long."; + dialogInsertVari->setValue(""); + } + + if(dialogInsertVari->exec() == QDialog::Accepted && sysPara){ +// qDebug()<< "dialogInsertVari::Accepted"; + int pixelSize = ui->labelFontSize->text().toInt(); + QFont font; + fontname=ui->labFontFamily->text(); + //qDebug()<< "fontname:"<checkBoxBold->isChecked() && (pixelSize<=16) ?QFont::Bold:QFont::Normal); + + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + + //qDebug()<para.textEditCharSpace<para.ExpirySplitMode; + dialogInsertVari->getValue(&varType,&digitalNum,&splitMode); + + fmt = textEdit->currentCharFormat (); + + if((varType<9 || varType==13) // 普通变量;varType=13 is CNT3 var + // ||(varType>=20 && varType<29) // 横左变量 + // ||(varType>=40 && varType<49) // 右横变量 + ) + { + int varType1= varType; + + if(fontname.contains("SerifL") ||fontname.contains("serifl") ) + varType1= 20+varType; + else if(fontname.contains("SerifR") ||fontname.contains("serifr") ) + varType1= 20+varType; + else if(fontname.contains("bangla") ) + varType1= 30+varType; + else if(fontname.contains("biyangF") ) + varType1= 50+varType; + else if(fontname.contains("Roman") ) + varType1= 60+varType; + // varType1= 40+varType; // 变量右横时取 40,左横时取 20 + // qDebug()<<"pixelSize:"<insertHtml(QString("") + .arg(varType).arg(ui->checkBoxBold->isChecked() && (pixelSize<=16)?(digitalNum*100 + 75):digitalNum) + .arg(height+1).arg(width*digitalNum).arg(varType1)); //插入索引后 + +// qDebug()<<"vari heigh:"<mergeCurrentCharFormat(fmt); + } // 普通变量 VarType<=8 + else if(varType >=9 && varType <=11) + { // +#ifdef _2DCODE_ + s= sysPara->para.qrOption.text; + dlgQrcode->move( (this->width() - dlgQrcode->width())/2 ,10); + if(varType==9){ + dlgQrcode->flagInsert=1; + sysPara->para.qrOption.AutoCount=1; + sysPara->para.qrOption.AutoRefresh=1; + sysPara->para.qrOption.type=0; + sysPara->para.qrOption.cntNum=digitalNum; //digitalNum + dlgQrcode->setWindowTitle(tr("二维码变量设置")); + dlgQrcode->SetOption(&sysPara->para.qrOption); + dlgQrcode->setCntCheckBoxHide(0); + dlgQrcode->show(); + } + + else if(varType==10){ + dlgQrcode->flagInsert=1; + sysPara->para.qrOption.AutoCount=1; + sysPara->para.qrOption.AutoRefresh=1; + sysPara->para.qrOption.type=1; + sysPara->para.qrOption.cntNum=digitalNum; + dlgQrcode->setCntCheckBoxHide(0); + dlgQrcode->setWindowTitle("二维码变量设置"); + dlgQrcode->SetOption(&sysPara->para.qrOption); + dlgQrcode->show(); + } + + else if(varType==11){ + barcode->move(0,0); + barcode->flagInsert=1; + sysPara->para.qrOption.AutoCount=1; + sysPara->para.qrOption.AutoRefresh=1; + sysPara->para.qrOption.type=1; + sysPara->para.qrOption.cntNum=digitalNum; + barVarFont = font; + barVarHeight=height; + barVarWidth =width; + //barcode->setCntCheckBoxHide(0); + barcode->setWindowTitle("条形码变量设置"); + barcode->SetOption(&sysPara->para.bcOption); + barcode->show(); + + } + textEdit->mergeCurrentCharFormat(fmt); +#endif + } + else if(varType ==RANDOMNUM){ //12 + //digitalNum=13; + //qDebug()<<"digitalNum"<insertHtml(QString("") + .arg(varType).arg(ui->checkBoxBold->isChecked() && (pixelSize<=16)?(digitalNum*100 + 75):digitalNum) + .arg(height+1).arg(width*digitalNum)); //插入索引后 + + textEdit->mergeCurrentCharFormat(fmt); + } + else if(varType ==EXPIRYDATE){ //80 :/80/image/expiryDate8.bmp qrc:/80/image/expiryDate875.bmp +// QImage img; +// img.load("/home/student/mini2440/UP/QtUI/QRUI_SUNV54/80/image/digitalWidth8.bmp"); +// img.setPixel(0,4,0xffff0Cfc); +// img.setPixel(0,5,0xffff0Cfc); +// img.save("/home/student/mini2440/UP/QtUI/QRUI_SUNV54/80/image/curDate8.bmp"); + // 0xff00fc + int varType1 = varType; + if(fontname.contains("bangla") ) + { + varType1= 10+varType; + } + else if(fontname.contains("biyangF") ) + { + varType1= 20+varType; + } + else if(fontname.contains("Roman") ) + { + varType1= 30+varType; + } + + sysPara->print.ExpiryVar.splitMode=splitMode; + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + QFontMetrics fontMetrics(font); + QHash dateFormat; + dateFormat.insert(0,"yyyy-MM-dd"); + dateFormat.insert(1,"yyyy/MM/dd"); + dateFormat.insert(2,"yyyyMMdd"); + dateFormat.insert(3,"yyyy年MM月dd日"); + dateFormat.insert(4,"yyyy-MM-dd hh:mm"); + dateFormat.insert(5,"yyyy/MM/dd hh:mm"); + dateFormat.insert(6,"yyyyMMddhhmm"); + dateFormat.insert(7,"yyyy年MM月dd日 hh:mm"); + dateFormat.insert(8,"hh:mm"); + dateFormat.insert(9,"ddhhmm"); + dateFormat.insert(10,"dd MM yy"); + dateFormat.insert(11,"dd/MM/yy"); + dateFormat.insert(12,"dd/MM/yyyy"); + dateFormat.insert(13,"dd-MM-yy"); + dateFormat.insert(14,"dd-MM-yyyy"); + QString DateTime = QDateTime::currentDateTime().toString(dateFormat.value(splitMode)); + //qDebug()<<"DateTime "<insertHtml(QString("") + .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(175):1) + .arg(height+1).arg(dateTimeWidth+4)); //插入索引后 + sysPara->print.ExpiryVar.bold = ui->checkBoxBold->checkState(); + textEdit->mergeCurrentCharFormat(fmt); + }else + { + if(splitMode == 3 || splitMode ==7 ) + { + height = fontMetrics.ascent(); + } + // textEdit->insertHtml(QString("") + // .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) + // .arg(height+1).arg(width*(splitMode<2?9:7)+(width>>1))); //插入索引后 + //sysPara->print.ExpiryVar.bold = ui->checkBoxBold->isChecked(); + textEdit->insertHtml(QString("") + .arg(varType1).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) + .arg(height+1).arg(dateTimeWidth+4)); //插入索引后 + sysPara->print.ExpiryVar.bold = ui->checkBoxBold->checkState(); + textEdit->mergeCurrentCharFormat(fmt); + } + } + else if(varType ==CURDATE ){ //81 :/80/image/expiryDate8.bmp qrc:/80/image/curDate8.bmp +#if 0 + QImage img; + img.load("/home/student/mini2440/UP/QtUI/QRUI_SUNV54/80/image/digitalWidth8.bmp"); + img.setPixel(0,4,0xffff0Cfc); + img.setPixel(0,5,0xffff0Cfc); + img.save("/home/student/mini2440/UP/QtUI/QRUI_SUNV54/81/image/curDate8.bmp"); +#endif + int varType1 = varType; + if(fontname.contains("bangla") ) + { + varType1= 10+varType; + } + else if(fontname.contains("biyangF") ) + { + varType1= 20+varType; + } + else if(fontname.contains("biyangF") ) + { + varType1= 30+varType; + } + + // 0xff00fc + //qDebug()<<"CurDateVar height"<print.CurDateVar.splitMode = splitMode; + font.setLetterSpacing(QFont::AbsoluteSpacing, sysPara->para.textEditCharSpace); + QFontMetrics fontMetrics(font); + QHash dateFormat; + dateFormat.insert(0,"yyyy-MM-dd"); + dateFormat.insert(1,"yyyy/MM/dd"); + dateFormat.insert(2,"yyyyMMdd"); + dateFormat.insert(3,"yyyy年MM月dd日"); + dateFormat.insert(4,"yyyy-MM-dd hh:mm"); + dateFormat.insert(5,"yyyy/MM/dd hh:mm"); + dateFormat.insert(6,"yyyyMMddhhmm"); + dateFormat.insert(7,"yyyy年MM月dd日 hh:mm"); + dateFormat.insert(8,"hh:mm"); + dateFormat.insert(9,"ddhhmm"); + dateFormat.insert(10,"dd MM yy"); + dateFormat.insert(11,"dd/MM/yy"); + dateFormat.insert(12,"dd/MM/yyyy"); + dateFormat.insert(13,"dd-MM-yy"); + dateFormat.insert(14,"dd-MM-yyyy"); + //dateFormat.insert(10,"x"); +// dateFormat.insert(10,"A dd MM yy"); + QString DateTime = QDateTime::currentDateTime().toString(dateFormat.value(splitMode)); + int dateTimeWidth = fontMetrics.width(DateTime) ; + qDebug()<<"insert splitMode="<insertHtml(QString("") +// .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) +// .arg(height+1).arg(width*(splitMode<2?9:7)+(width>>1))); //插入索引后 +// sysPara->print.CurDateVar.bold = ui->checkBoxBold->checkState(); + textEdit->insertHtml(QString("") + .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) + .arg(height+1).arg(dateTimeWidth+2)); //插入索引后 + sysPara->print.CurDateVar.bold = ui->checkBoxBold->checkState(); + //qDebug()<<"sysPara->print.CurDateVar.bold:"<print.CurDateVar.bold; + textEdit->mergeCurrentCharFormat(fmt); + } +#endif + if(DateTime == "x") + { + qDebug()<<" x handle"; + textEdit->insertHtml(QString("") + .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):1) + .arg(height+1).arg(dateTimeWidth+4)); //插入索引后 + textEdit->mergeCurrentCharFormat(fmt); + }else + { + if(splitMode == 3 || splitMode ==7 ) + { + height = fontMetrics.ascent();//fontMetrics.ascent()+ fontMetrics.descent(); + } +// textEdit->insertHtml(QString("") +// .arg(varType).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) +// .arg(height+1).arg(width*(splitMode<2?9:7)+(width>>1))); //插入索引后 +// sysPara->print.CurDateVar.bold = ui->checkBoxBold->checkState(); + qDebug()<<"height:"<insertHtml(QString("") + .arg(varType1).arg(ui->checkBoxBold->checkState() && (pixelSize<=16)?(875):8) + .arg(height+1).arg(dateTimeWidth+4)); //插入索引后 + //sysPara->print.CurDateVar.bold = ui->checkBoxBold->checkState(); + //qDebug()<<"sysPara->print.CurDateVar.bold:"<print.CurDateVar.bold; + textEdit->mergeCurrentCharFormat(fmt); + } + } + else if(varType == CURCLASS) { //82 :/82/image/curDate1.bmp + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + QFontMetrics fontMetrics(font); + int dateTimeWidth = fontMetrics.width("A") ; + int pixBmpSize = 1; + if (ui->checkBoxBold->checkState() && (pixelSize<=16)) { + pixBmpSize = 875; + } + else { + if(pixelSize >= 9) { + pixBmpSize = 91; + } + else { + pixBmpSize = 1; + } + } + qDebug()<<"height:"<insertHtml(QString("") + .arg(varType).arg(pixBmpSize) + .arg(height+1).arg(dateTimeWidth+2)); //插入索引后 + textEdit->mergeCurrentCharFormat(fmt); + } + textEdit->setFocus(); + } +} + + +void TextEditOption::mergeFormatOnWordOrSelection(const QTextCharFormat &format) +{ + + QTextCursor cursor = textEdit->textCursor(); + //if (!cursor.hasSelection()) + // cursor.select(QTextCursor::WordUnderCursor); + //cursor.mergeCharFormat(format); + //textEdit->setTextCursor(cursor); + //qDebug()<<"mergeFormatOnWordOrSelection"<mergeCurrentCharFormat(format); +} + +void TextEditOption::updateSysParaToUI() //重载 +{ + if(sysPara){ + /*务必先设置行距*/ + dialogLineSpace->setValue(sysPara->para.textEditLineSpace,sysPara->para.textEditCharSpace); + onDialogLineSpaceAccepted(); + /*将文件打开*/ + QString file = QString(sysPara->para.lastOpenedFileName); + if(QFile::exists(file)){ + sysPara->sysFile =file; + onFileOpen(file,false); + } + dialogFontSize->setValue(sysPara->para.fontPixelSize); + } +} + +void TextEditOption::onMbSetLineAndChar(int line_space, int char_space) +{ + sysPara->para.textEditLineSpace = line_space; + sysPara->para.textEditCharSpace = char_space; + dialogLineSpace->setValue(sysPara->para.textEditLineSpace,sysPara->para.textEditCharSpace); + onDialogLineSpaceAccepted(); +} + +QLabel *TextEditOption::getLabelFontSize(){ + return ui->labelFontSize; +} + +QLabel *TextEditOption::getLabelFontFamily(){ + return ui->labFontFamily; +} + +void TextEditOption::setFontFormat(){ + if(sysPara){ + + qreal pixelSize = ui->labelFontSize->text().toFloat(); + if(pixelSize < Public::getMinFontPixelSize()) + pixelSize = sysPara->para.fontPixelSize; + + if(pixelSize < Public::getMinFontPixelSize()){ + pixelSize = Public::getMinFontPixelSize(); + } + + if (pixelSize >= 0) { + QTextCharFormat fmt; + int DPI = textEdit->logicalDpiX(); + DPI = DPI?DPI:1; + qreal pointSize = pixelSize*72/DPI; //Pixel = DPI * Point / 72 + fmt.setFontPointSize(pointSize); +#ifdef VNLGXX + QString fontFamily = dialogFontSize->getFontFamily(); + +#else + QString fontFamily = // Public::getFontFamily((int)pixelSize); + ui->labFontFamily->text(); + ui->labFontFamily->setText(fontFamily); +#endif + fmt.setFontFamily(fontFamily); + fmt.setFontWeight(ui->checkBoxBold->isChecked() && (pixelSize<=16)? QFont::Bold:QFont::Normal); + //fmt.setUnderlineStyle(); + //fmt.setVerticalAlignment(QTextCharFormat::AlignBottom); + //QfontMetrics.bottom + //fmt.setUnderlineStyle(QTextCharFormat::NoUnderline); + //qDebug() << "logicalDpiX:" << textEdit->logicalDpiX() << "logicalDpiY:" << textEdit->logicalDpiY(); + //qDebug() << "physicalDpiX:" << textEdit->physicalDpiX() << "physicalDpiX:" << textEdit->physicalDpiX(); + mergeFormatOnWordOrSelection(fmt); +// QFont font = textEdit->document()->defaultFont(); +// font.setPointSizeF(pointSize); +// textEdit->document()->setDefaultFont(font); + + //qDebug()<<"Font:"<para.fontPixelSize = font.pointSize(); + dialogFontSize->setValue(sysPara->para.fontPixelSize); + ui->checkBoxBold->setChecked(font.bold()); +} + +QPushButton * TextEditOption::getPushButtonPreview(){ + return ui->pushButtonPreview; +} +QCheckBox *TextEditOption::getCheckBoxBold(){ + return ui->checkBoxBold; +} + +void TextEditOption::on_pushButtonFile_pressed() +{ + if(sceneEditItem) + { + dialogFileOperation->refreshListView(TXTFILE); + dialogFileOperation->exec(); + } + else + { + dialogFileOperation->refreshListView(editMode); + dialogFileOperation->exec(); + } +} + + +void TextEditOption::on_buttonSelectFont_pressed() +{ + if(dialogFontSize->exec() == QDialog::Accepted){ + int fontSize; + dialogFontSize->getValue(&fontSize); + ui->labFontFamily->setText(dialogFontSize->getFontFamily()); + if(sysPara){ + sysPara->para.fontPixelSize = fontSize; + } + ui->labelFontSize->setText(QString::number(fontSize)); + setFontFormat(); + textEdit->setFocus(); + emit fontSizeChange(fontSize); + } + +} + +void TextEditOption::on_checkBoxBold_released() +{ + setFontFormat(); + textEdit->setFocus(); +} + + +void TextEditOption::onDialogLineSpaceAccepted(){ + dialogLineSpace->getValue(&sysPara->para.textEditLineSpace,&sysPara->para.textEditCharSpace); + for(QTextBlock textBlock = textEdit->document()->begin();textBlock != textEdit->document()->end(); textBlock = textBlock.next()){ +// textBlock.setVisible(false); + QTextBlockFormat textBlockFormat = textBlock.blockFormat(); + textBlockFormat.setAlignment(Qt::AlignBottom); + textBlockFormat.setTopMargin(-1); + //textBlockFormat.setLineHeight(sysPara->para.fontPixelSize + sysPara->para.textEditLineSpace, QTextBlockFormat::FixedHeight); + //textBlockFormat.setLineHeight(0, QTextBlockFormat::LineDistanceHeight); + textBlockFormat.setBottomMargin(sysPara->para.textEditLineSpace-1); + //textBlockFormat.setBottomMargin(-1); + QTextCursor textCursor = textEdit->textCursor(); + textCursor.setPosition(textBlock.position()); + textCursor.setBlockFormat(textBlockFormat); + textEdit->setTextCursor(textCursor); + } + +// QTextCharFormat fmt; +// //fmt.setFontWordSpacing(sysPara->para.textEditCharSpace); +// fmt.setFontLetterSpacing(sysPara->para.textEditCharSpace); qDebug() << sysPara->para.textEditCharSpace; +// mergeFormatOnWordOrSelection(fmt); + QFont font = textEdit->font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + textEdit->setFont(font); + //sysPara->saveParaToFile(); + +} +void TextEditOption::on_buttonLineSpace_clicked() +{ + if(dialogLineSpace->exec() == QDialog::Accepted){ + onDialogLineSpaceAccepted(); + sysPara->saveParaToFile(); + textEdit->setFocus(); + sysPara->para.alterPrint.lineSpace = sysPara->para.textEditLineSpace; + } +} + +void TextEditOption::InsertQRCodeToEdit(QString barCodeName,int width,int height ,int enSave){ +#ifdef _2DCODE_ + textEdit->setText(""); + InsertQRCodeToEdit(barCodeName, width, height); + fileName = DOC_ROOT_DIR +QFileInfo(barCodeName).baseName() +".html"; + if(enSave) saveFile(); +#endif +} +void TextEditOption::InsertBarCodeToEdit(QString barCodeName,int width,int height ,int enSave){ +#ifdef _2DCODE_ + textEdit->setText(""); + InsertBarCodeToEdit(barCodeName, width, height); + fileName = DOC_ROOT_DIR +QFileInfo(barCodeName).baseName() +".html"; + if(enSave) saveFile(); +#endif +} +void TextEditOption::InsertBarCodeToEdit(QString barCodeName,int width,int height ) +{ +#ifdef _2DCODE_ + //dialogInsertVari->getValue(&varType,&digitalNum); + QTextCharFormat fmt = textEdit->currentCharFormat (); + //txt_fomart += ""; +// textEdit->insertHtml(QString("") +// .arg(barCodeName) +// .arg(height).arg(width)); //插入索引后 + textEdit->insertHtml(QString("") .arg(barCodeName)); + //插入索引后 + textEdit->mergeCurrentCharFormat(fmt); + //textEdit->setFocus(); + //qDebug()<<"TEOption:"<getValue(&varType,&digitalNum); + QTextCharFormat fmt = textEdit->currentCharFormat (); + textEdit->insertHtml(QString("") + .arg(barCodeName)//QFileInfo(barCodeName). + .arg(width).arg(height)); //插入索引后 + textEdit->mergeCurrentCharFormat(fmt); + //textEdit->setFocus(); + //qDebug()<<"TEOption:"<flagInsert ) { + dlgQrcode->GetOption((qrOption_t*)&sysPara->para.qrOption); + dlgQrcode->flagInsert=0; + if(sysPara->para.EditMode==PICFILE){ + + } + else { + + if(sysPara->para.qrOption.type==0){ + textEdit->insertHtml(QString("") + .arg(9).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + else if(sysPara->para.qrOption.type==1){ + textEdit->insertHtml(QString("") + .arg(10).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + else if(sysPara->para.qrOption.type==2){ + textEdit->insertHtml(QString("") + .arg(11).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + } + } + sysPara->saveParaToFile(); +#endif +} +void TextEditOption::onBarCodeClose(){ +#ifdef _2DCODE_ + bcPara_t bcoption; + if(barcode->flagInsert ) { + barcode->GetOption((bcOption_t*)&sysPara->para.bcOption); + //qDebug()<<"onBarCodeClose"<para.bcOption.barType<para.bcOption.height; + barcode->GetOption2((bcPara_t*)&bcoption); + //qDebug()<<"onBarCodeClose"<para.bcOption.barType = bcoption.type; + barcode->flagInsert=0; + if(sysPara->para.EditMode==PICFILE){ + + } + else + { + fmt = textEdit->currentCharFormat (); + textEdit->insertHtml(QString("") + .arg(11).arg(bcoption.height).arg(bcoption.width).arg(bcoption.type*100+bcoption.height)); + + //插入索引后 + //qDebug()<") + // .arg(11).arg(bcoption.height).arg(bcoption.width).arg(bcoption.type*100+bcoption.height); + + int varType1= 7;//CNT1:7, CNT2:8 + int digitalNum; + if(sysPara->para.bcOption.var1En){ + digitalNum=sysPara->para.bcOption.var1Num; + textEdit->insertHtml(QString("%1%2").arg(sysPara->para.bcOption.TxtModule).arg(sysPara->para.bcOption.TxtLine)); + textEdit->insertHtml(QString("") + .arg(varType1).arg(ui->checkBoxBold->isChecked() && (barVarHeight<=16)?(digitalNum*100 + 75):digitalNum) + .arg(barVarHeight+1).arg( barVarWidth*digitalNum)); //插入索引后 + } + if(sysPara->para.bcOption.var2En) + { + digitalNum=sysPara->para.bcOption.var2Num; + textEdit->insertHtml(QString("") + .arg(varType1+1).arg(ui->checkBoxBold->isChecked() && (barVarHeight<=16)?(digitalNum*100 + 75):digitalNum) + .arg(barVarHeight+1).arg( barVarWidth*digitalNum)); //插入索引后 + } + + textEdit->mergeCurrentCharFormat(fmt); + } + } + sysPara->saveParaToFile(); +#endif +} + +void TextEditOption::onEditItemMode() +{ + ui->bottonNew->setDisabled(true); + ui->buttonSaveAS->setDisabled(true); + ui->pushButtonPreview->setDisabled(true); + ui->bottonSave->setText(tr("完成")); + sceneEditItem = true; +} +void TextEditOption::editItemModeDone() +{ + sceneEditItem = false; + ui->bottonNew->setDisabled(false); + ui->buttonSaveAS->setDisabled(false); + ui->pushButtonPreview->setDisabled(false); + ui->bottonSave->setText(tr("保存")); +} + +void TextEditOption::modbus_insert_pic(QString filename) +{ +// on_pushButtonFile_pressed(); + dialogFileOperation->modbus_openfile(filename); + +} + +void TextEditOption::updateSysParaToZero() //重载 +{ + if(sysPara){ + dialogLineSpace->setValue(sysPara->para.textEditLineSpace,sysPara->para.textEditCharSpace); + onDialogLineSpaceAccepted(); + } +} + + +void TextEditOption::updateFileVariWidth(QString &str) +{ + QString patternVariableFormat = ""; + updateVariableFormat(str,patternVariableFormat); + + QString patternNormalVar = ""; + updateNormalVarWidth(str,patternNormalVar); + + QString patternCurDateVar = ""; + updateProduceDateVarWidth(str,patternCurDateVar,2); + + QString patternExpiryDateVar = ""; + updateProduceDateVarWidth(str,patternExpiryDateVar,1); + +} + +void TextEditOption::updateVariableFormat(QString& str,const QString& pattern){ + QRegExp rx(pattern); + int from = 0; + // 正常变量 + while(from < str.size() && from != -1) { + from = str.indexOf(rx,from);//返回匹配到到起始地址 + bool ok; + if(from != -1){//找到匹配的 + int varType = rx.cap(1).toInt(&ok); + // 获取匹配的标签 + QString matchedTag = rx.cap(0); + // 构建新的标签 + QString newTag = matchedTag; + int index = newTag.indexOf(QString::number(varType)); + if(varType != -1){ + newTag.insert(index+1,QString("/%1/..").arg(varType)); // :/7/image... :/7/7/../image + } + // 替换原始文本中的标签 + str.replace(from, rx.matchedLength(), newTag); +// from ++; + from+=newTag.length(); + } + } + +} + +void TextEditOption::updateNormalVarWidth(QString& str,const QString& pattern) +{ + QRegExp rx(pattern); + int from = 0; + // 正常变量 + while(from < str.size() && from != -1) { + from = str.indexOf(rx,from);//返回匹配到到起始地址 + bool ok; + if(from != -1){//找到匹配的 + int width = rx.cap(4).toInt(&ok)*(sysPara->status.addSpace?2:1); + int height = rx.cap(5).toInt(&ok); + int height2 = getVariableHight(height); + int digitalNum = rx.cap(3).toInt(&ok);//第二个匹配,数字到个数 + if(digitalNum>100){ //加粗 + digitalNum/=100; + ui->checkBoxBold->setChecked(true); + } + // 获取匹配的标签 + QString matchedTag = rx.cap(0); + // 构建新的标签,替换width属性值 + QString newTag = matchedTag; + int singlewidth = getSingleDigitWidth(height2); + int newWidth= (singlewidth + sysPara->para.textEditCharSpace) * digitalNum; + if(newWidth == width){ + return; + } + newTag.replace(QString("width=\"%1\"").arg(rx.cap(4)), QString("width=\"%1\"").arg(newWidth)); + // 替换原始文本中的标签 + str.replace(from, rx.matchedLength(), newTag); +// from ++; + from+=newTag.length(); + } + } +} + +void TextEditOption::updateProduceDateVarWidth(QString &str,const QString pattern,int mode){ + QRegExp rx(pattern); + int from = 0; + // 正常变量 + while(from < str.size() && from != -1) { + from = str.indexOf(rx,from);//返回匹配到到起始地址 + bool ok; + if(from != -1){//找到匹配的 + int width = rx.cap(3).toInt(&ok)*(sysPara->status.addSpace?2:1); + int height = rx.cap(4).toInt(&ok); + int digitalNum = rx.cap(2).toInt(&ok);//第二个匹配,数字到个数 + if(digitalNum>100){ //加粗 + digitalNum/=100; + ui->checkBoxBold->setChecked(true); + } + // 获取匹配的标签 + QString matchedTag = rx.cap(0); + // 构建新的标签,替换width属性值 + QString newTag = matchedTag; + int newWidth= getDateVarWidth(height,mode); +// std::cout<<"newWidth:"<标签 + str.replace(from, rx.matchedLength(), newTag); +// from ++; + from+=newTag.length(); + } + } + } + +int TextEditOption::getDateVarWidth(int height,int mode) +{ + int pixelSize = getVariableHight(height); + QFont font; + QString fontname="biyang"; + if(pixelSize>=12){ + fontname="wenquanyi"; + } + font.setFamily( + fontname // 20160812 + ); + font.setPixelSize(pixelSize); + font.setWeight(ui->checkBoxBold->isChecked() && (pixelSize<=16) ?QFont::Bold:QFont::Normal); + unsigned char splitMode=sysPara->para.ExpirySplitMode; + if(mode==1){ + sysPara->status.flagOfAdjustWidth_1 = 1; + sysPara->status.splitMode_Adjust_1= splitMode; + } + else if(mode ==2 ){ + sysPara->status.flagOfAdjustWidth_2 = 1; + sysPara->status.splitMode_Adjust_2= splitMode; + } +// std::cout<<"mode:"<print.CurDateVar.splitMode1:"<< static_cast(sysPara->print.CurDateVar.splitMode)<para.textEditCharSpace); + QFontMetrics fontMetrics(font); + QHash dateFormat; + dateFormat.insert(0,"yyyy-MM-dd"); + dateFormat.insert(1,"yyyy/MM/dd"); + dateFormat.insert(2,"yyyyMMdd"); + dateFormat.insert(3,"yyyy年MM月dd日"); + dateFormat.insert(4,"yyyy-MM-dd hh:mm"); + dateFormat.insert(5,"yyyy/MM/dd hh:mm"); + dateFormat.insert(6,"yyyyMMddhhmm"); + dateFormat.insert(7,"yyyy年MM月dd日 hh:mm"); + dateFormat.insert(8,"hh:mm"); + dateFormat.insert(9,"ddhhmm"); + dateFormat.insert(10,"dd MM yy"); + dateFormat.insert(11,"dd/MM/yy"); + dateFormat.insert(12,"dd/MM/yyyy"); + dateFormat.insert(13,"dd-MM-yy"); + dateFormat.insert(14,"dd-MM-yyyy"); + QString DateTime = QDateTime::currentDateTime().toString(dateFormat.value(splitMode)); + int dateTimeWidth = fontMetrics.width(DateTime) ; + return dateTimeWidth+4; +} + + +int TextEditOption::getSingleDigitWidth(int height) +{ + // int pixelSize = ui->labelFontSize->text().toInt(); + int pixelSize = height; + QFont font; + QString fontname="biyang"; + if(height>=12){ + fontname="wenquanyi"; + } + font.setFamily( + fontname // 20160812 + ); + font.setPixelSize(pixelSize); + font.setWeight(ui->checkBoxBold->isChecked() && (pixelSize<=16) ?QFont::Bold:QFont::Normal); + font.setLetterSpacing(QFont::AbsoluteSpacing,0); + QFontMetrics fontMetrics(font); + int width = (fontMetrics.width("0")); + // int width = (fontMetrics.width("0123456789"))/10; + // if(sysPara->para.flagOfModuleDecimal || sysPara->para.flagOfModuleHide){ + // width = (fontMetrics.width("0123456789.m "))/13; + // } + return width; +} + +int TextEditOption::getVariableHight(int height){ + if(height<7){ + return 5; + }else if(height<9){ + return 7; + }else if(height <12){ + return 9; + }else if(height<16){ + return 12; + }else if(height<22){ //24点阵变量高23 + return 16; + }else if(height<30){ + return 24; + }else if(height>=30){ + return 32; + } + +} diff --git a/TextEditOption.h b/TextEditOption.h new file mode 100644 index 0000000..8c0c68c --- /dev/null +++ b/TextEditOption.h @@ -0,0 +1,149 @@ +#ifndef TEXTEDITOPTION_H +#define TEXTEDITOPTION_H + +#include +#include +#include +#include +#include +#include "ParaSettingUI.h" +#include "MyFileDialog.h" +#include +#include +#include +#include "DialogFileOperation.h" +#include "DialogInsertVari.h" +#include "DialogFontSize.h" +#include "DialogLineSpace.h" +#include "PicWidget.h" +#include +#include "dlgQrCode.h" +#include "QBarCode.h" +#include "DialogSaveFile.h" +namespace Ui { +class TextEditOption; +} + +class TextEditOption : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + + explicit TextEditOption(QWidget *parent = 0); + ~TextEditOption(); + void updateSysParaToUI(); + void bindText(QTextEdit *textEdit); + + QLabel *getLabelFontSize(); + QPushButton *getPushButtonPreview(); + QCheckBox *getCheckBoxBold(); + void setFontFormat(); + void onbuttonOpenclicked(); + void bindPicWidget(PicWidget *picwidget); + void editItemModeDone(); + + void bindStackWidget(QStackedWidget *stackedWidgetOption,QStackedWidget *stackedWidgetText); + int editMode; + bool sceneEditItem; + QString fileName; + void InsertBarCodeToEdit(QString barCodeName,int width,int height); + void InsertBarCodeToEdit(QString barCodeName,int width,int height,int EnSave); + void InsertQRCodeToEdit(QString barCodeName,int width,int height ); + void InsertQRCodeToEdit(QString barCodeName,int width,int height ,int EnSave); + void modbus_insert_pic(QString filename); + dlgQrCode *dlgQrcode; + QBarCode *barcode; + QLabel * getLabelFontFamily(); + int barVarHeight,barVarWidth; + QFont barVarFont; + QTextCharFormat fmt; + QTextEdit *textEdit; + + void bindSysPara(SysPara *sysPara); + DialogFontSize *dialogFontSize; + + void updateFileVariWidth(QString &str); + void updateVariableFormat(QString&,const QString&); + void updateNormalVarWidth(QString&,const QString&); + void updateProduceDateVarWidth(QString &,const QString,int); + int getSingleDigitWidth(int); + int getVariableHight(int); + int getDateVarWidth(int height,int); + +public slots: + void on_bottonSave_clicked(); + void currentCharFormatChanged(const QTextCharFormat &format); + void onMbSetLineAndChar(int line_space, int char_space); + void onOpenNewFile(); + void updateSysParaToZero(); +private slots: + void onQRCodeClose(); + void onBarCodeClose(); // barDlgClose + void showDlg(); + + void enableButtonSave(); + /*--------------因为按钮被取消,功能消失-------------------------*/ + void onbottonInsertImgclicked(); + void onInsertImgFIle_select(); //选则文件后 + void onbottonInsertTextclicked(); + void onInsertTextFIle_select(); //选则文件后 + + void onOpenFIle_select(); //选则文件后 + /*-----------------------------------------------------------*/ + void on_buttonSaveAS_clicked(); + void onSaveAS_FIle_select(); //选则文件后 + + void onSave_File_reject(); + void on_bottonNew_pressed(); + + void on_buttonInsertVari_pressed(); + + void on_pushButtonFile_pressed(); + + void onFileOpen(QString filePath,bool insertFlag); + + void on_buttonSelectFont_pressed(); + + void on_checkBoxBold_released(); + void on_buttonLineSpace_clicked(); + + +Q_SIGNALS: + void fileNameChanged(QString); + void PicfileNameOpen(QString,bool); + void scenefileOpen(QString,bool); + void editItemDone(); + void fontSizeChange(int); + +protected slots: + void onSaveASFile(QString filename, bool Flag); + void onEditItemMode(); +private: + Ui::TextEditOption *ui; + QStackedWidget *stackedWidgetOption; + QStackedWidget *stackedWidgetText; + +// QTextEdit *textEdit; + PicWidget *picwidget; + + void saveFile(); + MyFileDialog *fileDialog; + bool maybeSave(); + void openFIle(QString fileName); + void mergeFormatOnWordOrSelection(const QTextCharFormat &format); + + + bool newFileAppending; + void checkNewFileAppending(); + void onDialogLineSpaceAccepted(); + + DialogFileOperation *dialogFileOperation; + DialogInsertVari *dialogInsertVari; + DialogLineSpace *dialogLineSpace; +#ifdef MYSAVEFILEDLG + DialogSaveFile *dialogSaveFile; +#endif +}; + +#endif // TEXTEDITOPTION_H diff --git a/Tftp/filetranseceiver.cpp b/Tftp/filetranseceiver.cpp new file mode 100644 index 0000000..b6c7b9e --- /dev/null +++ b/Tftp/filetranseceiver.cpp @@ -0,0 +1,210 @@ +#include "filetranseceiver.h" +#include +#include +#include +FileTranseceiver::FileTranseceiver() +{ +// struct sockaddr_in server_addr; +// bzero(&server_addr, sizeof(server_addr)); // 置字节字符串前n个字节为0,包括'\0' +// server_addr.sin_family = AF_INET; +// server_addr.sin_addr.s_addr = htons(INADDR_ANY); // 转小端,INADDR_ANY就是指定地址为0.0.0.0的地址 +// server_addr.sin_port = htons(5000); + serverThead = NULL; + sockfd = socket(PF_INET, SOCK_STREAM, 0); + + struct sockaddr_in seraddr; + seraddr.sin_family = AF_INET; + seraddr.sin_port = htons(5001); + seraddr.sin_addr.s_addr = htons(INADDR_ANY); + int tmp = 1; + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(int)); + if(bind(sockfd,(struct sockaddr *)&seraddr,sizeof(seraddr)) == -1) + { + qDebug() << "tftp server bind error"; + return; + } + + if(listen(sockfd,5) == -1) + { + qDebug() << "listen error"; + return; + } + serverThead = new QThread(); + moveToThread(serverThead); + QObject::connect(serverThead, SIGNAL(started()), this, SLOT(connectListen())); + //connect(&m_thread, SIGNAL(finished()), this, SLOT(deleteLater())); +// serverThead->start(); +// qDebug()<<"tftp server on..."; +} +FileTranseceiver::~FileTranseceiver(void) +{ + if(serverThead) { + disconnect(serverThead, SIGNAL(started()), this, SLOT(connectListen())); + if (serverThead->isRunning()) { + serverThead->quit(); + serverThead->wait(); + } + } + if(connfd) + close(connfd); + if(sockfd) + close(sockfd); +} +void FileTranseceiver::start() +{ + if(serverThead) + { + serverThead->start(); + } + qDebug()<<"tftp server on..."; +} + +void FileTranseceiver::connectListen() +{ + + struct msg info; + struct sockaddr_in cliaddr; + int len = sizeof(cliaddr); + pid_t pid; + int n; + QString fileName; + do + { + connfd = accept(sockfd,(struct sockaddr *)&cliaddr,(socklen_t *)&len); + if(connfd == -1) + { + qDebug() << "accept"; + continue; + } + +// pid = fork(); +// if(pid == -1) +// { +// qDebug() << "fork"; +// continue; +// } +// else if(pid == 0) + { + //close(sockfd); + while(1) + { + n = recv(connfd,&info,sizeof(info),0); + if(n == -1) + { + qDebug() << "recv"; + //exit(EXIT_FAILURE); + break; + } + if(n == 0) + { + qDebug() << "客户端退出"; + //exit(EXIT_SUCCESS); + break; + } + switch(info.type) + { +// case SEARCH: +// search_serverdir(connfd,info); +// break; + case DOWN: + ftp_download(connfd,info); + break; + case UP: + upload_ftp(connfd,info); + fileName = QString(info.fname); + qDebug()<<"emit fileRecieved(fileName)"; + emit fileRecieved(fileName); + break; + default: + break; + } + } + close(connfd); + } +// else +// { +// close(connfd); +// } + } + while(1); +} + +//将某文件中的内容传给客户端 +int FileTranseceiver::ftp_download(int connfd,struct msg info) +{ + FILE *fp; + + char name[100]; + memset(name,0,100); + sprintf(name, DOC_DIR"/%s",info.fname); +// QFile dl_file(QString::fromUtf8(name)); +// if (!dl_file.exists()) { +// return -1; +// } + //qDebug()<<"receive file name:"< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DOC_DIR "/home/plg/doc" +#define SEARCH 100 +#define DOWN 200 +#define END 500 +#define FAIL 300 +#define SUCCESS 400 +#define UP 600 + +struct msg +{ + int type; + int flag; + char buf[64]; + char fname[100]; +}; +class FileTranseceiver : public QObject +{ + Q_OBJECT +public: + explicit FileTranseceiver(); + ~FileTranseceiver(void); + + int ftp_download(int connfd,struct msg info); + int upload_ftp(int connfd,struct msg info); + void start(); +protected slots: + void connectListen(); +private: + int sockfd; + int connfd;; + QThread *serverThead; +signals: + void fileRecieved(QString fileName); +}; + +#endif // FILETRANSECEIVER_H diff --git a/TimeSettingDialog.cpp b/TimeSettingDialog.cpp new file mode 100644 index 0000000..bd2a76a --- /dev/null +++ b/TimeSettingDialog.cpp @@ -0,0 +1,53 @@ +#include "TimeSettingDialog.h" +#include "ui_timesettingdialog.h" + +TimeSettingDialog::TimeSettingDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::TimeSettingDialog) +{ + ui->setupUi(this); + this->setWindowTitle(tr("设置时间")); + this->setFixedSize(this->geometry().width(),this->geometry().height()); +} + +TimeSettingDialog::~TimeSettingDialog() +{ + delete ui; +} + +int TimeSettingDialog::getYear(){ + return ui->spinBoxYear->value(); +} +int TimeSettingDialog::getMonth(){ + return ui->spinBoxMonth->value(); +} +int TimeSettingDialog::getDay(){ + return ui->spinBoxDay->value(); +} +int TimeSettingDialog::getHour(){ + return ui->spinBoxHour->value(); +} +int TimeSettingDialog::getMinute(){ + return ui->spinBoxMinute->value(); +} +int TimeSettingDialog::getSecond(){ + return ui->spinBoxSecond->value(); +} +void TimeSettingDialog::setYear(int value){ + ui->spinBoxYear->setValue(value); +} +void TimeSettingDialog::setMonth(int value){ + ui->spinBoxMonth->setValue(value); +} +void TimeSettingDialog::setDay(int value){ + ui->spinBoxDay->setValue(value); +} +void TimeSettingDialog::setHour(int value){ + ui->spinBoxHour->setValue(value); +} +void TimeSettingDialog::setMinute(int value){ + ui->spinBoxMinute->setValue(value); +} +void TimeSettingDialog::setSecond(int value){ + ui->spinBoxSecond->setValue(value); +} diff --git a/TimeSettingDialog.h b/TimeSettingDialog.h new file mode 100644 index 0000000..81f19eb --- /dev/null +++ b/TimeSettingDialog.h @@ -0,0 +1,34 @@ +#ifndef TIMESETTINGDIALOG_H +#define TIMESETTINGDIALOG_H + +#include + +namespace Ui { +class TimeSettingDialog; +} + +class TimeSettingDialog : public QDialog +{ + Q_OBJECT + +public: + explicit TimeSettingDialog(QWidget *parent = 0); + ~TimeSettingDialog(); + + int getYear(); + int getMonth(); + int getDay(); + int getHour(); + int getMinute(); + int getSecond(); + void setYear(int value); + void setMonth(int value); + void setDay(int value); + void setHour(int value); + void setMinute(int value); + void setSecond(int value); +private: + Ui::TimeSettingDialog *ui; +}; + +#endif // TIMESETTINGDIALOG_H diff --git a/TriggerCtrl.cpp b/TriggerCtrl.cpp new file mode 100644 index 0000000..c2bd56c --- /dev/null +++ b/TriggerCtrl.cpp @@ -0,0 +1,656 @@ +#include "TriggerCtrl.h" +#include "ui_triggerctrl.h" +#include +#include +#include +#include +#include "qdebug.h" +#include +#include "myinclude.h" +#include "Public.h" +#include "VerBVersion.h" +#include "DevOp.h" + +/* readme: 20140809 +1. 同步字宽mm: 0.1+ w*(4-0.1) = 0.1+3.9w (mm) +2. 按长度喷印: +*/ + +// 20140923-12:05版本存在图形方式下变量不变绿问题,新版本已经更正 +// 20141013-16:36修正密码有效期设置错误。 +//2015-10-17 二维码变量问题 +// 2015-11-01 无聊: 要从V6S版本恢复原来的 para.set_HVData_Flag = 0; 参数 +// 估计过段时间又要要求增加 UART功能。 V6S 原来已经有这个功能了。但他们不用!! +// 20151109 新增计数1和计数器2单独立即清零 版本号 No42 +// 更新了Vietname字库,使用中文使用wenquanyiBitmap,编译uncode编码使用wenquanyimicrohei,英文自己编,越南语自己编,基于DejaVu Sans +// 新版软件更新或升级,会因参数错位,出现隔膜位置设定值(等参数)错误,引起主墨泵不工作,开机不循环等现象。(解决办法,重新检查并设置所有参数) +// 20160203:修改了变量定位方式,更新的Image图片。 将左下角更换为RGB = 250,250,0 -=== 0xFFF7FC00 +// 修正了停止打印关闭高压的问题,重新打印出现高压故障 +// 修改了密码一周一变,增加了密码校验,需要使用新版20以上的手机密码软件,密码为7位; +// 20160218 修改了提示框显示方式,避免提示阻塞处理进程 + +// 20160304 优化了变量显示; 增加了中心旋转交替功能;增加了 13位随机码打印功能; 修正界面显示字库部分汉字问题 +// 本次修改需要同时更并按ARM和FPGA + +// FPGA实现自动点距调整,实现连续点位置修正 20160714 FPGA版本 V44, 0714B +// 20160715 : 去掉了“点距电压微调”、“内存数据显示”、部分相检控制参数设置 +// 20160729: 发现打开历史记录会死机问题,原因待查。但执行删除历史记录后,可避免再次死机。 +// 20160723: 增加电眼复位功能。 与电眼清零不同,复位时,计数不清零,而是等于预设的当前值。 +// 20160718: 参考日立方案,优化打印效果 +/* + 20160728:发现历史记录打开时,会死机 + 20160729: 查找原因:fi +// 20160806:重要修改 : 毫米脉冲的系数由X8改为X256,原因是:使用X8时传递误差较大,导致1000mm会有6mm误差, 使用X256(即8位二进制表示小数时,可以精确到0.004,从而提高精度) + X8 时,小数精度为0.125而已 + + 20160812:增加左横,右横变量 + if((varType<9) // 普通变量 + ||(varType>=20 && varType<29) // 横左变量 + ||(varType>=40 && varType<49) // 右横变量 + if(fontname.contains("SerifL") ||fontname.contains("serifl") ) varType1= 20+varType; + else if(fontname.contains("SerifR") ||fontname.contains("serifr") ) varType1= 40+varType; + 20160831: 增加临时密码,每小时一变 + + 20160904: 解决重新开机后,有时不能自动打印文件问题。 + 20160905: 第二行单独变量时显示不全问题 + + // 20160912: 去掉高压故障自动关闭回收的默认值 1 + // 20160912: 设置了隐藏按键,用于对墨线时间和开机次数进行复位 No49 + 20160927: FIFO实现RAND 码上传,暂时与RST0806 No49区别开来 No50 + 20161212: 修改总产品计数器清零功能。由ARM清零改为FPGA清零 No51 // [3]总产品计数器清零FPGA + 20161217: 增加了 SPV210编译选项,以处理V6核心版驱动问题 + 修改随机码处理函数,以解决 不能输出奇数位 随机码问题。 + + 20170217: 有厂家只想打一条横线,改最小列点阵数。 + 20170224: 输入密码不回显 + 20170313: 修改开机重启或重载参数时,设定计数当前值为起始值 + 20170318: 制作0318版本的刷机文件 + + 20170803: 增加外接屏功能,20170808完成 + + */ + +#ifdef MIMA +#ifdef ALT16 + #define BVER "(ALT53_old)" TST // 20160801 之前使用 RST46 +#else + #define BVER "(SUN53)" TST // 20160801 之前使用 RST46 +#endif +#endif +//#define NON_CABLE//喷印间隔固定 +// 20160507 1138 +// 20161209 编辑 小数点喷印间隔 +// 20170603: 太阳能条码专用版本 +// Nam Ninh phồng tuyệt vời Mã Technology Co., Ltd. +TriggerCtrl::TriggerCtrl(QWidget *parent) : + QWidget(parent), + ui(new Ui::TriggerCtrl) +{ + ui->setupUi(this); +//#ifdef SYNLENFLOAT + QRegExp double_rx100("10000000|([0-9]{1,8}[\.][0-9]{0,1})"); + ui->spinBoxSynTriggerPrintLen->setValidator(new QRegExpValidator(double_rx100,ui->spinBoxSynTriggerPrintLen)); +#ifdef NON_CABLE + ui->spinBoxSynTriggerPrintLen->setEnabled(0); +#endif +//#endif + pulseNumFix = new PulseNumFix(parent); + pulseNumFix->hide(); + ui->lineEditTriggerPulsePerMm->setValidator(new QDoubleValidator(0)); + connect(pulseNumFix,SIGNAL(pulseNuxFixDone(float)),this,SLOT(onPulseNumFixDone(float))); + //ui->test_version->setText (tr(BUILD_DATE)); + + updateSysStatusToUI(); + QString s; +#if 0 /* roger use new Version manage,so delete it */ + s.sprintf(" %s ",__TIME__); + +#ifdef MYTEST + s = (QString) Public::DateToString(__DATE__)+s + "A2451测试"; +#else + s = (QString) Public::DateToString(__DATE__)+s + BVER; +#endif + +#else + s.sprintf("%d.%d.%02dS_", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER); + s = s + (QString) Public::DateToString(__DATE__)+" "+ QString(__TIME__); +// s = s + BVER; +#endif + ui->test_version->setText(s); + + ui->checkBoxEleEyeMakeClean->setVisible(false); + tr("独立参数"); + //ui->labelDelayTriggerValue->setText(tr("重复间隔(毫秒)")); + //--if( QString(BUILD_DATE).left(21)!="2015-10-26 20:56(M40)"){ + //--ui->labelEleMaskTime->hide(); + //--ui->spinBoxEleMaskTime->hide(); + //--} + + if(Public::ReadLanguageName()=="Chinese"){ + ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV12.png"))); + }else + { + ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV13.png"))); + } + //qDebug()<<"Run TriggerCtrl ok."; +#ifdef ENGLISH + ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV13.png"))); +#endif + ui->spinBoxOuputPulseCol->setHidden(1); +// ui->labelOuputPulseCol->setHidden(1); +} + +TriggerCtrl::~TriggerCtrl() +{ + delete ui; + delete pulseNumFix; +} + +void TriggerCtrl::setTriggerUI(int triggerMode){ + + ui->radioButtonDelayTrigger->setChecked(triggerMode == PRINT_TRIGGER_TIME); + ui->spinBoxDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME); + ui->labelDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME); + ui->comboBoxTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME); + ui->labelTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME); + + ui->radioButtonEleEyeEdgetTrigger->setChecked( triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->radioButtonEleEyeLevelTrigger->setChecked(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL); + ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->labelEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->spinBoxEleEyeTriggerRepeatCnt->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->labelEleEyeTriggerRepeatCnt->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->spinBoxEleEyeTriggerPrintDelay->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE || PRINT_TRIGGER_SYNCHRONIZER); + ui->labelEleEyeTriggerPrintDelay->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE || PRINT_TRIGGER_SYNCHRONIZER); + ui->checkBoxSynMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->checkEyeTriggerSynPrintEn->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->labelEleMaskTime->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + ui->spinBoxEleMaskTime->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE); + + if(sysPara->para.eleEyeTriggerSynPrintEn && + (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + ) + { + //ui->radioButtonSynTrigger->setChecked(1); + ui->spinBoxSynTriggerPrintLen->setEnabled(0); + ui->labelSynTriggerPrintLen->setEnabled(1); + ui->lineEditTriggerPulsePerMm->setEnabled(1); + ui->labelTriggerPulsePerMm->setEnabled(1); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1); + ui->labelSynTriggerPrintLenRatio->setEnabled(1); + ui->checkBoxEleEyeMakeClean->setEnabled(1); + ui->pushButtonApplyPulseFix->setEnabled(1); + ui->comboBoxSynPrintMode->setEnabled(1); + ui->labelSynPrintMode->setEnabled(1); + //ui->checkBoxAutoSpeedEN->setEnabled (1); + ui->labelEleMaskTime->setEnabled(1); + ui->spinBoxEleMaskTime->setEnabled(1); + + //ui->spinBoxEleMaskTime->setEnabled(1); + + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)")); + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)")); + ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)")); + } + else + { + ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + #ifndef NON_CABLE + ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + #endif + ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->labelEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->spinBoxEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + if(triggerMode == PRINT_TRIGGER_SYNCHRONIZER) + { + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)")); + } + else + { + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)")); + } + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)")); + ui->labelEleMaskTime->setText(tr("封锁时间(毫秒)")); + } + if(( ( //sysPara->para.eleEyeTriggerSynPrintEn || + ui->checkEyeTriggerSynPrintEn->isChecked()) + &&(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE)) + || triggerMode == PRINT_TRIGGER_SYNCHRONIZER ) + { + ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):")); + } + else ui->labelOutputPulseDelayMs->setText(tr("延时(毫秒):")); + + setSynPrintMode(sysPara->para.sysTriggerPrintMode); + +} + +void TriggerCtrl::setSynPrintMode(int mode){ + ui->labelSynTriggerPrintLenRatio->setText((mode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)?tr("字符宽度"):tr("喷印比例(%)")); + ui->comboBoxSynPrintMode->setCurrentIndex(mode); + ui->spinBoxSynTriggerPrintLenRatio->setValue((mode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)?sysPara->para.synCharWidthRatio:sysPara->para.synTriggerPrintLenRatio); +} + +void TriggerCtrl::GetTriggerUIPara(){ + if(sysPara){ + sysPara->para.printDelayMs = ui->spinBoxDelayTriggerValue->value(); + sysPara->para.timeTriggerPrintMode = ui->comboBoxTimeTriggerMode->currentIndex(); + sysPara->para.elecEyeTriggerInterval = ui->spinBoxEleEyeTriggerIntervalMs->value(); + sysPara->para.photoElectricityRepeateNum = ui->spinBoxEleEyeTriggerRepeatCnt->value(); + + // + sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->text().toFloat(); + //sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->value(); + #ifdef NON_CABLE + sysPara->para.synTriggerPrintLenMm = 255.0; + ui->spinBoxSynTriggerPrintLen->setText("255"); + #endif + sysPara->para.synPulseNumPerMm = ui->lineEditTriggerPulsePerMm->text().toFloat(); + + sysPara->para.sysTriggerPrintMode = ui->comboBoxSynPrintMode->currentIndex(); + if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH) + sysPara->para.synCharWidthRatio = ui->spinBoxSynTriggerPrintLenRatio->value(); + else + sysPara->para.synTriggerPrintLenRatio = ui->spinBoxSynTriggerPrintLenRatio->value(); + + // 原代码: + //sysPara->para.AltMirrorGap =(unsigned int) ( ((unsigned int)ui->spinBoxAltMirrorGap->value()) & 0x7fff) | ( ui->comboBoxAltMirrType->currentIndex()==1?0x8000:0x0000); + + // 20160303: + sysPara->para.AltMirrorGap =(unsigned int) ( ((unsigned int)ui->spinBoxAltMirrorGap->value()) & 0x0fff) |( ( ui->comboBoxAltMirrType->currentIndex())<<12 ); + + //qDebug()<< (sysPara->para.AltMirrorGap & 0x0fff) << (sysPara->para.AltMirrorGap & 0xf000); + + if(ui->radioButtonDelayTrigger->isChecked()) + sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME; + else if(ui->radioButtonEleEyeLevelTrigger->isChecked()) + sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL; + else if(ui->radioButtonEleEyeEdgetTrigger->isChecked()) + sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE; + else if(ui->radioButtonSynTrigger->isChecked()) + sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER; + else + sysPara->para.printTriggerMode = PRINT_TRIGGER_NONE; + + sysPara->para.eleEyeTriggerSynPrintEn = ui->checkEyeTriggerSynPrintEn->isChecked (); + sysPara->para.eleEyeTriggerPrintDelay = ui->spinBoxEleEyeTriggerPrintDelay->value(); + sysPara->para.synClearCntInEleEyeMode = ui->checkBoxSynMakeClean->isChecked(); + sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xf0) + ui->comboBoxEleEyeMakeClean->currentIndex(); //ui->checkBoxEleEyeMakeClean->isChecked(); + //sysPara->para.autoSynSpeedEn = ui->checkBoxAutoSpeedEN->isChecked (); + sysPara->para.autoSynSpeedEn = 0; + //sysPara->para.synPulsePerMmX8 = (unsigned short)(sysPara->para.synPulseNumPerMm *256); + sysPara->para.synPulsePerMmX8 = (unsigned short)((unsigned int)sysPara->para.synPulseNumPerMm <<8); + sysPara->para.eleMaskTime = ui->spinBoxEleMaskTime->value(); + //qDebug()<<"eleEyeClearCntInSynMode"<< sysPara->para.eleEyeClearCntInSynMode ; + sysPara->para.synchronizorActType = ui->comboBoxSyncActType->currentIndex(); + //qDebug()<<"synchronizorActType"<< sysPara->para.synchronizorActType; + + sysPara->para.pulse_sinal_value = ui->spinBoxpluseSinal->value(); + } +} +void TriggerCtrl::TriggerupdateSysParaToUI(){ + updateSysParaToUI(); +} + +void TriggerCtrl::updateSysParaToUI(){ + if(sysPara) + { + /*----------------------------------------*/ + setTriggerUI(sysPara->para.printTriggerMode); + ui->spinBoxDelayTriggerValue->setValue(sysPara->para.printDelayMs); +#ifndef NON_CABLE + ui->comboBoxTimeTriggerMode->setCurrentIndex(sysPara->para.timeTriggerPrintMode); +#endif + ui->spinBoxEleEyeTriggerIntervalMs->setValue(sysPara->para.elecEyeTriggerInterval); + ui->spinBoxOutputPulseDelayMs->setValue(sysPara->para.outputPulseDelayMs); + ui->spinBoxEleEyeTriggerRepeatCnt->setValue(sysPara->para.photoElectricityRepeateNum); + + //ui->spinBoxSynTriggerPrintLen->setValue(sysPara->para.synTriggerPrintLenMm); + ui->spinBoxSynTriggerPrintLen->setText(QString::number(sysPara->para.synTriggerPrintLenMm)); + ui->lineEditTriggerPulsePerMm->setText(QString::number(sysPara->para.synPulseNumPerMm)); + if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH) + ui->spinBoxSynTriggerPrintLenRatio->setValue(sysPara->para.synCharWidthRatio); + else + ui->spinBoxSynTriggerPrintLenRatio->setValue(sysPara->para.synTriggerPrintLenRatio); + + /*----------------------------------------*/ + ui->spinBoxEleEyeTriggerPrintDelay->setValue(sysPara->para.eleEyeTriggerPrintDelay); + ui->checkBoxSynMakeClean->setChecked(sysPara->para.synClearCntInEleEyeMode); + //ui->checkBoxEleEyeMakeClean->setChecked(sysPara->para.eleEyeClearCntInSynMode); + ui->comboBoxEleEyeMakeClean->setCurrentIndex( sysPara->para.eleEyeClearCntInSynMode & 0x0f); + + ui->checkBoxPulseOutputEnable->setChecked(sysPara->para.pulseOutputEnable); + ui->labelProductCntPerOutputPulse->setEnabled(sysPara->para.pulseOutputEnable); + ui->spinBoxProductCntPerOutputPulse->setEnabled(sysPara->para.pulseOutputEnable); + ui->spinBoxProductCntPerOutputPulse->setValue(sysPara->para.productCntPerOutputPulse); + + ui->labelOutputPulseDelayMs->setEnabled(sysPara->para.pulseOutputEnable); + + //ui->spinBoxOutputPulseDelayMs->setEnabled(sysPara->para.pulseOutputEnable); + + ui->spinBoxOutputPulseDelayMs->setEnabled(true /*sysPara->para.outputPulseDelayMs*/); + ui->spinBoxOuputPulseCol->setValue(sysPara->para.OuputPulseCol); + ui->checkEyeTriggerSynPrintEn->setChecked (sysPara->para.eleEyeTriggerSynPrintEn); + ui->comboBoxSyncActType->setCurrentIndex (sysPara->para.synchronizorActType); + //ui->checkBoxAutoSpeedEN->setChecked (sysPara->para.autoSynSpeedEn ); + ui->spinBoxEleMaskTime->setValue(sysPara->para.eleMaskTime); + + ui->spinBoxAltMirrorGap->setValue( sysPara->para.AltMirrorGap & 0x0fff ); + + ui->comboBoxAltMirrType->setCurrentIndex( (sysPara->para.AltMirrorGap>>12) & 0x000F); + ui->spinBoxpluseSinal->setValue(sysPara->para.pulse_sinal_value); + + } +} + +void TriggerCtrl::applyUIPara(){ + if(sysPara){ + GetTriggerUIPara(); + sysPara->para.pulseOutputEnable = ui->checkBoxPulseOutputEnable->isChecked(); + sysPara->para.productCntPerOutputPulse = ui->spinBoxProductCntPerOutputPulse->value(); + sysPara->para.outputPulseDelayMs = ui->spinBoxOutputPulseDelayMs->value(); + sysPara->para.OuputPulseCol = ui->spinBoxOuputPulseCol->value(); + if(( ( //sysPara->para.eleEyeTriggerSynPrintEn || + ui->checkEyeTriggerSynPrintEn->checkState()==1 ) + &&(sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE)) + || sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER ) + { + ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):")); + } + else ui->labelOutputPulseDelayMs->setText(tr("延时(毫秒):")); +#ifdef DEBUG1 + qDebug()<<"TriggerCtrl::applyUIPara"<<"1"; +#endif + if(sysPara->devOp->writeFpgaPrintPara() != -1) + QMessageBox::information(this,tr("提示"),tr("应用成功")); +#ifdef DEBUG1 + qDebug()<<"TriggerCtrl::applyUIPara"<<"3"; +#endif + + } +} + +void TriggerCtrl::updateSysStatusToUI(){ + static char t_init = 0; + if(sysPara){ + if(t_init == 0){ + sysPara->loadParaFromFile(); + //qDebug()<<"sysPara->para.pulse_sinal_value="<para.pulse_sinal_value; + ui->spinBoxpluseSinal->setValue(sysPara->para.pulse_sinal_value); + t_init = 1; + } +// if((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER)) +// { +// ui->lineEditPulseCount ->setText(QString::number((int )((sysPara->para.synTriggerPrintLenMm)*sysPara->para.synPulseNumPerMm))); +// } +// else if(((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL +// ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) +// && sysPara->para.eleEyeTriggerSynPrintEn)) +// { +// ui->lineEditPulseCount ->setText(QString::number( (int )((sysPara->para.elecEyeTriggerInterval)*sysPara->para.synPulseNumPerMm))); +// } + } +} + +void TriggerCtrl::on_checkEyeTriggerSynPrintEn_pressed() +{ +#if 0 + int triggerMode = sysPara->para.printTriggerMode; + if(sysPara) + { + //if( !sysPara->para.eleEyeTriggerSynPrintEn ) + if( !ui->checkEyeTriggerSynPrintEn->isChecked() ) + { + //ui->radioButtonSynTrigger->setChecked(1); + + ui->spinBoxSynTriggerPrintLen->setEnabled(1); + ui->labelSynTriggerPrintLen->setEnabled(1); + ui->lineEditTriggerPulsePerMm->setEnabled(1); + ui->labelTriggerPulsePerMm->setEnabled(1); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1); + ui->labelSynTriggerPrintLenRatio->setEnabled(1); + ui->checkBoxEleEyeMakeClean->setEnabled(1); + ui->pushButtonApplyPulseFix->setEnabled(1); + ui->comboBoxSynPrintMode->setEnabled(1); + ui->labelSynPrintMode->setEnabled(1); + ui->checkBoxAutoSpeedEN->setEnabled (1); + ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0); + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)")); + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)")); + ui->labelOutputPulseDelayMs->setText("延时(毫米):"); + if(ui->checkBoxpausePrintSyncInv->isChecked()) + { + ui->checkBoxpausePrintSyncInv->setChecked(false); + } + } + else + { + ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(1); + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)")); + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)")); + ui->labelOutputPulseDelayMs->setText( ui->radioButtonSynTrigger->isChecked()?"延时(毫米):":"延时(毫秒):"); + + } + // sysPara->para.eleEyeTriggerSynPrintEn=!sysPara->para.eleEyeTriggerSynPrintEn; + } +#endif +} + +void TriggerCtrl::on_radioButtonDelayTrigger_pressed() +{ + setTriggerUI(PRINT_TRIGGER_TIME); +} + +void TriggerCtrl::on_radioButtonEleEyeEdgetTrigger_pressed() +{ + setTriggerUI(PRINT_TRIGGER_ELEC_EYE_EDGE); +} + +void TriggerCtrl::on_radioButtonEleEyeLevelTrigger_pressed() +{ + setTriggerUI(PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL); +} + +void TriggerCtrl::on_radioButtonSynTrigger_pressed() +{ + setTriggerUI(PRINT_TRIGGER_SYNCHRONIZER); +} + +void TriggerCtrl::on_pushButtonApplyPulseFix_clicked() +{ + pulseNumFix->bindSysPara(sysPara); + pulseNumFix->hide(); + pulseNumFix->show(); +} + +void TriggerCtrl::onPulseNumFixDone(float value){ + ui->lineEditTriggerPulsePerMm->setText(QString::number(value)); +} + +void TriggerCtrl::on_comboBoxSynPrintMode_currentIndexChanged(int index) +{ + setSynPrintMode(index); +} + +void TriggerCtrl::on_pushButtonApply_pressed() +{ + applyUIPara(); + if(sysPara)sysPara->saveParaToFile (); +} + +void TriggerCtrl::on_checkBoxPulseOutputEnable_clicked() +{ + bool checked = ui->checkBoxPulseOutputEnable->isChecked(); + ui->labelProductCntPerOutputPulse->setEnabled(checked); + ui->spinBoxProductCntPerOutputPulse->setEnabled(checked); + //ui->labelOutputPulseDelayMs->setEnabled(checked); + //ui->spinBoxOutputPulseDelayMs->setEnabled(checked); +} + +void TriggerCtrl::setBuildTime(QString s1) +{ + QString s; + +#if 0 /* roger use new Version manage,so delete it */ + s.sprintf(" %s ",__TIME__); + s = (QString) Public::DateToString(__DATE__)+s + BVER; +#else + s.sprintf("%d.%d.%02dS_", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER); + s = s + (QString) Public::DateToString(__DATE__)+ " "+ QString(__TIME__)+"_"+UP_PRINTER_STAGE_VER; +// s = s + BVER; +#endif + ui->test_version->setText(s+s1); + + //ui->test_version->setText (BUILD_DATE+s); + +} + +void TriggerCtrl::on_checkEyeTriggerSynPrintEn_clicked(bool checked) +{ + int triggerMode = sysPara->para.printTriggerMode; + if(sysPara) + { + //if( !sysPara->para.eleEyeTriggerSynPrintEn ) + if( checked) + { + //ui->radioButtonSynTrigger->setChecked(1); +#ifndef NON_CABLE + ui->spinBoxSynTriggerPrintLen->setEnabled(1); +#endif + ui->labelSynTriggerPrintLen->setEnabled(1); + ui->lineEditTriggerPulsePerMm->setEnabled(1); + ui->labelTriggerPulsePerMm->setEnabled(1); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1); + ui->labelSynTriggerPrintLenRatio->setEnabled(1); + ui->checkBoxEleEyeMakeClean->setEnabled(1); + ui->pushButtonApplyPulseFix->setEnabled(1); + ui->comboBoxSynPrintMode->setEnabled(1); + ui->labelSynPrintMode->setEnabled(1); + //ui->checkBoxAutoSpeedEN->setEnabled (1); + ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0); + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)")); + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)")); + ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)")); + ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):")); + if(ui->comboBoxSyncActType->currentIndex() || 0b11) //如果不是在正反转打印的模式下,就切换到正反转模式 + { + ui->comboBoxSyncActType->setCurrentIndex(0); + } + } + else + { + ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); +#ifndef NON_CABLE + ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); +#endif + ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + //ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER); + ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(1); + ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)")); + ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)")); + ui->labelEleMaskTime->setText(tr("封锁间隔(毫秒)")); + ui->labelOutputPulseDelayMs->setText( ui->radioButtonSynTrigger->isChecked()?tr("延时(毫米):"):tr("延时(毫秒):")); + + } + } +} + +void TriggerCtrl::on_comboBoxSyncActType_activated(int index) +{ + if(index>0) + { + on_checkEyeTriggerSynPrintEn_clicked(false); + } +} + + +void TriggerCtrl::on_lineEditTriggerPulsePerMm_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + sysPara->para.synPulseNumPerMm = ui->lineEditTriggerPulsePerMm->text().toFloat(); +} + +void TriggerCtrl::on_spinBoxSynTriggerPrintLen_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + //sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->text().toFloat(); +} + +void TriggerCtrl::on_spinBoxEleEyeTriggerIntervalMs_valueChanged(int arg1) +{ + sysPara->para.elecEyeTriggerInterval = arg1; +} + +//2020/3/2 +void TriggerCtrl::on_radioButtonSynTrigger_clicked() +{ + sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER; +} + +void TriggerCtrl::on_radioButtonEleEyeLevelTrigger_clicked() +{ + sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL; +} + +void TriggerCtrl::on_radioButtonEleEyeEdgetTrigger_clicked() +{ + sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE; +} + +void TriggerCtrl::on_radioButtonDelayTrigger_clicked() +{ + sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME; +} + + + +#define PRINT_CTRL_ADDR_BASE 0xa400 +typedef struct pulse_struct { + unsigned int pulse_value:16; +}Pulse_struct; + +void TriggerCtrl::on_spinBoxpluseSinal_valueChanged(int arg1) +{ + Pulse_struct t_pulse_struct; + sysPara->para.pulse_sinal_value = arg1; + t_pulse_struct.pulse_value = arg1*10*ui->lineEditTriggerPulsePerMm->text().toFloat(); + sysPara->devOp->fpgaWr(PRINT_CTRL_ADDR_BASE + 0x88, (unsigned char *)&t_pulse_struct, 2); +} + +void TriggerCtrl::OutputPulse() +{ + ui->checkBoxPulseOutputEnable->setChecked(true); + ui->spinBoxProductCntPerOutputPulse->setEnabled(true); + ui->spinBoxProductCntPerOutputPulse->setValue(sysPara->para.productCntPerOutputPulse); +} diff --git a/TriggerCtrl.h b/TriggerCtrl.h new file mode 100644 index 0000000..0b7ccb1 --- /dev/null +++ b/TriggerCtrl.h @@ -0,0 +1,74 @@ +#ifndef TRIGGERCTRL_H +#define TRIGGERCTRL_H + +#include +#include "ParaSettingUI.h" +#include "PulseNumFix.h" +namespace Ui { +class TriggerCtrl; +} + +class TriggerCtrl : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit TriggerCtrl(QWidget *parent = 0); + ~TriggerCtrl(); + void updateSysParaToUI(); //重载 + void applyUIPara(); //重载 + void updateSysStatusToUI(); + + void setBuildTime(QString s); + +private slots: + void on_radioButtonDelayTrigger_pressed(); + void TriggerupdateSysParaToUI(); + void on_checkEyeTriggerSynPrintEn_pressed(); + void on_radioButtonEleEyeEdgetTrigger_pressed(); + + void on_radioButtonEleEyeLevelTrigger_pressed(); + + void on_radioButtonSynTrigger_pressed(); + + void on_pushButtonApplyPulseFix_clicked(); + + void onPulseNumFixDone(float); + + void on_comboBoxSynPrintMode_currentIndexChanged(int index); + void on_pushButtonApply_pressed(); + + void on_checkBoxPulseOutputEnable_clicked(); + + void on_checkEyeTriggerSynPrintEn_clicked(bool checked); + + void on_comboBoxSyncActType_activated(int index); + + void on_lineEditTriggerPulsePerMm_textChanged(const QString &arg1); + + void on_spinBoxSynTriggerPrintLen_textChanged(const QString &arg1); + + void on_spinBoxEleEyeTriggerIntervalMs_valueChanged(int arg1); + + void on_radioButtonSynTrigger_clicked(); + + void on_radioButtonEleEyeLevelTrigger_clicked(); + + void on_radioButtonEleEyeEdgetTrigger_clicked(); + + void on_radioButtonDelayTrigger_clicked(); + + void on_spinBoxpluseSinal_valueChanged(int arg1); + + void OutputPulse(); + +private: + Ui::TriggerCtrl *ui; + + void setTriggerUI(int triggerMode); + void setSynPrintMode(int mode); + void GetTriggerUIPara(); + PulseNumFix *pulseNumFix; +}; + +#endif // TRIGGERCTRL_H diff --git a/VerBVersion.h b/VerBVersion.h new file mode 100644 index 0000000..976d88d --- /dev/null +++ b/VerBVersion.h @@ -0,0 +1,19 @@ +#ifndef VERBVERSION_H +#define VERBVERSION_H +/* + Major.Minor.Rivison.yyyy-MM-DD_Beta +*/ +#define UP_PRINTER_MAJOR_VER 6 +#define UP_PRINTER_MINOR_VER 1 +#define UP_PRINTER_RIVISION_VER 1 +#define UP_PRINTER_STAGE_VER "" +//#define UP_PRINTER_STAGE_VER "Beta" +//#define UP_PRINTER_STAGE_VER "RC" +//#define UP_PRINTER_STAGE_VER "Release" + + +#define VERNONBACH_VERSION(a,b,c) (((a)<<16) + ((b)<<8) + (c)) + +#define VERNONBACH_VERSION_CODE VERNONBACH_VERSION(UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER, UP_PRINTER_RIVISION_VER) + +#endif // VERBVERSION_H diff --git a/VerBVersion.h.r24 b/VerBVersion.h.r24 new file mode 100644 index 0000000..e69de29 diff --git a/WINPY_utf8.txt b/WINPY_utf8.txt new file mode 100644 index 0000000..529c3b9 --- /dev/null +++ b/WINPY_utf8.txt @@ -0,0 +1,20915 @@ +安a +按a +爱a +阿a +暗a +啊a +埃a +碍a +凹a +奥a +岸a +矮a +案a +俺a +挨a +唉a +昂a +氨a +胺a +哎a +吖a +嗄a +腌a +锕a +安徽省ahs +爱ai +埃ai +碍ai +矮ai +挨ai +唉ai +哎ai +哀ai +皑ai +癌ai +蔼ai +艾ai +隘ai +呆*ai +捱ai +嗳ai +嗌ai +嫒ai +瑷ai +暧ai +砹ai +锿ai +霭ai +安an +按an +暗an +岸an +案an +俺an +氨an +胺an +鞍an +谙an +埯an +揞an +犴an +庵an +桉an +铵an +鹌an +黯an +昂ang +肮ang +盎ang +安徽anhui +凹ao +奥ao +敖ao +熬ao +翱ao +袄ao +傲ao +懊ao +澳ao +嚣*ao +坳ao +拗ao +嗷ao +岙ao +廒ao +遨ao +媪ao +骜ao +獒ao +聱ao +螯ao +鏊ao +鳌ao +鏖ao +不b +部b +本b +表b +把b +变b +比b +并b +别b +百b +报b +保b +病b +北b +被b +步b +边b +八b +办b +布b +把ba +八ba +吧ba +巴ba +拔ba +霸ba +罢ba +爸ba +坝ba +芭ba +捌ba +扒ba +叭ba +笆ba +疤ba +跋ba +靶ba +耙ba +茇ba +菝ba +岜ba +灞ba +钯ba +粑ba +鲅ba +魃ba +百bai +白bai +败bai +摆bai +伯*bai +柏bai +佰bai +拜bai +稗bai +捭bai +掰bai +办ban +半ban +板ban +班ban +般ban +版ban +拌ban +搬ban +斑ban +扳ban +伴ban +颁ban +扮ban +瓣ban +绊ban +阪ban +坂ban +钣ban +瘢ban +癍ban +舨ban +帮bang +棒bang +邦bang +榜bang +梆bang +膀bang +绑bang +磅bang +蚌bang +镑bang +傍bang +谤bang +蒡bang +浜bang +报bao +保bao +包bao +剥bao +薄bao +胞bao +暴bao +宝bao +饱bao +抱bao +爆bao +炮*bao +堡bao +刨*bao +苞bao +褒bao +雹bao +豹bao +鲍bao +曝*bao +瀑*bao +葆bao +孢bao +煲bao +鸨bao +褓bao +趵bao +龅bao +北bei +被bei +倍bei +备bei +背bei +辈bei +贝bei +杯bei +卑bei +臂*bei +悲bei +碑bei +钡bei +狈bei +惫bei +焙bei +孛bei +陂bei +邶bei +埤bei +萆bei +蓓bei +呗bei +悖bei +碚bei +鹎bei +褙bei +鐾bei +鞴bei +本ben +奔ben +苯ben +笨ben +夯*ben +畚ben +坌ben +贲ben +锛ben +本报benbao +奔波benbo +本部benbu +本厂benchang +奔驰benchi +本地bendi +奔放benfang +泵beng +崩beng +蚌*beng +绷beng +甭beng +蹦beng +迸beng +嘣beng +甏beng +比bi +必bi +避bi +闭bi +辟bi +笔bi +壁bi +臂bi +毕bi +彼bi +逼bi +币bi +鼻bi +蔽bi +秘*bi +鄙bi +碧bi +蓖bi +毙bi +毖bi +庇bi +痹bi +敝bi +弊bi +陛bi +拂*bi +泌*bi +匕bi +俾bi +埤*bi +芘*bi +荜bi +荸bi +萆*bi +薜bi +吡bi +哔bi +狴bi +庳bi +愎bi +滗bi +濞bi +弼bi +妣bi +婢bi +嬖bi +璧bi +贲*bi +睥*bi +畀bi +铋bi +秕bi +裨bi +筚bi +箅bi +篦bi +舭bi +襞bi +跸bi +髀bi +变bian +边bian +便bian +编bian +遍bian +辩bian +扁bian +辨bian +鞭bian +贬bian +卞bian +辫bian +匾bian +弁bian +苄bian +忭bian +汴bian +缏bian +飚bian +煸bian +砭bian +碥bian +窆bian +褊bian +蝙bian +笾bian +鳊bian +表biao +标biao +彪biao +膘biao +勺*biao +婊biao +骠biao +杓biao +飑biao +飙biao +镖biao +镳biao +瘭biao +裱biao +鳔biao +髟biao +别bie +鳖bie +憋bie +瘪bie +蹩bie +宾bin +彬bin +斌bin +濒bin +滨bin +摈bin +傧bin +豳bin +缤bin +玢bin +槟bin +殡bin +膑bin +镔bin +髌bin +鬓bin +并bing +病bing +兵bing +柄bing +冰bing +丙bing +饼bing +秉bing +炳bing +屏*bing +禀bing +邴bing +摒bing +槟*bing +波bo +播bo +剥*bo +伯bo +拨bo +薄*bo +博bo +勃bo +驳bo +玻bo +泊bo +柏*bo +卜*bo +菠bo +钵bo +搏bo +铂bo +箔bo +帛bo +舶bo +脖bo +膊bo +渤bo +魄*bo +孛*bo +亳bo +啵bo +饽bo +檗bo +掰*bo +擘bo +礴bo +钹bo +鹁bo +簸bo +趵*bo +跛bo +踣bo +不bu +部bu +步bu +布bu +补bu +捕bu +埔*bu +卜bu +堡*bu +哺bu +埠bu +簿bu +怖bu +卟bu +逋bu +瓿bu +晡bu +钚bu +钸bu +醭bu +不安buan +不比bubi +不必bubi +不变bubian +不便bubian +步兵bubing +步步bubu +不曾buceng +补偿buchang +不啻buchi +补充buchong +不错bucuo +不大buda +不待budai +不但budan +不当budang +不得bude +不等budeng +步调budiao +不动budong +不断buduan +不对budui +部队budui +不法bufa +补发bufa +步伐bufa +不凡bufan +不妨bufang +不分bufen +部分bufen +不服bufu +不符bufu +不该bugai +不敢bugan +不甘bugan +布告bugao +不够bugou +不顾bugu +不管buguan +不过buguo +不会buhui +补给buji +部件bujian +不借bujie +不尽bujin +不仅bujin +不禁bujin +布景bujing +不久bujiu +补救bujiu +布局buju +不堪bukan +不可buke +不快bukuai +不愧bukui +不理buli +不利buli +不良buliang +不料buliao +步履bulu +不论bulun +部落buluo +不满buman +部门bumen +不免bumian +不能buneng +不怕bupa +补品bupin +不平buping +步枪buqiang +不屈buqu +不然buran +不如buru +不少bushao +不是bushi +不识bushi +部首bushou +部属bushu +部署bushu +补贴butie +不同butong +不妥butuo +部位buwei +部委buwei +不问buwen +不惜buxi +补习buxi +部下buxia +不行buxing +不幸buxing +步行buxing +不朽buxiu +不许buxu +哺养buyang +不要buyao +不宜buyi +不用buyong +哺育buyu +不在buzai +部长buzhang +不振buzhen +不只buzhi +不止buzhi +不知buzhi +不致buzhi +布置buzhi +步骤buzhou +补助buzhu +捕捉buzhuo +步子buzi +不足buzu +博物馆bwg +产c +成c +出c +长c +从c +此c +常c +处c +车c +场c +传c +采c +层c +厂c +才c +次c +虫c +除c +查c +差c +擦ca +拆*ca +嚓ca +礤ca +采cai +才cai +材cai +菜cai +财cai +裁cai +彩cai +猜cai +睬cai +踩cai +蔡cai +参can +残can +蚕can +灿can +餐can +惭can +惨can +孱can +骖can +璨can +粲can +黪can +惨案canan +惨白canbai +残暴canbao +惨怛canda +残废canfei +藏cang +仓cang +苍cang +舱cang +沧cang +苍白cangbai +仓促cangcu +仓库cangku +苍老canglao +苍茫cangmang +藏匿cangni +苍穹cangqiong +沧桑cangsang +苍天cangtian +参观canguan +残骸canhai +残疾canji +参加canjia +参见canjian +残局canju +惨剧canju +参军canjun +参看cankan +参考cankao +残酷canku +惭愧cankui +灿烂canlan +参谋canmou +残缺canque +残忍canren +孱弱canruo +残杀cansha +残生cansheng +蚕食canshi +参数canshu +惨痛cantong +参与canyu +残余canyu +残月canyue +参阅canyue +参赞canzan +惨遭canzao +参战canzhan +参照canzhao +参政canzheng +惨重canzhong +草cao +槽cao +操cao +糙cao +曹cao +嘈cao +漕cao +螬cao +艚cao +草案caoan +草稿caogao +槽糕caogao +操劳caolao +操练caolian +草率caolu +草木caomu +草拟caoni +草签caoqian +操心caoxin +草原caoyuan +嘈杂caoza +操纵caozong +操作caozuo +差不多cbd +成本核算cbhs +出版社cbs +层出不穷ccbq +从长计议ccjy +存储器ccq +长春市ccs +成都市cds +测ce +策ce +侧ce +册ce +厕ce +恻ce +测定ceding +策动cedong +策反cefan +策划cehua +测量celiang +策略celue +侧面cemian +参*cen +岑cen +涔cen +涔涔cencen +层ceng +曾*ceng +蹭ceng +层层cengceng +层次cengci +曾经cengjing +测试ceshi +厕所cesuo +测验ceyan +侧重cezhong +出发点cfd +充分发挥cffh +唱高调cgd +从古到今cgdj +查cha +差cha +插cha +察cha +茶cha +叉cha +茬cha +碴cha +搽cha +岔cha +诧cha +刹*cha +喳*cha +嚓*cha +猹cha +馇cha +汊cha +姹cha +杈cha +楂cha +槎cha +檫cha +锸cha +镲cha +衩cha +查办chaban +差别chabie +差错chacuo +差点chadian +查对chadui +差额chae +查访chafang +察访chafang +查封chafeng +查获chahuo +差*chai +柴chai +拆chai +豺chai +侪chai +钗chai +瘥chai +虿chai +拆穿chaichuan +豺狼chailang +拆散chaisan +差使chaishi +拆卸chaixie +柴油chaiyou +差价chajia +差距chaju +察觉chajue +查看chakan +察看chakan +查考chakao +查明chaming +产chan +单*chan +铲chan +阐chan +搀chan +掺chan +蝉chan +馋chan +谗chan +缠chan +颤chan +冁chan +谄chan +蒇chan +廛chan +忏chan +潺chan +澶chan +孱*chan +羼chan +婵chan +骣chan +觇chan +禅chan +镡chan +蟾chan +躔chan +铲除chanchu +产地chandi +阐发chanfa +搀扶chanfu +长chang +常chang +场chang +厂chang +唱chang +肠chang +昌chang +倡chang +偿chang +畅chang +猖chang +尝chang +敞chang +裳*chang +倘*chang +伥chang +鬯chang +苌chang +菖chang +徜chang +怅chang +惝chang +阊chang +娼chang +嫦chang +昶chang +氅chang +鲳chang +长安changan +常常changchang +长城changcheng +长春changchun +畅达changda +倡导changdao +长度changdu +长短changduan +唱歌changge +常规changgui +长河changhe +场合changhe +偿还changhuan +厂家changjia +常见changjian +长江changjiang +长久changjiu +猖獗changjue +长空changkong +畅快changkuai +猖狂changkuang +场面changmian +长眠changmian +长年changnian +长篇changpian +长期changqi +长驱changqu +常任changren +长沙changsha +厂商changshang +常识changshi +尝试changshi +长寿changshou +常数changshu +场所changsuo +畅谈changtan +长途changtu +怅惘changwang +常委changwei +倘未changwei +常温changwen +常务changwu +畅想changxiang +畅销changxiao +倡议changyi +畅饮changyin +常用changyong +常有changyou +畅游changyou +长远changyuan +厂长changzhang +长征changzheng +厂址changzhi +常驻changzhu +婵娟chanjuan +蝉联chanlian +产量chanliang +缠绵chanmian +阐明chanming +产品chanpin +产权chanquan +缠绕chanrao +产生chansheng +禅师chanshi +阐述chanshu +产物chanwu +产销chanxiao +产业chanye +产值chanzhi +朝chao +超chao +潮chao +巢chao +抄chao +钞chao +嘲chao +吵chao +炒chao +绰*chao +剿*chao +怊chao +晁chao +焯*chao +耖chao +抄报chaobao +超产chaochan +超出chaochu +朝代chaodai +超额chaoe +嘲讽chaofeng +超过chaoguo +朝晖chaohui +超级chaoji +吵架chaojia +潮解chaojie +潮流chaoliu +抄录chaolu +吵闹chaonao +嘲弄chaonong +潮湿chaoshi +潮水chaoshui +抄送chaosong +超脱chaotuo +抄袭chaoxi +朝鲜chaoxian +嘲笑chaoxiao +巢穴chaoxue +朝阳chaoyang +朝野chaoye +超越chaoyue +超支chaozhi +查清chaqing +插曲chaqu +插入charu +查哨chashao +插手chashou +查收chashou +插图chatu +查问chawen +查询chaxun +茶叶chaye +差异chayi +查阅chayue +查证chazheng +岔子chazi +插足chazu +车che +彻che +尺*che +撤che +扯che +掣che +澈che +坼che +砗che +彻底chedi +车祸chehuo +车间chejian +车辆cheliang +陈chen +沉chen +称chen +衬chen +尘chen +臣chen +晨chen +沈*chen +郴chen +辰chen +忱chen +趁chen +伧chen +谌chen +谶chen +抻chen +嗔chen +宸chen +琛chen +榇chen +碜chen +龀chen +尘埃chenai +沉淀chendian +陈腐chenfu +沉浮chenfu +成cheng +程cheng +称cheng +城cheng +承cheng +乘cheng +呈cheng +盛*cheng +撑cheng +诚cheng +橙cheng +惩cheng +澄cheng +逞cheng +骋cheng +秤cheng +丞cheng +埕cheng +噌cheng +枨cheng +柽cheng +塍cheng +瞠cheng +铖cheng +铛cheng +裎cheng +蛏cheng +酲cheng +成败chengbai +承办chengban +惩办chengban +呈报chengbao +承包chengbao +成本chengben +成材chengcai +惩处chengchu +乘除chengchu +承担chengdan +承当chengdang +成都chengdu +程度chengdu +乘法chengfa +惩罚chengfa +成功chenggong +成规chenggui +成果chengguo +称号chenghao +称呼chenghu +成绩chengji +乘机chengji +成家chengjia +成见chengjian +成交chengjiao +承接chengjie +惩戒chengjie +成就chengjiu +乘客chengke +诚恳chengken +成立chengli +乘凉chengliang +成名chengming +成年chengnian +成批chengpi +成品chengpin +诚朴chengpu +逞强chengqiang +澄清chengqing +城区chengqu +成全chengquan +诚然chengran +成人chengren +承认chengren +成色chengse +成事chengshi +诚实chengshi +城市chengshi +承受chengshou +成熟chengshu +成为chengwei +称谓chengwei +成文chengwen +呈现chengxian +呈献chengxian +城乡chengxiang +成效chengxiao +称心chengxin +诚心chengxin +程序chengxu +乘虚chengxu +撑腰chengyao +诚意chengyi +成语chengyu +成员chengyuan +称赞chengzan +成长chengzhang +城镇chengzhen +称职chengzhi +诚挚chengzhi +趁机chenji +沉积chenji +陈迹chenji +沉浸chenjin +沉静chenjing +陈旧chenjiu +陈列chenlie +沉沦chenlun +沉闷chenmen +沉湎chenmian +沉默chenmo +沉溺chenni +陈设chenshe +陈述chenshu +陈说chenshuo +沉思chensi +沉痛chentong +衬托chentuo +沉吟chenyin +衬映chenying +趁早chenzao +沉重chenzhong +沉着chenzhuo +车皮chepi +扯皮chepi +撤退chetui +撤消chexiao +车站chezhan +撤职chezhi +持chi +尺chi +齿chi +吃chi +赤chi +池chi +迟chi +翅chi +斥chi +耻chi +痴chi +匙chi +弛chi +驰chi +侈chi +炽chi +傺chi +坻chi +墀chi +茌chi +叱chi +哧chi +啻chi +嗤chi +彳chi +饬chi +媸chi +敕chi +眵chi +鸱chi +瘛chi +褫chi +蚩chi +螭chi +笞chi +篪chi +豉chi +踟chi +魑chi +翅膀chibang +赤诚chicheng +驰骋chicheng +尺寸chicun +迟到chidao +赤道chidao +尺度chidu +迟钝chidun +吃喝chihe +迟缓chihuan +吃紧chijin +吃惊chijing +持久chijiu +吃苦chiku +吃亏chikui +吃力chili +炽烈chilie +齿轮chilun +持平chiping +痴情chiqing +炽热chire +耻辱chiru +池塘chitang +耻笑chixiao +赤心chixin +痴心chixin +迟疑chiyi +迟早chizao +斥责chize +叱咤chizha +持重chizhong +吃重chizhong +赤字chizi +催化剂chj +种*chong +虫chong +重*chong +充chong +冲chong +崇chong +涌*chong +宠chong +茺chong +忡chong +憧chong +铳chong +舂chong +艟chong +宠爱chongai +崇拜chongbai +充斥chongchi +冲刺chongci +冲淡chongdan +充当chongdang +重叠chongdie +冲动chongdong +宠儿chonger +充分chongfen +冲锋chongfeng +重复chongfu +崇高chonggao +重合chonghe +重婚chonghun +冲击chongji +重建chongjian +崇敬chongjing +憧憬chongjing +充满chongman +充沛chongpei +冲破chongpo +重庆chongqing +崇尚chongshang +重申chongshen +充实chongshi +冲刷chongshua +冲天chongtian +冲突chongtu +重温chongwen +冲洗chongxi +重新chongxin +重演chongyan +重印chongyin +充裕chongyu +充足chongzu +抽chou +仇chou +臭chou +酬chou +畴chou +踌chou +稠chou +愁chou +筹chou +绸chou +瞅chou +丑chou +俦chou +帱chou +惆chou +瘳chou +雠chou +筹办chouban +筹备choubei +惆怅chouchang +抽搐chouchu +踌躇chouchu +筹措choucuo +抽调choudiao +丑恶choue +仇恨chouhen +丑化chouhua +筹划chouhua +筹集chouji +筹建choujian +酬金choujin +抽空choukong +酬劳choulao +丑陋choulou +筹码chouma +稠密choumi +筹谋choumou +愁容chourong +抽象chouxiang +酬谢chouxie +抽噎chouye +出chu +处chu +除chu +初chu +础chu +触chu +楚chu +锄chu +储chu +畜*chu +橱chu +厨chu +躇chu +雏chu +滁chu +矗chu +搐chu +亍chu +刍chu +怵chu +憷chu +绌chu +杵chu +楮chu +樗chu +褚chu +蜍chu +蹰chu +黜chu +揣chuai +搋chuai +啜chuai +嘬*chuai +膪chuai +踹chuai +揣度chuaidu +揣摩chuaimo +传chuan +船chuan +穿chuan +串chuan +川chuan +椽chuan +喘chuan +舛chuan +遄chuan +巛chuan +氚chuan +钏chuan +舡chuan +传遍chuanbian +传标chuanbiao +传播chuanbo +船舶chuanbo +船埠chuanbu +穿插chuancha +传达chuanda +传单chuandan +传导chuandao +传递chuandi +床chuang +创chuang +窗chuang +闯chuang +疮chuang +幢chuang +怆chuang +创办chuangban +闯荡chuangdang +窗户chuanghu +创见chuangjian +创建chuangjian +闯劲chuangjin +创举chuangju +窗口chuangkou +创立chuangli +窗帘chuanglian +创始chuangshi +创新chuangxin +创业chuangye +创造chuangzao +创作chuangzuo +串联chuanlian +喘气chuanqi +传奇chuanqi +传染chuanran +传授chuanshou +传输chuanshu +传述chuanshu +传说chuanshuo +传送chuansong +传统chuantong +串通chuantong +喘息chuanxi +传讯chuanxun +传扬chuanyang +传阅chuanyue +传真chuanzhen +船只chuanzhi +穿着chuanzhuo +出版chuban +出榜chubang +储备chubei +出兵chubing +初步chubu +储藏chucang +出差chucha +出产chuchan +出场chuchang +出厂chuchang +处处chuchu +橱窗chuchuang +初次chuci +储存chucun +初等chudeng +出动chudong +触动chudong +出发chufa +触发chufa +除法chufa +处罚chufa +触犯chufan +出访chufang +除非chufei +处分chufen +出轨chugui +出海chuhai +吹chui +垂chui +锤chui +椎*chui +炊chui +捶chui +陲chui +棰chui +槌chui +吹棒chuibang +吹风chuifeng +吹拂chuifu +锤炼chuilian +吹牛chuiniu +垂青chuiqing +垂涎chuixian +吹嘘chuixu +垂直chuizhi +初级chuji +出击chuji +出界chujie +出境chujing +处境chujing +处决chujue +触觉chujue +除开chukai +出口chukou +出来chulai +除了chule +出力chuli +处理chuli +矗立chuli +初恋chulian +出笼chulong +出路chulu +出马chuma +出卖chumai +出面chumian +出名chuming +除名chuming +出没chumo +春chun +纯chun +醇chun +椿chun +唇chun +淳chun +蠢chun +莼chun +鹑chun +蝽chun +出纳chuna +春播chunbo +纯粹chuncui +纯度chundu +春分chunfen +春风chunfeng +春耕chungeng +春光chunguang +醇厚chunhou +春辉chunhui +春季chunji +春节chunjie +纯洁chunjie +纯净chunjing +纯利chunli +纯朴chunpu +春秋chunqiu +春色chunse +春笋chunsun +春天chuntian +处女chunu +触怒chunu +春意chunyi +纯真chunzhen +纯正chunzheng +戳chuo +绰chuo +啜*chuo +辍chuo +踔chuo +龊chuo +戳穿chuochuan +绰号chuohao +啜泣chuoqi +出品chupin +出奇chuqi +初期chuqi +出勤chuqin +出去chuqu +出让churang +出任churen +出入churu +出色chuse +出身chushen +出神chushen +出生chusheng +畜生chusheng +出事chushi +出世chushi +处世chushi +厨师chushi +出售chushou +处所chusuo +出庭chuting +锄头chutou +出土chutu +出外chuwai +除外chuwai +出席chuxi +出息chuxi +除夕chuxi +出现chuxian +初小chuxiao +雏形chuxing +储蓄chuxu +刍议chuyi +处于chuyu +初战chuzhan +处长chuzhang +出诊chuzhen +出征chuzheng +处置chuzhi +初中chuzhong +出租chuzu +此ci +次ci +刺ci +磁ci +雌ci +词ci +茨ci +疵ci +辞ci +慈ci +瓷ci +赐ci +伺*ci +兹*ci +茈ci +呲ci +祠ci +鹚ci +糍ci +慈爱ciai +辞别cibie +磁场cichang +磁带cidai +磁道cidao +此地cidi +词典cidian +辞典cidian +刺耳cier +词根cigen +刺骨cigu +此后cihou +词汇cihui +刺激ciji +赐教cijiao +此刻cike +刺客cike +词类cilei +辞令ciling +磁盘cipan +次品cipin +辞去ciqu +刺杀cisha +此时cishi +次数cishu +辞书cishu +词素cisu +祠堂citang +辞退citui +此外ciwai +慈祥cixiang +辞行cixing +词性cixing +雌雄cixiong +次序cixu +词序cixu +刺眼ciyan +次要ciyao +词语ciyu +赐予ciyu +此致cizhi +辞职cizhi +词缀cizhui +词组cizu +超级大国cjdg +参考书cks +参考消息ckxx +参考资料ckzl +触类旁通clpt +藏龙卧虎clwh +参谋长cmc +聪明才智cmcz +出谋划策cmhc +从难从严cncy +从cong +丛cong +聪cong +葱cong +囱cong +匆cong +苁cong +淙cong +骢cong +琮cong +璁cong +从此congci +匆匆congcong +匆促congcu +从而conger +从犯congfan +聪慧conghui +从来conglai +丛林conglin +匆忙congmang +聪明congming +从前congqian +从容congrong +从事congshi +丛书congshu +从速congsu +从新congxin +从严congyan +聪颖congying +葱郁congyu +从中congzhong +凑cou +楱cou +辏cou +腠cou +凑合couhe +凑巧couqiao +成品率cpl +成千上万cqsw +从容不迫crbp +承认错误crcw +趁热打铁crdt +措手不及csbj +出生率csl +长沙市css +炊事员csy +彻头彻尾ctcw +垂头丧气ctsq +粗cu +促cu +醋cu +簇cu +卒*cu +蔟cu +徂cu +猝cu +殂cu +酢cu +蹙cu +蹴cu +篡cuan +蹿cuan +窜cuan +攒*cuan +汆cuan +撺cuan +爨cuan +镩cuan +篡夺cuanduo +窜犯cuanfan +篡改cuangai +篡权cuanquan +粗暴cubao +粗糙cucao +粗犷cuguang +催cui +脆cui +淬cui +粹cui +摧cui +衰*cui +崔cui +瘁cui +翠cui +萃cui +啐cui +悴cui +璀cui +榱cui +毳cui +隹cui +摧残cuican +脆弱cuiruo +促进cujin +存cun +村cun +寸cun +蹲*cun +忖cun +皴cun +存储cunchu +存档cundang +存放cunfang +存款cunkuan +村落cunluo +存亡cunwang +存在cunzai +村镇cunzhen +村庄cunzhuang +村子cunzi +错cuo +措cuo +撮cuo +磋cuo +搓cuo +挫cuo +厝cuo +嵯cuo +脞cuo +锉cuo +矬cuo +痤cuo +瘥*cuo +鹾cuo +蹉cuo +错案cuoan +挫败cuobai +错处cuochu +措辞cuoci +错怪cuoguai +错过cuoguo +撮合cuohe +错觉cuojue +磋商cuoshang +挫伤cuoshang +措施cuoshi +错误cuowu +挫折cuozhe +错综cuozong +粗浅cuqian +促使cushi +粗俗cusu +粗心cuxin +粗壮cuzhuang +常委会cwh +崇文区cwq +常务委员会cwwh +乘务员cwy +诚心诚意cxcy +程序控制cxkz +程序设计cxsj +长远利益cyly +朝阳区cyq +财政部czb +错综复杂czfz +操之过急czgj +出租汽车czqc +此之外czw +财政危机czwj +创造性czx +操作系统czxt +操作员czy +持之以恒czyh +的d +大d +地d +动d +到d +对d +度d +多d +电d +党d +得d +定d +等d +斗d +当d +队d +都d +点d +代d +道d +大da +打da +达da +答da +搭da +塔*da +瘩da +耷da +哒da +嗒da +怛da +妲da +沓*da +疸da +褡da +笪da +靼da +鞑da +答案daan +打败dabai +大办daban +大半daban +打扮daban +答辩dabian +大伯dabo +大部dabu +达成dacheng +大胆dadan +搭档dadang +大道dadao +达到dadao +打倒dadao +大地dadi +大敌dadi +大抵dadi +打断daduan +大队dadui +大多daduo +大凡dafan +大夫dafu +大幅dafu +答复dafu +大概dagai +大纲dagang +大国daguo +大海dahai +大好dahao +大河dahe +大亨daheng +大会dahui +大*dai +代dai +带dai +待dai +袋dai +戴dai +呆dai +歹dai +傣dai +殆dai +贷dai +逮dai +怠dai +埭dai +甙dai +呔dai +岱dai +迨dai +骀dai +绐dai +玳dai +黛dai +呆板daiban +代表daibiao +逮捕daibu +逮逋daibu +代词daici +带动daidong +怠工daigong +代价daijia +贷款daikuan +带来dailai +代理daili +带领dailing +带路dailu +黛绿dailu +代码daima +怠慢daiman +待命daiming +代数daishu +代替daiti +带头daitou +歹徒daitu +待遇daiyu +呆滞daizhi +呆子daizi +打击daji +大家dajia +打搅dajiao +大街dajie +大捷dajie +打劫dajie +搭救dajiu +大局daju +答卷dajuan +打开dakai +耷拉dala +大力dali +大连dalian +大量daliang +打量daliang +大陆dalu +大略dalue +大妈dama +单dan +但dan +弹dan +担dan +石*dan +蛋dan +淡dan +胆dan +氮dan +丹dan +旦dan +耽dan +郸dan +掸dan +惮dan +诞dan +儋dan +萏dan +啖dan +澹*dan +殚dan +赕dan +眈dan +疸dan +瘅dan +聃dan +箪dan +大脑danao +担保danbao +单薄danbao +淡薄danbao +单产danchan +诞辰danchen +单纯danchun +单词danci +担当dandang +单调dandiao +单独dandu +单方danfang +担负danfu +党dang +当dang +档dang +挡dang +荡dang +谠dang +凼dang +菪dang +宕dang +砀dang +裆dang +单干dangan +胆敢dangan +档案dangan +当场dangchang +当初dangchu +当代dangdai +当地dangdi +单个dange +耽搁dange +党风dangfeng +党纲danggang +党纪dangji +党籍dangji +当即dangji +当家dangjia +当今dangjin +当局dangju +当量dangliang +当面dangmian +党内dangnei +当年dangnian +党派dangpai +当铺dangpu +当前dangqian +当然dangran +当日dangri +当时dangshi +当天dangtian +当头dangtou +党团dangtuan +当晚dangwan +党委dangwei +当先dangxian +党校dangxiao +当心dangxin +党性dangxing +荡漾dangyang +党员dangyuan +当月dangyue +党章dangzhang +当真dangzhen +党政dangzheng +当政dangzheng +当中dangzhong +当众dangzhong +当做dangzuo +单价danjia +担架danjia +胆量danliang +胆略danlue +淡漠danmo +胆怯danqie +丹青danqing +担任danren +单身danshen +诞生dansheng +但是danshi +胆识danshi +单体danti +丹田dantian +单位danwei +耽误danwu +单项danxiang +胆小danxiao +担心danxin +淡雅danya +弹药danyao +单一danyi +单元danyuan +但愿danyuan +单质danzhi +担子danzi +掸子danzi +单字danzi +到dao +道dao +导dao +刀dao +倒dao +稻dao +岛dao +捣dao +盗dao +蹈dao +祷dao +悼dao +叨dao +帱*dao +忉dao +氘dao +焘*dao +纛dao +倒闭daobi +到处daochu +悼词daoci +到达daoda +导弹daodan +道德daode +到底daodi +倒戈daoge +捣鬼daogui +捣毁daohui +到来daolai +到了daole +道理daoli +倒立daoli +道路daolu +捣乱daoluan +倒霉daomei +叨念daonian +道歉daoqian +刀枪daoqiang +盗窃daoqie +到时daoshi +导师daoshi +倒数daoshu +导体daoti +倒退daotui +导演daoyan +道义daoyi +盗用daoyong +岛屿daoyu +导致daozhi +大批dapi +大破dapo +打破dapo +大气daqi +大庆daqing +打扰darao +打扫dasao +大厦dasha +搭讪dashan +大赦dashe +大使dashi +大事dashi +大师dashi +大势dashi +大肆dasi +打算dasuan +大体dati +大厅dating +打听dating +大同datong +大小daxiao +大写daxie +答谢daxie +大选daxuan +大学daxue +大业daye +达因dayin +打印dayin +答应daying +大于dayu +大院dayuan +大约dayue +打仗dazhang +大致dazhi +大众dazhong +打字dazi +代办处dbc +得不偿失dbcs +大部分dbf +电报挂号dbgh +大不了dbl +大步流星dblx +对不起dbq +代表团dbt +电冰箱dbx +东城区dcq +到此为止dcwz +独创性dcx +调查研究dcyj +打成一片dcyp +打电话ddh +电动机ddj +对得起ddq +大多数dds +的de +得de +地*de +德de +底*de +锝de +得逞decheng +的当dedang +得当dedang +得到dedao +得分defen +德国deguo +得奖dejiang +得救dejiu +得了dele +得力deli +等deng +灯deng +登deng +邓deng +澄*deng +蹬deng +瞪deng +凳deng +噔deng +嶝deng +戥deng +磴deng +镫deng +簦deng +登场dengchang +等待dengdai +等到dengdao +灯光dengguang +等候denghou +等级dengji +登记dengji +等价dengjia +灯具dengju +登门dengmen +灯谜dengmi +登攀dengpan +登山dengshan +灯塔dengta +登台dengtai +等同dengtong +等闲dengxian +等于dengyu +登载dengzai +得胜desheng +得失deshi +得体deti +德行dexing +得以deyi +得意deyi +德育deyu +得志dezhi +得知dezhi +得罪dezui +大幅度dfd +多方面dfm +单方面dfm +电风扇dfs +大规模dgm +多功能dgn +大公无私dgws +帝国主义dgzy +电话号码dhhm +电化教育dhjy +大会堂dht +的*di +地di +第di +低di +敌di +底di +提*di +帝di +抵di +滴di +弟di +递di +堤di +迪di +笛di +狄di +涤di +翟di +嫡di +蒂di +缔di +氐di +籴di +诋di +谛di +邸di +坻*di +荻di +嘀di +娣di +绨di +柢di +棣di +觌di +砥di +碲di +睇di +镝di +羝di +骶di +嗲dia +电dian +点dian +垫dian +典dian +店dian +颠dian +淀dian +掂dian +滇dian +碘dian +靛dian +佃dian +甸dian +惦dian +奠dian +殿dian +阽dian +坫dian +巅dian +玷dian +钿dian +癜dian +癫dian +簟dian +踮dian +电报dianbao +点播dianbo +电场dianchang +电车dianche +电池dianchi +电传dianchuan +颠倒diandao +电灯diandeng +点滴diandi +奠定dianding +电动diandong +典范dianfan +淀粉dianfen +垫付dianfu +颠覆dianfu +电感diangan +典故diangu +电荷dianhe +电弧dianhu +电话dianhua +电汇dianhui +电机dianji +电极dianji +奠基dianji +惦记dianji +典籍dianji +点将dianjiang +电解dianjie +殿军dianjun +癫狂diankuang +电缆dianlan +电力dianli +电离dianli +典礼dianli +电流dianliu +电路dianlu +电脑diannao +电能dianneng +店铺dianpu +电气dianqi +电器dianqi +点燃dianran +电容dianrong +电扇dianshan +电视dianshi +电台diantai +电梯dianti +点头diantou +电网dianwang +电位dianwei +玷污dianwu +殿下dianxia +电线dianxian +癫痫dianxian +电信dianxin +典型dianxing +电讯dianxun +电压dianya +电影dianying +店员dianyuan +点阵dianzhen +点缀dianzhui +电子dianzi +点子dianzi +电阻dianzu +调diao +掉diao +吊diao +鸟*diao +碉diao +叼diao +雕diao +凋diao +刁diao +钓diao +铞diao +铫diao +貂diao +鲷diao +碉堡diaobao +凋敝diaobi +调查diaocha +吊车diaoche +调动diaodong +调度diaodu +钓饵diaoer +调换diaohuan +掉换diaohuan +雕刻diaoke +调令diaoling +刁难diaonan +调遣diaoqian +调任diaoren +雕塑diaosu +吊唁diaoyan +调用diaoyong +钓鱼diaoyu +调子diaozi +第八diba +地板diban +地步dibu +低沉dichen +抵触dichu +抵达dida +地带didai +低档didang +抵挡didang +地道didao +弟弟didi +地点didian +地段diduan +敌对didui +迭die +跌die +爹die +碟die +蝶die +谍die +叠die +垤die +堞die +揲die +喋die +牒die +瓞die +耋die +踮*die +蹀die +鲽die +迭起dieqi +第二dier +地方difang +低估digu +敌国diguo +帝国diguo +敌后dihou +诋毁dihui +低级diji +递加dijia +递减dijian +地窖dijiao +递交dijiao +缔交dijiao +缔结dijie +第九dijiu +敌军dijun +抵抗dikang +地牢dilao +地理dili +低劣dilie +第六diliu +低落diluo +地貌dimao +地面dimian +抵命diming +定ding +顶ding +钉ding +丁ding +订ding +盯ding +叮ding +鼎ding +锭ding +仃ding +啶ding +玎ding +腚ding +碇ding +町ding +铤*ding +疔ding +耵ding +酊ding +定案dingan +定产dingchan +丁当dingdang +顶点dingdian +定夺dingduo +定额dinge +顶峰dingfeng +顶锋dingfeng +定购dinggou +订购dinggou +订户dinghu +定货dinghuo +订货dinghuo +定价dingjia +定局dingju +定居dingju +定理dingli +订立dingli +鼎立dingli +定量dingliang +定律dinglu +定期dingqi +定然dingran +盯梢dingshao +定时dingshi +顶替dingti +定性dingxing +定型dingxing +定义dingyi +定语dingyu +定员dingyuan +订阅dingyue +订正dingzheng +叮嘱dingzhu +顶撞dingzhuang +钉子dingzi +嫡派dipai +地盘dipan +第七diqi +嫡亲diqin +敌情diqing +地球diqiu +地区diqu +的确dique +敌人diren +第三disan +地势dishi +第十dishi +滴水dishui +第四disi +地铁ditie +地图ditu +丢diu +铥diu +丢掉diudiao +丢脸diulian +丢失diushi +地位diwei +敌伪diwei +第五diwu +嫡系dixi +底细dixi +地下dixia +低下dixia +底下dixia +地形dixing +弟兄dixiong +第一diyi +敌意diyi +地域diyu +抵御diyu +缔造dizao +递增dizeng +地震dizhen +敌阵dizhen +地质dizhi +地址dizhi +抵制dizhi +底子dizi +弟子dizi +党纪国法djgf +当机立断djld +多劳多得dldd +大力发展dlfz +大力加强dljq +大力开展dlkz +独立自主dlzz +多面手dms +对内搞活dngh +多年来dnl +东南亚dny +动dong +东dong +冬dong +懂dong +洞dong +冻dong +董dong +栋dong +侗dong +恫dong +垌dong +咚dong +岽dong +峒dong +氡dong +胨dong +胴dong +硐dong +鸫dong +东北dongbei +东边dongbian +东部dongbu +洞察dongcha +动词dongci +动荡dongdang +懂得dongde +东方dongfang +东风dongfeng +动工donggong +东海donghai +恫吓donghe +动机dongji +冬季dongji +东家dongjia +冻结dongjie +动静dongjing +东京dongjing +动力dongli +动量dongliang +栋梁dongliang +动乱dongluan +动脉dongmai +东南dongnan +东欧dongou +动人dongren +动身dongshen +董事dongshi +动手dongshou +动态dongtai +冬天dongtian +动听dongting +动物dongwu +东西dongxi +洞悉dongxi +动向dongxiang +动心dongxin +东亚dongya +东洋dongyang +动摇dongyao +动用dongyong +动员dongyuan +动辄dongzhe +动作dongzuo +斗dou +都*dou +豆dou +读*dou +兜dou +抖dou +陡dou +逗dou +痘dou +蔸dou +窦dou +蚪dou +篼dou +兜风doufeng +逗号douhao +逗留douliu +斗室doushi +兜售doushou +斗争douzheng +斗志douzhi +斗智douzhi +抖嘴douzui +打破常规dpcg +地平线dpx +电器化dqh +待人接物drjw +第三产业dscy +第十二届dsej +大使馆dsg +到时候dsh +电视机dsj +多少年dsn +大失所望dssw +电视台dst +低三下四dsxs +第十一届dsyj +大踏步dtb +到头来dtl +大体上dts +大同小异dtxy +度du +都du +毒du +独du +读du +渡du +杜du +堵du +镀du +顿du +督du +犊du +睹du +赌du +肚du +妒du +芏du +嘟du +渎du +椟du +牍du +蠹du +笃du +髑du +黩du +断duan +端duan +段duan +短duan +锻duan +缎duan +椴duan +煅duan +簖duan +短波duanbo +短处duanchu +短促duancu +断定duanding +短短duanduan +断交duanjiao +断绝duanjue +锻练duanlian +锻炼duanlian +短路duanlu +段落duanluo +短评duanping +短期duanqi +短缺duanque +断然duanran +煅烧duanshao +断送duansong +短途duantu +端午duanwu +端详duanxiang +短小duanxiao +断言duanyan +端阳duanyang +短语duanyu +短暂duanzan +端正duanzheng +端庄duanzhuang +读报dubao +读本duben +赌博dubo +独裁ducai +毒草ducao +独唱duchang +独创duchuang +督促ducu +毒打duda +独到dudao +度过duguo +毒害duhai +毒化duhua +都会duhui +对dui +队dui +堆dui +敦*dui +兑dui +怼dui +憝dui +碓dui +对比duibi +队部duibu +对策duice +对称duichen +对此duici +对待duidai +对等duideng +对调duidiao +对方duifang +对付duifu +对话duihua +兑换duihuan +对讲duijiang +对抗duikang +对口duikou +对垒duilei +对立duili +对联duilian +队列duilie +对流duiliu +对面duimian +对内duinei +对偶duiou +对手duishou +对数duishu +对外duiwai +队伍duiwu +兑现duixian +对象duixiang +对应duiying +对于duiyu +队员duiyuan +堆栈duizhan +队长duizhang +对照duizhao +对证duizheng +对质duizhi +对峙duizhi +对准duizhun +镀金dujin +杜绝dujue +渡口dukou +都来dulai +独立duli +度量duliang +盾dun +吨dun +顿dun +蹲dun +敦dun +墩dun +囤dun +钝dun +遁dun +沌dun +炖dun +砘dun +礅dun +盹dun +镦dun +趸dun +蹲点dundian +顿号dunhao +囤积dunji +遁迹dunji +钝角dunjiao +顿时dunshi +敦实dunshi +多duo +度*duo +夺duo +朵duo +掇duo +哆duo +垛duo +躲duo +跺duo +舵duo +剁duo +惰duo +堕duo +驮*duo +咄duo +哚duo +沲duo +缍duo +柁duo +铎duo +裰duo +踱duo +多半duoban +躲避duobi +多变duobian +多边duobian +躲藏duocang +多次duoci +夺得duode +多端duoduan +多方duofang +躲开duokai +多亏duokui +夺魁duokui +堕落duoluo +多么duome +夺目duomu +多年duonian +多情duoqing +夺取duoqu +多少duoshao +多事duoshi +掇拾duoshi +舵手duoshou +多数duoshu +多谢duoxie +多心duoxin +惰性duoxing +多样duoyang +多余duoyu +多种duozhong +肚皮dupi +毒品dupin +毒气duqi +读取duqu +度日duri +读入duru +堵塞duse +毒蛇dushe +都是dushi +毒手dushou +读数dushu +读书dushu +毒素dusu +独特dute +读物duwu +毒药duyao +独占duzhan +读者duzhe +毒汁duzhi +渎职duzhi +赌注duzhu +杜撰duzhuan +独自duzi +党委会dwh +对外开放dwkf +敌我矛盾dwmd +对外贸易dwmy +大无畏dww +动物园dwy +当务之急dwzj +邓小平dxp +大学生dxs +大显身手dxss +大西洋dxy +大跃进dyj +打印机dyj +大有可为dykw +待业青年dyqn +掉以轻心dyqx +电影院dyy +大洋洲dyz +大有作为dyzw +党支部dzb +多种多样dzdy +党政机关dzjg +多种经营dzjy +断章取义dzqy +大自然dzr +德智体dzt +电子学dzx +党中央dzy +而e +二e +尔e +儿e +恶e +额e +恩e +俄e +耳e +饵e +蛾e +饿e +峨e +鹅e +讹e +娥e +厄e +扼e +遏e +鄂e +噩e +谔e +垩e +苊e +莪e +萼e +呃e +愕e +屙e +婀e +轭e +腭e +锇e +锷e +鹗e +颚e +鳄e +恶霸eba +恶毒edu +恶感egan +恶棍egun +噩耗ehao +恶化ehua +诶ei +二极管ejg +二进制ejz +恶劣elie +鹅毛emao +噩梦emeng +恶魔emo +耳目一新emyx +恩en +蒽en +摁en +恩爱enai +恩赐enci +恩典endian +恩惠enhui +恩情enqing +而er +二er +尔er +儿er +耳er +饵er +洱er +贰er +佴er +迩er +珥er +铒er +鸸er +鲕er +耳朵erduo +儿歌erge +耳光erguang +而后erhou +尔后erhou +二届erjie +而今erjin +而况erkuang +而且erqie +而是ershi +儿童ertong +儿戏erxi +而已eryi +耳语eryu +二月eryue +儿子erzi +扼杀esha +额外ewai +扼腕ewan +额外负担ewfd +恶习exi +恶心exin +恶性exing +恶性循环exxh +扼要eyao +厄运eyun +讹诈ezha +遏止ezhi +分f +发f +方f +法f +反f +放f +复f +风f +防f +非f +服f +肥f +副f +粉f +府f +夫f +负f +封f +富f +翻f +发fa +法fa +阀fa +乏fa +伐fa +罚fa +筏fa +珐fa +垡fa +砝fa +发报fabao +法宝fabao +发表fabiao +发布fabu +发财facai +发愁fachou +发出fachu +发达fada +发电fadian +法典fadian +法定fading +发动fadong +发放fafang +发奋fafen +发愤fafen +法官faguan +法规fagui +法国faguo +发慌fahuang +发挥fahui +发火fahuo +发给faji +发迹faji +法纪faji +发家fajia +发奖fajiang +发酵fajiao +罚金fajin +发觉fajue +发掘fajue +罚款fakuan +发狂fakuang +法郎falang +法令faling +法律falu +发落faluo +发明faming +反fan +翻fan +范fan +犯fan +饭fan +繁fan +泛fan +番fan +凡fan +烦fan +返fan +藩fan +帆fan +樊fan +矾fan +钒fan +贩fan +蕃fan +蘩fan +幡fan +梵fan +燔fan +畈fan +蹯fan +翻版fanban +反比fanbi +反驳fanbo +帆布fanbu +反常fanchang +范畴fanchou +犯愁fanchou +帆船fanchuan +饭店fandian +反动fandong +翻动fandong +反对fandui +繁多fanduo +反而faner +反复fanfu +方fang +放fang +防fang +访fang +房fang +纺fang +仿fang +妨fang +芳fang +肪fang +坊fang +邡fang +彷*fang +枋fang +钫fang +舫fang +鲂fang +妨碍fangai +方案fangan +反感fangan +防备fangbei +方便fangbian +防潮fangchao +方程fangcheng +放大fangda +放荡fangdang +防盗fangdao +方法fangfa +防范fangfan +防风fangfeng +防腐fangfu +仿佛fangfu +妨害fanghai +防护fanghu +防火fanghuo +放假fangjia +房间fangjian +方面fangmian +放牧fangmu +返工fangong +反攻fangong +放屁fangpi +放弃fangqi +防区fangqu +放任fangren +放哨fangshao +放射fangshe +方式fangshi +防守fangshou +放肆fangsi +放松fangsong +仿宋fangsong +翻滚fangun +方位fangwei +防卫fangwei +访问fangwen +房屋fangwu +放下fangxia +防线fangxian +方向fangxiang +芳香fangxiang +仿效fangxiao +放心fangxin +放行fangxing +方言fangyan +防疫fangyi +防御fangyu +仿造fangzao +仿照fangzhao +方针fangzhen +仿真fangzhen +防治fangzhi +仿制fangzhi +放置fangzhi +防止fangzhi +纺织fangzhi +房子fangzi +放纵fangzong +房租fangzu +番号fanhao +繁华fanhua +反悔fanhui +返回fanhui +反击fanji +反抗fankang +反馈fankui +泛滥fanlan +范例fanli +凡例fanli +翻脸fanlian +贩卖fanmai +繁忙fanmang +烦闷fanmen +反面fanmian +反目fanmu +烦恼fannao +反叛fanpan +犯人fanren +繁荣fanrong +反射fanshe +翻身fanshen +繁盛fansheng +凡是fanshi +凡事fanshi +繁琐fansuo +烦琐fansuo +翻腾fanteng +繁体fanti +饭桶fantong +发怒fanu +饭碗fanwan +范围fanwei +反问fanwen +反响fanxiang +返销fanxiao +反省fanxing +翻修fanxiu +繁衍fanyan +翻译fanyi +翻印fanyin +反应fanying +反映fanying +繁育fanyu +翻越fanyue +翻阅fanyue +贩运fanyun +繁杂fanza +烦燥fanzao +反正fanzheng +反之fanzhi +繁殖fanzhi +繁重fanzhong +贩子fanzi +犯罪fanzui +发起faqi +法权faquan +发射fashe +发生fasheng +发誓fashi +发售fashou +法庭fating +发现faxian +发泄faxie +发行faxing +发言fayan +发扬fayang +法医fayi +发育fayu +发源fayuan +法院fayuan +法则faze +发展fazhan +法制fazhi +法治fazhi +发作fazuo +奋不顾身fbgs +分崩离析fblx +副产品fcp +发电机fdj +发动机fdj +反动派fdp +分道扬镳fdyb +非fei +肥fei +飞fei +费fei +废fei +肺fei +沸fei +菲fei +匪fei +啡fei +诽fei +吠fei +芾fei +狒fei +悱fei +淝fei +妃fei +绯fei +榧fei +腓fei +斐fei +扉fei +镄fei +痱fei +蜚fei +篚fei +翡fei +霏fei +鲱fei +匪帮feibang +诽谤feibang +飞奔feiben +非常feichang +飞驰feichi +废除feichu +非但feidan +非得feide +沸点feidian +非法feifa +非凡feifan +肺腑feifu +绯红feihong +废话feihua +飞机feiji +飞溅feijian +费解feijie +费劲feijin +飞快feikuai +费力feili +肥料feiliao +废料feiliao +肥胖feipang +废品feipin +废弃feiqi +费神feishen +废水feishui +飞速feisu +沸腾feiteng +匪徒feitu +肥沃feiwo +废物feiwu +飞舞feiwu +飞翔feixiang +费心feixin +飞行feixing +废墟feixu +飞扬feiyang +扉页feiye +非议feiyi +费用feiyong +飞跃feiyue +肥皂feizao +飞涨feizhang +废止feizhi +非洲feizhou +妃子feizi +分fen +粉fen +奋fen +份fen +粪fen +纷fen +芬fen +愤fen +酚fen +吩fen +氛fen +坟fen +焚fen +汾fen +忿fen +偾fen +瀵fen +玢*fen +棼fen +鲼fen +鼢fen +分贝fenbei +分辩fenbian +分辨fenbian +粪便fenbian +分别fenbie +分部fenbu +分布fenbu +分册fence +分寸fencun +分担fendan +分得fende +分店fendian +奋斗fendou +分队fendui +分发fenfa +奋发fenfa +纷纷fenfen +吩咐fenfu +风feng +封feng +蜂feng +丰feng +缝feng +峰feng +锋feng +疯feng +奉feng +枫feng +烽feng +逢feng +冯feng +讽feng +凤feng +俸feng +酆feng +葑feng +唪feng +沣feng +砜feng +风暴fengbao +丰碑fengbei +封闭fengbi +风波fengbo +丰产fengchan +奉承fengcheng +讽刺fengci +封存fengcun +风度fengdu +分割fenge +分隔fenge +风发fengfa +风帆fengfan +丰富fengfu +奉告fenggao +风格fengge +奉公fenggong +风光fengguang +风寒fenghan +奉还fenghuan +凤凰fenghuang +烽火fenghuo +封建fengjian +风景fengjing +疯狂fengkuang +风浪fenglang +风力fengli +风流fengliu +丰满fengman +锋芒fengmang +风貌fengmao +奉命fengming +丰年fengnian +分工fengong +奉陪fengpei +风气fengqi +风情fengqing +风趣fengqu +奉劝fengquan +缝纫fengren +风骚fengsao +风沙fengsha +风尚fengshang +风声fengsheng +丰盛fengsheng +丰收fengshou +风霜fengshuang +风水fengshui +丰硕fengshuo +奉祀fengsi +风俗fengsu +封锁fengsuo +疯瘫fengtan +封条fengtiao +风头fengtou +分管fenguan +风味fengwei +缝隙fengxi +风险fengxian +奉献fengxian +风向fengxiang +风行fengxing +奉行fengxing +蜂拥fengyong +风云fengyun +风韵fengyun +风灾fengzai +疯子fengzi +风姿fengzi +分号fenhao +分毫fenhao +分红fenhong +粉红fenhong +分化fenhua +分会fenhui +焚毁fenhui +分级fenji +分解fenjie +分界fenjie +奋进fenjin +分居fenju +分开fenkai +愤慨fenkai +分类fenlei +分离fenli +奋力fenli +分量fenliang +分裂fenlie +纷乱fenluan +分娩fenmian +分秒fenmiao +分明fenming +粉末fenmo +坟墓fenmu +愤怒fennu +分派fenpai +分配fenpei +分批fenpi +分期fenqi +分歧fenqi +奋起fenqi +分清fenqing +分区fenqu +分散fensan +焚烧fenshao +分数fenshu +分说fenshuo +粉碎fensui +分摊fentan +粪土fentu +分外fenwai +氛围fenwei +分析fenxi +奋勇fenyong +分赃fenzang +奋战fenzhan +分支fenzhi +分子fenzi +分组fenzu +丰富多采ffdc +奋发图强fftq +反过来说fgls +反革命fgm +福建省fjs +封建主义fjzy +翻来覆去flfq +法律顾问flgw +分秒必争fmbz +发明创造fmcz +否fou +缶fou +否定fouding +否决foujue +否认fouren +否则fouze +费品率fpl +废寝忘食fqws +缝纫机frj +分水岭fsl +翻天复地ftfd +丰台区ftq +非同小可ftxk +繁体字ftz +复fu +服fu +副fu +府fu +夫fu +负fu +富fu +附fu +福fu +伏fu +符fu +幅fu +腐fu +浮fu +辅fu +付fu +腹fu +妇fu +孵fu +覆fu +扶fu +辐fu +傅fu +佛fu +缚fu +父fu +弗fu +甫fu +肤fu +氟fu +敷fu +拂fu +俘fu +涪fu +袱fu +抚fu +俯fu +釜fu +斧fu +脯fu +腑fu +赴fu +赋fu +阜fu +讣fu +咐fu +匐fu +凫fu +郛fu +芙fu +芾*fu +苻fu +茯fu +莩fu +菔fu +拊fu +呋fu +幞fu +怫fu +滏fu +艴fu +孚fu +驸fu +绂fu +绋fu +桴fu +赙fu +祓fu +砩fu +黻fu +黼fu +罘fu +稃fu +馥fu +蚨fu +蜉fu +蝠fu +蝮fu +麸fu +趺fu +跗fu +鲋fu +鳆fu +腐败fubai +复辟fubi +复查fucha +浮沉fuchen +扶持fuchi +付出fuchu +副词fuci +服从fucong +附带fudai +负担fudan +辅导fudao +浮雕fudiao +浮动fudong +幅度fudu +复发fufa +伏法fufa +夫妇fufu +覆盖fugai +讣告fugao +富贵fugui +符号fuhao +附和fuhe +符合fuhe +负荷fuhe +腐化fuhua +浮华fuhua +复活fuhuo +俘获fuhuo +伏击fuji +附加fujia +附件fujian +福建fujian +佛教fujiao +附近fujin +副刊fukan +俯瞰fukan +浮夸fukua +付款fukuan +腐烂fulan +福利fuli +浮力fuli +富丽fuli +妇联fulian +附录fulu +俘虏fulu +覆灭fumie +覆没fumo +父母fumu +富农funong +妇女funu +扶贫fupin +服气fuqi +福气fuqi +夫妻fuqi +付讫fuqi +肤浅fuqian +富强fuqiang +父亲fuqin +富饶furao +夫人furen +芙蓉furong +妇孺furu +负伤fushang +辐射fushe +复试fushi +腐蚀fushi +俯视fushi +副手fushou +复数fushu +负数fushu +附属fushu +富庶fushu +赋税fushui +伏特fute +覆亡fuwang +富翁fuweng +服务fuwu +复习fuxi +浮现fuxian +赋闲fuxian +浮想fuxiang +腐朽fuxiu +抚恤fuxu +敷衍fuyan +扶养fuyang +抚养fuyang +俯仰fuyang +副业fuye +服役fuyi +复印fuyin +富有fuyou +赋有fuyou +赋于fuyu +抚育fuyu +富裕fuyu +赋予fuyu +复员fuyuan +复原fuyuan +负约fuyue +复杂fuza +负载fuzai +附则fuze +负责fuze +负债fuzhai +付帐fuzhang +复制fuzhi +扶植fuzhi +附中fuzhong +福州fuzhou +抚州fuzhou +附注fuzhu +辅助fuzhu +扶助fuzhu +服装fuzhuang +附着fuzhuo +富足fuzu +辅佐fuzuo +服务部fwb +服务态度fwtd +服务员fwy +方兴未艾fxwa +奋勇当先fydx +翻一番fyf +风言风语fyfy +发扬光大fygd +复印机fyj +发言人fyr +风雨同舟fytz +房租费fzf +副总理fzl +纺织品fzp +福州市fzs +反作用fzy +副作用fzy +负责制fzz +发展中国家fzzj +个g +国g +工g +过g +高g +干g +关g +各g +革g +公g +根g +更g +改g +管g +光g +广g +果g +格g +共g +搞g +夹*ga +噶ga +嘎ga +胳*ga +尬ga +尕ga +尜ga +旮ga +钆ga +公安部gab +改gai +该gai +盖gai +概gai +钙gai +溉gai +芥*gai +丐gai +陔gai +垓gai +戤gai +赅gai +改变gaibian +改编gaibian +该当gaidang +改道gaidao +改动gaidong +改革gaige +改观gaiguan +改过gaiguo +改悔gaihui +改建gaijian +改进gaijin +概况gaikuang +概括gaikuo +改良gailiang +概率gailu +概论gailun +概貌gaimao +概念gainian +改期gaiqi +改善gaishan +概述gaishu +概叹gaitan +改天gaitian +改选gaixuan +概要gaiyao +改造gaizao +改正gaizheng +改装gaizhuang +改组gaizu +公安局gaj +干gan +杆gan +感gan +敢gan +赶gan +甘gan +肝gan +秆gan +柑gan +竿gan +赣gan +乾*gan +坩gan +苷gan +尴gan +擀gan +泔gan +淦gan +澉gan +绀gan +橄gan +旰gan +矸gan +疳gan +酐gan +干部ganbu +感触ganchu +干脆gancui +敢当gandang +甘当gandang +感到gandao +感动gandong +感恩ganen +刚gang +钢gang +缸gang +纲gang +岗gang +港gang +杠gang +冈gang +肛gang +扛*gang +戆gang +罡gang +筻gang +尴尬ganga +港澳gangao +刚才gangcai +钢材gangcai +刚刚ganggang +刚好ganghao +港口gangkou +纲领gangling +岗哨gangshao +钢铁gangtie +港湾gangwan +岗位gangwei +港务gangwu +刚要gangyao +纲要gangyao +刚毅gangyi +干旱ganhan +感化ganhua +干活ganhuo +肝火ganhuo +感激ganji +干劲ganjin +赶紧ganjin +干净ganjing +感觉ganjue +感慨gankai +甘苦ganku +赶快gankuai +赶忙ganmang +感冒ganmao +感情ganqing +感染ganran +干扰ganrao +干涉ganshe +干事ganshi +感受ganshou +甘肃gansu +感叹gantan +干线ganxian +感想ganxiang +敢想ganxiang +感谢ganxie +甘心ganxin +感性ganxing +感应ganying +敢于ganyu +干预ganyu +甘愿ganyuan +干燥ganzao +感召ganzhao +赣州ganzhou +敢做ganzuo +高gao +搞gao +告gao +稿gao +膏gao +篙gao +皋gao +羔gao +糕gao +镐gao +睾gao +诰gao +郜gao +藁gao +缟gao +槔gao +槁gao +杲gao +锆gao +高矮gaoai +高昂gaoang +告别gaobie +高产gaochan +高超gaochao +高潮gaochao +告成gaocheng +告辞gaoci +高大gaoda +高档gaodang +高等gaodeng +高地gaodi +高低gaodi +糕点gaodian +高度gaodu +告发gaofa +高峰gaofeng +高高gaogao +高歌gaoge +高贵gaogui +高喊gaohan +搞好gaohao +高呼gaohu +搞坏gaohuai +高级gaoji +告急gaoji +高价gaojia +高见gaojian +稿件gaojian +告捷gaojie +告诫gaojie +高龄gaoling +高楼gaolou +告密gaomi +高明gaoming +高能gaoneng +高攀gaopan +高频gaopin +高强gaoqiang +高山gaoshan +高尚gaoshang +高深gaoshen +告示gaoshi +高耸gaosong +高速gaosu +告诉gaosu +高温gaowen +高小gaoxiao +高校gaoxiao +高兴gaoxing +膏药gaoyao +高原gaoyuan +高涨gaozhang +高招gaozhao +高中gaozhong +告终gaozhong +告状gaozhuang +稿子gaozi +港澳同胞gatb +怪不得gbd +各部门gbm +各部委gbw +供不应求gbyq +故步自封gbzf +共产党gcd +共产党员gcdy +工程师gcs +顾此失彼gcsb +贯彻执行gczx +共产主义gczy +各地方gdf +各大军区gdjq +广东省gds +高档商品gdsp +各单位gdw +高等院校gdyx +固定资产gdzc +个ge +各ge +革ge +合*ge +格ge +割ge +歌ge +隔ge +盖*ge +哥ge +铬ge +阁ge +戈ge +葛ge +搁ge +鸽ge +胳ge +疙ge +蛤ge +咯*ge +屹*ge +鬲ge +仡ge +哿ge +圪ge +塥ge +嗝ge +纥*ge +搿ge +膈ge +硌ge +镉ge +袼ge +颌*ge +虼ge +舸ge +骼ge +隔壁gebi +戈壁gebi +个别gebie +歌唱gechang +各处gechu +革除gechu +疙瘩geda +各地gedi +格调gediao +隔断geduan +个个gege +各个gege +各国geguo +隔阂gehe +歌喉gehou +各级geji +各界gejie +格局geju +割据geju +隔绝gejue +各类gelei +隔离geli +割裂gelie +格律gelu +革命geming +隔膜gemo +给gei +根gen +跟gen +亘gen +茛gen +哏gen +艮gen +根本genben +根除genchu +根底gendi +更geng +耕geng +颈geng +庚geng +羹geng +埂geng +耿geng +梗geng +哽geng +赓geng +绠geng +鲠geng +耕地gengdi +更迭gengdie +更动gengdong +更多gengduo +更改genggai +梗概genggai +更高genggao +更换genghuan +更加gengjia +更为gengwei +颈项gengxiang +更新gengxin +哽咽gengyan +耕耘gengyun +更正gengzheng +耿直gengzhi +梗直gengzhi +耕种gengzhong +梗阻gengzu +耕作gengzuo +根基genji +根据genju +跟前genqian +跟随gensui +根源genyuan +根治genzhi +跟着genzhuo +根子genzi +跟踪genzong +搁浅geqian +歌曲gequ +个人geren +格式geshi +歌颂gesong +个体geti +格外gewai +各位gewei +歌舞gewu +阁下gexia +各项gexiang +革新gexin +个性gexing +格言geyan +各样geyang +歌咏geyong +搁置gezhi +各种gezhong +各族gezu +国防部gfb +各方面gfm +格格不入ggbr +归根到底ggdd +恭恭敬敬ggjj +滚瓜烂熟ggls +歌功颂德ggsd +共和国ghg +各行各业ghgy +干劲冲天gjct +各级党委gjdw +各级领导gjld +国家利益gjly +国计民生gjms +工具书gjs +各尽所能gjsn +国库券gkq +工矿企业gkqy +孤陋寡闻glgw +规律性glx +国民党gmd +革命化gmh +革命家gmj +国民经济gmjj +购买力gml +光明磊落gmll +光明日报gmrb +顾名思义gmsy +冠冕堂皇gmth +刮目相看gmxk +光明正大gmzd +工农兵gnb +国内外gnw +工农业gny +工gong +公gong +共gong +供gong +功gong +攻gong +红*gong +巩gong +贡gong +汞gong +宫gong +恭gong +龚gong +躬gong +弓gong +拱gong +珙gong +肱gong +蚣gong +觥gong +公安gongan +公报gongbao +工本gongben +公布gongbu +公差gongcha +公拆gongchai +工厂gongchang +功臣gongchen +工程gongcheng +共处gongchu +供词gongci +共存gongcun +公道gongdao +公德gongde +功德gongde +工地gongdi +公敌gongdi +宫殿gongdian +攻读gongdu +公费gongfei +公愤gongfen +工夫gongfu +功夫gongfu +公告gonggao +公共gonggong +巩固gonggu +公关gongguan +公害gonghai +公函gonghan +共和gonghe +工会gonghui +供给gongji +共计gongji +攻击gongji +功绩gongji +公家gongjia +公斤gongjin +恭敬gongjing +工具gongju +公开gongkai +功课gongke +公款gongkuan +功劳gonglao +公理gongli +公里gongli +公历gongli +公路gonglu +功率gonglu +公民gongmin +共鸣gongming +公墓gongmu +功能gongneng +工农gongnong +公判gongpan +公平gongping +公仆gongpu +供求gongqiu +工区gongqu +公然gongran +工人gongren +公认gongren +供认gongren +工伤gongshang +公社gongshe +公审gongshen +工时gongshi +公事gongshi +共事gongshi +公式gongshi +公署gongshu +公司gongsi +公私gongsi +公诉gongsu +宫廷gongting +共同gongtong +恭维gongwei +公文gongwen +公物gongwu +公务gongwu +恭喜gongxi +贡献gongxian +工效gongxiao +功效gongxiao +供销gongxiao +共性gongxing +工序gongxu +共需gongxu +功勋gongxun +供养gongyang +工业gongye +工艺gongyi +供应gongying +公用gongyong +共有gongyou +公元gongyuan +公园gongyuan +公约gongyue +公允gongyun +公债gongzhai +公章gongzhang +共振gongzhen +工整gongzheng +公正gongzheng +公证gongzheng +供职gongzhi +公众gongzhong +工资gongzi +工作gongzuo +够gou +构gou +沟gou +句*gou +狗gou +钩gou +勾gou +购gou +苟gou +垢gou +佝gou +诟gou +岣gou +遘gou +媾gou +缑gou +枸gou +觏gou +彀gou +笱gou +篝gou +鞲gou +构成goucheng +勾搭gouda +勾当goudang +媾和gouhe +沟壑gouhe +构件goujian +勾结goujie +购买goumai +苟且gouqie +构思gousi +沟通goutong +勾通goutong +构陷gouxian +勾销gouxiao +购销gouxiao +勾引gouyin +构造gouzao +购置gouzhi +钩子gouzi +国庆节gqj +共青团gqt +光荣榜grb +根深蒂固gsdg +瓜熟蒂落gsdl +公使馆gsg +各式各样gsgy +甘肃省gss +工商业gsy +个体户gth +改头换面gthm +高谈阔论gtkl +鼓gu +固gu +古gu +骨gu +故gu +顾gu +股gu +谷gu +估gu +雇gu +孤gu +姑gu +贾*gu +辜gu +菇gu +咕gu +箍gu +沽gu +蛊gu +嘏gu +诂gu +菰gu +呱gu +崮gu +汩gu +梏gu +轱gu +牯gu +牿gu +臌gu +毂gu +瞽gu +罟gu +钴gu +锢gu +鸪gu +鹄*gu +痼gu +蛄gu +酤gu +觚gu +鲴gu +鹘gu +挂gua +刮gua +瓜gua +括*gua +剐gua +寡gua +褂gua +卦gua +诖gua +呱gua +栝gua +胍gua +鸹gua +瓜分guafen +瓜葛guage +挂号guahao +怪guai +乖guai +拐guai +乖舛guaichuan +乖戾guaili +乖僻guaipi +乖巧guaiqiao +怪物guaiwu +怪异guaiyi +拐杖guaizhang +挂名guaming +关guan +管guan +观guan +官guan +灌guan +贯guan +惯guan +冠guan +馆guan +罐guan +棺guan +纶*guan +倌guan +莞guan +掼guan +涫guan +盥guan +鹳guan +矜guan +鳏guan +关闭guanbi +观测guance +观察guancha +贯彻guanche +贯穿guanchuan +管道guandao +官邸guandi +观点guandian +官方guanfang +光guang +广guang +逛guang +咣guang +犷guang +桄guang +胱guang +灌溉guangai +光标guangbiao +广播guangbo +广博guangbo +光彩guangcai +广场guangchang +光大guangda +广大guangda +广东guangdong +广度guangdu +广泛guangfan +广告guanggao +光顾guanggu +光滑guanghua +光辉guanghui +光景guangjing +广阔guangkuo +光芒guangmang +广袤guangmao +光明guangming +光盘guangpan +光谱guangpu +光荣guangrong +观光guanguang +广西guangxi +光线guangxian +广义guangyi +光阴guangyin +光涌guangyong +广州guangzhou +关怀guanhuai +挂念guanian +管家guanjia +关键guanjian +管教guanjiao +关节guanjie +冠军guanjun +关卡guanka +观看guankan +关口guankou +管理guanli +贯例guanli +惯例guanli +官吏guanli +关联guanlian +官僚guanliao +观摩guanmo +灌木guanmu +官能guanneng +观念guannian +关切guanqie +观赏guanshang +管事guanshi +管束guanshu +灌输guanshu +关税guanshui +官司guansi +贯通guantong +关头guantou +观望guanwang +关系guanxi +管辖guanxia +官衔guanxian +关心guanxin +惯性guanxing +关押guanya +惯用guanyong +关于guanyu +官员guanyuan +观战guanzhan +关照guanzhao +管制guanzhi +观止guanzhi +观众guanzhong +关注guanzhu +贯注guanzhu +馆子guanzi +挂失guashi +挂帅guashuai +鼓吹guchui +故此guci +古代gudai +孤单gudan +故地gudi +古典gudian +固定guding +鼓动gudong +股东gudong +古董gudong +孤独gudu +咕嘟gudu +孤儿guer +股份gufen +辜负gufu +骨干gugan +雇工gugong +故宫gugong +古怪guguai +蛊惑guhuo +规gui +贵gui +归gui +硅gui +鬼gui +轨gui +龟gui +桂gui +瑰gui +圭gui +闺gui +诡gui +癸gui +柜gui +跪gui +刽gui +傀*gui +炔*gui +匦gui +刿gui +庋gui +宄gui +妫gui +桧gui +炅gui +晷gui +皈gui +簋gui +鲑gui +鳜gui +诡辩guibian +贵宾guibin +归并guibing +规程guicheng +归档guidang +轨道guidao +规定guiding +归队guidui +规范guifan +规格guige +归公guigong +归功guigong +桂冠guiguan +归国guiguo +规划guihua +鬼话guihua +归还guihuan +诡计guiji +轨迹guiji +贵贱guijian +归咎guijiu +规矩guiju +瑰丽guili +鬼脸guilian +龟裂guilie +规律guilu +诡秘guimi +规模guimo +归纳guina +闺女guinu +规劝guiquan +贵人guiren +归属guishu +龟缩guisuo +柜台guitai +闺秀guixiu +归于guiyu +规则guize +规章guizhang +贵重guizhong +贵州guizhou +鬼子guizi +贵族guizu +归罪guizui +顾及guji +估计guji +古迹guji +顾忌guji +估价gujia +古今gujin +古旧gujiu +故旧gujiu +故居guju +顾客guke +孤苦guku +古老gulao +孤立guli +鼓励guli +估量guliang +顾虑gulu +估摸gumo +滚gun +辊gun +棍gun +衮gun +绲gun +磙gun +鲧gun +滚动gundong +姑娘guniang +雇农gunong +滚烫guntang +棍子gunzi +国guo +过guo +果guo +锅guo +郭guo +涡*guo +裹guo +馘guo +埚guo +掴guo +呙guo +帼guo +崞guo +猓guo +椁guo +虢guo +聒guo +蜾guo +蝈guo +过半guoban +国策guoce +国产guochan +过程guocheng +过错guocuo +过度guodu +过渡guodu +果断guoduan +国法guofa +国防guofang +过分guofen +果腹guofu +果敢guogan +国歌guoge +过关guoguan +过后guohou +国会guohui +国际guoji +国籍guoji +国家guojia +国界guojie +国境guojing +国库guoku +过来guolai +过量guoliang +过虑guolu +锅炉guolu +国民guomin +过目guomu +果木guomu +国难guonan +国内guonei +果皮guopi +果品guopin +国旗guoqi +过期guoqi +国情guoqing +国庆guoqing +过去guoqu +果然guoran +过少guoshao +过甚guoshen +过剩guosheng +过时guoshi +国事guoshi +过失guoshi +果实guoshi +过头guotou +国外guowai +国王guowang +过问guowen +国务guowu +过细guoxi +国药guoyao +国营guoying +过硬guoying +过于guoyu +果园guoyuan +果真guozhen +锅子guozi +顾盼gupan +孤僻gupi +股票gupiao +骨气guqi +姑且guqie +顾全guquan +固然guran +古人guren +骨肉gurou +故事gushi +股市gushi +固守gushou +估算gusuan +固体guti +骨头gutou +故土gutu +顾问guwen +古文guwen +谷物guwu +鼓舞guwu +姑息guxi +故乡guxiang +故意guyi +雇佣guyong +固有guyou +雇员guyuan +鼓掌guzhang +故障guzhang +固执guzhi +拐弯抹角gwmj +国务委员gwwy +国务院gwy +改邪归正gxgz +更新换代gxhd +各行其事gxqs +感性认识gxrs +广西壮族gxzz +工业化gyh +工艺流程gylc +工艺美术gyms +工业品gyp +工艺品gyp +贵阳市gys +公有制gyz +各种各样gzgy +工资级别gzjb +各族人民gzrm +工作上gzs +广州市gzs +贵州省gzs +各自为政gzwz +高瞻远瞩gzyz +高瞻远嘱gzyz +工作者gzz +和h +会h +后h +化h +好h +合h +还h +活h +很h +回h +号h +毫h +花h +或h +海h +话h +红h +火h +黄h +害h +哈ha +蛤*ha +虾*ha +铪ha +哈达hada +还hai +海hai +害hai +孩hai +骸hai +氦hai +亥hai +骇hai +嘿*hai +咳*hai +嗨hai +胲hai +醢hai +海岸haian +海拔haiba +海报haibao +害虫haichong +害处haichu +海岛haidao +海港haigang +海关haiguan +还好haihao +海疆haijiang +海军haijun +海浪hailang +海绵haimian +害怕haipa +海上haishang +还是haishi +海外haiwai +海湾haiwan +海峡haixia +海啸haixiao +害羞haixiu +海洋haiyang +还要haiyao +还有haiyou +海域haiyu +海员haiyuan +孩子haizi +含han +焊han +旱han +喊han +汉han +寒han +汗han +函han +韩han +酣han +憨han +邯han +涵han +罕han +翰han +撼han +捍han +憾han +悍han +邗han +菡han +撖han +阚han +瀚han +晗han +焓han +顸han +颔han +蚶han +鼾han +寒潮hanchao +寒带handai +行*hang +航hang +夯hang +杭hang +吭*hang +巷*hang +沆hang +绗hang +珩hang +颃hang +航标hangbiao +航程hangcheng +航船hangchuan +行当hangdang +航道hangdao +航海hanghai +行家hangjia +行距hangju +航空hangkong +行列hanglie +航路hanglu +航模hangmo +函购hangou +行情hangqing +航天hangtian +航线hangxian +航向hangxiang +航行hangxing +航运hangyun +杭州hangzhou +含糊hanhu +含混hanhun +旱季hanji +函件hanjian +罕见hanjian +汉奸hanjian +喊叫hanjiao +焊接hanjie +寒冷hanleng +翰林hanlin +寒流hanliu +函授hanshou +函数hanshu +酣睡hanshui +寒酸hansuan +捍卫hanwei +含蓄hanxu +寒暄hanxuan +涵养hanyang +含义hanyi +涵义hanyi +汉语hanyu +含冤hanyuan +旱灾hanzai +汉字hanzi +汉族hanzu +好hao +号hao +毫hao +耗hao +豪hao +郝hao +浩hao +镐*hao +壕hao +嚎hao +貉*hao +蒿hao +薅hao +嗥hao +嚆hao +濠hao +灏hao +昊hao +皓hao +颢hao +蚝hao +好比haobi +毫不haobu +号称haocheng +好处haochu +浩大haoda +好歹haodai +浩荡haodang +好的haode +浩繁haofan +耗费haofei +好感haogan +好汉haohan +豪华haohua +好坏haohuai +号角haojiao +耗竭haojie +豪杰haojie +浩劫haojie +好看haokan +毫厘haoli +号令haoling +号码haoma +豪迈haomai +毫毛haomao +毫米haomi +浩淼haomiao +好奇haoqi +豪强haoqiang +豪情haoqing +好人haoren +豪绅haoshen +毫升haosheng +好事haoshi +豪爽haoshuang +好似haosi +耗损haosun +号啕haotao +好听haoting +好玩haowan +毫无haowu +好象haoxiang +好些haoxie +好样haoyang +好意haoyi +号召haozhao +好转haozhuan +汇编程序hbcx +货币回笼hbhl +货币流通hblt +河北省hbs +湖北省hbs +汇编语言hbyy +或多或少hdhs +海淀区hdq +和he +合he +河he +何he +核he +赫he +荷he +褐he +喝he +贺he +呵he +禾he +吓*he +盒he +菏he +貉he +阂he +涸he +鹤he +诃he +劾he +壑he +嗬he +阖he +纥he +曷he +盍he +颌he +蚵he +翮he +和蔼heai +哈尔滨heb +合办heban +荷包hebao +河北hebei +何必hebi +合并hebing +哈尔滨市hebs +何不hebu +喝彩hecai +合唱hechang +何尝hechang +合成hecheng +呵斥hechi +何处hechu +河川hechuan +河床hechuang +贺词heci +何等hedeng +贺电hedian +核定heding +核对hedui +合法hefa +何妨hefang +合肥hefei +合格hege +和好hehao +赫赫hehe +合乎hehu +合伙hehuo +黑hei +嘿hei +黑暗heian +黑白heibai +黑帮heibang +嘿嘿heihei +黑人heiren +黑色heise +黑市heishi +黑夜heiye +合计heji +核计heji +和解hejie +合金hejin +何苦heku +何况hekuang +合理heli +合力heli +合流heliu +河流heliu +合谋hemou +和睦hemu +很hen +狠hen +痕hen +恨hen +河南henan +狠毒hendu +很多henduo +河内henei +行*heng +横heng +衡heng +恒heng +哼heng +亨heng +蘅heng +珩*heng +桁heng +横财hengcai +哼哧hengchi +横幅hengfu +横亘henggen +横贯hengguan +横祸henghuo +横加hengjia +衡量hengliang +横蛮hengman +横批hengpi +衡器hengqi +横扫hengsao +横竖hengshu +恒心hengxin +横行hengxing +恒星hengxing +很好henhao +贺年henian +痕迹henji +很快henkuai +狠心henxin +狠抓henzhua +和平heping +和气heqi +河渠hequ +赫然heran +河山heshan +和尚heshang +合适heshi +核实heshi +合算hesuan +核算hesuan +河滩hetan +合同hetong +贺喜hexi +和谐hexie +核心hexin +贺信hexin +和煦hexu +何以heyi +合影heying +合营heying +核准hezhun +合资hezi +赫兹hezi +合作hezuo +合法权益hfqy +合肥市hfs +宏观世界hgsj +化公为私hgws +好高务远hgwy +核工业部hgyb +海关总署hgzs +后顾之忧hgzy +呼和浩特hhht +轰轰烈烈hhll +换句话说hjhs +黄金时代hjsd +环境卫生hjws +后继有人hjyr +海枯石烂hksl +合理化hlh +糊里糊涂hlht +黑龙江hlj +汗流浃背hljb +汗马功劳hmgl +海南岛hnd +河南省hns +湖南省hns +红hong +洪hong +轰hong +烘hong +哄hong +虹hong +鸿hong +宏hong +弘hong +黉hong +訇hong +讧hong +荭hong +蕻hong +薨hong +闳hong +泓hong +红尘hongchen +轰动hongdong +洪都hongdu +洪峰hongfeng +鸿沟honggou +宏观hongguan +红光hongguang +红花honghua +红军hongjun +红利hongli +洪亮hongliang +轰隆honglong +弘论honglun +鸿毛hongmao +轰鸣hongming +哄骗hongpian +红旗hongqi +红人hongren +红色hongse +洪水hongshui +哄抬hongtai +宏图hongtu +宏伟hongwei +红星hongxing +弘扬hongyang +鸿运hongyun +红晕hongyun +轰炸hongzha +后hou +候hou +厚hou +侯hou +喉hou +猴hou +吼hou +堠hou +後hou +逅hou +瘊hou +篌hou +糇hou +鲎hou +骺hou +后备houbei +后辈houbei +后边houbian +厚薄houbo +候补houbu +后尘houchen +后代houdai +厚道houdao +厚度houdu +后盾houdun +后方houfang +后果houguo +后患houhuan +后悔houhui +后记houji +后进houjin +后劲houjin +后来houlai +喉咙houlong +后门houmen +后面houmian +后期houqi +后勤houqin +后人houren +喉舌houshe +厚实houshi +后嗣housi +后台houtai +后天houtian +后退houtui +后续houxu +候选houxuan +后裔houyi +后缀houzhui +和平共处hpgc +黄埔江hpj +后勤部hqb +何去何从hqhc +合情合理hqhl +好容易hry +好事多磨hsdm +胡思乱想hslx +航天工业部htgb +昏头昏脑hthn +欢天喜地htxd +和*hu +护hu +互hu +湖hu +呼hu +户hu +弧hu +乎hu +胡hu +糊hu +虎hu +忽hu +核*hu +瑚hu +戏*hu +壶hu +葫hu +蝴hu +狐hu +唬hu +沪hu +冱hu +唿hu +囫hu +岵hu +猢hu +怙hu +惚hu +浒hu +滹hu +琥hu +槲hu +轷hu +觳hu +烀hu +煳hu +戽hu +扈hu +祜hu +瓠hu +鹄hu +鹕hu +鹱hu +笏hu +醐hu +斛hu +化hua +花hua +话hua +划hua +滑hua +华hua +画hua +哗hua +猾hua +豁*hua +骅hua +桦hua +砉hua +铧hua +画报huabao +华北huabei +哗变huabian +话柄huabing +划拨huabo +划策huace +画册huace +华东huadong +花朵huaduo +花儿huaer +化肥huafei +花费huafei +划分huafen +化工huagong +华贵huagui +化合huahe +花卉huahui +坏huai +怀huai +划*huai +淮huai +槐huai +徊huai +踝huai +怀抱huaibao +淮北huaibei +坏处huaichu +怀古huaigu +淮海huaihai +怀恨huaihen +怀旧huaijiu +淮南huainan +怀念huainian +坏人huairen +坏事huaishi +怀疑huaiyi +怀着huaizhe +滑稽huaji +画家huajia +话剧huaju +哗啦huala +画廊hualang +华丽huali +画面huamian +化名huaming +还*huan +环huan +换huan +欢huan +缓huan +患huan +幻huan +焕huan +桓huan +唤huan +痪huan +豢huan +涣huan +宦huan +郇huan +奂huan +萑huan +擐huan +圜huan +獾huan +洹huan +浣huan +漶huan +寰huan +逭huan +缳huan +锾huan +鲩huan +鬟huan +华南huanan +欢畅huanchang +缓冲huanchong +幻灯huandeng +欢度huandu +焕发huanfa +黄huang +簧huang +荒huang +皇huang +慌huang +蝗huang +磺huang +凰huang +惶huang +煌huang +晃huang +幌huang +恍huang +谎huang +隍huang +徨huang +湟huang +潢huang +遑huang +璜huang +肓huang +癀huang +蟥huang +篁huang +鳇huang +磺胺huangan +皇朝huangchao +荒诞huangdan +晃荡huangdang +皇帝huangdi +荒废huangfei +黄海huanghai +黄河huanghe +恍惚huanghu +谎话huanghua +黄昏huanghun +黄金huangjin +皇历huangli +荒凉huangliang +荒乱huangluan +慌乱huangluan +慌忙huangmang +荒谬huangmiu +恍然huangran +黄色huangse +黄山huangshan +皇上huangshang +荒唐huangtang +环顾huangu +宦官huanguan +谎言huangyan +慌张huangzhang +幌子huangzi +缓和huanhe +欢呼huanhu +环环huanhuan +滑腻huani +花鸟huaniao +还给huanji +缓急huanji +还价huanjia +环节huanjie +环境huanjing +幻境huanjing +幻景huanjing +欢聚huanju +幻觉huanjue +欢乐huanle +缓慢huanman +患难huannan +唤起huanqi +缓期huanqi +欢庆huanqing +环球huanqiu +寰球huanqiu +换取huanqu +环绕huanrao +涣散huansan +欢声huansheng +环视huanshi +欢送huansong +换算huansuan +欢腾huanteng +欢喜huanxi +幻想huanxiang +欢笑huanxiao +欢心huanxin +欢欣huanxin +环行huanxing +缓刑huanxing +唤醒huanxing +幻影huanying +欢迎huanying +寰宇huanyu +还原huanyuan +患者huanzhe +滑坡huapo +花腔huaqiang +华侨huaqiao +划清huaqing +花圈huaquan +划拳huaquan +哗然huaran +华人huaren +花色huase +化身huashen +化石huashi +划算huasuan +话题huati +滑头huatou +花纹huawen +华夏huaxia +化纤huaxian +画像huaxiang +花絮huaxu +化学huaxue +画押huaya +化验huayan +花样huayang +华裔huayi +话音huayin +话语huayu +花园huayuan +画展huazhan +花招huazhao +华中huazhong +化装huazhuang +化妆huazhuang +湖北hubei +胡扯huche +弧度hudu +忽而huer +呼喊huhan +呼号huhao +呼唤huhuan +互惠huhui +会hui +回hui +灰hui +挥hui +辉hui +汇hui +毁hui +慧hui +恢hui +绘hui +惠hui +徽hui +溃*hui +堕*hui +徊*hui +蛔hui +悔hui +卉hui +晦hui +贿hui +秽hui +烩hui +讳hui +诲hui +诙hui +茴hui +荟hui +蕙hui +咴hui +哕hui +喙hui +隳hui +洄hui +浍hui +彗hui +缋hui +珲hui +桧*hui +晖hui +恚hui +虺hui +蟪hui +麾hui +灰暗huian +回报huibao +汇报huibao +回避huibi +汇编huibian +会场huichang +回潮huichao +灰尘huichen +回春huichun +荟萃huicui +回答huida +回荡huidang +回电huidian +汇兑huidui +挥发huifa +汇费huifei +会风huifeng +回复huifu +恢复huifu +悔改huigai +回顾huigu +惠顾huigu +悔过huiguo +会合huihe +回合huihe +汇合huihe +悔恨huihen +恢弘huihong +会话huihua +回话huihua +绘画huihua +毁坏huihuai +辉煌huihuang +挥霍huihuo +会集huiji +回击huiji +汇集huiji +回家huijia +会见huijian +会聚huiju +汇聚huiju +回扣huikou +汇款huikuan +回来huilai +回笼huilong +汇率huilu +贿赂huilu +会面huimian +毁灭huimie +回民huimin +汇票huipiao +回去huiqu +挥洒huisa +灰色huise +晦涩huise +回收huishou +回首huishou +会谈huitan +会堂huitang +会同huitong +回头huitou +回味huiwei +会晤huiwu +挥舞huiwu +悔悟huiwu +麾下huixia +回想huixiang +回响huixiang +诙谐huixie +灰心huixin +彗星huixing +会演huiyan +汇演huiyan +会议huiyi +回忆huiyi +回音huiyin +辉映huiying +会员huiyuan +会战huizhan +徽章huizhang +会诊huizhen +绘制huizhi +回转huizhuan +汇总huizong +回族huizu +户籍huji +呼叫hujiao +户口hukou +虎口hukou +护理huli +互利huli +护林hulin +呼噜hulu +胡乱huluan +忽略hulue +互勉humian +混hun +浑hun +荤hun +昏hun +婚hun +魂hun +诨hun +馄hun +阍hun +溷hun +湖南hunan +胡闹hunao +昏沉hunchen +混合hunhe +浑厚hunhou +昏黄hunhuang +混迹hunji +婚礼hunli +混乱hunluan +糊弄hunong +婚配hunpei +混入hunru +浑身hunshen +混同huntong +混淆hunxiao +婚姻hunyin +昏庸hunyong +混杂hunza +混帐hunzhang +混浊hunzhuo +浑浊hunzhuo +和*huo +活huo +或huo +火huo +货huo +获huo +伙huo +霍huo +豁huo +惑huo +祸huo +劐huo +藿huo +攉huo +嚯huo +夥huo +钬huo +锪huo +镬huo +耠huo +蠖huo +火把huoba +伙伴huoban +火暴huobao +货币huobi +火柴huochai +火车huoche +豁达huoda +获得huode +霍地huodi +活动huodong +伙房huofang +祸根huogen +祸害huohai +火候huohou +火化huohua +火花huohua +祸患huohuan +活活huohuo +伙计huoji +火箭huojian +火警huojing +火炬huoju +火坑huokeng +活力huoli +霍乱huoluan +活泼huopo +获取huoqu +豁然huoran +货色huose +火山huoshan +获胜huosheng +或是huoshi +伙食huoshi +祸首huoshou +伙同huotong +货物huowu +获悉huoxi +火线huoxian +活现huoxian +或许huoxu +火药huoyao +活页huoye +活跃huoyue +货运huoyun +火灾huozai +火葬huozang +或则huoze +或者huozhe +获准huozhun +湖泊hupo +忽然huran +呼声husheng +护士hushi +忽视hushi +湖水hushui +胡说hushuo +护送husong +胡同hutong +互通hutong +户头hutou +糊涂hutu +护卫huwei +呼吸huxi +互相huxiang +呼啸huxiao +虎穴huxue +护养huyang +呼应huying +呼吁huyu +护照huzhao +互助huzhu +毫无疑问hwyw +互相爱护hxah +横行霸道hxbd +互相帮助hxbz +欢欣鼓舞hxgw +候选人hxr +合作化hzh +杭州市hzs +化整为零hzwl +级j +就j +进j +加j +经j +家j +结j +阶j +间j +件j +及j +解j +较j +机j +军j +接j +教j +极j +九j +见j +基本国策jbgc +基本上jbs +据不完全统计jbwj +饥不择食jbzs +坚持不懈jcbx +集成电路jcdl +基础上jcs +绝大部分jdbf +坚定不移jdby +绝大多数jdds +鉴定会jdh +绝对化jdh +经得起jdq +见多识广jdsg +精打细算jdxs +接二连三jels +解放后jfh +解放军jfj +解放军报jfjb +解放前jfq +仅供参考jgck +机构改革jggg +坚固耐用jgny +襟怀坦白jhtb +计划性jhx +级ji +及ji +机ji +极ji +几ji +积ji +给ji +基ji +其*ji +记ji +己ji +期*ji +系*ji +革*ji +计ji +集ji +即ji +际ji +季ji +激ji +济ji +技ji +击ji +继ji +急ji +剂ji +既ji +纪ji +寄ji +挤ji +鸡ji +迹ji +绩ji +齐*ji +奇*ji +吉ji +脊ji +辑ji +籍ji +疾ji +肌ji +棘ji +畸ji +圾ji +稽ji +箕ji +饥ji +讥ji +姬ji +缉ji +汲ji +嫉ji +蓟ji +冀ji +伎ji +祭ji +悸ji +寂ji +忌ji +妓ji +藉ji +丌ji +亟ji +乩ji +剞ji +佶ji +偈ji +诘ji +墼ji +芨ji +芰ji +荠ji +蒺ji +蕺ji +掎ji +叽ji +咭ji +哜ji +唧ji +岌ji +嵴ji +洎ji +屐ji +骥ji +畿ji +玑ji +楫ji +殛ji +戟ji +戢ji +赍ji +觊ji +犄ji +齑ji +矶ji +羁ji +嵇ji +稷ji +瘠ji +虮ji +笈ji +笄ji +暨ji +跻ji +跽ji +霁ji +鲚ji +鲫ji +髻ji +麂ji +加jia +家jia +架jia +价jia +甲jia +夹jia +假jia +钾jia +贾jia +稼jia +驾jia +嘉jia +枷jia +佳jia +荚jia +颊jia +嫁jia +茄*jia +挟*jia +嘏*jia +伽jia +郏jia +葭jia +岬jia +浃jia +迦jia +珈jia +戛jia +胛jia +恝jia +铗jia +镓jia +痂jia +瘕jia +袷jia +蛱jia +笳jia +袈jia +跏jia +加班jiaban +甲板jiaban +加倍jiabei +甲虫jiachong +家畜jiachu +家当jiadang +家底jiadi +假定jiading +加法jiafa +家访jiafang +价格jiage +加工jiagong +佳话jiahua +家伙jiahuo +加急jiaji +嘉奖jiajiang +家教jiajiao +嫁接jiajie +佳节jiajie +假借jiajie +加紧jiajin +家境jiajing +家具jiaju +加剧jiaju +加快jiakuai +加仑jialun +加码jiama +假冒jiamao +家门jiamen +加密jiami +加冕jiamian +价目jiamu +间jian +件jian +见jian +建jian +坚jian +减jian +检jian +践jian +尖jian +简jian +碱jian +剪jian +艰jian +渐jian +肩jian +键jian +健jian +柬jian +鉴jian +剑jian +歼jian +监jian +兼jian +浅*jian +奸jian +箭jian +茧jian +舰jian +俭jian +笺jian +煎jian +缄jian +硷jian +拣jian +捡jian +荐jian +槛jian +贱jian +饯jian +溅jian +涧jian +僭jian +谏jian +谫jian +菅jian +蒹jian +搛jian +囝*jian +湔jian +蹇jian +謇jian +缣jian +枧jian +楗jian +戋jian +戬jian +牮jian +犍jian +毽jian +腱jian +睑jian +锏jian +鹣jian +裥jian +笕jian +翦jian +趼jian +踺jian +鲣jian +鞯jian +吉安jian +煎熬jianao +简报jianbao +渐变jianbian +简便jianbian +简编jianbian +鉴别jianbie +兼并jianbing +尖兵jianbing +剪裁jiancai +剪彩jiancai +检测jiance +检查jiancha +检察jiancha +监察jiancha +减产jianchan +建成jiancheng +简称jiancheng +坚持jianchi +简单jiandan +建党jiandang +减低jiandi +检点jiandian +间谍jiandie +坚定jianding +鉴定jianding +监督jiandu +间断jianduan +尖端jianduan +简短jianduan +舰队jiandui +健儿jianer +减法jianfa +肩负jianfu +将jiang +降jiang +讲jiang +强*jiang +江jiang +浆jiang +蒋jiang +奖jiang +疆jiang +僵jiang +姜jiang +桨jiang +匠jiang +酱jiang +茳jiang +洚jiang +绛jiang +缰jiang +犟jiang +礓jiang +耩jiang +糨jiang +豇jiang +奖杯jiangbei +疆场jiangchang +奖惩jiangcheng +僵持jiangchi +降低jiangdi +间隔jiange +讲稿jianggao +江湖jianghu +僵化jianghua +讲话jianghua +降级jiangji +降价jiangjia +讲解jiangjie +疆界jiangjie +将近jiangjin +奖金jiangjin +讲究jiangjiu +僵局jiangju +将军jiangjun +讲课jiangke +将来jianglai +讲理jiangli +奖励jiangli +降临jianglin +将领jiangling +降落jiangluo +江南jiangnan +奖品jiangpin +讲评jiangping +奖券jiangquan +江山jiangshan +讲师jiangshi +僵尸jiangshi +讲授jiangshou +讲述jiangshu +降水jiangshui +江苏jiangsu +讲台jiangtai +讲坛jiangtan +疆土jiangtu +坚固jiangu +兼顾jiangu +监管jianguan +建国jianguo +降温jiangwen +江西jiangxi +讲习jiangxi +匠心jiangxin +讲学jiangxue +讲演jiangyan +将要jiangyao +讲义jiangyi +僵硬jiangying +奖章jiangzhang +讲座jiangzuo +监护jianhu +简化jianhua +间或jianhuo +奸计jianji +歼击jianji +剪辑jianji +减价jianjia +渐渐jianjian +健将jianjiang +建交jianjiao +间接jianjie +见解jianjie +简介jianjie +简洁jianjie +简捷jianjie +渐进jianjin +监禁jianjin +检举jianju +艰巨jianju +坚决jianjue +健康jiankang +尖刻jianke +坚苦jianku +艰苦jianku +监牢jianlao +建立jianli +尖利jianli +简历jianli +简练jianlian +简陋jianlou +简略jianlue +健美jianmei +减免jianmian +歼灭jianmie +简明jianming +缄默jianmo +艰难jiannan +键盘jianpan +简拼jianpin +简朴jianpu +俭朴jianpu +坚强jianqiang +减轻jianqing +健全jianquan +兼任jianren +坚韧jianren +兼容jianrong +尖锐jianrui +减弱jianruo +艰涩jianse +鉴赏jianshang +减少jianshao +建设jianshe +艰深jianshen +见识jianshi +坚实jianshi +监视jianshi +建树jianshu +减速jiansu +检索jiansuo +践踏jianta +健谈jiantan +检讨jiantao +简体jianti +舰艇jianting +减退jiantui +健忘jianwang +间文jianwen +见闻jianwen +间隙jianxi +奸细jianxi +艰险jianxian +见效jianxiao +间歇jianxie +简写jianxie +坚信jianxin +艰辛jianxin +减刑jianxing +检修jianxiu +简讯jianxun +检验jianyan +简要jianyao +建议jianyi +坚毅jianyi +简易jianyi +奸淫jianyin +坚硬jianying +剪影jianying +鉴于jianyu +监狱jianyu +减员jianyuan +检阅jianyue +建造jianzao +简则jianze +坚贞jianzhen +监制jianzhi +简直jianzhi +兼职jianzhi +建筑jianzhu +简装jianzhuang +健壮jianzhuang +较jiao +教jiao +交jiao +角jiao +叫jiao +脚jiao +胶jiao +浇jiao +焦jiao +觉*jiao +校*jiao +搅jiao +酵jiao +郊jiao +铰jiao +窖jiao +椒jiao +礁jiao +骄jiao +娇jiao +嚼jiao +矫jiao +侥jiao +狡jiao +饺jiao +缴jiao +绞jiao +剿jiao +轿jiao +佼jiao +僬jiao +艽jiao +茭jiao +挢jiao +噍jiao +峤jiao +徼jiao +湫*jiao +姣jiao +敫jiao +皎jiao +鹪jiao +蛟jiao +醮jiao +跤jiao +鲛jiao +骄傲jiaoao +搅拌jiaoban +狡辩jiaobian +教材jiaocai +交叉jiaocha +教程jiaocheng +交错jiaocuo +较大jiaoda +交代jiaodai +交淡jiaodan +教导jiaodao +交点jiaodian +焦点jiaodian +校订jiaoding +角度jiaodu +校对jiaodui +较多jiaoduo +焦耳jiaoer +交锋jiaofeng +交付jiaofu +浇灌jiaoguan +娇贵jiaogui +叫喊jiaohan +较好jiaohao +叫好jiaohao +狡猾jiaohua +交换jiaohuan +叫唤jiaohuan +教诲jiaohui +缴获jiaohuo +交际jiaoji +矫健jiaojian +交接jiaojie +交界jiaojie +叫苦jiaoku +较快jiaokuai +教练jiaolian +较量jiaoliang +交流jiaoliu +搅乱jiaoluan +角落jiaoluo +叫骂jiaoma +剿灭jiaomie +酵母jiaomu +交纳jiaona +缴纳jiaona +娇嫩jiaonen +交配jiaopei +骄气jiaoqi +交情jiaoqing +郊区jiaoqu +叫嚷jiaorang +角色jiaose +交涉jiaoshe +教师jiaoshi +教授jiaoshou +教唆jiaosuo +脚踏jiaota +交谈jiaotan +教堂jiaotang +交替jiaoti +教条jiaotiao +交通jiaotong +郊外jiaowai +交往jiaowang +较为jiaowei +狡黠jiaoxia +叫嚣jiaoxiao +侥幸jiaoxing +绞刑jiaoxing +教学jiaoxue +教训jiaoxun +教养jiaoyang +骄阳jiaoyang +教益jiaoyi +交易jiaoyi +交谊jiaoyi +教育jiaoyu +教员jiaoyuan +狡诈jiaozha +校正jiaozheng +脚注jiaozhu +角逐jiaozhu +浇铸jiaozhu +校准jiaozhun +焦灼jiaozhuo +娇纵jiaozong +叫做jiaozuo +家谱jiapu +假期jiaqi +价钱jiaqian +加强jiaqiang +假日jiari +加入jiaru +假如jiaru +假若jiaruo +加上jiashang +假设jiashe +加深jiashen +假使jiashi +架势jiashi +驾驶jiashi +家属jiashu +假说jiashuo +加速jiasu +枷锁jiasuo +家庭jiating +家乡jiaxiang +假想jiaxiang +家业jiaye +加以jiayi +佳音jiayin +家用jiayong +加油jiayou +家园jiayuan +夹杂jiaza +加载jiazai +家长jiazhang +价值jiazhi +加重jiazhong +假装jiazhuang +嫁妆jiazhuang +架子jiazi +家族jiazu +击败jibai +羁绊jiban +几倍jibei +基本jiben +击毙jibi +级别jibie +疾病jibing +计策jice +基层jiceng +稽查jicha +机场jichang +集成jicheng +继承jicheng +计酬jichou +基础jichu +机床jichuang +几次jici +急促jicu +积存jicun +寄存jicun +极大jida +亟待jidai +激荡jidang +记得jide +基地jidi +机电jidian +极点jidian +基调jidiao +机动jidong +激动jidong +极度jidu +几度jidu +即度jidu +季度jidu +基督jidu +嫉妒jidu +忌妒jidu +极端jiduan +结jie +阶jie +解jie +接jie +节jie +家*jie +界jie +截jie +介jie +借jie +价*jie +届jie +街jie +揭jie +洁jie +杰jie +竭jie +皆jie +秸jie +劫jie +桔jie +捷jie +睫jie +姐jie +戒jie +藉jie +芥jie +疥jie +诫jie +楷*jie +偈*jie +讦jie +诘*jie +拮jie +喈jie +嗟jie +婕jie +孑jie +桀jie +碣jie +疖jie +颉jie +蚧jie +羯jie +鲒jie +骱jie +饥饿jie +结案jiean +洁白jiebai +接班jieban +捷报jiebao +戒备jiebei +结彩jiecai +节操jiecao +阶层jieceng +劫持jiechi +杰出jiechu +解除jiechu +接触jiechu +戒除jiechu +揭穿jiechuan +结存jiecun +解答jieda +接待jiedai +借贷jiedai +街道jiedao +解冻jiedong +阶段jieduan +截断jieduan +揭发jiefa +借方jiefang +解放jiefang +街坊jiefang +结构jiegou +解雇jiegu +借故jiegu +结果jieguo +结合jiehe +结核jiehe +结婚jiehun +阶级jieji +接见jiejian +节俭jiejian +借鉴jiejian +结交jiejiao +姐姐jiejie +接近jiejin +竭尽jiejin +结晶jiejing +捷径jiejing +洁净jiejing +解救jiejiu +结局jieju +解决jiejue +孑孓jiejue +解开jiekai +揭开jiekai +解渴jieke +接口jiekou +借口jiekou +借款jiekuan +竭力jieli +接连jielian +揭露jielu +戒律jielu +结论jielun +解闷jiemen +结盟jiemeng +界面jiemian +节目jiemu +揭幕jiemu +接纳jiena +解聘jiepin +解剖jiepou +节气jieqi +接洽jieqia +截取jiequ +既而jier +节日jieri +介入jieru +解散jiesan +介绍jieshao +节省jiesheng +届时jieshi +结实jieshi +解释jieshi +揭示jieshi +解手jieshou +接受jieshou +接收jieshou +结束jieshu +解说jieshuo +结算jiesuan +解体jieti +阶梯jieti +接替jieti +接头jietou +街头jietou +解脱jietuo +结尾jiewei +解围jiewei +接吻jiewen +解析jiexi +界线jiexian +界限jiexian +揭晓jiexiao +戒严jieyan +结业jieye +介意jieyi +接应jieying +结余jieyu +节约jieyue +结帐jiezhang +接着jiezhao +节制jiezhi +介质jiezhi +戒指jiezhi +借支jiezhi +截止jiezhi +借助jiezhu +节奏jiezou +杰作jiezuo +激发jifa +技法jifa +讥讽jifeng +几个jige +及格jige +技工jigong +记功jigong +机构jigou +叽咕jigu +机关jiguan +籍贯jiguan +极光jiguang +激光jiguang +记过jiguo +极好jihao +记号jihao +集合jihe +几何jihe +稽核jihe +几乎jihu +激化jihua +计划jihua +饥荒jihuang +机会jihui +集会jihui +击毁jihui +忌讳jihui +积极jiji +机件jijian +计件jijian +急件jijian +击剑jijian +即将jijiang +计较jijiao +季节jijie +急进jijin +基金jijin +机警jijing +即景jijing +寂静jijing +急救jijiu +积聚jiju +急剧jiju +急遽jiju +寄居jiju +季刊jikan +即刻jike +疾苦jiku +击溃jikui +积累jilei +极力jili +吉利jili +激励jili +伎俩jilia +计量jiliang +寂寥jiliao +激烈jilie +吉林jilin +机灵jiling +激流jiliu +记录jilu +纪律jilu +纪录jilu +辑录jilu +击落jiluo +急忙jimang +机密jimi +寂寞jimo +计谋jimou +进jin +金jin +近jin +紧jin +斤jin +今jin +尽jin +仅jin +劲jin +浸jin +禁jin +津jin +筋jin +锦jin +晋jin +巾jin +襟jin +谨jin +靳jin +烬jin +卺jin +荩jin +堇jin +噤jin +馑jin +廑jin +妗jin +缙jin +瑾jin +槿jin +赆jin +觐jin +衿jin +缉拿jina +济南jinan +禁闭jinbi +锦标jinbiao +进步jinbu +浸沉jinchen +进程jincheng +进出jinchu +紧凑jincou +近代jindai +劲敌jindi +进度jindu +金额jine +机能jineng +技能jineng +进而jiner +进犯jinfan +经jing +精jing +京jing +径jing +井jing +静jing +竟jing +晶jing +净jing +境jing +镜jing +景jing +警jing +劲*jing +茎jing +敬jing +惊jing +睛jing +竞jing +荆jing +兢jing +鲸jing +粳jing +痉jing +靖jing +刭jing +儆jing +阱jing +菁jing +獍jing +憬jing +泾jing +迳jing +弪jing +婧jing +肼jing +胫jing +腈jing +旌jing +靓*jing +敬爱jingai +警报jingbao +警备jingbei +精兵jingbing +精采jingcai +精彩jingcai +警察jingcha +经常jingchang +精粹jingcui +静电jingdian +经典jingdian +惊动jingdong +精度jingdu +经费jingfei +精干jinggan +竟敢jinggan +警告jinggao +经过jingguo +净化jinghua +精华jinghua +经济jingji +竞技jingji +荆棘jingji +精简jingjian +境界jingjie +警戒jingjie +经久jingjiu +惊恐jingkong +经理jingli +经历jingli +精力jingli +敬礼jingli +精练jinglian +精良jingliang +经络jingluo +精美jingmei +精密jingmi +精明jingming +进攻jingong +敬佩jingpei +精辟jingpi +景气jingqi +惊奇jingqi +精巧jingqiao +精确jingque +竟然jingran +竞赛jingsai +景色jingse +经商jingshang +精神jingshen +经手jingshou +经受jingshou +精髓jingsui +静态jingtai +惊叹jingtan +晶体jingti +警惕jingti +精通jingtong +镜头jingtou +筋骨jingu +禁锢jingu +尽管jinguan +巾帼jinguo +经委jingwei +警卫jingwei +敬畏jingwei +景物jingwu +精细jingxi +京戏jingxi +惊险jingxian +景象jingxiang +经销jingxiao +经心jingxin +精心jingxin +惊心jingxin +惊醒jingxing +竞选jingxuan +惊讶jingya +经验jingyan +敬仰jingyang +经营jingying +晶莹jingying +经由jingyou +境遇jingyu +精湛jingzhan +竞争jingzheng +精制jingzhi +径直jingzhi +精致jingzhi +静止jingzhi +净值jingzhi +竟址jingzhi +净重jingzhong +镜子jingzi +静坐jingzuo +近海jinhai +今后jinhou +近乎jinhu +进化jinhua +几年jinian +记念jinian +纪念jinian +晋级jinji +紧急jinji +近郊jinjiao +紧紧jinjin +仅仅jinjin +进军jinjun +进口jinkou +尽快jinkuai +近况jinkuang +进来jinlai +近来jinlai +尽力jinli +尽量jinliang +斤两jinliang +禁令jinling +劲旅jinlu +紧密jinmi +近年jinnian +今年jinnian +金牌jinpai +紧迫jinpo +近期jinqi +近前jinqian +金钱jinqian +尽情jinqing +进去jinqu +进取jinqu +禁区jinqu +近日jinri +今日jinri +金融jinrong +进入jinru +浸入jinru +谨慎jinshen +晋升jinsheng +今是jinshi +尽是jinshi +近视jinshi +金属jinshu +近似jinsi +紧缩jinsuo +今天jintian +津贴jintie +尽头jintou +劲头jintou +浸透jintou +进退jintui +今晚jinwan +今昔jinxi +尽心jinxin +进行jinxing +进修jinxiu +锦秀jinxiu +谨严jinyan +紧要jinyao +进展jinzhan +紧张jinzhang +今朝jinzhao +紧着jinzhe +禁止jinzhi +尽职jinzhi +进驻jinzhu +金子jinzi +炯jiong +窘jiong +迥jiong +炅*jiong +扃jiong +窘迫jiongpo +迥然jiongran +击破jipo +急迫jipo +及其jiqi +极其jiqi +激起jiqi +机器jiqi +机枪jiqiang +技巧jiqiao +急切jiqie +激情jiqing +汲取jiqu +集权jiquan +既然jiran +己任jiren +继任jiren +即日jiri +吉日jiri +肌肉jirou +极少jishao +寄生jisheng +即是jishi +及时jishi +几时jishi +计时jishi +即时jishi +即使jishi +记事jishi +基石jishi +集市jishi +级数jishu +基数jishu +计数jishu +记述jishu +技术jishu +祭祀jisi +激素jisu +急速jisu +计算jisuan +机体jiti +集体jiti +肌体jiti +几天jitian +集团jituan +寄托jituo +就jiu +九jiu +旧jiu +究jiu +久jiu +救jiu +酒jiu +纠jiu +揪jiu +玖jiu +韭jiu +灸jiu +厩jiu +臼jiu +舅jiu +咎jiu +疚jiu +僦jiu +啾jiu +阄jiu +柩jiu +桕jiu +鸠jiu +鹫jiu +赳jiu +鬏jiu +就餐jiucan +纠察jiucha +纠缠jiuchan +就此jiuci +就地jiudi +就范jiufan +纠纷jiufen +纠葛jiuge +救国jiuguo +救护jiuhu +救火jiuhuo +纠集jiuji +鸠集jiuji +救济jiuji +救急jiuji +九江jiujiang +九届jiujie +就近jiujin +酒精jiujing +究竟jiujing +救命jiuming +救生jiusheng +就是jiushi +就事jiushi +救亡jiuwang +久违jiuwei +酒窝jiuwo +酒席jiuxi +救险jiuxian +揪心jiuxin +救星jiuxing +就绪jiuxu +就学jiuxue +久仰jiuyang +就要jiuyao +就业jiuye +久远jiuyuan +九月jiuyue +救灾jiuzai +纠正jiuzheng +就职jiuzhi +救治jiuzhi +九洲jiuzhou +救助jiuzhu +极为jiwei +纪委jiwei +极限jixian +迹象jixiang +吉祥jixiang +讥笑jixiao +机械jixie +记性jixing +急性jixing +畸形jixing +即兴jixing +吉凶jixiong +几许jixu +积蓄jixu +继续jixu +记叙jixu +急需jixu +集训jixun +积压jiya +羁押jiya +给养jiyang +机要jiyao +纪要jiyao +给以jiyi +记忆jiyi +技艺jiyi +基因jiyin +急用jiyong +基于jiyu +急于jiyu +机遇jiyu +给予jiyu +寄予jiyu +觊觎jiyu +纪元jiyuan +集约jiyue +记载jizai +及早jizao +急躁jizao +激增jizeng +记帐jizhang +记者jizhe +集镇jizhen +机制jizhi +及至jizhi +机智jizhi +集中jizhong +击中jizhong +记住jizhu +基准jizhun +集资jizi +经济核算jjhs +聚精会神jjhs +将计就计jjjj +戒骄戒躁jjjz +近几年来jjnl +竭尽全力jjql +节假日jjr +积极性jjx +经济效益jjxy +兢兢业业jjyy +精简整编jjzb +叽叽喳喳jjzz +艰苦奋斗jkfd +尽可能jkn +教科书jks +俱乐部jlb +交流电jld +吉林省jls +价廉物美jlwm +纪律性jlx +纪念碑jnb +几年来jnl +近年来jnl +纪念品jnp +济南市jns +吉普车jpc +坚强不屈jqbq +奖勤罚懒jqfl +机器人jqr +急起直追jqzz +截然不同jrbt +兼容性jrx +积少成多jscd +金山公司jsgs +集思广益jsgy +精神焕发jshf +计算机jsj +尽善尽美jsjm +集市贸易jsmy +介绍人jsr +就是说jss +计算所jss +江苏省jss +举世闻名jswm +介绍信jsx +技术员jsy +计算中心jszx +交通部jtb +家庭出身jtcs +惊天动地jtdd +具体地说jtds +晶体管jtg +交通工具jtgj +脚踏实地jtsd +具体说来jtsl +具ju +据ju +局ju +举ju +车*ju +句ju +聚ju +距ju +巨ju +居ju +锯ju +剧ju +矩ju +拒ju +柜*ju +桔*ju +鞠ju +拘ju +狙ju +疽ju +驹ju +菊ju +咀ju +沮ju +踞ju +俱ju +惧ju +炬ju +倨ju +讵ju +苣ju +苴ju +莒ju +掬ju +遽ju +屦ju +琚ju +枸*ju +椐ju +榘ju +榉ju +橘ju +犋ju +飓ju +钜ju +锔ju +窭ju +裾ju +趄ju +醵ju +踽ju +龃ju +雎ju +瞿*ju +鞫ju +卷juan +捐juan +鹃juan +娟juan +倦juan +眷juan +绢juan +俊*juan +鄄juan +狷juan +涓juan +桊juan +蠲juan +锩juan +镌juan +隽juan +卷进juanjin +捐款juankuan +眷恋juanlian +眷念juannian +捐躯juanqu +卷入juanru +眷属juanshu +捐献juanxian +卷烟juanyan +卷帙juanzhi +捐助juanzhu +卷宗juanzong +举办juban +具备jubei +剧本juben +巨变jubian +局部jubu +拘捕jubu +剧场juchang +据此juci +巨大juda +举动judong +居多juduo +决jue +觉jue +绝jue +角*jue +脚*jue +掘jue +嚼*jue +撅jue +攫jue +抉jue +倔jue +爵jue +诀jue +厥jue +劂jue +谲jue +矍jue +蕨jue +嗟*jue +噘jue +噱jue +崛jue +獗jue +孓jue +珏jue +桷jue +橛jue +爝jue +镢jue +蹶jue +觖jue +巨额jue +诀别juebie +决不juebu +绝不juebu +决策juece +觉察juecha +觉得juede +决定jueding +决断jueduan +绝对juedui +绝迹jueji +倔强juejiang +绝交juejiao +绝径juejing +绝境juejing +绝句jueju +决裂juelie +绝路juelu +绝密juemi +绝妙juemiao +崛起jueqi +诀窍jueqiao +决赛juesai +绝食jueshi +决死juesi +决算juesuan +绝望juewang +爵位juewei +觉悟juewu +决心juexin +觉醒juexing +决议jueyi +绝缘jueyuan +抉择jueze +决战juezhan +绝招juezhao +绝症juezheng +巨幅jufu +居功jugong +鞠躬jugong +句号juhao +聚合juhe +聚会juhui +聚集juji +巨匠jujiang +拘谨jujin +拒绝jujue +咀嚼jujue +距离juli +举例juli +剧烈julie +拘留juliu +局面jumian +居民jumin +剧目jumu +军jun +均jun +菌jun +君jun +龟*jun +钧jun +峻jun +俊jun +竣jun +浚jun +郡jun +骏jun +捃jun +皲jun +筠jun +麇jun +军操juncao +君臣junchen +均等jundeng +军队jundui +军法junfa +军阀junfa +军服junfu +军港jungang +军工jungong +竣工jungong +均衡junheng +军火junhuo +拘泥juni +军机junji +军纪junji +军舰junjian +俊杰junjie +军垦junken +军粮junliang +军令junling +骏马junma +军民junmin +军旗junqi +峻峭junqiao +俊俏junqiao +军区junqu +军权junquan +军人junren +军事junshi +军师junshi +军属junshu +军团juntuan +军委junwei +军衔junxian +军校junxiao +军械junxie +军心junxin +俊秀junxiu +军需junxu +军训junxun +军医junyi +军营junying +军用junyong +军邮junyou +均匀junyun +军长junzhang +军政junzheng +君主junzhu +军装junzhuang +君子junzi +俱全juquan +居然juran +遽然juran +沮丧jusang +局势jushi +举手jushou +拘束jushu +据说jushuo +具体juti +剧团jutuan +据悉juxi +局限juxian +居心juxin +举行juxing +矩形juxing +巨型juxing +具有juyou +据有juyou +剧院juyuan +局长juzhang +剧照juzhao +举止juzhi +居中juzhong +剧终juzhong +巨著juzhu +居住juzhu +句子juzi +节外生枝jwsz +惊心动魄jxdp +继续革命jxgm +机械化jxh +江西省jxs +谨小慎微jxsw +局限性jxx +教育部jyb +进一步jyb +家用电器jydq +教育方针jyfz +家喻户晓jyhx +加以解决jyjj +记忆力jyl +精益求精jyqj +教研室jys +见义勇为jyyw +旧中国jzg +建筑物jzw +可k +开k +看k +克k +孔k +科k +口k +空k +苦k +快k +考k +刻k +靠k +况k +块k +困k +宽k +矿k +抗k +卡k +卡ka +喀ka +咖ka +咯ka +佧ka +咔ka +胩ka +喀嚓kacha +卡车kache +咖啡kafei +开kai +凯kai +揩kai +楷kai +慨kai +剀kai +垲kai +蒈kai +忾kai +恺kai +铠kai +锎kai +锴kai +开办kaiban +开遍kaibian +开采kaicai +开场kaichang +开车kaiche +开除kaichu +开创kaichuang +开导kaidao +开刀kaidao +开动kaidong +开端kaiduan +开发kaifa +开放kaifang +开封kaifeng +开赴kaifu +凯歌kaige +开关kaiguan +开航kaihang +开户kaihu +开花kaihua +开怀kaihuai +开荒kaihuang +开会kaihui +开掘kaijue +开垦kaiken +开口kaikou +开矿kaikuang +开阔kaikuo +开朗kailang +开郎kailang +开路kailu +开明kaiming +楷模kaimo +开幕kaimu +开炮kaipao +开辟kaipi +开启kaiqi +开枪kaiqiang +开窍kaiqiao +开设kaishe +开始kaishi +开庭kaiting +开头kaitou +开脱kaituo +开拓kaituo +开外kaiwai +开销kaixiao +开心kaixin +凯旋kaixuan +开学kaixue +开颜kaiyan +开业kaiye +开战kaizhan +开展kaizhan +开张kaizhang +开支kaizhi +看kan +刊kan +坎kan +槛*kan +堪kan +勘kan +砍kan +嵌*kan +侃kan +莰kan +阚*kan +戡kan +龛kan +瞰kan +勘测kance +勘察kancha +看出kanchu +看待kandai +看到kandao +刊登kandeng +看法kanfa +砍伐kanfa +抗kang +康kang +炕kang +慷kang +糠kang +扛kang +亢kang +伉kang +闶kang +钪kang +亢奋kangfen +康复kangfu +抗衡kangheng +抗击kangji +亢进kangjin +抗拒kangju +伉俪kangli +抗日kangri +看管kanguan +抗议kangyi +看见kanjian +坎坷kanke +看来kanlai +看齐kanqi +刊头kantou +看望kanwang +刊物kanwu +勘误kanwu +看样kanyang +刊载kanzai +考kao +靠kao +拷kao +烤kao +尻kao +栲kao +犒kao +铐kao +拷贝kaobei +靠边kaobian +考查kaocha +考察kaocha +考核kaohe +靠近kaojin +考究kaojiu +靠拢kaolong +考虑kaolu +考勤kaoqin +靠山kaoshan +考试kaoshi +考题kaoti +考验kaoyan +考证kaozheng +卡片kapian +看不惯kbg +看不起kbq +刻不容缓kbrh +开诚布公kcbg +矿产资源kczy +扩大化kdh +可ke +克ke +科ke +刻ke +客ke +壳ke +颗ke +棵ke +柯ke +呵*ke +坷ke +苛ke +磕ke +咳ke +渴ke +课ke +嗑ke +岢ke +恪ke +溘ke +骒ke +缂ke +珂ke +轲ke +氪ke +瞌ke +钶ke +锞ke +稞ke +疴ke +窠ke +颏ke +蝌ke +髁ke +可爱keai +科班keban +课本keben +可比kebi +刻薄kebo +可不kebu +客车keche +课程kecheng +可耻kechi +可恶kee +可风kefeng +可否kefou +克服kefu +可观keguan +客观keguan +可贵kegui +可好kehao +可恨kehen +刻划kehua +刻画kehua +克己keji +客机keji +科技keji +可见kejian +科教kejiao +可敬kejing +窠臼kejiu +科举keju +可靠kekao +苛刻keke +可口kekou +克扣kekou +刻苦keku +克拉kela +克朗kelang +颗粒keli +可怜kelian +科目kemu +肯ken +啃ken +垦ken +恳ken +裉ken +肯定kending +可能keneng +坑keng +吭keng +铿keng +坑道kengdao +坑害kenghai +铿锵kengqiang +恳切kenqie +恳求kenqiu +垦殖kenzhi +可怕kepa +磕碰kepeng +科普kepu +客气keqi +可亲keqin +可取kequ +客人keren +客商keshang +可是keshi +科室keshi +课堂ketang +客套ketao +课题keti +客体keti +客厅keting +磕头ketou +可望kewang +渴望kewang +可喜kexi +可惜kexi +可行kexing +科学kexue +科研keyan +可以keyi +可疑keyi +刻意keyi +科员keyuan +科长kezhang +可知kezhi +克制kezhi +狂风暴雨kfby +克己奉公kjfg +科技司kjs +苦口婆心kkpx +昆明市kms +可能性knx +孔kong +空kong +控kong +恐kong +倥kong +崆kong +箜kong +空白kongbai +恐怖kongbu +控拆kongchai +空洞kongdong +空额konge +空乏kongfa +控告konggao +空喊konghan +恐吓konghe +空话konghua +恐慌konghuang +空间kongjian +空降kongjiang +恐惧kongju +空军kongjun +空旷kongkuang +恐龙konglong +空虑konglu +恐怕kongpa +空气kongqi +空前kongqian +孔雀kongque +控诉kongsu +空谈kongtan +空头kongtou +空文kongwen +空隙kongxi +空闲kongxian +空想kongxiang +空虚kongxu +空运kongyun +控制kongzhi +空中kongzhong +口kou +扣kou +抠kou +寇kou +芤kou +蔻kou +叩kou +眍kou +筘kou +口岸kouan +叩拜koubai +口才koucai +扣除kouchu +口传kouchuan +口服koufu +口供kougong +口号kouhao +口红kouhong +口角koujiao +口径koujing +口诀koujue +口令kouling +扣留kouliu +口气kouqi +口腔kouqiang +口哨koushao +口试koushi +口述koushu +口头koutou +叩头koutou +口信kouxin +扣押kouya +口语kouyu +看起来kql +口若悬河krxh +口是心非ksxf +苦ku +库ku +枯ku +酷ku +哭ku +窟ku +裤ku +刳ku +堀ku +喾ku +绔ku +骷ku +跨kua +夸kua +垮kua +挎kua +胯kua +侉kua +跨步kuabu +夸大kuada +跨度kuadu +会*kuai +快kuai +块kuai +筷kuai +侩kuai +蒯kuai +郐kuai +哙kuai +狯kuai +浍*kuai +脍kuai +会计kuaiji +快乐kuaile +快速kuaisu +宽kuan +款kuan +髋kuan +宽敞kuanchang +宽绰kuanchuo +宽大kuanda +宽待kuandai +款待kuandai +宽度kuandu +况kuang +矿kuang +狂kuang +框kuang +匡kuang +筐kuang +眶kuang +旷kuang +诓kuang +诳kuang +邝kuang +圹kuang +夼kuang +哐kuang +纩kuang +贶kuang +矿藏kuangcang +矿产kuangchan +狂风kuangfeng +矿工kuanggong +旷工kuanggong +矿井kuangjing +框框kuangkuang +哐啷kuanglang +况且kuangqie +矿区kuangqu +矿泉kuangquan +狂热kuangre +矿山kuangshan +矿石kuangshi +框图kuangtu +宽广kuanguang +狂妄kuangwang +矿物kuangwu +旷野kuangye +宽宏kuanhong +宽厚kuanhou +宽阔kuankuo +宽容kuanrong +款式kuanshi +宽恕kuanshu +款项kuanxiang +宽心kuanxin +宽裕kuanyu +垮台kuatai +跨越kuayue +夸张kuazhang +裤衩kucha +库存kucun +哭喊kuhan +奎kui +溃kui +馈kui +亏kui +盔kui +岿kui +窥kui +葵kui +魁kui +傀kui +愧kui +馗kui +匮kui +夔kui +隗kui +蒉kui +揆kui +喹kui +喟kui +悝kui +愦kui +逵kui +暌kui +睽kui +聩kui +蝰kui +篑kui +跬kui +亏本kuiben +窥测kuice +亏待kuidai +愧疚kuijiu +亏空kuikong +亏损kuisun +魁梧kuiwu +溃疡kuiyang +枯竭kujie +库仑kulun +苦闷kumen +枯木kumu +困kun +昆kun +坤kun +捆kun +悃kun +阃kun +琨kun +锟kun +醌kun +鲲kun +髡kun +苦难kunan +苦恼kunao +困厄kune +困乏kunfa +困惑kunhuo +困境kunjing +困苦kunku +昆明kunming +困难kunnan +扩kuo +括kuo +适*kuo +阔kuo +廓kuo +栝*kuo +蛞kuo +阔别kuobie +扩充kuochong +阔绰kuochuo +扩大kuoda +括号kuohao +扩建kuojian +阔气kuoqi +扩展kuozhan +扩张kuozhang +哭泣kuqi +酷暑kushu +苦头kutou +苦维kuwei +枯萎kuwei +酷刑kuxing +苦于kuyu +枯燥kuzao +可想而知kxez +科学家kxj +科学技术kxjs +可行性kxx +科学院kxy +科研部kyb +开源节流kyjl +看样子kyz +了l +来l +量l +理l +路l +里l +论l +两l +利l +领l +流l +力l +立l +料l +连l +老l +六l +轮l +类l +列l +拉la +落*la +啦la +蜡la +腊la +蓝la +垃la +喇la +辣la +剌la +邋la +旯la +砬la +瘌la +喇叭laba +来lai +赖lai +莱lai +崃lai +徕lai +涞lai +濑lai +赉lai +睐lai +铼lai +癞lai +籁lai +来宾laibin +来到laidao +来犯laifan +来访laifang +来函laihan +来回laihui +来历laili +来临lailin +赖皮laipi +来日lairi +来势laishi +来头laitou +来往laiwang +来信laixin +来源laiyuan +来者laizhe +来自laizi +癞子laizi +辣椒lajiao +拉拢lalong +喇嘛lama +腊梅lamei +兰lan +烂lan +蓝lan +览lan +栏lan +婪lan +拦lan +篮lan +阑lan +澜lan +谰lan +揽lan +懒lan +缆lan +滥lan +岚lan +漤lan +榄lan +斓lan +罱lan +镧lan +褴lan +蓝本lanben +懒怠landai +滥调landiao +懒惰landuo +浪lang +朗lang +郎lang +狼lang +琅lang +榔lang +廊lang +莨lang +蒗lang +啷lang +阆lang +锒lang +稂lang +螂lang +栏杆langan +狼狈langbei +浪潮langchao +浪荡langdang +朗读langdu +浪费langfei +狼藉langji +浪漫langman +朗诵langsong +郎中langzhong +兰花lanhua +拦截lanjie +烂漫lanman +懒散lansan +蓝色lanse +缆绳lansheng +烂熟lanshu +蓝天lantian +蓝图lantu +阑尾lanwei +拦腰lanyao +滥用lanyong +兰州lanzhou +老lao +劳lao +落*lao +牢lao +涝lao +捞lao +络*lao +佬lao +姥lao +酪lao +烙lao +潦*lao +唠lao +崂lao +栳lao +铑lao +铹lao +痨lao +耢lao +醪lao +老板laoban +老伴laoban +老本laoben +劳动laodong +牢固laogu +老汉laohan +老化laohua +牢记laoji +劳驾laojia +牢靠laokao +劳苦laoku +牢牢laolao +劳累laolei +劳力laoli +老练laolian +牢笼laolong +劳模laomo +老年laonian +老人laoren +牢骚laosao +老少laoshao +老是laoshi +老实laoshi +老师laoshi +老乡laoxiang +老爷laoye +烙印laoyin +劳支laozhi +劳资laozi +劳作laozuo +腊月layue +狼狈不堪lbbk +力不从心lbcx +来不及lbj +来不了lbl +了不起lbq +劳动保险ldbx +来得及ldj +劳动量ldl +劳动力ldl +灵丹妙药ldmy +拉丁美洲ldmz +劳动者ldz +劳动致富ldzf +了le +乐le +勒le +肋le +仂le +叻le +泐le +鳓le +乐观leguan +类lei +雷lei +累lei +勒*lei +垒lei +泪lei +镭lei +蕾lei +磊lei +儡lei +擂lei +肋lei +羸lei +诔lei +嘞lei +嫘lei +缧lei +檑lei +耒lei +酹lei +类别leibie +类次leici +雷达leida +雷管leiguan +泪痕leihen +泪花leihua +累积leiji +累计leiji +累进leijin +磊落leiluo +累年leinian +类似leisi +擂台leitai +雷同leitong +类推leitui +类型leixing +雷雨leiyu +累月leiyue +累赘leizhui +勒令leling +冷leng +棱leng +楞leng +塄leng +愣leng +冷藏lengcang +冷淡lengdan +冷宫lenggong +棱角lengjiao +冷静lengjing +冷落lengluo +冷门lengmen +冷漠lengmo +冷暖lengnuan +冷僻lengpi +冷气lengqi +冷却lengque +冷水lengshui +冷遇lengyu +乐趣lequ +勒索lesuo +乐意leyi +乐园leyuan +两个文明lgwm +拉关系lgx +联合国lhg +联合会lhh +两回事lhs +联合体lht +理li +里li +利li +力li +立li +离li +例li +历li +粒li +厘li +礼li +李li +隶li +黎li +璃li +励li +犁li +梨li +丽li +厉li +篱li +狸li +漓li +鲤li +莉li +荔li +吏li +栗li +砾li +傈li +俐li +痢li +沥li +哩li +鬲*li +俪li +俚li +郦li +坜li +苈li +莅li +蓠li +藜li +呖li +唳li +喱li +猁li +悝*li +溧li +澧li +逦li +娌li +嫠li +骊li +缡li +枥li +栎li +轹li +戾li +砺li +詈li +罹li +锂li +鹂li +疠li +疬li +蛎li +蜊li +蠡li +笠li +篥li +粝li +醴li +跞li +雳li +鲡li +鳢li +黧li +俩lia +连lian +联lian +练lian +炼lian +脸lian +链lian +莲lian +镰lian +廉lian +怜lian +涟lian +帘lian +敛lian +恋lian +蔹lian +奁lian +潋lian +濂lian +琏lian +楝lian +殓lian +臁lian +裢lian +裣lian +蠊lian +鲢lian +立案lian +恋爱lianai +联邦lianbang +练兵lianbing +联播lianbo +练达lianda +连队liandui +量liang +两liang +粮liang +良liang +亮liang +梁liang +凉liang +辆liang +粱liang +晾liang +谅liang +墚liang +莨*liang +椋liang +踉liang +靓liang +魉liang +炼钢liangang +两半liangban +量变liangbian +两边liangbian +两便liangbian +两侧liangce +两次liangci +两地liangdi +两点liangdian +量度liangdu +良方liangfang +两广liangguang +良好lianghao +两极liangji +良机liangji +谅解liangjie +量具liangju +凉快liangkuai +两立liangli +两面liangmian +练功liangong +两栖liangqi +两讫liangqi +两全liangquan +粮食liangshi +两手liangshou +凉爽liangshuang +亮堂liangtang +两条liangtiao +两头liangtou +连贯lianguan +联贯lianguan +亮相liangxiang +良心liangxin +两性liangxing +量刑liangxing +两样liangyang +粮油liangyou +良缘liangyuan +粮站liangzhan +两者liangzhe +两重liangzhong +良种liangzhong +量子liangzi +联合lianhe +联欢lianhuan +廉价lianjia +联结lianjie +连接lianjie +联接lianjie +廉洁lianjie +联军lianjun +连累lianlei +联络lianluo +连忙lianmang +联盟lianmeng +怜悯lianmin +连年liannian +脸谱lianpu +连日lianri +炼乳lianru +联赛liansai +脸色lianse +连锁liansuo +练武lianwu +联系lianxi +练习lianxi +怜惜lianxi +联想lianxiang +连续lianxu +涟漪lianyi +联姻lianyin +联营lianying +炼油lianyou +联运lianyun +连载lianzai +了*liao +料liao +疗liao +辽liao +僚liao +撩liao +聊liao +燎liao +寥liao +潦liao +撂liao +镣liao +廖liao +蓼liao +尥liao +嘹liao +獠liao +寮liao +缭liao +钌liao +鹩liao +撩拨liaobo +潦草liaocao +疗程liaocheng +料到liaodao +潦倒liaodao +料定liaoding +了结liaojie +了解liaojie +辽阔liaokuo +料理liaoli +寥寥liaoliao +寥落liaoluo +辽宁liaoning +了却liaoque +了事liaoshi +聊天liaotian +料想liaoxiang +疗养liaoyang +礼拜libai +利弊libi +里边libian +理财licai +理睬licai +立场lichang +里程licheng +历程licheng +立春lichun +历次lici +历代lidai +理当lidang +立冬lidong +列lie +裂lie +烈lie +劣lie +猎lie +冽lie +埒lie +捩lie +咧lie +洌lie +趔lie +躐lie +鬣lie +裂变liebian +列车lieche +列出liechu +列岛liedao +裂缝liefeng +列国lieguo +烈火liehuo +劣迹lieji +列举lieju +裂开liekai +裂口liekou +列宁liening +猎奇lieqi +列强lieqiang +猎取liequ +烈日lieri +列入lieru +劣绅lieshen +烈士lieshi +劣势lieshi +烈属lieshu +裂纹liewen +列席liexi +烈性liexing +立法lifa +立方lifang +礼服lifu +立功ligong +利害lihai +厉害lihai +理化lihua +礼花lihua +理会lihui +离婚lihun +立即liji +理解lijie +礼节lijie +历届lijie +力矩liju +离开likai +理科like +立刻like +理亏likui +历来lilai +历历lili +力量liliang +利率lilu +理论lilun +立论lilun +礼貌limao +里面limian +利民limin +黎民limin +黎明liming +林lin +磷lin +临lin +邻lin +淋lin +麟lin +琳lin +霖lin +鳞lin +凛lin +赁lin +吝lin +蔺lin +啉lin +嶙lin +廪lin +懔lin +遴lin +檩lin +辚lin +膦lin +瞵lin +粼lin +躏lin +淋巴linba +临别linbie +淋病linbing +林场linchang +临床linchuang +临到lindao +领ling +另ling +零ling +令ling +灵ling +岭ling +铃ling +龄ling +凌ling +棱*ling +陵ling +拎ling +玲ling +菱ling +伶ling +羚ling +酃ling +苓ling +呤ling +囹ling +泠ling +绫ling +柃ling +棂ling +瓴ling +聆ling +蛉ling +翎ling +鲮ling +令爱lingai +凌晨lingchen +灵丹lingdan +领导lingdao +领地lingdi +零点lingdian +领队lingdui +灵感linggan +领海linghai +领航linghang +领会linghui +灵魂linghun +灵活linghuo +灵机lingji +零件lingjian +领教lingjiao +灵杰lingjie +领空lingkong +凌空lingkong +玲珑linglong +零乱lingluan +凌乱lingluan +领略linglue +灵敏lingmin +陵墓lingmu +灵巧lingqiao +领取lingqu +令人lingren +凌辱lingru +零散lingsan +领事lingshi +领受lingshou +领司lingsi +零碎lingsui +灵堂lingtang +零头lingtou +领土lingtu +磷光linguang +另外lingwai +领悟lingwu +领先lingxian +领衔lingxian +零星lingxing +领袖lingxiu +另选lingxuan +灵验lingyan +领域lingyu +令尊lingzun +磷火linhuo +历年linian +临界linjie +临近linjin +邻近linjin +邻里linli +淋漓linli +凛冽linlie +临摹linmo +里弄linong +鳞伤linshang +临时linshi +临死linsi +吝惜linxi +临行linxing +林业linye +临战linzhan +临终linzhong +礼炮lipao +李鹏lipeng +礼品lipin +力气liqi +离奇liqi +力求liqiu +立秋liqiu +历任liren +例如liru +利润lirun +离散lisan +理事lishi +历史lishi +隶属lishu +礼堂litang +立体liti +例题liti +力图litu +流liu +六liu +留liu +刘liu +硫liu +柳liu +陆*liu +馏liu +瘤liu +溜liu +琉liu +榴liu +碌*liu +浏liu +遛liu +骝liu +绺liu +旒liu +熘liu +锍liu +镏liu +鹨liu +鎏liu +留步liubu +流产liuchan +流畅liuchang +流程liucheng +流传liuchuan +流窜liucuan +流动liudong +流毒liudu +流放liufang +六届liujie +浏览liulan +流利liuli +留恋liulian +流露liulu +流落liuluo +流氓liumang +留念liunian +流失liushi +流逝liushi +流体liuti +流通liutong +流亡liuwang +流泻liuxie +留心liuxin +流行liuxing +流星liuxing +留学liuxue +流血liuxue +流言liuyan +留言liuyan +留洋liuyang +留影liuying +留用liuyong +流域liuyu +六月liuyue +流转liuzhuan +例外liwai +礼物liwu +利息lixi +立夏lixia +理想lixiang +立新lixin +离心lixin +理性lixing +力行lixing +厉行lixing +离休lixiu +立意liyi +利益liyi +离异liyi +利用liyong +理由liyou +力争lizheng +立正lizheng +理智lizhi +立志lizhi +离职lizhi +例子lizi +粒子lizi +立足lizu +屡见不鲜ljbx +两极分化ljfh +逻辑设计ljsj +逻辑思维ljsw +逻辑性ljx +灵机一动ljyd +落落大方lldf +拦路虎llh +来龙去脉llqm +零零碎碎llss +来来往往llww +联绵不断lmbd +灵敏度lmd +辽宁省lns +列宁主义lnzy +龙long +垄long +弄*long +笼long +隆long +聋long +咙long +窿long +拢long +陇long +垅long +茏long +泷long +珑long +栊long +胧long +砻long +癃long +隆冬longdong +垄断longduan +隆隆longlong +笼络longluo +笼统longtong +笼罩longzhao +隆重longzhong +漏lou +露*lou +楼lou +娄lou +搂lou +篓lou +陋lou +偻lou +蒌lou +喽lou +嵝lou +镂lou +瘘lou +耧lou +蝼lou +髅lou +漏洞loudong +漏斗loudou +镂空loukong +漏网louwang +来日方长lrfc +来人来函lrlh +了如指掌lrzz +理所当然lsdr +连锁反应lsfy +领事馆lsg +理事会lsh +力所能及lsnj +拉萨市lss +流水线lsx +良师益友lsyy +路lu +六*lu +率lu +露lu +绿lu +炉lu +律lu +虑lu +滤lu +陆lu +氯lu +鲁lu +铝lu +录lu +旅lu +卢lu +吕lu +芦lu +颅lu +庐lu +掳lu +卤lu +虏lu +麓lu +碌lu +赂lu +鹿lu +潞lu +禄lu +戮lu +驴lu +侣lu +履lu +屡lu +缕lu +垆lu +蓼*lu +撸lu +噜lu +闾lu +泸lu +渌lu +漉lu +逯lu +璐lu +栌lu +榈lu +橹lu +轳lu +辂lu +辘lu +氇lu +胪lu +膂lu +镥lu +稆lu +鸬lu +鹭lu +褛lu +簏lu +舻lu +鲈lu +卵luan +乱luan +峦luan +挛luan +孪luan +滦luan +脔luan +娈luan +栾luan +鸾luan +銮luan +卵巢luanchao +乱伦luanlun +乱子luanzi +旅伴luban +路标lubiao +路程lucheng +旅程lucheng +露出luchu +屡次luci +陆地ludi +露底ludi +旅店ludian +略lue +掠lue +锊lue +掠夺lueduo +旅费lufei +露骨lugu +旅馆luguan +路过luguo +绿化luhua +炉火luhuo +路径lujing +路局luju +陆军lujun +旅客luke +履历luli +率领luling +鲁莽lumang +露面lumian +论lun +轮lun +伦lun +抡lun +仑lun +沦lun +纶lun +囵lun +论处lunchu +轮船lunchuan +论点lundian +论调lundiao +伦敦lundun +轮换lunhuan +论据lunju +轮廓lunkuo +论理lunli +伦理lunli +轮流lunliu +论述lunshu +轮胎luntai +论坛luntan +沦为lunwei +论文lunwen +沦陷lunxian +轮训lunxun +论战lunzhan +论正lunzheng +论证lunzheng +轮轴lunzhou +论著lunzhu +落luo +罗luo +螺luo +洛luo +络luo +逻luo +咯*luo +烙*luo +萝luo +锣luo +箩luo +骡luo +裸luo +骆luo +倮luo +蠃luo +荦luo +捋luo +摞luo +猡luo +泺luo +漯luo +珞luo +椤luo +脶luo +硌*luo +镙luo +瘰luo +雒luo +萝卜luobu +落成luocheng +螺钉luoding +罗汉luohan +落后luohou +落户luohu +逻辑luoji +落空luokong +落款luokuan +箩筐luokuang +罗列luolie +罗马luoma +螺母luomu +罗盘luopan +落泊luopo +落实luoshi +螺栓luoshuan +裸体luoti +骆驼luotuo +罗网luowang +螺纹luowen +落伍luowu +落选luoxuan +螺旋luoxuan +络绎luoyi +录取luqu +路人luren +绿色luse +庐山lushan +旅社lushe +律师lushi +露天lutian +路途lutu +旅途lutu +路线luxian +率先luxian +录像luxiang +旅行luxing +履行luxing +陆续luxu +录音luyin +绿荫luyin +录用luyong +旅游luyou +绿洲luzhou +露珠luzhu +路子luzi +炉子luzi +另行安排lxap +例行公事lxgs +联系人lxr +留学生lxs +另行通知lxtz +林业部lyb +老一辈lyb +另一方面lyfm +劳逸结合lyjh +利用率lyl +老一套lyt +留有余地lyyd +来者不拒lzbj +立足点lzd +老中青lzq +理直气壮lzqz +兰州市lzs +两重性lzx +面m +命m +们m +民m +毛m +没m +米m +明m +马m +么m +每m +门m +名m +磨m +美m +密m +苗m +满m +亩m +目m +呒m +马ma +么*ma +麻ma +吗ma +妈ma +骂ma +嘛ma +码ma +摩*ma +抹*ma +玛ma +蚂ma +唛ma +犸ma +嬷ma +杩ma +蟆ma +马鞍maan +麻痹mabi +马达mada +麻烦mafan +麻纺mafang +马虎mahu +麦mai +脉mai +卖mai +买mai +埋mai +迈mai +劢mai +荬mai +霾mai +买办maiban +脉搏maibo +迈步maibu +埋藏maicang +脉冲maichong +脉动maidong +埋伏maifu +卖国maiguo +脉络mailuo +买卖maimai +卖命maiming +埋没maimo +卖弄mainong +埋头maitou +卖淫maiyin +埋怨maiyuan +埋葬maizang +买帐maizhang +卖座maizuo +马力mali +麻利mali +马路malu +妈妈mama +麻木mamu +满man +慢man +曼man +漫man +蔓man +瞒man +馒man +蛮man +谩man +墁man +幔man +缦man +熳man +镘man +颟man +螨man +鳗man +鞔man +漫长manchang +忙mang +芒mang +盲mang +茫mang +氓mang +莽mang +邙mang +漭mang +硭mang +蟒mang +忙碌manglu +莽莽mangmang +盲目mangmu +茫然mangran +盲人mangren +忙于mangyu +莽原mangyuan +蛮横manheng +漫画manhua +满怀manhuai +谩骂manma +满目manmu +满腔manqiang +蔓延manyan +满意manyi +满载manzai +满足manzu +毛mao +矛mao +冒mao +貌mao +贸mao +帽mao +猫mao +茅mao +锚mao +铆mao +卯mao +茂mao +袤mao +茆mao +峁mao +泖mao +瑁mao +昴mao +牦mao +耄mao +旄mao +懋mao +瞀mao +蟊mao +髦mao +毛病maobing +毛糙maocao +冒充maochong +铆钉maoding +矛盾maodun +冒犯maofan +毛纺maofang +冒号maohao +冒尖maojian +冒进maojin +茅坑maokeng +毛利maoli +冒昧maomei +茂密maomi +冒牌maopai +毛坯maopi +贸然maoran +茂盛maosheng +冒失maoshi +矛头maotou +冒险maoxian +贸易maoyi +冒雨maoyu +毛重maozhong +帽子maozi +马上mashang +马桶matong +码头matou +马戏maxi +麻醉mazui +免不了mbl +明辨是非mbsf +满不在乎mbzh +默不作声mbzs +满城风雨mcfy +目的地mdd +目瞪口呆mdkd +描淡写mdx +么me +麽me +秘而不宣mebx +没mei +每mei +美mei +煤mei +霉mei +酶mei +梅mei +妹mei +眉mei +玫mei +枚mei +媒mei +镁mei +昧mei +寐mei +媚mei +糜*mei +谜*mei +莓mei +嵋mei +猸mei +浼mei +湄mei +楣mei +镅mei +鹛mei +袂mei +魅mei +每次meici +每当meidang +美德meide +没法meifa +每逢meifeng +每个meige +美观meiguan +玫瑰meigui +美国meiguo +美好meihao +美化meihua +媒介meijie +眉睫meijie +枚举meiju +煤矿meikuang +霉烂meilan +魅力meili +美丽meili +美满meiman +眉毛meimao +美貌meimao +妹妹meimei +美妙meimiao +眉目meimu +每年meinian +煤气meiqi +每人meiren +每日meiri +美容meirong +眉梢meishao +每时meishi +美术meishu +媒妁meishuo +煤炭meitan +每天meitian +煤田meitian +美学meixue +没有meiyou +煤油meiyou +美元meiyuan +每月meiyue +没治meizhi +每周meizhou +们men +门men +闷men +扪men +焖men +懑men +钔men +门房menfang +孟meng +猛meng +蒙meng +盟meng +梦meng +萌meng +锰meng +氓*meng +檬meng +勐meng +甍meng +瞢meng +懵meng +朦meng +礞meng +虻meng +蜢meng +蠓meng +艋meng +艨meng +蒙蔽mengbi +萌发mengfa +蒙古menggu +盟国mengguo +梦幻menghuan +蒙混menghun +梦见mengjian +猛进mengjin +梦境mengjing +猛烈menglie +蒙胧menglong +蒙昧mengmei +猛然mengran +萌生mengsheng +猛士mengshi +蒙受mengshou +梦想mengxiang +梦乡mengxiang +猛醒mengxing +萌芽mengya +盟友mengyou +盟约mengyue +猛增mengzeng +门户menhu +门路menlu +门牌menpai +门票menpiao +闷气menqi +门诊menzhen +名副其实mfqs +眉飞色舞mfsw +没关系mgx +蒙古族mgz +蒙混过关mhgg +米mi +密mi +迷mi +蜜mi +秘mi +眯mi +醚mi +靡mi +糜mi +谜mi +弥mi +觅mi +泌mi +幂mi +芈mi +谧mi +蘼mi +咪mi +嘧mi +猕mi +汨mi +宓mi +弭mi +脒mi +祢mi +敉mi +糸mi +縻mi +麋mi +面mian +棉mian +免mian +绵mian +眠mian +冕mian +勉mian +娩mian +缅mian +沔mian +渑mian +湎mian +腼mian +眄mian +面部mianbu +免除mianchu +免得miande +面对miandui +面额miane +棉花mianhua +缅怀mianhuai +面积mianji +面具mianju +面孔miankong +勉励mianli +面临mianlin +面貌mianmao +面面mianmian +绵绵mianmian +面目mianmu +面庞mianpang +面前mianqian +勉强mianqiang +面容mianrong +面色mianse +棉纱miansha +面授mianshou +免税mianshui +面谈miantan +面向mianxiang +免刑mianxing +棉絮mianxu +绵延mianyan +面议mianyi +免疫mianyi +面罩mianzhao +免职mianzhi +面子mianzi +苗miao +秒miao +描miao +庙miao +妙miao +瞄miao +藐miao +渺miao +喵miao +邈miao +缈miao +缪miao +杪miao +淼miao +眇miao +鹋miao +秒表miaobiao +描绘miaohui +妙龄miaoling +渺茫miaomang +描摹miaomo +藐视miaoshi +描述miaoshu +苗条miaotiao +苗头miaotou +描写miaoxie +瞄准miaozhun +弥补mibu +谜底midi +密度midu +灭mie +蔑mie +乜*mie +咩mie +蠛mie +篾mie +灭火miehuo +灭迹mieji +灭绝miejue +灭口miekou +蔑视mieshi +灭亡miewang +密封mifeng +蜜蜂mifeng +眯缝mifeng +迷航mihang +迷糊mihu +迷惑mihuo +密集miji +密件mijian +迷津mijin +秘诀mijue +糜烂milan +迷恋milian +密令miling +迷路milu +密码mima +迷漫miman +弥漫miman +秘密mimi +汨汨mimi +谜面mimian +密谋mimou +民min +敏min +抿min +皿min +悯min +闽min +苠min +岷min +闵min +泯min +缗min +玟min +珉min +愍min +黾min +鳘min +民办minban +民兵minbing +民法minfa +民愤minfen +民风minfeng +命ming +明ming +名ming +鸣ming +螟ming +盟*ming +铭ming +冥ming +茗ming +溟ming +暝ming +瞑ming +酩ming +敏感mingan +明白mingbai +名册mingce +名称mingcheng +明处mingchu +名次mingci +名词mingci +名单mingdan +明灯mingdeng +民歌minge +名额minge +名贵minggui +铭记mingji +名家mingjia +铭刻mingke +明快mingkuai +明朗minglang +名利mingli +明亮mingliang +明了mingliao +命令mingling +名流mingliu +明码mingma +明媚mingmei +明明mingming +名目mingmu +明年mingnian +名牌mingpai +名片mingpian +名气mingqi +明确mingque +明人mingren +名人mingren +名胜mingsheng +名声mingsheng +名堂mingtang +明天mingtian +名望mingwang +明文mingwen +明细mingxi +明显mingxian +鸣谢mingxie +明星mingxing +名言mingyan +名义mingyi +名誉mingyu +命运mingyun +明知mingzhi +明智mingzhi +明珠mingzhu +名著mingzhu +名字mingzi +民航minhang +民间minjian +敏捷minjie +民警minjing +民情minqing +敏锐minrui +民事minshi +民心minxin +民意minyi +民用minyong +民运minyun +民政minzheng +民众minzhong +民主minzhu +民族minzu +密切miqie +迷人miren +迷失mishi +秘书mishu +密探mitan +迷途mitu +谬miu +谬论miulun +谬误miuwu +迷惘miwang +迷雾miwu +迷信mixin +密友miyou +谜语miyu +蜜月miyue +马克思mks +眉开眼笑mkyx +马列主义mlzy +满面春风mmcf +马马虎虎mmhh +面面俱到mmjd +莫名其妙mmqm +默默无闻mmww +明目张胆mmzd +无*mo +磨mo +没*mo +万*mo +末mo +模mo +膜mo +摸mo +墨mo +摩mo +脉*mo +莫mo +抹mo +冒*mo +默mo +貉*mo +嘿*mo +摹mo +蘑mo +魔mo +沫mo +漠mo +寞mo +陌mo +谟mo +茉mo +蓦mo +馍mo +嫫mo +殁mo +镆mo +秣mo +瘼mo +耱mo +貊mo +貘mo +默哀moai +莫不mobu +磨擦moca +摩擦moca +磨蹭moceng +莫大moda +磨刀modao +摩登modeng +摸底modi +模范mofan +模仿mofang +摹仿mofang +莫非mofei +魔鬼mogui +模糊mohu +墨迹moji +模块mokuai +磨砺moli +磨练molian +末了moliao +末路molu +没落moluo +磨灭momie +默默momo +磨难monan +模拟moni +摹拟moni +末期moqi +默契moqi +默然moran +漠然moran +默认moren +末日mori +莫如moru +抹杀mosha +抹煞mosha +末梢moshao +陌生mosheng +模式moshi +没收moshou +魔术moshu +磨损mosun +摸索mosuo +模特mote +摩托motuo +某mou +谋mou +牟mou +侔mou +哞mou +缪*mou +眸mou +蛑mou +蝥mou +鍪mou +某地moudi +某个mouge +谋害mouhai +谋划mouhua +某军moujun +牟利mouli +谋略moulue +谋求mouqiu +牟取mouqu +谋杀mousha +谋生mousheng +某些mouxie +末尾mowei +默写moxie +模型moxing +默许moxu +模样moyang +魔掌mozhang +模子mozi +妙趣横生mqhs +门市部msb +名胜古迹msgj +妙手回春mshc +莫斯科msk +没什么msm +每时每刻msmk +秘书长msz +没事找事mszs +摩托车mtc +埋头工作mtgz +埋头苦干mtkg +亩mu +目mu +木mu +母mu +墓mu +模*mu +幕mu +牧mu +姆mu +穆mu +姥*mu +牟*mu +拇mu +牡mu +暮mu +募mu +慕mu +睦mu +仫mu +坶mu +苜mu +沐mu +毪mu +钼mu +母爱muai +墓碑mubei +目标mubiao +木材mucai +牧草mucao +目测muce +牧场muchang +目次muci +牡丹mudan +目的mudi +牧歌muge +目光muguang +幕后muhou +目击muji +募集muji +木刻muke +木料muliao +幕僚muliao +目录mulu +牧民mumin +木讷mune +木偶muou +目前muqian +母亲muqin +牧区muqu +木然muran +暮色muse +牧师mushi +目送musong +牧童mutong +牧业muye +沐浴muyu +民意测验mycy +贸易市场mysc +贸易协定myxd +民政部mzb +美中不足mzbz +毛泽东mzd +满载而归mzeg +明知故犯mzgf +毛织品mzp +目中无人mzwr +毛主席mzx +年n +能n +内n +那n +农n +你n +南n +难n +呢n +女n +泥n +哪n +拿n +念n +牛n +宁n +脑n +粘n +尼n +纳n +嗯n +那na +南na +哪na +拿na +纳na +呢*na +钠na +呐na +娜na +捺na +肭na +镎na +衲na +那边nabian +纳粹nacui +哪儿naer +那个nage +哪个nage +呐喊nahan +哪会nahui +耐nai +哪*nai +奶nai +乃nai +氖nai +奈nai +鼐nai +艿nai +萘nai +柰nai +耐烦naifan +奈何naihe +耐久naijiu +耐劳nailao +奶奶nainai +耐心naixin +耐性naixing +耐用naiyong +奶油naiyou +乃至naizhi +那里nali +哪里nali +那么name +南nan +难nan +男nan +喃nan +囝nan +囡nan +楠nan +腩nan +蝻nan +赧nan +难办nanban +南北nanbei +南边nanbian +难产nanchan +南昌nanchang +难处nanchu +难道nandao +难得nande +难点nandian +难度nandu +哪能naneng +南方nanfang +南非nanfei +难分nanfen +南风nanfeng +囊nang +攮nang +囔nang +馕nang +曩nang +囊括nangkuo +难怪nanguai +难关nanguan +南国nanguo +难过nanguo +南海nanhai +南货nanhuo +南极nanji +难解nanjie +南京nanjing +难看nankan +难堪nankan +南面nanmian +难免nanmian +难民nanmin +南宁nanning +男女nannu +赧然nanran +男人nanren +难色nanse +难事nanshi +难受nanshou +难说nanshuo +难题nanti +难听nanting +难为nanwei +男性nanxing +南亚nanya +南洋nanyang +难以nanyi +难友nanyou +难于nanyu +脑nao +闹nao +努*nao +挠nao +恼nao +淖nao +孬nao +垴nao +呶nao +猱nao +瑙nao +硇nao +铙nao +蛲nao +脑袋naodai +脑海naohai +恼火naohuo +脑筋naojin +闹剧naoju +闹事naoshi +哪怕napa +纳入naru +那时nashi +拿手nashou +纳税nashui +那些naxie +哪些naxie +纳新naxin +那样nayang +哪样nayang +那种nazhong +年产量ncl +农产品ncp +南昌市ncs +难道说nds +呢ne +哪*ne +呐*ne +讷ne +内nei +那*nei +哪*nei +馁nei +内部neibu +内存neicun +内地neidi +内阁neige +内涵neihan +内行neihang +内奸neijian +内疚neijiu +内科neike +内乱neiluan +内幕neimu +内勤neiqin +内容neirong +内外neiwai +内销neixiao +内心neixin +内因neiyin +内应neiying +内在neizai +嫩nen +恁nen +能neng +能动nengdong +能否nengfou +能干nenggan +能够nenggou +能力nengli +能量nengliang +能耐nengnai +能人nengren +能手nengshou +能源nengyuan +能者nengzhe +农副产品nfcp +年富力强nflq +能工巧匠ngqj +你ni +泥ni +尼ni +呢*ni +逆ni +拟ni +尿ni +妮ni +霓ni +倪ni +匿ni +腻ni +溺ni +伲ni +坭ni +猊ni +怩ni +昵ni +旎ni +祢*ni +慝ni +睨ni +铌ni +鲵ni +年nian +念nian +粘nian +蔫nian +拈nian +碾nian +撵nian +捻nian +酿nian +廿nian +埝nian +辇nian +黏nian +鲇nian +鲶nian +年初nianchu +年代niandai +念叨niandao +年底niandi +年度niandu +年份nianfen +娘niang +年华nianhua +年画nianhua +年级nianji +年纪nianji +年鉴nianjian +年来nianlai +年利nianli +年历nianli +拈量nianliang +年龄nianling +年迈nianmai +年年niannian +年青nianqing +年轻nianqing +年岁niansui +年头niantou +念头niantou +年限nianxian +年月nianyue +酿造nianzao +年终nianzhong +尿niao +鸟niao +溺*niao +茑niao +嬲niao +脲niao +袅niao +鸟瞰niaokan +逆差nicha +你处nichu +你的nide +拟定niding +拟订niding +镍nie +啮nie +涅nie +捏nie +聂nie +孽nie +镊nie +乜nie +陧nie +蘖nie +嗫nie +颞nie +臬nie +蹑nie +捏造niezao +腻烦nifan +泥浆nijiang +逆境nijing +泥坑nikeng +逆流niliu +你们nimen +您nin +宁ning +凝ning +拧ning +柠ning +狞ning +泞ning +佞ning +苎ning +咛ning +甯ning +聍ning +凝固ninggu +凝结ningjie +宁静ningjing +凝聚ningju +宁可ningke +宁肯ningken +宁日ningri +凝视ningshi +凝望ningwang +宁夏ningxia +宁愿ningyuan +泥泞nining +泥塑nisu +牛niu +扭niu +钮niu +纽niu +拗*niu +狃niu +忸niu +妞niu +纽带niudai +牛犊niudu +纽扣niukou +纽约niuyue +扭转niuzhuan +腻味niwei +你我niwo +拟议niyi +泥沼nizhao +逆转nizhuan +难解难分njnf +南京市njs +南极洲njz +扭亏为盈nkwy +脑力劳动nlld +年老体弱nltr +内蒙古nmg +农贸市场nmsc +那么些nmx +那么样nmy +念念不忘nnbw +难能可贵nnkg +南宁市nns +农nong +弄nong +浓nong +脓nong +侬nong +哝nong +脓包nongbao +农村nongcun +浓度nongdu +农妇nongfu +浓厚nonghou +农会nonghui +农活nonghuo +农具nongju +农历nongli +农林nonglin +农忙nongmang +农民nongmin +弄清nongqing +农时nongshi +农药nongyao +农业nongye +农艺nongyi +浓郁nongyu +耨nou +年轻化nqh +年轻人nqr +那时候nsh +能说会道nshd +南斯拉夫nslf +能上能下nsnx +逆水行舟nsxz +农田水利ntsl +女nu +奴nu +努nu +怒nu +弩nu +胬nu +孥nu +驽nu +恧nu +钕nu +衄nu +暖nuan +暖和nuanhe +暖流nuanliu +暖气nuanqi +奴婢nubi +奴才nucai +虐nue +虐待nuedai +虐疾nueji +女儿nuer +女工nugong +怒吼nuhou +奴化nuhua +怒火nuhuo +努力nuli +奴隶nuli +诺nuo +娜*nuo +挪nuo +懦nuo +糯nuo +傩nuo +搦nuo +喏nuo +锘nuo +挪用nuoyong +奴仆nupu +女人nuren +女色nuse +女士nushi +女性nuxing +女婿nuxu +女子nuzi +能文能武nwnw +弄虚作假nxzj +农作物nzw +你争我夺nzwd +欧o +偶o +哦o +鸥o +殴o +藕o +呕o +沤o +讴o +噢o +怄o +瓯o +耦o +偶然性orx +区*ou +欧ou +偶ou +鸥ou +殴ou +藕ou +呕ou +沤ou +讴ou +怄ou +瓯ou +耦ou +殴打ouda +偶尔ouer +讴歌ouge +偶合ouhe +耦合ouhe +欧姆oumu +怄气ouqi +偶然ouran +藕色ouse +偶数oushu +呕吐outu +欧阳ouyang +欧洲ouzhou +批p +平p +判p +配p +片p +派p +破p +排p +品p +皮p +喷p +盘p +偏p +评p +怕p +培p +普p +贫p +跑p +炮p +怕pa +派pa +爬pa +帕pa +扒*pa +耙*pa +啪pa +趴pa +琶pa +葩pa +杷pa +钯*pa +筢pa +派pai +排pai +拍pai +牌pai +迫*pai +哌pai +徘pai +湃pai +俳pai +蒎pai +排版paiban +拍板paiban +排比paibi +派别paibie +排场paichang +排斥paichi +排除paichu +排队paidui +牌号paihao +徘徊paihuai +排挤paiji +牌价paijia +排列pailie +拍卖paimai +派遣paiqian +排球paiqiu +派生paisheng +派头paitou +排外paiwai +排泄paixie +排演paiyan +牌照paizhao +判pan +盘pan +叛pan +番*pan +潘pan +攀pan +磐pan +盼pan +畔pan +胖pan +拚*pan +爿pan +泮pan +袢pan +襻pan +蟠pan +蹒pan +叛变panbian +判别panbie +盘缠panchan +盘存pancun +叛党pandang +攀登pandeng +盘点pandian +判定panding +判断panduan +攀附panfu +旁pang +膀*pang +磅*pang +乓pang +庞pang +耪pang +胖pang +彷pang +滂pang +逄pang +螃pang +旁边pangbian +庞大pangda +盘亘pangen +旁观pangguan +旁听pangting +旁通pangtong +滂沱pangtuo +庞杂pangza +盘踞panju +判决panjue +叛乱panluan +判明panming +叛逆panni +盘算pansuan +蟠桃pantao +叛徒pantu +盼望panwang +判刑panxing +盘旋panxuan +跑pao +炮pao +刨pao +抛pao +泡pao +咆pao +袍pao +匏pao +狍pao +庖pao +脬pao +疱pao +炮兵paobing +跑步paobu +炮弹paodan +跑道paodao +抛光paoguang +炮火paohuo +炮击paoji +抛锚paomao +泡沫paomo +抛弃paoqi +炮手paoshou +炮台paotai +炮艇paoting +咆哮paoxiao +泡影paoying +炮仗paozhang +炮制paozhi +怕死pasi +疲惫不堪pbbk +迫不急待pbjd +破除迷信pcmx +平等互利pdhl +配pei +培pei +陪pei +胚pei +呸pei +裴pei +赔pei +佩pei +沛pei +辔pei +帔pei +旆pei +锫pei +醅pei +霈pei +陪伴peiban +配备peibei +赔本peiben +赔偿peichang +陪衬peichen +配方peifang +佩服peifu +配合peihe +配给peiji +配件peijian +配角peijiao +赔款peikuan +赔礼peili +配偶peiou +陪审peishen +陪送peisong +胚胎peitai +配套peitao +陪同peitong +培训peixun +培养peiyang +配音peiyin +培育peiyu +配乐peiyue +陪葬peizang +配制peizhi +配置peizhi +培植peizhi +喷pen +盆pen +湓pen +盆地pendi +碰peng +棚peng +蓬peng +朋peng +捧peng +膨peng +砰peng +抨peng +烹peng +澎peng +彭peng +硼peng +篷peng +鹏peng +堋peng +嘭peng +怦peng +蟛peng +碰杯pengbei +碰壁pengbi +蓬勃pengbo +捧场pengchang +抨击pengji +蓬莱penglai +蓬乱pengluan +澎湃pengpai +烹饪pengren +硼砂pengsha +蓬松pengsong +烹调pengtiao +朋友pengyou +膨胀pengzhang +喷溅penjian +盆景penjing +喷射penshe +喷嚏penti +平方公里pfgl +平分秋色pfqs +批pi +皮pi +坏*pi +否*pi +辟*pi +坯pi +脾pi +疲pi +砒pi +霹pi +披pi +劈pi +琵pi +毗pi +啤pi +匹pi +痞pi +僻pi +屁pi +譬pi +丕pi +仳pi +陂*pi +陴pi +邳pi +郫pi +圮pi +埤*pi +鼙pi +芘pi +擗pi +吡*pi +噼pi +庀pi +淠pi +媲pi +纰pi +枇pi +甓pi +睥pi +罴pi +铍pi +癖pi +裨*pi +疋pi +蚍pi +蜱pi +貔pi +片pian +偏pian +便*pian +篇pian +骗pian +扁*pian +谝pian +骈pian +缏*pian +犏pian +胼pian +翩pian +蹁pian +偏差piancha +片断pianduan +片段pianduan +偏废pianfei +篇幅pianfu +偏激pianji +偏见pianjian +骗局pianju +片刻pianke +偏离pianli +片面pianmian +偏旁pianpang +偏僻pianpi +偏颇pianpo +骗取pianqu +骗人pianren +骗术pianshu +偏袒piantan +翩跹pianxian +偏向pianxiang +偏移pianyi +便宜pianyi +篇章pianzhang +骗子pianzi +票piao +漂piao +朴*piao +飘piao +瓢piao +剽piao +莩*piao +嘌piao +嫖piao +骠*piao +缥piao +殍piao +瞟piao +螵piao +漂泊piaobo +票房piaofang +漂浮piaofu +票价piaojia +票据piaoju +漂亮piaoliang +漂流piaoliu +飘流piaoliu +飘落piaoluo +票面piaomian +飘渺piaomiao +飘泊piaopo +剽窃piaoqie +飘然piaoran +飘散piaosan +飘扬piaoyang +飘游piaoyou +疲惫pibei +批驳pibo +撇pie +瞥pie +丿pie +苤pie +氕pie +批发pifa +批复pifu +皮肤pifu +皮革pige +屁股pigu +疲倦pijuan +疲劳pilao +纰漏pilou +披露pilu +品pin +贫pin +频pin +拼pin +苹pin +聘pin +拚pin +姘pin +嫔pin +榀pin +牝pin +颦pin +品尝pinchang +频传pinchuan +拼凑pincou +频带pindai +频道pindao +品德pinde +贫乏pinfa +频繁pinfan +平ping +评ping +瓶ping +凭ping +苹ping +冯*ping +乒ping +坪ping +萍ping +屏ping +俜ping +娉ping +枰ping +鲆ping +平安pingan +评比pingbi +屏蔽pingbi +平常pingchang +平川pingchuan +平淡pingdan +平等pingdeng +平地pingdi +平定pingding +评定pingding +品格pinge +平反pingfan +平凡pingfan +平方pingfang +平分pingfen +评分pingfen +评功pinggong +平衡pingheng +评级pingji +平价pingjia +评价pingjia +评奖pingjiang +凭借pingjie +平静pingjing +平均pingjun +平空pingkong +凭空pingkong +评理pingli +评论pinglun +平面pingmian +平民pingmin +屏幕pingmu +评判pingpan +乒乓pingpang +平平pingping +平壤pingrang +平日pingri +平时pingshi +平手pingshou +评说pingshuo +平素pingsu +平坦pingtan +乒坛pingtan +平稳pingwen +平息pingxi +萍乡pingxiang +平行pingxing +平易pingyi +评议pingyi +平庸pingyong +平原pingyuan +平仄pingze +屏障pingzhang +凭着pingzhe +平整pingzheng +凭证pingzheng +评注pingzhu +贫寒pinhan +品级pinji +贫困pinkun +频率pinlu +品貌pinmao +拼命pinming +品名pinming +品评pinping +聘请pinqing +贫穷pinqiong +聘任pinren +聘书pinshu +拼写pinxie +品行pinxing +品性pinxing +拼音pinyin +品质pinzhi +品种pinzhong +批判pipan +匹配pipei +批评piping +脾气piqi +譬如piru +疲软piruan +批示pishi +脾胃piwei +脾性pixing +辟谣piyao +批语piyu +批阅piyue +批注pizhu +批准pizhun +平均数pjs +披荆斩棘pjzj +评论员ply +跑马观花pmgh +破po +迫po +坡po +泼po +繁*po +朴*po +泊*po +颇po +婆po +魄po +粕po +叵po +陂*po +鄱po +泺*po +珀po +攴po +钋po +钷po +钹*po +皤po +笸po +破案poan +破产pochan +破除pochu +坡度podu +泼妇pofu +破格poge +迫害pohai +破坏pohuai +破获pohuo +迫近pojin +破旧pojiu +泼辣pola +破烂polan +魄力poli +破例poli +破裂polie +破灭pomie +迫切poqie +迫使poshi +破碎posui +破损posun +破土potu +剖pou +裒pou +掊pou +剖解poujie +剖析pouxi +破绽pozhan +蓬蓬勃勃ppbb +普普通通pptt +旁若无人prwr +普通话pth +抛头露面ptlm +普pu +谱pu +扑pu +埔pu +铺pu +暴*pu +葡pu +朴pu +蒲pu +堡*pu +脯*pu +仆pu +莆pu +菩pu +圃pu +浦pu +曝pu +瀑pu +匍pu +噗pu +溥pu +濮pu +璞pu +氆pu +镤pu +镨pu +蹼pu +普遍pubian +普查pucha +扑哧puchi +扑打puda +铺盖pugai +普及puji +铺平puping +仆人puren +菩萨pusa +铺设pushe +朴实pushi +朴素pusu +葡萄putao +普通putong +扑通putong +铺位puwei +谱写puxie +普选puxuan +铺张puzhang +普照puzhao +朴直puzhi +平易近人pyjr +拼音字母pyzm +铺张浪费pzlf +起q +前q +其q +去q +气q +全q +期q +群q +情q +区q +强q +切q +取q +七q +求q +清q +确q +权q +且q +青q +亲爱的qad +情报所qbs +千百万qbw +千变万化qbwh +取长补短qcbd +千锤百炼qcbl +恰到好处qdhc +全党全军和全国qdqg +取而代之qedz +轻而易举qeyj +千方百计qfbj +清规戒律qgjl +勤工俭学qgjx +旗鼓相当qgxd +轻工业qgy +轻工业部qgyb +勤工助学qgzx +权衡利弊qhlb +骑虎难下qhnx +青海省qhs +青红皂白qhzb +起qi +其qi +气qi +期qi +七qi +器qi +齐qi +奇qi +汽qi +企qi +漆qi +欺qi +旗qi +畦qi +启qi +弃qi +歧qi +稽*qi +缉*qi +栖qi +戚qi +妻qi +凄qi +柒qi +沏qi +棋qi +崎qi +脐qi +祈qi +祁qi +骑qi +岂qi +乞qi +契qi +砌qi +迄qi +泣qi +讫qi +亟*qi +亓qi +俟qi +圻qi +芑qi +芪qi +荠*qi +萁qi +萋qi +葺qi +蕲qi +嘁qi +屺qi +岐qi +岖*qi +汔qi +淇qi +骐qi +绮qi +琪qi +琦qi +杞qi +桤qi +槭qi +耆qi +欹qi +祺qi +憩qi +碛qi +颀qi +蛴qi +蜞qi +綦qi +綮qi +蹊qi +鳍qi +麒qi +卡*qia +恰qia +掐qia +洽qia +伽*qia +葜qia +袷*qia +髂qia +恰当qiadang +恰好qiahao +前qian +千qian +钱qian +浅qian +签qian +迁qian +铅qian +潜qian +牵qian +钳qian +纤*qian +谴qian +扦qian +钎qian +仟qian +谦qian +乾qian +黔qian +遣qian +堑qian +嵌qian +欠qian +歉qian +倩qian +佥qian +阡qian +芊qian +芡qian +茜qian +荨qian +掮qian +岍qian +悭qian +慊qian +骞qian +搴qian +褰qian +缱qian +椠qian +犍*qian +肷qian +愆qian +钤qian +虔qian +箬qian +箝qian +前辈qianbei +前边qianbian +浅薄qianbo +钱财qiancai +欠产qianchan +前程qiancheng +签到qiandao +前敌qiandi +签订qianding +签发qianfa +遣返qianfan +前方qianfang +强qiang +将*qiang +枪qiang +抢qiang +墙qiang +腔qiang +呛qiang +羌qiang +蔷qiang +戕qiang +嫱qiang +樯qiang +戗qiang +炝qiang +锖qiang +锵qiang +镪qiang +襁qiang +蜣qiang +羟qiang +跄qiang +墙壁qiangbi +枪毙qiangbi +强辩qiangbian +强大qiangda +枪弹qiangdan +强盗qiangdao +强调qiangdiao +腔调qiangdiao +强度qiangdu +抢夺qiangduo +强攻qianggong +强国qiangguo +强化qianghua +强加qiangjia +强奸qiangjian +抢劫qiangjie +强劲qiangjin +抢救qiangjiu +枪决qiangjue +强烈qianglie +强迫qiangpo +强权qiangquan +强弱qiangruo +枪杀qiangsha +强盛qiangsheng +千古qiangu +牵挂qiangua +蔷薇qiangwei +抢险qiangxian +强行qiangxing +强硬qiangying +强占qiangzhan +强者qiangzhe +强制qiangzhi +枪支qiangzhi +强壮qiangzhuang +前后qianhou +前进qianjin +前景qianjing +迁就qianjiu +歉疚qianjiu +迁居qianju +乾坤qiankun +千里qianli +前例qianli +潜力qianli +牵连qianlian +前列qianlie +浅陋qianlou +前面qianmian +签名qianming +前年qiannian +前期qianqi +千秋qianqiu +前驱qianqu +欠缺qianque +前人qianren +前任qianren +纤弱qianruo +前哨qianshao +牵涉qianshe +歉收qianshou +签署qianshu +遣送qiansong +前提qianti +前天qiantian +欠条qiantiao +前途qiantu +千瓦qianwa +千万qianwan +前往qianwang +前夕qianxi +纤细qianxi +前线qianxian +浅显qianxian +谦虚qianxu +谦逊qianxun +前言qianyan +前沿qianyan +前夜qianye +歉意qianyi +迁移qianyi +牵引qianyin +潜在qianzai +谴责qianze +前者qianzhe +签证qianzheng +牵制qianzhi +钳制qianzhi +签字qianzi +前奏qianzou +桥qiao +瞧qiao +壳*qiao +巧qiao +敲qiao +乔qiao +蕉qiao +橇qiao +锹qiao +悄qiao +侨qiao +鞘qiao +撬qiao +翘qiao +峭qiao +俏qiao +窍qiao +雀*qiao +劁qiao +诮qiao +谯qiao +荞qiao +峤*qiao +愀qiao +憔qiao +缲*qiao +樵qiao +硗qiao +跷qiao +鞒qiao +侨胞qiaobao +桥墩qiaodun +巧计qiaoji +瞧见qiaojian +侨居qiaoju +桥梁qiaoliang +窍门qiaomen +巧妙qiaomiao +桥牌qiaopai +乔迁qiaoqian +悄然qiaoran +侨务qiaowu +敲诈qiaozha +恰似qiasi +洽谈qiatan +岂不qibu +起步qibu +器材qicai +奇才qicai +凄惨qican +起草qicao +汽车qiche +骑车qiche +启程qicheng +起初qichu +凄楚qichu +其次qici +期待qidai +脐带qidai +岂但qidan +启迪qidi +起点qidian +启动qidong +气度qidu +切qie +且qie +砌*qie +茄qie +怯qie +窃qie +伽*qie +郄qie +惬qie +慊*qie +妾qie +挈qie +锲qie +箧qie +窃案qiean +切断qieduan +切合qiehe +窃据qieju +窃取qiequ +怯弱qieruo +切身qieshen +切实qieshi +切题qieti +窃听qieting +切削qiexiao +惬意qieyi +启发qifa +起飞qifei +岂非qifei +气愤qifen +气氛qifen +欺负qifu +气概qigai +乞丐qigai +岂敢qigan +气功qigong +奇怪qiguai +器官qiguan +旗号qihao +漆黑qihei +气候qihou +期货qihuo +契机qiji +奇迹qiji +期间qijian +起见qijian +器件qijian +七届qijie +迄今qijin +起来qilai +凄凉qiliang +欺凌qiling +气流qiliu +歧路qilu +起码qima +骑马qima +启蒙qimeng +奇妙qimiao +器皿qimin +亲qin +侵qin +勤qin +秦qin +钦qin +琴qin +芹qin +擒qin +禽qin +寝qin +沁qin +芩qin +揿qin +吣qin +嗪qin +噙qin +廑*qin +溱qin +檎qin +锓qin +矜*qin +覃qin +螓qin +衾qin +亲爱qinai +亲笔qinbi +岂能qineng +侵犯qinfan +勤奋qinfen +情qing +清qing +青qing +轻qing +倾qing +请qing +亲*qing +庆qing +氢qing +晴qing +卿qing +擎qing +氰qing +顷qing +苘qing +圊qing +檠qing +磬qing +蜻qing +罄qing +箐qing +綮*qing +謦qing +鲭qing +黥qing +清白qingbai +青白qingbai +情报qingbao +情操qingcao +青草qingcao +清查qingcha +清除qingchu +清楚qingchu +青春qingchun +青翠qingcui +清单qingdan +倾倒qingdao +清点qingdian +情调qingdiao +轻浮qingfu +青工qinggong +青海qinghai +庆贺qinghe +清华qinghua +情怀qinghuai +清还qinghuan +请假qingjia +请柬qingjian +请教qingjiao +情节qingjie +清洁qingjie +情景qingjing +顷刻qingke +晴空qingkong +轻快qingkuai +情况qingkuang +青睐qinglai +晴朗qinglang +情理qingli +清理qingli +轻率qinglu +轻蔑qingmie +青年qingnian +氢气qingqi +轻巧qingqiao +请求qingqiu +情趣qingqu +青山qingshan +请示qingshi +清爽qingshuang +青松qingsong +轻松qingsong +倾诉qingsu +青天qingtian +晴天qingtian +倾听qingting +倾吐qingtu +请问qingwen +倾向qingxiang +倾销qingxiao +情形qingxing +清醒qingxing +情绪qingxu +情谊qingyi +轻易qingyi +轻盈qingying +情愿qingyuan +请愿qingyuan +请战qingzhan +轻重qingzhong +倾注qingzhu +庆祝qingzhu +请罪qingzui +侵害qinhai +勤俭qinjian +亲近qinjin +亲眷qinjuan +勤快qinkuai +勤劳qinlao +亲历qinli +亲临qinlin +侵略qinlue +亲密qinmi +勤勉qinmian +钦佩qinpei +亲戚qinqi +亲切qinqie +亲热qinre +亲人qinren +侵入qinru +亲身qinshen +侵蚀qinshi +寝室qinshi +亲手qinshou +亲属qinshu +侵吞qintun +勤务qinwu +亲信qinxin +亲眼qinyan +亲友qinyou +侵占qinzhan +亲自qinzi +穷qiong +琼qiong +邛qiong +茕qiong +穹qiong +蛩qiong +筇qiong +跫qiong +銎qiong +穷国qiongguo +穷苦qiongku +穷困qiongkun +穹隆qionglong +穷期qiongqi +穷人qiongren +穷途qiongtu +气派qipai +欺骗qipian +气魄qipo +乞求qiqiu +崎岖qiqu +齐全qiquan +凄然qiran +起色qise +气色qise +其实qishi +起始qishi +启事qishi +气势qishi +启示qishi +歧视qishi +奇数qishu +汽水qishui +起诉qisu +其他qita +其它qita +奇特qite +气体qiti +汽艇qiting +企图qitu +歧途qitu +求qiu +球qiu +秋qiu +丘qiu +仇*qiu +龟*qiu +邱qiu +囚qiu +酋qiu +泅qiu +俅qiu +巯qiu +犰qiu +湫qiu +逑qiu +遒qiu +楸qiu +赇qiu +虬qiu +蚯qiu +蝤qiu +裘qiu +糗qiu +鳅qiu +鼽qiu +秋播qiubo +球场qiuchang +囚犯qiufan +秋风qiufeng +秋季qiuji +求教qiujiao +囚禁qiujin +求救qiujiu +丘陵qiuling +秋千qiuqian +求情qiuqing +求全qiuquan +秋色qiuse +求实qiushi +秋收qiushou +秋天qiutian +求学qiuxue +求战qiuzhan +求证qiuzheng +求知qiuzhi +求助qiuzhu +期望qiwang +气味qiwei +气温qiwen +奇闻qiwen +欺侮qiwu +气息qixi +栖息qixi +起先qixian +期限qixian +气象qixiang +器械qixie +齐心qixin +气压qiya +欺压qiya +气焰qiyan +企业qiye +起义qiyi +歧义qiyi +起因qiyin +启用qiyong +汽油qiyou +其余qiyu +起源qiyuan +七月qiyue +契约qiyue +欺诈qizha +气质qizhi +旗帜qizhi +其中qizhong +器重qizhong +旗子qizi +妻子qizi +勤俭建国qjjg +勤俭节约qjjy +迄今为止qjwz +取决于qjy +千钧一发qjyf +旗开得胜qkds +全力以赴qlyf +勤劳致富qlzf +千里之行qlzx +亲密无间qmwj +青年人qnr +千篇一律qpyl +清清楚楚qqcc +勤勤恳恳qqkk +切切实实qqss +确确实实qqss +恰恰相反qqxf +求全责备qqzb +恰如其分qrqf +欺人之谈qrzt +七手八脚qsbj +全神贯注qsgz +全世界qsj +切实可行qskx +切身利益qsly +青少年qsn +前所未闻qsww +前所未有qswy +气势汹汹qsxx +齐头并进qtbj +奇谈怪论qtgl +千头万绪qtwx +前提下qtx +去qu +区qu +取qu +曲qu +且*qu +渠qu +屈qu +趋qu +驱qu +趣qu +蛆qu +躯qu +娶qu +龋qu +戌*qu +诎qu +劬qu +苣*qu +蕖qu +蘧qu +岖qu +衢qu +阒qu +璩qu +觑qu +氍qu +朐qu +祛qu +磲qu +鸲qu +癯qu +蛐qu +蠼qu +麴qu +瞿qu +黢qu +全quan +权quan +圈quan +劝quan +泉quan +醛quan +颧quan +痊quan +拳quan +犬quan +券quan +诠quan +荃quan +悛quan +绻quan +辁quan +畎quan +铨quan +蜷quan +筌quan +鬈quan +全部quanbu +全党quandang +劝导quandao +蜷伏quanfu +劝告quangao +全国quanguo +权衡quanheng +全会quanhui +拳击quanji +劝解quanjie +全局quanju +全军quanjun +全力quanli +权利quanli +权力quanli +全貌quanmao +全面quanmian +劝勉quanmian +全民quanmin +全能quanneng +全年quannian +全盘quanpan +全拼quanpin +全球quanqiu +蜷曲quanqu +全权quanquan +全然quanran +全胜quansheng +权术quanshu +泉水quanshui +劝说quanshuo +圈套quantao +全体quanti +拳头quantou +权威quanwei +劝慰quanwei +全文quanwen +全县quanxian +权限quanxian +全校quanxiao +权益quanyi +权宜quanyi +劝诱quanyou +痊愈quanyu +劝止quanzhi +劝阻quanzu +区别qubie +屈才qucai +驱除quchu +取代qudai +渠道qudao +取得qude +取缔qudi +曲调qudiao +驱动qudong +确que +却que +缺que +炔que +瘸que +鹊que +榷que +雀que +阕que +阙que +悫que +确保quebao +缺点quedian +确定queding +缺乏quefa +缺口quekou +确立queli +确切queqie +确认queren +缺少queshao +缺省quesheng +确实queshi +缺席quexi +缺陷quexian +确信quexin +确凿quezao +瘸子quezi +区分qufen +屈服qufu +躯干qugan +区划quhua +曲解qujie +取经qujing +取决qujue +躯壳quke +取乐qule +群qun +裙qun +逡qun +裙带qundai +群岛qundao +去年qunian +群众qunzhong +区区ququ +屈辱quru +驱散qusan +取舍qushe +取胜qusheng +去世qushi +驱使qushi +趋势qushi +躯体quti +区位quwei +区委quwei +趣味quwei +区县quxian +去向quxiang +趋向quxiang +取消quxiao +取信quxin +曲艺quyi +区域quyu +区长quzhang +曲折quzhe +屈指quzhi +驱逐quzhu +曲子quzi +奇形怪状qxgz +全心全意qxqy +气象台qxt +气象万千qxwq +齐心协力qxxl +岂有此理qycl +前因后果qyhg +情有可原qyky +强有力qyl +求之不得qzbd +取之不尽qzbj +轻重缓急qzhj +气壮山河qzsh +千真万确qzwq +人r +如r +日r +认r +入r +任r +热r +然r +容r +让r +润r +弱r +燃r +染r +壤r +绕r +仁r +溶r +刃r +仍r +然ran +燃ran +染ran +冉ran +苒ran +蚺ran +髯ran +燃点randian +然而raner +让rang +壤rang +嚷rang +瓤rang +攘rang +禳rang +穰rang +让步rangbu +让位rangwei +让贤rangxian +然后ranhou +燃料ranliao +染料ranliao +冉冉ranran +燃烧ranshao +绕rao +扰rao +饶rao +荛rao +娆rao +桡rao +扰乱raoluan +如此而已rcey +人才济济rcjj +热re +若*re +惹re +热爱reai +热潮rechao +热忱rechen +热诚recheng +热带redai +热火rehuo +热量reliang +热烈relie +人ren +认ren +任ren +仁ren +刃ren +忍ren +壬ren +韧ren +妊ren +纫ren +仞ren +荏ren +葚ren +饪ren +轫ren +稔ren +衽ren +热闹renao +人才rencai +人次renci +仁慈renci +认错rencuo +人大renda +韧带rendai +人道rendao +认得rende +认定rending +人防renfang +仍reng +扔reng +扔掉rengdiao +人格renge +仍旧rengjiu +人工rengong +认购rengou +仍然rengran +任何renhe +人家renjia +人间renjian +人杰renjie +认可renke +人口renkou +人类renlei +人力renli +人们renmen +任免renmian +人民renmin +任命renming +忍耐rennai +任凭renping +任期renqi +认清renqing +人权renquan +荏苒renran +忍让renrang +人人renren +人参renshen +人生rensheng +人事renshi +人士renshi +认识renshi +人手renshou +忍受renshou +认输renshu +忍痛rentong +人为renwei +认为renwei +人物renwu +任务renwu +人心renxin +忍心renxin +人选renxuan +任意renyi +仁义renyi +任用renyong +人员renyuan +认帐renzhang +认真renzhen +人质renzhi +任职renzhi +认罪renzui +认作renzuo +热切reqie +热情reqing +惹事reshi +热线rexian +热心rexin +热血rexue +人工合成rghc +热火朝天rhct +如虎添翼rhty +日ri +日报ribao +日本riben +日产richan +日常richang +日程richeng +日光riguang +日后rihou +日记riji +日久rijiu +日历rili +日落riluo +日内rinei +日期riqi +日夜riye +日益riyi +日用riyong +日照rizhao +日中rizhong +日子rizi +软件包rjb +人杰地灵rjdl +人尽其才rjqc +如饥似渴rjsk +日久天长rjtc +任劳任怨rlry +热泪盈眶rlyk +人民币rmb +人民代表大会rmdh +人民日报rmrb +燃眉之急rmzj +容rong +溶rong +荣rong +熔rong +融rong +绒rong +戎rong +茸rong +蓉rong +冗rong +嵘rong +狨rong +榕rong +肜rong +蝾rong +熔点rongdian +容光rongguang +融合ronghe +溶化ronghua +熔化ronghua +融化ronghua +融会ronghui +荣获ronghuo +容积rongji +溶解rongjie +容量rongliang +戎马rongma +容貌rongmao +容纳rongna +融洽rongqia +容忍rongren +荣辱rongru +容身rongshen +绒线rongxian +荣幸rongxing +容许rongxu +荣耀rongyao +溶液rongye +容易rongyi +荣誉rongyu +溶质rongzhi +肉rou +揉rou +柔rou +糅rou +蹂rou +鞣rou +柔和rouhe +肉麻rouma +柔软rouruan +肉体routi +任人为贤rrwx +日日夜夜rryy +人生观rsg +认识论rsl +惹事生非rssf +如上所述rsss +如ru +入ru +儒ru +乳ru +茹ru +蠕ru +孺ru +辱ru +汝ru +褥ru +蓐ru +薷ru +嚅ru +洳ru +溽ru +濡ru +缛ru +铷ru +襦ru +颥ru +软ruan +阮ruan +朊ruan +软骨ruangu +软件ruanjian +软禁ruanjin +软盘ruanpan +如常ruchang +如此ruci +入党rudang +蠕动rudong +乳房rufang +如果ruguo +如何ruhe +瑞rui +锐rui +蕊rui +芮rui +蕤rui +枘rui +睿rui +蚋rui +锐利ruili +瑞雪ruixue +锐意ruiyi +儒家rujia +如今rujin +辱骂ruma +入门rumen +入迷rumi +润run +闰run +润滑runhua +弱ruo +若ruo +偌ruo +弱点ruodian +若干ruogan +若是ruoshi +弱小ruoxiao +如期ruqi +入侵ruqin +如若ruruo +儒生rusheng +入手rushou +如同rutong +如下ruxia +入选ruxuan +如意ruyi +如愿ruyuan +入帐ruzhang +人武部rwb +若无其事rwqs +人言可畏rykw +日用品ryp +若有所思ryss +人之长情rzcq +是s +上s +时s +生s +说s +社s +深s +水s +所s +三s +十s +使s +事s +数s +四s +实s +少s +式s +山s +手s +撒sa +萨sa +洒sa +卅sa +仨sa +挲sa +脎sa +飒sa +撒谎sahuang +塞sai +思*sai +赛sai +腮sai +鳃sai +噻sai +赛车saiche +塞子saizi +撒娇sajiao +三san +散san +叁san +伞san +馓san +毵san +糁san +散步sanbu +散布sanbu +散发sanfa +三废sanfei +桑sang +丧sang +嗓sang +搡sang +磉sang +颡sang +丧命sangming +丧失sangshi +三国sanguo +三好sanhao +散会sanhui +三角sanjiao +三届sanjie +散失sanshi +散文sanwen +三月sanyue +扫sao +梢*sao +搔sao +骚sao +嫂sao +埽sao +缫sao +缲sao +臊sao +瘙sao +鳋sao +扫除saochu +扫荡saodang +扫地saodi +骚动saodong +骚乱saoluan +扫描saomiao +扫墓saomu +骚扰saorao +瘙痒saoyang +扫帚saozhou +洒脱satuo +说不定sbd +舍不得sbd +说不过去sbgq +说不来sbl +数不胜数sbss +素不相识sbxs +身不由己sbyj +上层建筑scjz +生产力scl +生产率scl +水产品scp +四川省scs +市场调节sctj +市场信息scxx +生动活泼sdhp +山东省sds +水电站sdz +色se +塞*se +瑟se +涩se +啬se +铯se +穑se +视而不见sebj +色彩secai +色调sediao +色盲semang +森sen +僧seng +僧侣senglu +森林senlin +森严senyan +色情seqing +瑟瑟sese +十二月sey +色泽seze +司法部sfb +赏罚分明sffm +说服力sfl +手风琴sfq +三番五次sfwc +四个现代化sgxh +手工业sgy +沙sha +杀sha +砂sha +啥sha +纱sha +莎sha +刹sha +傻sha +煞sha +杉sha +厦*sha +唼sha +嗄*sha +挲*sha +歃sha +铩sha +痧sha +裟sha +霎sha +鲨sha +煞白shabai +刹车shache +煞车shache +沙发shafa +傻瓜shagua +沙皇shahuang +色*shai +筛shai +晒shai +晒台shaitai +砂烬shajin +沙龙shalong +沙漠shamo +山shan +单*shan +闪shan +善shan +珊shan +扇shan +陕shan +掸*shan +苫shan +杉shan +删shan +煽shan +衫shan +擅shan +赡shan +膳shan +汕shan +缮shan +栅*shan +剡shan +讪shan +鄯shan +埏shan +芟shan +潸shan +姗shan +嬗shan +骟shan +膻shan +禅*shan +钐shan +疝shan +蟮shan +舢shan +跚shan +鳝shan +刹那shana +山坳shanao +陕北shanbei +擅长shanchang +删除shanchu +山川shanchuan +山地shandi +闪电shandian +扇动shandong +煽动shandong +山东shandong +山峰shanfeng +上shang +商shang +伤shang +尚shang +汤*shang +墒shang +赏shang +晌shang +裳shang +垧shang +绱shang +殇shang +熵shang +觞shang +删改shangai +山岗shangang +山冈shangang +上班shangban +上报shangbao +上边shangbian +商标shangbiao +上部shangbu +上策shangce +上层shangceng +商场shangchang +上次shangci +赏赐shangci +上当shangdang +上等shangdeng +上帝shangdi +商店shangdian +上调shangdiao +商定shangding +上访shangfang +伤感shanggan +上告shanggao +赏光shangguang +上海shanghai +伤害shanghai +商行shanghang +上级shangji +上集shangji +上进shangjin +上空shangkong +上来shanglai +商量shangliang +上流shangliu +上门shangmen +上面shangmian +上年shangnian +山沟shangou +商品shangpin +商洽shangqia +上前shangqian +尚且shangqie +上去shangqu +商榷shangque +商人shangren +上任shangren +上山shangshan +上升shangsheng +赏识shangshi +上述shangshu +上司shangsi +上诉shangsu +商谈shangtan +商讨shangtao +闪光shanguang +上文shangwen +上午shangwu +商务shangwu +上下shangxia +上限shangxian +伤心shangxin +上旬shangxun +上演shangyan +商业shangye +商议shangyi +上映shangying +上游shangyou +上涨shangzhang +上阵shangzhen +山河shanhe +善后shanhou +删节shanjie +善良shanliang +山林shanlin +山岭shanling +山脉shanmai +杉木shanmu +山区shanqu +扇区shanqu +山水shanshui +闪烁shanshuo +山头shantou +山西shanxi +陕西shanxi +赡养shanyang +闪耀shanyao +善意shanyi +善于shanyu +善战shanzhan +擅自shanzi +少shao +烧shao +稍shao +绍shao +召*shao +哨shao +梢shao +鞘*shao +捎shao +芍shao +勺shao +韶shao +邵shao +劭shao +苕shao +潲shao +杓*shao +蛸shao +筲shao +艄shao +哨兵shaobing +艄公shaogong +烧毁shaohui +少见shaojian +哨卡shaoka +少量shaoliang +少年shaonian +少女shaonu +烧伤shaoshang +少数shaoshu +哨所shaosuo +稍微shaowei +少许shaoxu +稍许shaoxu +少爷shaoye +少有shaoyou +少于shaoyu +少壮shaozhuang +沙哑shaya +砂眼shayan +傻子shazi +社she +设she +射she +摄she +舌she +折*she +涉she +舍she +蛇she +奢she +赊she +赦she +慑she +厍she +佘she +摺*she +猞she +滠she +歙she +畲she +麝she +设备shebei +射程shecheng +奢侈shechi +舍得shede +设法shefa +慑服shefu +赊购shegou +奢华shehua +社会shehui +社稷sheji +涉及sheji +设计sheji +射击sheji +舍己sheji +社交shejiao +设立sheli +涉猎shelie +社论shelun +深shen +身shen +神shen +什*shen +伸shen +参*shen +甚shen +渗shen +沈shen +肾shen +审shen +申shen +慎shen +砷shen +呻shen +娠shen +绅shen +婶shen +诜shen +谂shen +莘shen +葚*shen +哂shen +渖shen +椹shen +胂shen +矧shen +蜃shen +深奥shenao +申报shenbao +身边shenbian +申辩shenbian +身材shencai +审查shencha +深沉shenchen +深处shenchu +审处shenchu +审定shending +深度shendu +甚而shener +身分shenfen +身份shenfen +生sheng +胜sheng +声sheng +省sheng +升sheng +盛sheng +绳sheng +剩sheng +圣sheng +牲sheng +乘*sheng +甥sheng +嵊sheng +渑*sheng +晟sheng +眚sheng +笙sheng +生财shengcai +生产shengchan +生成shengcheng +牲畜shengchu +生存shengcun +盛大shengda +省得shengde +胜地shengdi +盛典shengdian +声调shengdiao +生动shengdong +省份shengfen +胜负shengfu +省府shengfu +生根shenggen +升华shenghua +省会shenghui +盛会shenghui +生活shenghuo +生机shengji +生计shengji +升级shengji +圣洁shengjie +圣经shengjing +盛开shengkai +牲口shengkou +盛况shengkuang +生理shengli +胜利shengli +省力shengli +省略shenglue +生命shengming +声明shengming +盛名shengming +生怕shengpa +生僻shengpi +生平shengping +升旗shengqi +生前shengqian +升迁shengqian +盛情shengqing +生趣shengqu +省去shengqu +胜任shengren +生日shengri +省事shengshi +盛事shengshi +声势shengshi +生疏shengshu +生死shengsi +胜似shengsi +胜诉shengsu +绳索shengsuo +生态shengtai +声讨shengtao +声望shengwang +省委shengwei +生物shengwu +生息shengxi +剩下shengxia +盛夏shengxia +圣贤shengxian +生效shengxiao +生肖shengxiao +盛行shengxing +生涯shengya +生意shengyi +声音shengyin +生于shengyu +生育shengyu +胜于shengyu +声誉shengyu +剩余shengyu +声援shengyuan +生长shengzhang +省长shengzhang +声张shengzhang +胜仗shengzhang +生殖shengzhi +圣旨shengzhi +盛装shengzhuang +审核shenhe +深厚shenhou +深化shenhua +神话shenhua +甚或shenhuo +审计shenji +神经shenjing +深刻shenke +审理shenli +什么shenme +审美shenmei +神秘shenmi +申明shenming +审判shenpan +身旁shenpang +审批shenpi +神气shenqi +神奇shenqi +深浅shenqian +深切shenqie +深情shenqing +申请shenqing +身躯shenqu +深入shenru +渗入shenru +神圣shensheng +身世shenshi +绅士shenshi +伸手shenshou +申述shenshu +神速shensu +申诉shensu +伸缩shensuo +神态shentai +身体shenti +神通shentong +渗透shentou +审问shenwen +神仙shenxian +审讯shenxun +沈阳shenyang +审议shenyi +呻吟shenyin +身影shenying +深远shenyuan +申冤shenyuan +审阅shenyue +深造shenzao +伸张shenzhang +深圳shenzhen +甚至shenzhi +深重shenzhong +慎重shenzhong +神州shenzhou +舍弃sheqi +赊欠sheqian +设施sheshi +社团shetuan +奢望shewang +射线shexian +涉嫌shexian +设想shexiang +赊销shexiao +设宴sheyan +摄影sheying +社员sheyuan +社长shezhang +设置shezhi +涉足shezu +社会公德shgd +是shi +时shi +十shi +使shi +事shi +实shi +式shi +识shi +世shi +试shi +石shi +什shi +示shi +市shi +史shi +师shi +始shi +施shi +士shi +势shi +湿shi +适shi +食shi +失shi +视shi +室shi +氏shi +似*shi +蚀shi +诗shi +释shi +殖*shi +拾shi +饰shi +驶shi +匙*shi +狮shi +尸shi +虱shi +矢shi +屎shi +柿shi +拭shi +誓shi +逝shi +嗜shi +噬shi +仕shi +侍shi +恃shi +嘘*shi +峙*shi +谥shi +埘shi +莳shi +蓍shi +弑shi +轼shi +贳shi +炻shi +铈shi +螫shi +舐shi +筮shi +酾shi +豕shi +鲥shi +鲺shi +失败shibai +势必shibi +事变shibian +师表shibiao +识别shibie +失策shice +史册shice +视察shicha +时常shichang +失常shichang +市场shichang +时辰shichen +失传shichuan +侍从shicong +时代shidai +世代shidai +适当shidang +是的shide +实地shidi +试点shidian +失调shidiao +失掉shidiao +事端shiduan +拾掇shiduo +时而shier +示范shifan +师范shifan +施放shifang +释放shifang +是非shifei +时分shifen +十分shifen +侍奉shifeng +是否shifou +师傅shifu +实干shigan +是个shige +诗歌shige +施工shigong +事故shigu +世故shigu +尸骨shigu +使馆shiguan +时光shiguang +嗜好shihao +适合shihe +时候shihou +事后shihou +侍候shihou +使唤shihuan +实惠shihui +失火shihuo +时机shiji +事迹shiji +实际shiji +世纪shiji +试剂shiji +史籍shiji +施加shijia +市价shijia +时间shijian +事件shijian +世间shijian +实践shijian +视角shijiao +市郊shijiao +使节shijie +十届shijie +世界shijie +使劲shijin +市井shijing +时局shiju +视觉shijue +时刻shike +石刻shike +市侩shikuai +实况shikuang +事理shili +实力shili +事例shili +势利shili +失利shili +势力shili +视力shili +示例shili +失恋shilian +适量shiliang +矢量shiliang +拾零shiling +失灵shiling +适龄shiling +时髦shimao +失密shimi +市民shimin +使命shiming +市内shinei +室内shinei +诗篇shipian +食品shipin +视频shipin +识破shipo +时期shiqi +事前shiqian +失窃shiqie +事情shiqing +实情shiqing +时区shiqu +时取shiqu +失去shiqu +市区shiqu +诗人shiren +市容shirong +湿润shirun +示弱shiruo +失散shisan +失色shise +施舍shishe +师生shisheng +失声shisheng +时时shishi +时事shishi +适时shishi +事实shishi +失事shishi +实施shishi +失实shishi +逝世shishi +史诗shishi +失势shishi +誓师shishi +尸首shishou +失守shishou +实数shishu +施属shishu +世俗shisu +失算shisuan +事态shitai +试探shitan +食堂shitang +实体shiti +尸体shiti +石头shitou +势头shitou +师团shituan +十万shiwan +失望shiwang +市委shiwei +示威shiwei +时务shiwu +事物shiwu +事务shiwu +实物shiwu +食物shiwu +饰物shiwu +失误shiwu +实习shixi +事先shixian +视线shixian +实现shixian +试想shixiang +事项shixiang +实效shixiao +试销shixiao +失信shixin +实行shixing +试行shixing +施行shixing +失修shixiu +实学shixue +史学shixue +实验shiyan +试验shiyan +食言shiyan +誓言shiyan +式样shiyang +事业shiye +实业shiye +失业shiye +视野shiye +时宜shiyi +事宜shiyi +示意shiyi +诗意shiyi +适宜shiyi +释疑shiyi +适应shiying +使用shiyong +实用shiyong +试用shiyong +适用shiyong +事由shiyou +石油shiyou +誓由shiyou +适于shiyu +誓愿shiyuan +十月shiyue +失约shiyue +实在shizai +实战shizhan +施展shizhan +市长shizhang +师长shizhang +使者shizhe +侍者shizhe +失真shizhen +市镇shizhen +市政shizheng +试制shizhi +实质shizhi +市制shizhi +食指shizhi +失职shizhi +适中shizhong +示众shizhong +始终shizhong +时装shizhuang +师资shizi +十足shizu +实足shizu +失足shizu +始祖shizu +手shou +受shou +收shou +首shou +守shou +熟*shou +授shou +寿shou +兽shou +售shou +瘦shou +狩shou +绶shou +艏shou +守备shoubei +手表shoubiao +收兵shoubing +收藏shoucang +手册shouce +首倡shouchang +寿辰shouchen +收成shoucheng +首创shouchuang +首次shouci +收存shoucun +寿诞shoudan +受到shoudao +守敌shoudi +首度shoudu +首都shoudu +手段shouduan +守法shoufa +首犯shoufan +收复shoufu +首府shoufu +手感shougan +手稿shougao +收割shouge +收购shougou +受害shouhai +守候shouhou +守护shouhu +收回shouhui +受贿shouhui +收获shouhuo +收集shouji +售价shoujia +受奖shoujiang +授奖shoujiang +手脚shoujiao +收缴shoujiao +首届shoujie +守旧shoujiu +收据shouju +授课shouke +受理shouli +收敛shoulian +首领shouling +收留shouliu +收录shoulu +收买shoumai +授命shouming +寿命shouming +首脑shounao +首批shoupi +授权shouquan +收容shourong +收入shouru +手软shouruan +瘦弱shouruo +首饰shoushi +手术shoushu +收缩shousuo +收条shoutiao +收听shouting +收尾shouwei +首尾shouwei +首先shouxian +首相shouxiang +瘦小shouxiao +收效shouxiao +手续shouxu +瘦削shouxue +收养shouyang +首要shouyao +受益shouyi +收益shouyi +兽医shouyi +受用shouyong +授予shouyu +守则shouze +首长shouzhang +收支shouzhi +生活上shs +上海市shs +数shu +书shu +树shu +属shu +术shu +输shu +述shu +熟shu +束shu +鼠shu +疏shu +殊shu +舒shu +蔬shu +薯shu +叔shu +署shu +枢shu +梳shu +抒shu +淑shu +赎shu +孰shu +暑shu +曙shu +蜀shu +黍shu +戍shu +竖shu +墅shu +庶shu +漱shu +恕shu +俞*shu +丨shu +倏shu +塾shu +菽shu +摅shu +沭shu +澍shu +姝shu +纾shu +毹shu +腧shu +殳shu +秫shu +刷shua +耍shua +唰shua +衰shuai +帅shuai +摔shuai +甩shuai +蟀shuai +衰败shuaibai +摔打shuaida +摔交shuaijiao +衰竭shuaijie +衰老shuailao +衰弱shuairuo +衰退shuaitui +衰亡shuaiwang +耍赖shualai +栓shuan +拴shuan +闩shuan +涮shuan +双shuang +霜shuang +爽shuang +泷*shuang +孀shuang +双边shuangbian +双方shuangfang +爽口shuangkou +爽快shuangkuai +爽朗shuanglang +双拼shuangpin +双重shuangzhong +耍弄shuanong +刷洗shuaxi +刷新shuaxin +书报shubao +书本shuben +蔬菜shucai +舒畅shuchang +输出shuchu +树丛shucong +疏导shudao +书店shudian +数额shue +抒发shufa +书法shufa +舒服shufu +束缚shufu +曙光shuguang +蜀汉shuhan +疏忽shuhu +倏忽shuhu +书画shuhua +水shui +说*shui +谁shui +睡shui +税shui +水稻shuidao +水电shuidian +水分shuifen +水果shuiguo +水火shuihuo +水晶shuijing +水库shuiku +水利shuili +水流shuiliu +睡眠shuimian +水平shuiping +税收shuishou +税务shuiwu +水下shuixia +水性shuixing +水源shuiyuan +水灾shuizai +谁知shuizhi +书记shuji +书籍shuji +暑假shujia +数据shuju +书刊shukan +数理shuli +树立shuli +竖立shuli +熟练shulian +数量shuliang +数列shulie +疏漏shulou +数落shuluo +数码shuma +书面shumian +庶民shumin +数目shumu +书目shumu +树木shumu +顺shun +吮shun +瞬shun +舜shun +顺便shunbian +顺差shuncha +顺次shunci +顺从shuncong +顺当shundang +顺道shundao +顺风shunfeng +枢纽shuniu +顺利shunli +顺路shunlu +瞬时shunshi +顺势shunshi +顺心shunxin +顺序shunxu +顺应shunying +顺着shunzhuo +说shuo +数*shuo +硕shuo +朔shuo +烁shuo +蒴shuo +搠shuo +妁shuo +槊shuo +铄shuo +说到shuodao +说道shuodao +说动shuodong +说法shuofa +说服shuofu +硕果shuoguo +说话shuohua +说教shuojiao +说明shuoming +说情shuoqing +硕士shuoshi +述评shuping +署期shuqi +暑期shuqi +抒情shuqing +熟人shuren +输入shuru +疏散shusan +属实shushi +熟识shushi +舒适shushi +束手shushou +叔叔shushu +数说shushuo +述说shushuo +输送shusong +疏松shusong +舒坦shutan +疏通shutong +熟悉shuxi +属相shuxiang +舒心shuxin +书信shuxin +属性shuxing +数学shuxue +属于shuyu +术语shuyu +疏远shuyuan +舒展shuzhan +数值shuzhi +树脂shuzhi +梳妆shuzhuang +数字shuzi +赎罪shuzui +售货员shy +社会主义shzy +四si +思si +死si +斯si +丝si +似si +司si +饲si +食*si +私si +厕*si +撕si +嘶si +肆si +寺si +嗣si +伺si +巳si +厮si +俟*si +兕si +厶si +咝si +汜si +泗si +澌si +姒si +驷si +缌si +祀si +锶si +鸶si +耜si +蛳si +笥si +死板siban +四边sibian +死别sibie +思潮sichao +丝绸sichou +四处sichu +四川sichuan +死党sidang +死敌sidi +司法sifa +四方sifang +四海sihai +丝毫sihao +嗣后sihou +似乎sihu +四化sihua +死缓sihuan +撕毁sihui +死活sihuo +四季siji +司机siji +私交sijiao +四届sijie +思考sikao +私利sili +私了siliao +司令siling +思路silu +四面simian +思念sinian +私念sinian +死去siqu +私人siren +死伤sishang +私事sishi +死尸sishi +死水sishui +思索sisuo +四体siti +私吞situn +死亡siwang +思维siwei +斯文siwen +私下sixia +思想sixiang +四项sixiang +死心sixin +私心sixin +肆行sixing +死刑sixing +私有siyou +私欲siyu +寺院siyuan +四月siyue +死者sizhe +四周sizhou +私自sizi +死罪sizui +拾金不昧sjbm +身经百战sjbz +书记处sjc +世界观sjg +舍己救人sjjr +数据库sjk +省军区sjq +杀鸡取蛋sjqd +实际上sjs +设计所sjs +试金石sjs +舍己为人sjwr +设计院sjy +随机应变sjyb +十进制sjz +石家庄sjz +适可而止skez +数理化slh +收录机slj +十六进制sljz +三令五申slws +司令员sly +四面八方smbf +手忙脚乱smjl +生命力sml +说明书sms +什么样smy +深谋远虑smyl +数目字smz +松song +送song +宋song +颂song +耸song +怂song +讼song +诵song +凇song +菘song +崧song +嵩song +忪song +悚song +淞song +竦song +松绑songbang +送别songbie +松弛songchi +松动songdong +颂歌songge +松劲songjin +松快songkuai +耸立songli +送礼songli +松散songsan +松涛songtao +松懈songxie +颂扬songyang +怂恿songyong +送葬songzang +送终songzhong +搜sou +艘sou +擞sou +嗽sou +叟sou +薮sou +嗖sou +嗾sou +馊sou +溲sou +飕sou +瞍sou +锼sou +螋sou +搜查soucha +搜集souji +搜索sousuo +搜寻souxun +售票处spc +食品工业spgy +水平线spx +生气勃勃sqbb +诗情画意sqhy +盛气凌人sqlr +山穷水尽sqsj +十全十美sqsm +首屈一指sqyz +四人帮srb +损人利己srlj +深入浅出srqc +似是而非ssef +时时刻刻sskk +姗姗来迟sslc +实事求是ssqs +事实上sss +随时随地sssd +善始善终sssz +顺水推舟sstz +四通公司stgs +四通集团stjt +身体力行stlx +生态平衡stph +素su +速su +苏su +塑su +缩su +俗su +诉su +宿su +肃su +酥su +粟su +僳su +溯su +夙su +谡su +蔌su +嗉su +愫su +涑su +簌su +觫su +稣su +算suan +酸suan +蒜suan +狻suan +酸楚suanchu +算法suanfa +算计suanji +算了suanle +算盘suanpan +算术suanshu +酸疼suanteng +酸痛suantong +素材sucai +速成sucheng +苏丹sudan +速度sudu +俗话suhua +随sui +穗sui +碎sui +虽sui +岁sui +尿*sui +隋sui +绥sui +髓sui +遂sui +隧sui +祟sui +谇sui +荽sui +濉sui +邃sui +燧sui +眭sui +睢sui +随笔suibi +随便suibian +随处suichu +随从suicong +随地suidi +随和suihe +随后suihou +随机suiji +随即suiji +虽然suiran +随身suishen +随时suishi +随手suishou +岁数suishu +虽说suishuo +随同suitong +随心suixin +随行suixing +随意suiyi +遂意suiyi +岁月suiyue +虽则suize +随着suizhe +诉苦suku +苏联sulian +塑料suliao +速率sulu +素描sumiao +肃穆sumu +损sun +孙sun +笋sun +荪sun +狲sun +飧sun +榫sun +隼sun +损害sunhai +损耗sunhao +损坏sunhuai +损伤sunshang +损失sunshi +孙子sunzi +所suo +缩suo +锁suo +索suo +莎*suo +蓑suo +梭suo +唆suo +琐suo +唢suo +嗦suo +嗍suo +娑suo +桫suo +挲*suo +睃suo +羧suo +所得suode +缩短suoduan +缩减suojian +锁链suolian +所能suoneng +索取suoqu +唆使suoshi +所属suoshu +琐碎suosui +所为suowei +所谓suowei +缩小suoxiao +缩写suoxie +琐屑suoxie +索性suoxing +所以suoyi +索引suoyin +缩影suoying +所有suoyou +所在suozai +所长suozhang +所至suozhi +梭子suozi +肃清suqing +苏区suqu +宿舍sushe +素数sushu +诉说sushuo +诉讼susong +速效suxiao +速写suxie +苏醒suxing +素养suyang +宿营suying +溯源suyuan +宿愿suyuan +夙愿suyuan +塑造suzao +速战suzhan +素质suzhi +苏州suzhou +苏维埃swa +税务局swj +手舞足蹈swzd +少先队sxd +身心健康sxjk +思想上sxs +山西省sxs +陕西省sxs +顺息万变sxwb +所向无敌sxwd +思想性sxx +商业部syb +说一不二sybe +收音机syj +使用价值syjz +所有权syq +沈阳市sys +实用性syx +十一月syy +所有制syz +私有制syz +时至今日szjr +三中全会szqh +始终如一szry +深圳四通szst +所作所为szsw +甚至于szy +他t +同t +它t +提t +题t +体t +图t +天t +头t +通t +条t +特t +土t +团t +统t +台t +她t +太t +套t +铁t +他ta +它ta +她ta +塔ta +踏ta +塌ta +獭ta +挞ta +蹋ta +拓*ta +嗒*ta +闼ta +溻ta +漯*ta +遢ta +榻ta +沓ta +铊ta +趿ta +鳎ta +踏步tabu +他的tade +它的tade +她的tade +塌方tafang +台tai +太tai +态tai +胎tai +抬tai +泰tai +苔tai +酞tai +汰tai +邰tai +薹tai +呔*tai +骀*tai +肽tai +炱tai +钛tai +跆tai +鲐tai +台北taibei +台词taici +态度taidu +台风taifeng +台阶taijie +太平taiping +泰然tairan +泰山taishan +态势taishi +太太taitai +抬头taitou +台湾taiwan +太阳taiyang +太原taiyuan +天安门tam +他们tamen +它们tamen +她们tamen +谈tan +碳tan +探tan +炭tan +弹*tan +坦tan +贪tan +滩tan +坍tan +摊tan +瘫tan +坛tan +檀tan +痰tan +潭tan +谭tan +毯tan +袒tan +叹tan +郯tan +澹tan +昙tan +忐tan +钽tan +锬tan +镡*tan +坦白tanbai +探测tance +探访tanfang +谈锋tanfeng +叹服tanfu +堂tang +糖tang +唐tang +塘tang +汤tang +搪tang +棠tang +膛tang +倘tang +躺tang +淌tang +趟tang +烫tang +傥tang +帑tang +溏tang +瑭tang +樘tang +铴tang +镗tang +耥tang +螗tang +螳tang +羰tang +醣tang +倘不tangbu +搪瓷tangci +弹弓tangong +倘若tangruo +搪塞tangsai +烫伤tangshang +堂堂tangtang +唐突tangtu +弹劾tanhe +袒护tanhu +谈话tanhua +瘫痪tanhuan +探究tanjiu +坦克tanke +贪婪tanlan +坦率tanlu +谈论tanlun +摊派tanpai +谈判tanpan +叹气tanqi +探亲tanqin +弹琴tanqin +坦然tanran +探索tansuo +探讨tantao +谈天tantian +探听tanting +贪图tantu +谈吐tantu +滩涂tantu +探望tanwang +探问tanwen +贪污tanwu +叹息tanxi +探险tanxian +谈心tanxin +弹性tanxing +探询tanxun +贪赃tanzang +套tao +讨tao +逃tao +陶tao +萄tao +桃tao +掏tao +涛tao +滔tao +绦tao +淘tao +鼗tao +叨*tao +啕tao +洮tao +韬tao +焘tao +饕tao +逃奔taoben +逃避taobi +逃兵taobing +逃窜taocuan +逃遁taodun +讨伐taofa +讨饭taofan +套购taogou +讨好taohao +讨还taohuan +讨价taojia +桃李taoli +韬略taolue +讨论taolun +逃命taoming +逃难taonan +逃跑taopao +淘气taoqi +逃生taosheng +淘汰taotai +滔滔taotao +逃脱taotuo +逃亡taowang +讨厌taoyan +陶冶taoye +桃子taozi +逃走taozou +陶醉taozui +踏青taqing +他人taren +踏实tashi +他说tashuo +他乡taxiang +挑拨离间tblj +台北市tbs +贪便宜tby +统筹兼顾tcjg +铁道部tdb +土地改革tdgg +同等学历tdxl +特te +忒te +忑te +慝*te +铽te +特别tebie +特产techan +特长techang +特出techu +特此teci +特大teda +特等tedeng +特地tedi +特点tedian +特定teding +特级teji +特技teji +特急teji +特将tejiang +特刊tekan +特快tekuai +特例teli +腾teng +疼teng +藤teng +誊teng +滕teng +疼爱tengai +腾达tengda +誊写tengxie +特派tepai +特区tequ +特权tequan +托儿所tes +特色tese +特使teshi +特殊teshu +特为tewei +特务tewu +特效texiao +特写texie +特性texing +特邀teyao +特意teyi +特有teyou +特约teyue +特征tezheng +特制tezhi +特种tezhong +突飞猛进tfmj +铁饭碗tfw +同甘共苦tggk +提货单thd +谈何容易thry +提ti +题ti +体ti +替ti +梯ti +惕ti +剔ti +踢ti +锑ti +蹄ti +啼ti +嚏ti +涕ti +剃ti +屉ti +倜ti +荑*ti +悌ti +逖ti +绨*ti +缇ti +鹈ti +裼ti +醍ti +天tian +田tian +添tian +填tian +甜tian +佃*tian +恬tian +舔tian +腆tian +掭tian +忝tian +阗tian +殄tian +畋tian +填报tianbao +天边tianbian +填表tianbiao +填补tianbu +天才tiancai +天长tianchang +填充tianchong +天地tiandi +田地tiandi +天鹅tiane +天府tianfu +天赋tianfu +天机tianji +天际tianji +添加tianjia +天津tianjin +恬静tianjing +天空tiankong +填空tiankong +天理tianli +天良tianliang +天亮tianliang +甜美tianmei +甜蜜tianmi +天明tianming +天平tianping +天气tianqi +天桥tianqiao +天然tianran +天壤tianrang +天色tianse +天上tianshang +天生tiansheng +天使tianshi +天堂tiantang +天体tianti +天天tiantian +甜头tiantou +天文tianwen +天下tianxia +天险tianxian +天仙tianxian +天性tianxing +天涯tianya +田野tianye +天真tianzhen +天职tianzhi +添置tianzhi +天资tianzi +条tiao +调*tiao +跳tiao +挑tiao +迢tiao +眺tiao +佻tiao +苕*tiao +祧tiao +窕tiao +蜩tiao +笤tiao +粜tiao +龆tiao +鲦tiao +髫tiao +挑拔tiaoba +跳动tiaodong +挑动tiaodong +挑逗tiaodou +跳高tiaogao +调和tiaohe +调剂tiaoji +条件tiaojian +调解tiaojie +调节tiaojie +条款tiaokuan +调理tiaoli +条理tiaoli +条例tiaoli +条令tiaoling +调配tiaopei +挑剔tiaoti +调停tiaoting +条文tiaowen +跳舞tiaowu +调戏tiaoxi +挑衅tiaoxin +挑选tiaoxuan +条约tiaoyue +挑战tiaozhan +调整tiaozheng +条子tiaozi +提拨tibo +题材ticai +体裁ticai +体操ticao +体察ticha +提倡tichang +提成ticheng +提出tichu +剔除tichu +题词tici +替代tidai +梯队tidui +铁tie +贴tie +帖tie +萜tie +餮tie +贴补tiebu +铁道tiedao +贴近tiejin +铁路tielu +贴切tieqie +贴身tieshen +铁证tiezheng +提法tifa +提防tifang +提纲tigang +提高tigao +体格tige +提供tigong +替换tihuan +体会tihui +提货tihuo +体积tiji +提价tijia +体力tili +体例tili +提炼tilian +体谅tiliang +体面timian +提名timing +题名timing +题目timu +听ting +停ting +庭ting +挺ting +廷ting +厅ting +烃ting +汀ting +亭ting +艇ting +莛ting +葶ting +婷ting +梃ting +町*ting +铤ting +蜓ting +霆ting +挺拔tingba +停办tingban +停泊tingbo +停产tingchan +听从tingcong +停顿tingdun +停工tinggong +挺括tinggua +听候tinghou +听话tinghua +停火tinghuo +听见tingjian +厅局tingju +听觉tingjue +停留tingliu +听凭tingping +听取tingqu +听任tingren +听说tingshuo +听信tingxin +厅长tingzhang +停止tingzhi +停职tingzhi +停滞tingzhi +听众tingzhong +提起tiqi +提前tiqian +提取tiqu +提升tisheng +提示tishi +体坛titan +体贴titie +提问tiwen +体温tiwen +体系tixi +体现tixian +体型tixing +提醒tixing +体验tiyan +提要tiyao +提议tiyi +体育tiyu +体制tizhi +体质tizhi +题字tizi +统计表tjb +条件反射tjfs +讨价还价tjhj +天津市tjs +条件下tjx +讨论会tlh +拖拉机tlj +他们的tmd +同盟会tmh +天南地北tndb +同tong +通tong +统tong +铜tong +痛tong +筒tong +童tong +桶tong +侗*tong +恫*tong +桐tong +酮tong +瞳tong +彤tong +捅tong +佟tong +仝tong +垌*tong +茼tong +嗵tong +峒*tong +恸tong +潼tong +砼tong +同伴tongban +同胞tongbao +通报tongbao +同辈tongbei +通病tongbing +同步tongbu +通常tongchang +通称tongcheng +统称tongcheng +痛斥tongchi +统筹tongchou +痛楚tongchu +同窗tongchuang +同道tongdao +通道tongdao +同等tongdeng +通电tongdian +通牒tongdie +通读tongdu +通告tonggao +统购tonggou +通过tongguo +通航tonghang +痛恨tonghen +同化tonghua +通话tonghua +童话tonghua +痛悔tonghui +通婚tonghun +统计tongji +通辑tongji +痛击tongji +同居tongju +痛苦tongku +痛哭tongku +痛快tongkuai +同僚tongliao +通令tongling +同盟tongmeng +同年tongnian +童年tongnian +同期tongqi +通气tongqi +同情tongqing +通融tongrong +同上tongshang +通商tongshang +同时tongshi +同事tongshi +统属tongshu +统帅tongshuai +通顺tongshun +通俗tongsu +通往tongwang +痛恶tongwu +痛惜tongxi +统辖tongxia +通向tongxiang +同乡tongxiang +统销tongxiao +通宵tongxiao +通晓tongxiao +同心tongxin +痛心tongxin +通信tongxin +同行tongxing +通行tongxing +同性tongxing +同学tongxue +通讯tongxun +同样tongyang +统一tongyi +同意tongyi +通用tongyong +通邮tongyou +统战tongzhan +同志tongzhi +统治tongzhi +通知tongzhi +头tou +投tou +透tou +偷tou +钭tou +骰tou +投案touan +头版touban +投奔touben +投标toubiao +投产touchan +透彻touche +头等toudeng +投放toufang +投机touji +投靠toukao +投篮toulan +偷懒toulan +头颅toulu +透露toulu +头面toumian +透明touming +头目toumu +头脑tounao +投票toupiao +透气touqi +投入touru +投身toushen +透视toushi +头痛toutong +偷闲touxian +投降touxiang +头绪touxu +投影touying +投掷touzhi +头子touzi +投资touzi +突破口tpk +太平洋tpy +通情达理tqdl +天气预报tqyb +突然袭击trxj +妥善处理tscl +通俗读物tsdw +挺身而出tsec +图书馆tsg +滔滔不绝ttbj +痛痛快快ttkk +团体赛tts +踏踏实实ttss +图tu +土tu +突tu +途tu +徒tu +凸tu +涂tu +吐tu +兔tu +屠tu +秃tu +堍tu +荼tu +菟tu +钍tu +酴tu +团tuan +湍tuan +抟tuan +彖tuan +疃tuan +图案tuan +湍急tuanji +团结tuanjie +团聚tuanju +湍流tuanliu +团体tuanti +团员tuanyuan +团圆tuanyuan +团长tuanzhang +突变tubian +图表tubiao +土产tuchan +突出tuchu +土地tudi +徒弟tudi +土匪tufei +土改tugai +涂改tugai +图画tuhua +土话tuhua +推tui +退tui +腿tui +颓tui +蜕tui +褪tui +忒*tui +煺tui +蜕变tuibian +退步tuibu +推测tuice +推迟tuichi +推崇tuichong +退出tuichu +推导tuidao +推动tuidong +推断tuiduan +推翻tuifan +颓废tuifei +推广tuiguang +退化tuihua +蜕化tuihua +退回tuihui +推荐tuijian +推进tuijin +推举tuiju +推开tuikai +推理tuili +推论tuilun +推敲tuiqiao +推却tuique +退却tuique +推让tuirang +退让tuirang +颓丧tuisang +退色tuise +推算tuisuan +退缩tuisuo +颓唐tuitang +推托tuituo +退伍tuiwu +推向tuixiang +推销tuixiao +推卸tuixie +推行tuixing +退休tuixiu +退学tuixue +推移tuiyi +退职tuizhi +突击tuji +图解tujie +途径tujing +徒劳tulao +图例tuli +吐露tulu +囤*tun +褪*tun +吞tun +屯tun +臀tun +氽tun +饨tun +暾tun +豚tun +吞并tunbing +吞没tunmo +吞吐tuntu +脱tuo +拖tuo +托tuo +妥tuo +椭tuo +舵*tuo +魄*tuo +鸵tuo +陀tuo +驮tuo +驼tuo +拓tuo +唾tuo +乇tuo +佗tuo +坨tuo +庹tuo +沱tuo +柝tuo +柁*tuo +橐tuo +砣tuo +铊*tuo +箨tuo +酡tuo +跎tuo +鼍tuo +驼背tuobei +拓补tuobu +脱出tuochu +妥当tuodang +脱轨tuogui +拓荒tuohuang +脱节tuojie +拖拉tuola +脱离tuoli +唾骂tuoma +唾弃tuoqi +妥善tuoshan +脱身tuoshen +妥协tuoxie +拖延tuoyan +唾液tuoye +图片tupian +突破tupo +突起tuqi +突然turan +徒然turan +土壤turang +屠杀tusha +徒手tushou +图书tushu +吐痰tutan +突围tuwei +突兀tuwu +图象tuxiang +图像tuxiang +图形tuxing +徒刑tuxing +图章tuzhang +图纸tuzhi +途中tuzhong +土著tuzhu +秃子tuzi +贪污盗窃twdq +台湾省tws +贪污受贿twsh +提心吊胆txdd +通讯社txs +同心同德txtd +同心协力txxl +推心置腹txzf +体育场tyc +体育锻炼tydl +体育馆tyg +腾云驾雾tyjw +太阳能tyn +太原市tys +天衣无缝tywf +通用性tyx +体育运动tyyd +团支部tzb +停滞不前tzbq +同志们tzm +天灾人祸tzrh +听之任之tzrz +通知书tzs +为w +我w +无w +问w +外w +五w +位w +物w +委w +完w +温w +万w +文w +往w +武w +务w +王w +围w +误w +晚w +瓦wa +挖wa +凹*wa +哇wa +蛙wa +洼wa +娃wa +袜wa +佤wa +娲wa +腽wa +外wai +歪wai +外币waibi +外边waibian +外表waibiao +外宾waibin +外部waibu +外传waichuan +外存waicun +外地waidi +外调waidiao +歪风waifeng +外观waiguan +外国waiguo +外行waihang +外汇waihui +外加waijia +外交waijiao +外界waijie +外景waijing +外科waike +外快waikuai +外流wailiu +外貌waimao +外贸waimao +外面waimian +外勤waiqin +歪曲waiqu +外商waishang +外伤waishang +外设waishe +外省waisheng +外甥waisheng +外事waishi +外围waiwei +外文waiwen +外线waixian +外销waixiao +歪斜waixie +外延waiyan +外因waiyin +外语waiyu +外援waiyuan +外在waizai +外债waizhai +外资waizi +瓦解wajie +挖掘wajue +挖苦waku +瓦砾wali +完wan +万wan +晚wan +弯wan +碗wan +顽wan +湾wan +挽wan +玩wan +蔓*wan +娩*wan +豌wan +丸wan +烷wan +皖wan +惋wan +宛wan +婉wan +腕wan +剜wan +芄wan +莞*wan +菀wan +纨wan +绾wan +琬wan +脘wan +畹wan +蜿wan +万般wanban +晚报wanbao +完备wanbei +完毕wanbi +完成wancheng +万代wandai +顽敌wandi +万吨wandun +万恶wane +万分wanfen +往wang +王wang +望wang +网wang +忘wang +妄wang +亡wang +旺wang +芒*wang +汪wang +枉wang +罔wang +尢wang +惘wang +辋wang +魍wang +往常wangchang +王朝wangchao +忘掉wangdiao +妄动wangdong +枉法wangfa +往返wangfan +枉费wangfei +往复wangfu +王国wangguo +亡国wangguo +往后wanghou +忘怀wanghuai +忘记wangji +旺季wangji +往来wanglai +网络wangluo +亡命wangming +往年wangnian +完工wangong +忘却wangque +枉然wangran +惘然wangran +往日wangri +旺盛wangsheng +往事wangshi +妄图wangtu +万古wangu +顽固wangu +往往wangwang +汪汪wangwang +忘我wangwo +往昔wangxi +妄想wangxiang +汪洋wangyang +望远wangyuan +王子wangzi +完好wanhao +晚会wanhui +挽回wanhui +晚婚wanhun +晚间wanjian +完结wanjie +挽救wanjiu +玩具wanju +顽抗wankang +完了wanle +挽力wanli +弯路wanlu +完美wanmei +万能wanneng +万年wannian +晚年wannian +玩弄wannong +晚期wanqi +顽强wanqiang +弯曲wanqu +完全wanquan +完善wanshan +晚上wanshang +玩赏wanshang +万事wanshi +万世wanshi +玩耍wanshua +万岁wansui +万万wanwan +万物wanwu +晚霞wanxia +万象wanxiang +玩笑wanxiao +万幸wanxing +婉言wanyan +万一wanyi +万元wanyuan +完整wanzheng +顽症wanzheng +万众wanzhong +宛转wanzhuan +瓦斯wasi +瓦特wate +娃娃wawa +外部设备wbsb +微不足道wbzd +无产阶级wcjj +微处理机wclj +无产者wcz +为wei +位wei +委wei +围wei +维wei +唯wei +卫wei +微wei +伟wei +未wei +威wei +危wei +尾wei +谓wei +喂wei +味wei +胃wei +魏wei +伪wei +遗*wei +违wei +韦wei +畏wei +纬wei +巍wei +桅wei +惟wei +潍wei +苇wei +萎wei +蔚wei +渭wei +尉wei +慰wei +偎wei +诿wei +隈wei +隗*wei +圩*wei +葳wei +薇wei +囗wei +帏wei +帷wei +崴wei +嵬wei +猥wei +猬wei +闱wei +沩wei +洧wei +涠wei +逶wei +娓wei +玮wei +韪wei +軎wei +炜wei +煨wei +痿wei +艉wei +鲔wei +尾巴weiba +违背weibei +未必weibi +威逼weibi +微波weibo +微薄weibo +未曾weiceng +未尝weichang +维持weichi +为此weici +伟大weida +味道weidao +纬度weidu +唯独weidu +巍峨weie +违法weifa +违反weifan +违犯weifan +威风weifeng +桅杆weigan +微观weiguan +危害weihai +为何weihe +维护weihu +危及weiji +微机weiji +危机weiji +危急weiji +围歼weijian +围剿weijiao +慰藉weijie +违禁weijin +未经weijing +畏惧weiju +违抗weikang +未可weike +唯恐weikong +惟恐weikong +胃口weikou +未来weilai +慰劳weilao +为了weile +威力weili +委靡weimi +未免weimian +微妙weimiao +帷幕weimu +危难weinan +畏难weinan +未能weineng +委派weipai +为期weiqi +畏怯weiqie +委曲weiqu +委屈weiqu +未然weiran +巍然weiran +围绕weirao +伟人weiren +委任weiren +微弱weiruo +威慑weishe +为生weisheng +卫生weisheng +尾声weisheng +卫士weishi +威势weishi +为首weishou +为数weishu +尾随weisui +未遂weisui +畏缩weisuo +萎缩weisuo +猥琐weisuo +委托weituo +委婉weiwan +危亡weiwang +巍巍weiwei +慰问weiwen +唯物weiwu +威武weiwu +微细weixi +威吓weixia +危险weixian +微小weixiao +微笑weixiao +威协weixie +威胁weixie +猥亵weixie +维新weixin +唯心weixin +违心weixin +威信weixin +微型weixing +卫星weixing +维修weixiu +威严weiyan +伟业weiye +唯一weiyi +位移weiyi +位于weiyu +谓语weiyu +委员weiyuan +为止weizhi +位置weizhi +未知weizhi +为重weizhong +为主weizhu +伪装weizhuang +问wen +温wen +文wen +稳wen +纹wen +闻wen +蚊wen +瘟wen +吻wen +紊wen +刎wen +阌wen +汶wen +璺wen +雯wen +文本wenben +瘟病wenbing +稳步wenbu +问答wenda +稳定wending +温度wendu +嗡weng +翁weng +瓮weng +蓊weng +蕹weng +稳固wengu +问好wenhao +温和wenhe +吻合wenhe +文化wenhua +文件wenjian +稳健wenjian +问津wenjin +文静wenjing +文具wenju +文科wenke +文盲wenmang +文明wenming +闻名wenming +温暖wennuan +文凭wenping +文人wenren +温柔wenrou +问世wenshi +文坛wentan +问题wenti +文体wenti +稳妥wentuo +文物wenwu +文献wenxian +文选wenxuan +文学wenxue +问讯wenxun +闻讯wenxun +文艺wenyi +瘟疫wenyi +文娱wenyu +文摘wenzhai +文章wenzhang +稳重wenzhong +文字wenzi +问罪wenzui +望而生畏wesw +闻风而动wfed +违法乱纪wflj +歪风邪气wfxq +温故知新wgzx +文化部whb +文汇报whb +文化馆whg +文化宫whg +武汉市whs +五湖四海whsh +忘乎所以whsy +问寒问暖whwn +文化娱乐whyl +玩忽职守whzs +外交部wjb +无纪律wjl +五讲四美wjsm +无拘无束wjws +无可奉告wkfg +无可非议wkfy +无可奈何wknh +乌鲁木齐wlmq +无理取闹wlqn +无论如何wlrh +物美价廉wmjl +误码率wml +文明礼貌wmlm +无名英雄wmyx +无能为力wnwl +我wo +握wo +窝wo +蜗wo +涡wo +沃wo +挝wo +卧wo +斡wo +倭wo +莴wo +喔wo +幄wo +渥wo +肟wo +硪wo +龌wo +窝藏wocang +卧床wochuang +我党wodang +卧倒wodao +我的wode +窝工wogong +我国woguo +我军wojun +我们women +窝囊wonang +我省wosheng +我校woxiao +为期不远wqby +无穷无尽wqwj +误入歧途wrqt +卫生部wsb +纹丝不动wsbd +万事大吉wsdj +万事俱备wsjb +为什么wsm +无所谓wsw +为所欲为wsyw +无所作为wszw +无wu +五wu +物wu +武wu +务wu +误wu +伍wu +舞wu +污wu +悟wu +雾wu +午wu +恶*wu +屋wu +乌wu +吴wu +亡*wu +诬wu +钨wu +巫wu +呜wu +芜wu +梧wu +吾wu +毋wu +捂wu +侮wu +坞wu +戊wu +晤wu +勿wu +兀wu +仵wu +阢wu +邬wu +圬wu +芴wu +唔wu +庑wu +怃wu +忤wu +浯wu +寤wu +迕wu +妩wu +婺wu +骛wu +杌wu +牾wu +於*wu +焐wu +鹉wu +鹜wu +痦wu +蜈wu +鋈wu +鼯wu +吾辈wubei +无比wubi +五笔wubi +务必wubi +舞弊wubi +无边wubian +无不wubu +五彩wucai +误差wucha +无常wuchang +无偿wuchang +舞场wuchang +武昌wuchang +无耻wuchi +无从wucong +武打wuda +舞蹈wudao +无敌wudi +舞动wudong +武斗wudou +武断wuduan +无法wufa +无妨wufang +无非wufei +武功wugong +污垢wugou +无故wugu +无关wuguan +五官wuguan +武官wuguan +无害wuhai +诬害wuhai +武汉wuhan +无何wuhe +乌黑wuhei +五湖wuhu +呜呼wuhu +误会wuhui +舞会wuhui +污秽wuhui +无及wuji +无机wuji +物价wujia +无间wujian +物件wujian +误解wujie +五届wujie +五金wujin +无愧wukui +无赖wulai +诬赖wulai +无理wuli +物理wuli +无礼wuli +物力wuli +武力wuli +无聊wuliao +无虑wulu +无论wulun +污蔑wumie +诬蔑wumie +无奈wunai +无能wuneng +毋宁wuning +务农wunong +物品wupin +无期wuqi +五七wuqi +武器wuqi +无情wuqing +无穷wuqiong +舞曲wuqu +无权wuquan +污染wuran +无任wuren +污辱wuru +侮辱wuru +物色wuse +无上wushang +误伤wushang +无声wusheng +午时wushi +务使wushi +无视wushi +误事wushi +务实wushi +无数wushu +武术wushu +无双wushuang +午睡wushui +五四wusi +无私wusi +舞台wutai +无题wuti +物体wuti +舞厅wuting +无为wuwei +无谓wuwei +无物wuwu +无暇wuxia +无限wuxian +诬陷wuxian +无效wuxiao +五星wuxing +午休wuxiu +无须wuxu +无需wuxu +务虚wuxu +午夜wuye +五一wuyi +无益wuyi +无疑wuyi +无垠wuyin +无用wuyong +毋庸wuyong +无余wuyu +无缘wuyuan +五月wuyue +物证wuzheng +无知wuzhi +物质wuzhi +武装wuzhuang +物资wuzi +兀自wuzi +误字wuzi +无罪wuzui +无微不至wwbz +唯物论wwl +卧薪尝胆wxcd +无线电wxd +微型机wxj +唯心论wxl +问心无愧wxwk +委员会wyh +无缘无故wywg +委员长wyz +误字率wzl +无足轻重wzqz +未知数wzs +完整无缺wzwq +学x +下x +行x +小x +线x +性x +新x +些x +想x +心x +向x +相x +系x +席x +现x +西x +修x +象x +先x +形x +心安理得xald +西安市xas +西半球xbq +相比之下xbzx +宣传部xcb +新陈代谢xcdx +新产品xcp +畜产品xcp +西城区xcq +喜出望外xcww +相对而言xdey +现代化xdh +想当然xdr +相对误差xdwc +先睹为快xdwk +形而上学xesx +显而易见xeyj +西方国家xfgj +消费品xfp +想方设法xfsf +先发制人xfzr +兴高采烈xgcl +新华社xhs +新华书店xhsd +系xi +席xi +西xi +习xi +细xi +吸xi +析xi +喜xi +洗xi +铣xi +稀xi +戏xi +隙xi +希xi +息xi +袭xi +锡xi +烯xi +牺xi +悉xi +惜xi +溪xi +腊*xi +栖*xi +昔xi +熙xi +硒xi +矽xi +晰xi +嘻xi +膝xi +夕xi +熄xi +汐xi +犀xi +檄xi +媳xi +僖xi +兮xi +隰xi +郗xi +茜*xi +菥xi +葸xi +蓰xi +奚xi +唏xi +徙xi +饩xi +阋xi +浠xi +淅xi +屣xi +嬉xi +玺xi +樨xi +曦xi +觋xi +欷xi +歙*xi +熹xi +禊xi +禧xi +皙xi +穸xi +裼*xi +蜥xi +螅xi +蟋xi +舄xi +舾xi +羲xi +粞xi +翕xi +醯xi +蹊*xi +鼷xi +下xia +夏xia +吓xia +狭xia +霞xia +唬*xia +瞎xia +虾xia +匣xia +辖xia +暇xia +峡xia +侠xia +厦xia +呷xia +狎xia +遐xia +瑕xia +柙xia +硖xia +瘕*xia +罅xia +黠xia +狭隘xiaai +下班xiaban +下辈xiabei +下边xiabian +下策xiace +下层xiaceng +下场xiachang +下沉xiachen +下次xiaci +瑕疵xiaci +下达xiada +吓倒xiadao +下等xiadeng +下毒xiadu +下发xiafa +下放xiafang +峡谷xiagu +霞光xiaguang +瞎话xiahua +喜爱xiai +下级xiaji +下集xiaji +夏季xiaji +下降xiajiang +侠客xiake +下来xialai +下联xialian +夏粮xialiang +下列xialie +下令xialing +下流xialiu +下落xialuo +下马xiama +厦门xiamen +下面xiamian +线xian +现xian +先xian +县xian +限xian +见*xian +显xian +鲜xian +献xian +险xian +陷xian +宪xian +纤xian +洗*xian +掀xian +弦xian +铣*xian +腺xian +锨xian +仙xian +咸xian +贤xian +衔xian +舷xian +闲xian +涎xian +嫌xian +馅xian +羡xian +冼xian +苋xian +莶xian +藓xian +岘xian +猃xian +暹xian +娴xian +氙xian +燹xian +祆xian +鹇xian +痫xian +蚬xian +筅xian +籼xian +酰xian +跣xian +跹xian +霰xian +西安xian +献宝xianbao +先辈xianbei +现场xianchang +现成xiancheng +县城xiancheng +献丑xianchou +献词xianci +现存xiancun +现代xiandai +先导xiandao +显得xiande +险地xiandi +限定xianding +限度xiandu +线段xianduan +限额xiane +险恶xiane +宪法xianfa +先锋xianfeng +险峰xianfeng +想xiang +向xiang +相xiang +象xiang +响xiang +项xiang +箱xiang +乡xiang +降*xiang +香xiang +像xiang +详xiang +橡xiang +享xiang +湘xiang +厢xiang +镶xiang +襄xiang +翔xiang +祥xiang +巷xiang +芗xiang +葙xiang +饷xiang +庠xiang +骧xiang +缃xiang +蟓xiang +鲞xiang +飨xiang +相爱xiangai +相比xiangbi +想必xiangbi +相差xiangcha +相称xiangcheng +相处xiangchu +相传xiangchuan +乡村xiangcun +相当xiangdang +向导xiangdao +相等xiangdeng +相对xiangdui +想法xiangfa +相反xiangfan +相仿xiangfang +相干xianggan +香港xianggang +相隔xiangge +相关xiangguan +相好xianghao +相互xianghu +相继xiangji +相加xiangjia +相见xiangjian +相减xiangjian +相交xiangjiao +橡胶xiangjiao +相近xiangjin +详尽xiangjin +巷口xiangkou +向来xianglai +相连xianglian +向量xiangliang +响亮xiangliang +相貌xiangmao +项目xiangmu +想念xiangnian +相片xiangpian +想起xiangqi +详情xiangqing +向上xiangshang +相声xiangsheng +响声xiangsheng +相识xiangshi +翔实xiangshi +享受xiangshou +相思xiangsi +相似xiangsi +香甜xiangtian +相同xiangtong +相投xiangtou +显贵xiangui +向往xiangwang +详细xiangxi +向下xiangxia +乡下xiangxia +象限xiangxian +想象xiangxiang +相信xiangxin +香烟xiangyan +相依xiangyi +相宜xiangyi +相应xiangying +相映xiangying +响应xiangying +享用xiangyong +相遇xiangyu +相约xiangyue +乡镇xiangzhen +象征xiangzheng +箱子xiangzi +陷害xianhai +显赫xianhe +鲜红xianhong +先后xianhou +鲜花xianhua +献花xianhua +闲话xianhua +贤惠xianhui +献计xianji +献技xianji +显见xianjian +衔接xianjie +先进xianjin +现金xianjin +险境xianjing +陷阱xianjing +现款xiankuan +现况xiankuang +先例xianli +献礼xianli +先烈xianlie +线路xianlu +显露xianlu +鲜美xianmei +鲜明xianming +贤明xianming +显目xianmu +羡慕xianmu +贤能xianneng +先期xianqi +掀起xianqi +限期xianqi +嫌弃xianqi +先前xianqian +先遣xianqian +险情xianqing +先驱xianqu +显然xianran +贤人xianren +闲人xianren +现任xianren +陷入xianru +闲散xiansan +献身xianshen +先生xiansheng +先是xianshi +现实xianshi +显示xianshi +娴熟xianshu +线索xiansuo +闲谈xiantan +险滩xiantan +先天xiantian +线条xiantiao +县委xianwei +纤维xianwei +显现xianxian +现象xianxiang +现行xianxing +鲜血xianxue +显眼xianyan +鲜艳xianyan +显要xianyao +险要xianyao +显耀xianyao +现役xianyi +嫌疑xianyi +现有xianyou +限于xianyu +闲杂xianza +现在xianzai +县长xianzhang +宪章xianzhang +限制xianzhi +先知xianzhi +闲置xianzhi +闲职xianzhi +显著xianzhu +现状xianzhuang +险阻xianzu +小xiao +消xiao +削xiao +效xiao +笑xiao +校xiao +销xiao +硝xiao +萧xiao +肖xiao +孝xiao +霄xiao +哮xiao +嚣xiao +宵xiao +淆xiao +晓xiao +啸xiao +哓xiao +崤xiao +潇xiao +逍xiao +骁xiao +绡xiao +枭xiao +枵xiao +蛸*xiao +筱xiao +箫xiao +魈xiao +小报xiaobao +小辈xiaobei +笑柄xiaobing +消沉xiaochen +消除xiaochu +消毒xiaodu +效法xiaofa +小贩xiaofan +消防xiaofang +消费xiaofei +校风xiaofeng +小鬼xiaogui +效果xiaoguo +小孩xiaohai +消耗xiaohao +消化xiaohua +笑话xiaohua +小惠xiaohui +销毁xiaohui +销魂xiaohun +消极xiaoji +削减xiaojian +小结xiaojie +小姐xiaojie +孝敬xiaojing +校刊xiaokan +小康xiaokang +效劳xiaolao +效力xiaoli +销路xiaolu +效率xiaolu +消灭xiaomie +消磨xiaomo +效能xiaoneng +消气xiaoqi +消遣xiaoqian +笑容xiaorong +削弱xiaoruo +潇洒xiaosa +校舍xiaoshe +小时xiaoshi +消失xiaoshi +消逝xiaoshi +消瘦xiaoshou +销售xiaoshou +小数xiaoshu +小说xiaoshuo +萧条xiaotiao +消息xiaoxi +肖像xiaoxiang +小心xiaoxin +枭雄xiaoxiong +小学xiaoxue +效验xiaoyan +逍遥xiaoyao +效益xiaoyi +效应xiaoying +校友xiaoyou +小于xiaoyu +校园xiaoyuan +销赃xiaozang +校长xiaozhang +嚣张xiaozhang +效忠xiaozhong +小组xiaozu +下情xiaqing +下去xiaqu +辖区xiaqu +下手xiashou +夏收xiashou +下属xiashu +下水xiashui +下台xiatai +夏天xiatian +下文xiawen +下午xiawu +下限xiaxian +下乡xiaxiang +遐想xiaxiang +狭义xiayi +下游xiayou +狭窄xiazhai +夏至xiazhi +夏种xiazhong +喜报xibao +细胞xibao +西北xibei +西边xibian +稀薄xibo +锡箔xibo +西餐xican +洗涤xidi +吸毒xidu +些xie +解*xie +写xie +斜xie +谢xie +协xie +械xie +叶*xie +血*xie +卸xie +屑xie +鞋xie +歇xie +邪xie +胁xie +蟹xie +泄xie +泻xie +契*xie +楔xie +蝎xie +挟xie +携xie +谐xie +懈xie +偕xie +亵xie +勰xie +燮xie +薤xie +撷xie +獬xie +廨xie +渫xie +瀣xie +邂xie +绁xie +缬xie +榭xie +榍xie +颉*xie +躞xie +写出xiechu +协从xiecong +携带xiedai +邪道xiedao +协调xiediao +协定xieding +亵渎xiedu +邪恶xiee +协和xiehe +谐和xiehe +协会xiehui +谢绝xiejue +协力xieli +泄漏xielou +邪路xielu +泄露xielu +泄密xiemi +邪念xienian +胁迫xiepo +邪气xieqi +协商xieshang +写生xiesheng +携手xieshou +邪说xieshuo +协同xietong +歇息xiexi +谢谢xiexie +协议xieyi +谐音xieyin +协约xieyue +写照xiezhao +协助xiezhu +鞋子xiezi +写作xiezuo +协作xiezuo +西方xifang +西风xifeng +西服xifu +吸附xifu +媳妇xifu +习惯xiguan +西汉xihan +稀罕xihan +希罕xihan +喜欢xihuan +袭击xiji +细节xijie +洗劫xijie +喜剧xiju +戏剧xiju +席卷xijuan +细菌xijun +犀利xili +系列xilie +奚落xiluo +熄灭ximie +新xin +心xin +信xin +锌xin +芯xin +辛xin +寻*xin +欣xin +薪xin +忻xin +衅xin +囟xin +馨xin +昕xin +歆xin +镡*xin +鑫xin +心爱xinai +西南xinan +新春xinchun +信贷xindai +心得xinde +心烦xinfan +心服xinfu +信服xinfu +行xing +性xing +形xing +型xing +星xing +兴xing +省*xing +醒xing +姓xing +幸xing +腥xing +猩xing +惺xing +刑xing +邢xing +杏xing +陉xing +荇xing +荥xing +擤xing +饧xing +悻xing +硎xing +心甘xingan +兴办xingban +性别xingbie +姓别xingbie +刑场xingchang +星辰xingchen +形成xingcheng +行程xingcheng +行动xingdong +幸而xinger +刑法xingfa +刑罚xingfa +兴奋xingfen +幸福xingfu +性格xingge +幸好xinghao +型号xinghao +行贿xinghui +星火xinghuo +性急xingji +形迹xingji +兴建xingjian +行径xingjing +行军xingjun +星空xingkong +幸亏xingkui +行李xingli +行旅xinglu +幸免xingmian +性命xingming +姓名xingming +醒目xingmu +性能xingneng +行期xingqi +兴起xingqi +星期xingqi +性情xingqing +星球xingqiu +兴趣xingqu +形容xingrong +行商xingshang +兴盛xingsheng +行使xingshi +行事xingshi +行驶xingshi +形式xingshi +幸事xingshi +刑事xingshi +形势xingshi +姓氏xingshi +行署xingshu +兴衰xingshuai +形态xingtai +形体xingti +兴亡xingwang +兴旺xingwang +行为xingwei +行文xingwen +醒悟xingwu +形象xingxiang +行销xingxiao +星星xingxing +行凶xingxiong +兴修xingxiu +行业xingye +星夜xingye +幸运xingyun +行政xingzheng +性质xingzhi +兴致xingzhi +形状xingzhuang +行走xingzou +信号xinhao +心狠xinhen +心慌xinhuang +信汇xinhui +细腻xini +西宁xining +心急xinji +信件xinjian +新疆xinjiang +新近xinjin +新居xinju +心坎xinkan +辛苦xinku +信赖xinlai +辛劳xinlao +心理xinli +心里xinli +心灵xinling +心目xinmu +信念xinnian +戏弄xinong +新奇xinqi +辛勤xinqin +心情xinqing +新区xinqu +新人xinren +信任xinren +欣赏xinshang +新生xinsheng +心声xinsheng +新事xinshi +新式xinshi +新书xinshu +薪水xinshui +心酸xinsuan +辛酸xinsuan +心疼xinteng +心田xintian +心跳xintiao +心头xintou +欣慰xinwei +新闻xinwen +心细xinxi +信息xinxi +欣喜xinxi +新鲜xinxian +心想xinxiang +信箱xinxiang +馨香xinxiang +信心xinxin +新型xinxing +新星xinxing +新兴xinxing +心虚xinxu +心血xinxue +信仰xinyang +心意xinyi +新异xinyi +新颖xinying +信用xinyong +新余xinyu +信誉xinyu +心愿xinyuan +心脏xinzang +新址xinzhi +心中xinzhong +雄xiong +胸xiong +兄xiong +凶xiong +熊xiong +匈xiong +汹xiong +芎xiong +雄辩xiongbian +雄兵xiongbing +凶残xiongcan +兄弟xiongdi +凶恶xionge +雄关xiongguan +凶狠xionghen +雄厚xionghou +胸怀xionghuai +雄健xiongjian +胸口xiongkou +熊猫xiongmao +凶猛xiongmeng +匈奴xiongnu +凶器xiongqi +凶杀xiongsha +雄师xiongshi +凶手xiongshou +胸膛xiongtang +雄伟xiongwei +雄心xiongxin +汹涌xiongyong +雄壮xiongzhuang +雄姿xiongzi +西欧xiou +习气xiqi +吸气xiqi +喜气xiqi +稀奇xiqi +希奇xiqi +喜庆xiqing +吸取xiqu +戏曲xiqu +昔日xiri +牺牲xisheng +西式xishi +喜事xishi +稀释xishi +吸收xishou +系数xishu +洗刷xishua +吸吮xishun +习俗xisu +习题xiti +西天xitian +系统xitong +修xiu +锈xiu +休xiu +袖xiu +秀xiu +朽xiu +宿*xiu +臭*xiu +羞xiu +嗅xiu +绣xiu +咻xiu +岫xiu +馐xiu +庥xiu +溴xiu +鸺xiu +貅xiu +髹xiu +修补xiubu +秀才xiucai +羞耻xiuchi +修辞xiuci +修订xiuding +修复xiufu +修改xiugai +修建xiujian +修剪xiujian +嗅觉xiujue +休克xiuke +羞愧xiukui +修理xiuli +秀丽xiuli +秀气xiuqi +羞辱xiuru +羞涩xiuse +修饰xiushi +休息xiuxi +休想xiuxiang +修养xiuyang +休养xiuyang +修造xiuzao +袖章xiuzhang +袖珍xiuzhen +修正xiuzheng +修筑xiuzhu +希望xiwang +席位xiwei +细微xiwei +西文xiwen +檄文xiwen +细小xixiao +细心xixin +悉心xixin +喜讯xixun +吸烟xiyan +西洋xiyang +西医xiyi +吸引xiyin +希有xiyou +戏院xiyuan +喜悦xiyue +西藏xizang +洗澡xizao +细则xize +细致xizhi +习作xizuo +下基层xjc +现阶段xjd +新技术xjs +献计献策xjxc +先见之明xjzm +兴利除弊xlcb +系列化xlh +稀里糊涂xlht +狭路相逢xlxf +畜牧业xmy +心满意足xmyz +西宁市xns +小朋友xpy +向前看xqk +喜气洋洋xqyy +先人后己xrhj +兴师动众xsdz +销售额xse +刑事犯罪xsfz +小时候xsh +新时期xsq +新生事物xssw +形式主义xszy +相提并论xtbl +续xu +许xu +须xu +需xu +序xu +虚xu +絮xu +畜xu +叙xu +蓄xu +绪xu +徐xu +墟xu +戌xu +嘘xu +酗xu +旭xu +恤xu +婿xu +吁*xu +诩xu +勖xu +圩xu +蓿xu +洫xu +浒*xu +溆xu +顼xu +栩xu +煦xu +砉*xu +盱xu +胥xu +糈xu +醑xu +选xuan +旋xuan +宣xuan +悬xuan +玄xuan +券*xuan +轩xuan +喧xuan +癣xuan +眩xuan +绚xuan +儇xuan +谖xuan +萱xuan +揎xuan +泫xuan +渲xuan +漩xuan +璇xuan +楦xuan +暄xuan +炫xuan +煊xuan +碹xuan +铉xuan +镟xuan +痃xuan +悬案xuanan +轩昂xuanang +选拔xuanba +宣布xuanbu +选材xuancai +选场xuanchang +宣称xuancheng +宣传xuanchuan +选定xuanding +宣读xuandu +宣告xuangao +选购xuangou +悬挂xuangua +玄乎xuanhu +喧哗xuanhua +选集xuanji +宣讲xuanjiang +选举xuanju +绚烂xuanlan +绚丽xuanli +选录xuanlu +旋律xuanlu +选民xuanmin +喧闹xuannao +悬念xuannian +选派xuanpai +宣判xuanpan +选配xuanpei +选票xuanpiao +选区xuanqu +选取xuanqu +喧嚷xuanrang +宣誓xuanshi +选手xuanshou +悬殊xuanshu +旋涡xuanwo +玄虚xuanxu +悬崖xuanya +宣言xuanyan +宣扬xuanyang +炫耀xuanyao +选用xuanyong +选择xuanze +宣战xuanzhan +选种xuanzhong +旋转xuanzhuan +许多xuduo +学xue +血xue +削*xue +雪xue +穴xue +靴xue +薛xue +谑xue +噱*xue +泶xue +踅xue +鳕xue +学报xuebao +学部xuebu +学潮xuechao +学费xuefei +学风xuefeng +学府xuefu +血汗xuehan +学好xuehao +学会xuehui +学籍xueji +血迹xueji +学科xueke +血泪xuelei +学历xueli +学龄xueling +学年xuenian +学派xuepai +学期xueqi +血肉xuerou +学生xuesheng +学时xueshi +学识xueshi +学士xueshi +学术xueshu +血书xueshu +学说xueshuo +血统xuetong +学徒xuetu +学位xuewei +学问xuewen +学习xuexi +血洗xuexi +学校xuexiao +血压xueya +学业xueye +血液xueye +学友xueyou +学员xueyuan +学院xueyuan +血晕xueyun +血战xuezhan +学者xuezhe +学制xuezhi +虚构xugou +序号xuhao +蓄积xuji +虚假xujia +叙旧xujiu +许可xuke +序列xulie +绪论xulun +虚名xuming +序幕xumu +畜牧xumu +训xun +旬xun +迅xun +讯xun +寻xun +循xun +巡xun +荤*xun +浚*xun +勋xun +熏xun +询xun +驯xun +殉xun +汛xun +逊xun +巽xun +郇*xun +埙xun +荀xun +蕈xun +薰xun +峋xun +徇xun +獯xun +恂xun +洵xun +浔xun +曛xun +窨*xun +醺xun +鲟xun +巡捕xunbu +巡查xuncha +寻常xunchang +驯服xunfu +殉国xunguo +巡航xunhang +循环xunhuan +巡回xunhui +虚拟xuni +寻机xunji +巡警xunjing +勋爵xunjue +训练xunlian +巡逻xunluo +迅猛xunmeng +寻求xunqiu +逊色xunse +巡视xunshi +徇私xunsi +迅速xunsu +熏陶xuntao +许诺xunuo +讯问xunwen +询问xunwen +寻衅xunxin +循序xunxu +勋章xunzhang +寻找xunzhao +殉职xunzhi +寻址xunzhi +需求xuqiu +序曲xuqu +虚荣xurong +虚弱xuruo +虚设xushe +叙事xushi +虚实xushi +序数xushu +虚数xushu +叙述xushu +叙说xushuo +虚伪xuwei +虚心xuxin +序言xuyan +需要xuyao +须臾xuyu +许愿xuyuan +须知xuzhi +宣武区xwq +信息处理xxcl +循序见进xxjj +辛辛苦苦xxkk +信息量xxl +熙熙攘攘xxrr +小学生xxs +欣欣向荣xxxr +小心翼翼xxyy +下一步xyb +胸有成竹xycz +洗衣机xyj +小意思xys +习以为常xywc +新颖性xyx +兴致勃勃xzbb +新中国xzg +行政区域xzqy +雪中送炭xzst +心中无数xzws +选择性xzx +心中有数xzys +行之有效xzyx +一y +有y +用y +要y +以y +于y +也y +样y +义y +与y +由y +压y +员y +月y +意y +又y +运y +原y +油y +验y +压ya +亚ya +呀ya +牙ya +芽ya +雅ya +蚜ya +鸭ya +匹*ya +押ya +鸦ya +丫ya +崖ya +衙ya +涯ya +哑ya +讶ya +伢ya +垭ya +揠ya +岈ya +迓ya +娅ya +琊ya +桠ya +氩ya +砑ya +睚ya +痖ya +哑巴yaba +牙齿yachi +压倒yadao +压服yafu +牙关yaguan +雅观yaguan +压价yajia +押金yajin +亚军yajun +压力yali +验yan +研yan +严yan +眼yan +言yan +盐yan +演yan +岩yan +沿yan +烟yan +延yan +掩yan +宴yan +炎yan +颜yan +燕yan +衍yan +铅*yan +焉yan +咽yan +阉yan +淹yan +蜒yan +阎yan +奄yan +艳yan +堰yan +厌yan +砚yan +雁yan +唁yan +彦yan +焰yan +谚yan +殷*yan +厣yan +赝yan +剡*yan +俨yan +偃yan +兖yan +谳yan +阽*yan +郾yan +鄢yan +芫*yan +菸yan +崦yan +恹yan +闫yan +阏yan +湮yan +滟yan +妍yan +嫣yan +琰yan +檐yan +晏yan +胭yan +腌*yan +焱yan +罨yan +筵yan +酽yan +魇yan +餍yan +鼹yan +沿岸yanan +严办yanban +掩蔽yanbi +演变yanbian +烟草yancao +延长yanchang +演唱yanchang +严惩yancheng +延迟yanchi +演出yanchu +唁电yandian +严冬yandong +厌恶yane +厌烦yanfan +样yang +养yang +氧yang +扬yang +洋yang +阳yang +羊yang +秧yang +央yang +杨yang +仰yang +殃yang +鸯yang +佯yang +疡yang +痒yang +漾yang +徉yang +怏yang +泱yang +炀yang +烊yang +恙yang +蛘yang +鞅yang +掩盖yangai +样板yangban +样本yangben +洋财yangcai +养成yangcheng +沿革yange +严格yange +阳光yangguang +洋行yanghang +养护yanghu +氧化yanghua +养料yangliao +杨柳yangliu +仰面yangmian +殃民yangmin +仰慕yangmu +样品yangpin +洋气yangqi +扬弃yangqi +央求yangqiu +养伤yangshang +样式yangshi +阳台yangtai +眼光yanguang +仰望yangwang +洋务yangwu +洋相yangxiang +扬言yangyan +样样yangyang +洋溢yangyi +养育yangyu +养殖yangzhi +样子yangzi +沿海yanhai +严寒yanhan +眼红yanhong +咽喉yanhou +掩护yanhu +眼花yanhua +延缓yanhuan +宴会yanhui +焰火yanhuo +演讲yanjiang +眼界yanjie +严禁yanjin +严谨yanjin +眼镜yanjing +眼睛yanjing +研究yanjiu +严峻yanjun +眼看yankan +严酷yanku +眼眶yankuang +眼泪yanlei +眼力yanli +严厉yanli +艳丽yanli +眼帘yanlian +眼亮yanliang +言路yanlu +沿路yanlu +言论yanlun +掩埋yanmai +严密yanmi +严明yanming +烟幕yanmu +延年yannian +延期yanqi +眼前yanqian +宴请yanqing +俨然yanran +炎热yanre +眼色yanse +颜色yanse +延伸yanshen +岩石yanshi +演示yanshi +掩饰yanshi +验收yanshou +严守yanshou +延寿yanshou +演说yanshuo +严肃yansu +演算yansuan +言谈yantan +研讨yantao +沿途yantu +阎王yanwang +延误yanwu +烟雾yanwu +宴席yanxi +筵席yanxi +演习yanxi +沿袭yanxi +眼下yanxia +沿线yanxian +言行yanxing +严刑yanxing +延续yanxu +艳阳yanyang +演义yanyi +演绎yanyi +掩映yanying +沿用yanyong +言语yanyu +演员yanyuan +厌战yanzhan +沿着yanzhe +验证yanzheng +研制yanzhi +严重yanzhong +演奏yanzou +要yao +药yao +约*yao +摇yao +腰yao +咬yao +邀yao +耀yao +陶*yao +侥*yao +疟yao +妖yao +瑶yao +尧yao +遥yao +窑yao +谣yao +姚yao +舀yao +钥*yao +夭yao +爻yao +吆yao +崾yao +徭yao +幺yao +珧yao +杳yao +轺yao +曜yao +肴yao +铫*yao +鹞yao +窈yao +繇yao +鳐yao +摇摆yaobai +腰包yaobao +要不yaobu +谣传yaochuan +要得yaode +要点yaodian +摇动yaodong +窑洞yaodong +遥感yaogan +妖怪yaoguai +要害yaohai +摇撼yaohan +摇晃yaohuang +要件yaojian +要紧yaojin +摇控yaokong +遥控yaokong +摇篮yaolan +要领yaoling +要么yaome +妖魔yaomo +要目yaomu +邀请yaoqing +要求yaoqiu +要塞yaosai +要是yaoshi +钥匙yaoshi +要素yaosu +窈窕yaotiao +摇头yaotou +要闻yaowen +药物yaowu +要挟yaoxie +耀眼yaoyan +谣言yaoyan +妖艳yaoyan +夭折yaozhe +要职yaozhi +鸦片yapian +压迫yapo +压强yaqiang +压缩yasuo +雅兴yaxing +压仰yayang +压抑yayi +压榨yazha +压制yazhi +雅致yazhi +亚洲yazhou +鸭子yazi +雅座yazuo +要不得ybd +一般的说ybds +一部分ybf +要不然ybr +要不是ybs +一般说来ybsl +要不要yby +一辈子ybz +一把抓ybz +用不着ybz +扬长避短ycbd +由此可见yckj +银川市ycs +与此同时ycts +有偿转让yczr +邮电部ydb +有道德ydd +邮电局ydj +一刀切ydq +运动员ydy +印度洋ydy +因地制宜ydzy +也ye +业ye +页ye +叶ye +液ye +夜ye +野ye +爷ye +冶ye +邪*ye +哗*ye +咽*ye +椰ye +噎ye +耶ye +掖ye +曳ye +腋ye +拽*ye +靥ye +谒ye +邺ye +揶ye +晔ye +烨ye +铘ye +夜餐yecan +野餐yecan +野火yehuo +业绩yeji +夜间yejian +冶金yejin +夜里yeli +冶练yelian +野蛮yeman +夜幕yemu +夜色yese +也是yeshi +夜市yeshi +野兽yeshou +液体yeti +野外yewai +夜晚yewan +业务yewu +夜校yexiao +野心yexin +野性yexing +也许yexu +幼儿园yey +爷爷yeye +野营yeying +业余yeyu +野战yezhan +叶子yezi +一方面yfm +一分为二yfwe +阳奉阴违yfyw +一概而论ygel +一国两制yglz +有根有据ygyj +严格要求ygyq +有何特长yhtc +银行帐号yhzh +炎黄子孙yhzs +一yi +以yi +义yi +意yi +已yi +移yi +医yi +议yi +依yi +易yi +乙yi +艺yi +益yi +异yi +宜yi +仪yi +亿yi +遗yi +伊yi +役yi +衣yi +疑yi +亦yi +谊yi +翼yi +译yi +抑yi +忆yi +疫yi +壹yi +揖yi +铱yi +颐yi +夷yi +胰yi +沂yi +姨yi +彝yi +椅yi +蚁yi +倚yi +矣yi +邑yi +屹yi +臆yi +逸yi +肄yi +裔yi +毅yi +溢yi +诣yi +翌yi +绎yi +刈yi +劓yi +仡*yi +佚yi +佾yi +诒yi +圯yi +埸yi +懿yi +苡yi +荑yi +薏yi +弈yi +奕yi +挹yi +弋yi +呓yi +咦yi +咿yi +嗌*yi +噫yi +峄yi +嶷yi +猗yi +饴yi +怿yi +怡yi +悒yi +漪yi +迤yi +驿yi +缢yi +殪yi +轶yi +贻yi +欹*yi +旖yi +熠yi +眙yi +钇yi +镒yi +镱yi +痍yi +瘗yi +癔yi +翊yi +蜴yi +舣yi +羿yi +翳yi +酏yi +黟yi +议案yian +疑案yian +一半yiban +一般yiban +一斑yiban +一边yibian +以便yibian +仪表yibiao +一并yibing +异步yibu +遗产yichan +异常yichang +议程yicheng +益处yichu +遗传yichuan +一次yici +依次yici +依从yicong +一代yidai +一带yidai +一旦yidan +一点yidian +一定yiding +议定yiding +移动yidong +一度yidu +遗毒yidu +一端yiduan +臆断yiduan +亿吨yidun +一发yifa +依法yifa +义愤yifen +衣服yifu +依附yifu +一概yigai +一个yige +一共yigong +议购yigou +已故yigu +一贯yiguan +异国yiguo +遗憾yihan +遗恨yihen +以后yihou +异化yihua +议会yihui +疑惑yihuo +以及yiji +异己yiji +遗迹yiji +议价yijia +意见yijian +移交yijiao +一届yijie +一经yijing +已经yijing +意境yijing +依旧yijiu +一举yiju +依据yiju +移居yiju +议决yijue +依靠yikao +倚靠yikao +一刻yike +医科yike +一块yikuai +以来yilai +依赖yilai +一览yilan +一例yili +毅力yili +屹立yili +一连yilian +意料yiliao +医疗yiliao +遗留yiliu +遗漏yilou +一律yilu +疑虑yilu +议论yilun +一面yimian +以免yimian +疫苗yimiao +移民yimin +因yin +引yin +阴yin +印yin +音yin +银yin +烟*yin +隐yin +饮yin +荫yin +茵yin +殷yin +姻yin +吟yin +淫yin +寅yin +尹yin +胤yin +鄞yin +圻*yin +垠yin +堙yin +茚yin +吲yin +喑yin +狺yin +夤yin +洇yin +湮*yin +氤yin +铟yin +瘾yin +窨yin +蚓yin +霪yin +龈yin +疑难yinan +阴暗yinan +隐蔽yinbi +音标yinbiao +隐藏yincang +阴沉yinchen +银川yinchuan +因此yinci +引导yindao +音调yindiao +印度yindu +引渡yindu +以内yinei +因而yiner +印发yinfa +音符yinfu +应ying +影ying +硬ying +营ying +英ying +映ying +迎ying +樱ying +婴ying +鹰ying +缨ying +莹ying +萤ying +荧ying +蝇ying +赢ying +盈ying +颖ying +嬴ying +郢ying +茔ying +荥*ying +莺ying +萦ying +蓥ying +撄ying +嘤ying +膺ying +滢ying +潆ying +瀛ying +瑛ying +璎ying +楹ying +媵ying +鹦ying +瘿ying +颍ying +罂ying +英镑yingbang +硬币yingbi +应变yingbian +映衬yingchen +应酬yingchou +迎春yingchun +应当yingdang +赢得yingde +婴儿yinger +营房yingfang +迎风yingfeng +应付yingfu +应该yinggai +英国yingguo +樱花yinghua +英魂yinghun +应急yingji +硬件yingjian +迎接yingjie +应届yingjie +英杰yingjie +营救yingjiu +英俊yingjun +盈亏yingkui +赢利yingli +盈利yingli +英烈yinglie +迎面yingmian +英明yingming +硬盘yingpan +影片yingpian +硬拼yingpin +影射yingshe +映射yingshe +樱桃yingtao +迎头yingtou +因果yinguo +影响yingxiang +硬性yingxing +英雄yingxiong +营养yingyang +应邀yingyao +营业yingye +应用yingyong +英勇yingyong +应有yingyou +英语yingyu +盈余yingyu +营造yingzao +应战yingzhan +迎战yingzhan +映照yingzhao +应征yingzheng +影子yingzi +英姿yingzi +银行yinhang +引号yinhao +殷红yinhong +隐患yinhuan +淫秽yinhui +阴魂yinhun +意念yinian +姨娘yiniang +阴极yinji +印鉴yinjian +引进yinjin +引力yinli +阴历yinli +阴凉yinliang +引路yinlu +隐瞒yinman +阴谋yinmou +银幕yinmu +隐慝yinni +银牌yinpai +引起yinqi +殷切yinqie +殷勤yinqin +引擎yinqing +引人yinren +饮食yinshi +印刷yinshua +饮水yinshui +因素yinsu +阴天yintian +引退yintui +因为yinwei +淫威yinwei +阴险yinxian +印象yinxiang +音响yinxiang +音信yinxin +因循yinxun +引言yinyan +阴影yinying +引用yinyong +引诱yinyou +阴雨yinyu +姻缘yinyuan +隐约yinyue +音乐yinyue +引证yinzheng +印证yinzheng +一片yipian +一瞥yipie +一起yiqi +一齐yiqi +义气yiqi +意气yiqi +仪器yiqi +遗弃yiqi +以前yiqian +一切yiqie +依然yiran +亦然yiran +毅然yiran +艺人yiren +宜人yiren +遗容yirong +以上yishang +一生yisheng +医生yisheng +一时yishi +一事yishi +意识yishi +议事yishi +逸事yishi +仪式yishi +医师yishi +医士yishi +遗失yishi +一手yishou +遗书yishu +艺术yishu +意思yisi +一体yiti +议题yiti +遗体yiti +一天yitian +一同yitong +异同yitong +一头yitou +意图yitu +疑团yituan +以外yiwai +意外yiwai +亿万yiwan +以往yiwang +遗忘yiwang +以为yiwei +意味yiwei +意文yiwen +疑问yiwen +译文yiwen +一无yiwu +义务yiwu +遗物yiwu +医务yiwu +贻误yiwu +一下yixia +以下yixia +一线yixian +一向yixiang +一项yixiang +意向yixiang +遗像yixiang +一些yixie +一心yixin +疑心yixin +异性yixing +医学yixue +一言yiyan +义演yiyan +遗言yiyan +一样yiyang +医药yiyao +意义yiyi +异议yiyi +义勇yiyong +易于yiyu +议员yiyuan +意愿yiyuan +医院yiyuan +亿元yiyuan +遗愿yiyuan +疑云yiyun +一再yizai +一早yizao +臆造yizao +依仗yizhang +仪仗yizhang +一朝yizhao +衣着yizhao +依照yizhao +一阵yizhen +一直yizhi +一致yizhi +以至yizhi +以致yizhi +意志yizhi +抑制yizhi +医治yizhi +抑止yizhi +移植yizhi +遗址yizhi +一种yizhong +遗嘱yizhu +研究会yjh +有纪律yjl +研究生yjs +研究所yjs +研究室yjs +养精畜锐yjxr +研究员yjy +拥军优属yjys +一技之长yjzc +一口气ykq +一览表ylb +以理服人ylfr +阅览室yls +有理想ylx +有利于yly +越来越yly +有目共睹ymgd +一目了然ymlr +有没有ymy +云南省yns +育*yo +哟yo +唷yo +用yong +勇yong +永yong +拥yong +涌yong +蛹yong +庸yong +佣yong +臃yong +痈yong +雍yong +踊yong +咏yong +泳yong +恿yong +俑yong +壅yong +墉yong +喁yong +慵yong +邕yong +镛yong +甬yong +鳙yong +饔yong +拥抱yongbao +永别yongbie +永不yongbu +用处yongchu +用度yongdu +用法yongfa +用费yongfei +勇敢yonggan +用功yonggong +永恒yongheng +用户yonghu +拥护yonghu +拥挤yongji +永久yongjiu +用具yongju +永诀yongjue +用力yongli +庸碌yonglu +勇猛yongmeng +用品yongpin +勇气yongqi +勇士yongshi +庸俗yongsu +咏叹yongtan +用途yongtu +涌现yongxian +用心yongxin +用意yongyi +拥有yongyou +用于yongyu +勇于yongyu +永远yongyuan +踊跃yongyue +有you +由you +又you +油you +右you +友you +优you +幼you +游you +尤you +诱you +犹you +幽you +悠you +忧you +邮you +铀you +酉you +佑you +釉you +卣you +攸you +侑you +莠you +莜you +莸you +尢*you +呦you +囿you +宥you +柚you +猷you +牖you +铕you +疣you +蚰you +蚴you +蝣you +蝤*you +繇*you +鱿you +黝you +鼬you +有碍youai +友爱youai +幽暗youan +友邦youbang +右边youbian +忧愁youchou +由此youci +有错youcuo +有待youdai +优待youdai +诱导youdao +有的youde +优等youdeng +有点youdian +邮电youdian +优点youdian +诱发youfa +有功yougong +有关youguan +有害youhai +友好youhao +优化youhua +油画youhua +幽会youhui +优惠youhui +诱惑youhuo +有机youji +游击youji +有劲youjin +幽静youjing +悠久youjiu +邮局youju +由来youlai +游览youlan +有劳youlao +有利youli +有力youli +游离youli +优良youliang +优劣youlie +幽灵youling +忧虑youlu +优美youmei +幼苗youmiao +有名youming +幽默youmo +右派youpai +诱骗youpian +邮票youpiao +尤其youqi +油漆youqi +友情youqing +右倾youqing +有趣youqu +油然youran +犹如youru +有色youse +优胜yousheng +有时youshi +有事youshi +有失youshi +优势youshi +有数youshu +油水youshui +有所yousuo +有望youwang +有为youwei +游戏youxi +有限youxian +优先youxian +悠闲youxian +有效youxiao +幼小youxiao +有些youxie +有心youxin +游行youxing +优秀youxiu +幽雅youya +悠扬youyang +又要youyao +有益youyi +优异youyi +友谊youyi +有用youyong +游泳youyong +有余youyu +由于youyu +犹豫youyu +忧郁youyu +悠远youyuan +优越youyue +有着youzhe +邮政youzheng +优质youzhi +幼稚youzhi +由衷youzhong +邮资youzi +有求必应yqby +以权谋私yqms +有气无力yqwl +迎刃而解yrej +因人而异yrey +与人为善yrws +引人注目yrzm +意识到ysd +艺术家ysj +因势利导ysld +印刷体yst +意识形态ysxt +衣食住行yszx +以身作则yszz +研讨会yth +一条龙ytl +一条心ytx +有条有理ytyl +于yu +与yu +育yu +鱼yu +雨yu +玉yu +余yu +遇yu +预yu +域yu +语yu +愈yu +渔yu +予yu +羽yu +愚yu +御yu +谷*yu +欲yu +宇yu +蔚*yu +尉*yu +迂yu +淤yu +盂yu +榆yu +虞yu +舆yu +俞yu +逾yu +愉yu +渝yu +隅yu +娱yu +屿yu +禹yu +芋yu +郁yu +吁yu +喻yu +峪yu +狱yu +誉yu +浴yu +寓yu +裕yu +豫yu +驭yu +粥*yu +禺yu +毓yu +伛yu +俣yu +谀yu +谕yu +萸yu +菀*yu +蓣yu +揄yu +圄yu +圉yu +嵛yu +狳yu +饫yu +馀yu +庾yu +阈yu +鬻yu +妪yu +妤yu +纡yu +瑜yu +昱yu +觎yu +腴yu +腧*yu +欤yu +於yu +煜yu +熨yu +燠yu +聿yu +钰yu +鹆yu +鹬yu +瘐yu +瘀yu +窬yu +窳yu +蜮yu +蝓yu +竽yu +臾yu +舁yu +雩yu +龉yu +员yuan +原yuan +圆yuan +源yuan +元yuan +远yuan +愿yuan +院yuan +缘yuan +援yuan +园yuan +怨yuan +鸳yuan +渊yuan +冤yuan +垣yuan +袁yuan +辕yuan +猿yuan +苑yuan +垸yuan +塬yuan +芫yuan +掾yuan +圜*yuan +沅yuan +媛yuan +瑗yuan +橼yuan +爰yuan +眢yuan +鸢yuan +螈yuan +箢yuan +鼋yuan +原本yuanben +渊博yuanbo +冤仇yuanchou +远大yuanda +元旦yuandan +园地yuandi +园丁yuanding +远东yuandong +远方yuanfang +缘分yuanfen +原告yuangao +原故yuangu +缘故yuangu +圆滑yuanhua +原籍yuanji +冤家yuanjia +元件yuanjian +远见yuanjian +远近yuanjin +远景yuanjing +援救yuanjiu +原来yuanlai +原理yuanli +原谅yuanliang +原料yuanliao +远虑yuanlu +圆满yuanman +远谋yuanmou +远期yuanqi +冤屈yuanqu +源泉yuanquan +原始yuanshi +远视yuanshi +元首yuanshou +元帅yuanshuai +元素yuansu +援外yuanwai +愿望yuanwang +冤枉yuanwang +原先yuanxian +远销yuanxiao +元宵yuanxiao +院校yuanxiao +原形yuanxing +怨言yuanyan +原野yuanye +愿意yuanyi +园艺yuanyi +原因yuanyin +援引yuanyin +原有yuanyou +缘由yuanyou +远游yuanyou +远远yuanyuan +渊源yuanyuan +元月yuanyue +原则yuanze +院长yuanzhang +远征yuanzheng +援助yuanzhu +原子yuanzi +院子yuanzi +预报yubao +预备yubei +愚笨yuben +余步yubu +预测yuce +愚蠢yuchun +遇到yudao +预定yuding +预订yuding +余毒yudu +月yue +说*yue +越yue +约yue +乐*yue +跃yue +曰yue +阅yue +钥yue +岳yue +粤yue +悦yue +龠yue +瀹yue +栎*yue +樾yue +刖yue +钺yue +月报yuebao +月初yuechu +月底yuedi +约定yueding +月度yuedu +阅读yuedu +乐队yuedui +约法yuefa +月份yuefen +月光yueguang +越轨yuegui +约会yuehui +越界yuejie +跃进yuejin +越境yuejing +阅览yuelan +阅历yueli +月亮yueliang +月末yuemo +约莫yuemo +越南yuenan +乐谱yuepu +乐器yueqi +月球yueqiu +乐曲yuequ +月色yuese +越是yueshi +约束yueshu +月台yuetai +乐团yuetuan +约有yueyou +乐章yuezhang +预防yufang +预风yufeng +预付yufu +预感yugan +预告yugao +预购yugou +遇害yuhai +宇航yuhang +与会yuhui +迂回yuhui +雨季yuji +预计yuji +遇见yujian +预见yujian +语句yuju +豫剧yuju +愉快yukuai +娱乐yule +鱼雷yulei +预料yuliao +雨露yulu +舆论yulun +愚昧yumei +育苗yumiao +预谋yumou +运yun +员*yun +云yun +匀yun +均*yun +允yun +孕yun +耘yun +郧yun +陨yun +蕴yun +酝yun +晕yun +韵yun +郓yun +芸yun +狁yun +恽yun +愠yun +纭yun +韫yun +殒yun +昀yun +氲yun +熨yun +遇难yunan +云彩yuncai +蕴藏yuncang +匀称yuncheng +运动yundong +熨斗yundou +云海yunhai +运河yunhe +韵律yunlu +陨落yunluo +云南yunnan +酝酿yunnian +允诺yunnuo +愚弄yunong +运气yunqi +运输yunshu +运算yunsuan +云梯yunti +运往yunwang +韵味yunwei +云雾yunwu +云霞yunxia +运行yunxing +允许yunxu +运用yunyong +孕育yunyu +运载yunzai +运转yunzhuan +与其yuqi +语气yuqi +预期yuqi +预审yushen +于是yushi +预示yushi +预售yushou +雨水yushui +预算yusuan +欲望yuwang +语文yuwen +预习yuxi +预先yuxian +遇险yuxian +预想yuxiang +预言yuyan +语言yuyan +寓言yuyan +预演yuyan +予以yuyi +寓于yuyu +愉悦yuyue +预兆yuzhao +预支yuzhi +宇宙yuzhou +有文化ywh +业务联系ywlx +意味着ywz +有限公司yxgs +一系列yxl +有效期yxq +医学院yxy +一心一意yxyy +游泳池yyc +营业额yye +夜以继日yyjr +应用科学yykx +一言堂yyt +引以为戒yywj +优越性yyx +营业员yyy +隐隐约约yyyy +运用自如yyzr +拥政爱民yzam +原子能yzn +已知数yzs +有助于yzy +言之有理yzyl +在z +这z +主z +中z +种z +着z +争z +战z +作z +正z +之z +制z +重z +组z +治z +只z +子z +自z +质z +指z +杂za +扎*za +咱za +匝za +砸za +咋za +咂za +在zai +再zai +载zai +栽zai +灾zai +仔*zai +哉zai +宰zai +崽zai +甾zai +再版zaiban +再不zaibu +在场zaichang +再度zaidu +宰割zaige +灾害zaihai +再好zaihao +在乎zaihu +灾荒zaihuang +再会zaihui +灾祸zaihuo +再见zaijian +在理zaili +灾民zaimin +灾难zainan +栽培zaipei +再起zaiqi +灾情zaiqing +灾区zaiqu +再三zaisan +在世zaishi +再说zaishuo +载体zaiti +在下zaixia +再现zaixian +宰相zaixiang +在意zaiyi +在于zaiyu +再造zaizao +再则zaize +在职zaizhi +再植zaizhi +杂技zaji +杂粮zaliang +杂乱zaluan +赞zan +咱zan +暂zan +攒zan +拶zan +瓒zan +昝zan +簪zan +糌zan +趱zan +錾zan +赞成zancheng +暂定zanding +藏*zang +脏zang +葬zang +赃zang +奘zang +驵zang +臧zang +赞歌zange +赃款zangkuan +葬送zangsong +赃物zangwu +藏族zangzu +杂念zanian +赞美zanmei +咱们zanmen +暂且zanqie +暂缺zanque +赞赏zanshang +暂时zanshi +赞颂zansong +赞叹zantan +暂停zanting +赞同zantong +暂行zanxing +赞扬zanyang +暂用zanyong +赞助zanzhu +造zao +早zao +遭zao +燥zao +凿zao +糟zao +枣zao +皂zao +藻zao +澡zao +蚤zao +躁zao +噪zao +灶zao +唣zao +早晨zaochen +造成zaocheng +凿穿zaochuan +造次zaoci +造词zaoci +遭到zaodao +早稻zaodao +造反zaofan +早饭zaofan +造福zaofu +糟糕zaogao +造化zaohua +造价zaojia +造就zaojiu +造林zaolin +早年zaonian +糟粕zaopo +早期zaoqi +早日zaori +早上zaoshang +遭受zaoshou +早衰zaoshuai +糟蹋zaota +早晚zaowan +造型zaoxing +遭殃zaoyang +造谣zaoyao +造诣zaoyi +早已zaoyi +噪音zaoyin +遭遇zaoyu +造字zaozi +杂谈zatan +杂文zawen +杂质zazhi +杂志zazhi +资本主义zbzy +资产阶级zcjj +增长率zcl +总参谋部zcmb +真才实学zcsx +自动化zdh +自动检测zdjc +自动检索zdjs +自动控制zdkz +主动权zdq +招待所zds +总的说来zdsl +主动性zdx +则ze +择ze +责ze +侧*ze +泽ze +咋*ze +仄ze +赜ze +啧ze +帻ze +迮ze +昃ze +笮ze +箦ze +舴ze +责备zebei +责成zecheng +责罚zefa +责怪zeguai +贼zei +责令zeling +责骂zema +怎zen +谮zen +增zeng +曾zeng +综*zeng +憎zeng +赠zeng +缯zeng +甑zeng +罾zeng +锃zeng +增补zengbu +增产zengchan +增长zengchang +增大zengda +增订zengding +增多zengduo +增高zenggao +憎恨zenghen +增加zengjia +增减zengjian +增进zengjin +增量zengliang +赠品zengpin +增强zengqiang +增删zengshan +增设zengshe +赠送zengsong +增添zengtian +赠言zengyan +增益zengyi +增援zengyuan +怎么zenme +怎奈zennai +怎样zenyang +责任zeren +责问zewen +总而言之zeyz +争分夺秒zfdm +针锋相对zfxd +自负盈亏zfyk +中关村zgc +自告奋勇zgfy +中国共产党zggd +总工会zgh +中国特色的zgtd +中国银行zgyh +自古以来zgyl +中国政府zgzf +中共中央zgzy +查*zha +扎zha +炸zha +闸zha +铡zha +轧zha +渣zha +蜡*zha +喳zha +札zha +眨zha +栅zha +榨zha +咋*zha +乍zha +诈zha +柞*zha +揸zha +吒zha +咤zha +哳zha +喋*zha +楂*zha +砟zha +痄zha +蚱zha +齄zha +炸弹zhadan +扎根zhagen +炸毁zhahui +寨zhai +侧*zhai +择*zhai +摘zhai +窄zhai +斋zhai +翟*zhai +祭*zhai +宅zhai +债zhai +砦zhai +瘵zhai +摘录zhailu +债权zhaiquan +债务zhaiwu +窄小zhaixiao +摘要zhaiyao +札记zhaji +战zhan +展zhan +站zhan +占zhan +粘*zhan +颤*zhan +瞻zhan +毡zhan +詹zhan +沾zhan +盏zhan +斩zhan +辗zhan +崭zhan +蘸zhan +栈zhan +湛zhan +绽zhan +谵zhan +搌zhan +旃zhan +战败zhanbai +战报zhanbao +战备zhanbei +战场zhanchang +展翅zhanchi +展出zhanchu +战地zhandi +战斗zhandou +战犯zhanfan +长*zhang +张zhang +章zhang +掌zhang +仗zhang +障zhang +胀zhang +涨zhang +账zhang +樟zhang +彰zhang +漳zhang +杖zhang +丈zhang +帐zhang +瘴zhang +仉zhang +鄣zhang +幛zhang +嶂zhang +獐zhang +嫜zhang +璋zhang +蟑zhang +障碍zhangai +站岗zhangang +长辈zhangbei +章程zhangcheng +长大zhangda +战歌zhange +章法zhangfa +帐房zhangfang +丈夫zhangfu +掌管zhangguan +帐号zhanghao +章节zhangjie +帐目zhangmu +战功zhangong +掌权zhangquan +张贴zhangtie +战鼓zhangu +沾光zhanguang +战国zhanguo +战果zhanguo +张望zhangwang +掌握zhangwo +张扬zhangyang +战壕zhanhao +战后zhanhou +战机zhanji +战绩zhanji +战局zhanju +占据zhanju +展开zhankai +战况zhankuang +展览zhanlan +占领zhanling +战略zhanlue +战马zhanma +展品zhanpin +战区zhanqu +沾染zhanran +战胜zhansheng +战时zhanshi +战事zhanshi +战士zhanshi +展示zhanshi +战术zhanshu +展望zhanwang +战线zhanxian +展现zhanxian +展销zhanxiao +崭新zhanxin +瞻仰zhanyang +战役zhanyi +占用zhanyong +占有zhanyou +战友zhanyou +站长zhanzhang +战争zhanzheng +着*zhao +照zhao +找zhao +招zhao +朝*zhao +召zhao +赵zhao +爪zhao +罩zhao +沼zhao +兆zhao +嘲*zhao +昭zhao +肇zhao +诏zhao +啁*zhao +棹zhao +钊zhao +笊zhao +照办zhaoban +照搬zhaoban +招标zhaobiao +照常zhaochang +照抄zhaochao +招待zhaodai +照发zhaofa +招工zhaogong +照顾zhaogu +招呼zhaohu +召唤zhaohuan +照会zhaohui +着急zhaoji +招集zhaoji +召集zhaoji +招架zhaojia +召开zhaokai +招考zhaokao +招揽zhaolan +着力zhaoli +照例zhaoli +照料zhaoliao +着落zhaoluo +着迷zhaomi +照明zhaoming +招聘zhaopin +朝气zhaoqi +招惹zhaore +照射zhaoshe +招生zhaosheng +着手zhaoshou +招手zhaoshou +招收zhaoshou +招贴zhaotie +朝夕zhaoxi +朝霞zhaoxia +着想zhaoxiang +照相zhaoxiang +昭雪zhaoxue +找寻zhaoxun +着眼zhaoyan +照样zhaoyang +照耀zhaoyao +照应zhaoying +招展zhaozhan +招致zhaozhi +着重zhaozhong +照着zhaozhuo +诈骗zhapian +榨取zhaqu +诈取zhaqu +扎实zhashi +炸药zhayao +渣滓zhazi +这zhe +着zhe +者zhe +折zhe +哲zhe +浙zhe +遮zhe +蛰zhe +辙zhe +锗zhe +蔗zhe +谪zhe +摺zhe +柘zhe +辄zhe +磔zhe +鹧zhe +褶zhe +蜇zhe +赭zhe +这般zheban +这边zhebian +这次zheci +遮挡zhedang +这点zhedian +折叠zhedie +折服zhefu +遮盖zhegai +这个zhege +折合zhehe +浙江zhejiang +折旧zhejiu +折扣zhekou +这里zheli +哲理zheli +这么zheme +折磨zhemo +真zhen +针zhen +阵zhen +镇zhen +振zhen +震zhen +珍zhen +诊zhen +斟zhen +甄zhen +砧zhen +臻zhen +贞zhen +侦zhen +枕zhen +疹zhen +圳zhen +蓁zhen +浈zhen +溱*zhen +缜zhen +桢zhen +椹*zhen +榛zhen +轸zhen +赈zhen +胗zhen +朕zhen +祯zhen +畛zhen +稹zhen +鸩zhen +箴zhen +珍爱zhenai +珍宝zhenbao +针砭zhenbian +珍藏zhencang +贞操zhencao +侦察zhencha +真诚zhencheng +震荡zhendang +阵地zhendi +真谛zhendi +震动zhendong +诊断zhenduan +针对zhendui +振奋zhenfen +争zheng +正zheng +政zheng +整zheng +证zheng +征zheng +蒸zheng +症zheng +丁*zheng +郑zheng +挣zheng +睁zheng +狰zheng +怔zheng +拯zheng +帧zheng +诤zheng +峥zheng +徵zheng +钲zheng +铮zheng +筝zheng +争霸zhengba +整备zhengbei +正比zhengbi +政变zhengbian +争辩zhengbian +整编zhengbian +征兵zhengbing +政策zhengce +正常zhengchang +争吵zhengchao +征程zhengcheng +争持zhengchi +正大zhengda +正当zhengdang +政党zhengdang +整党zhengdang +正道zhengdao +争端zhengduan +整顿zhengdun +争夺zhengduo +蒸发zhengfa +政法zhengfa +正反zhengfan +整风zhengfeng +政府zhengfu +征服zhengfu +整改zhenggai +整个zhengge +征购zhenggou +争光zhengguang +正规zhenggui +正轨zhenggui +正好zhenghao +政绩zhengji +征集zhengji +证件zhengjian +政见zhengjian +整洁zhengjie +政局zhengju +证据zhengju +正理zhengli +整理zhengli +正梁zhengliang +政令zhengling +争论zhenglun +政论zhenglun +正面zhengmian +争鸣zhengming +证明zhengming +正派zhengpai +征聘zhengpin +争气zhengqi +正气zhengqi +蒸气zhengqi +整齐zhengqi +正巧zhengqiao +征求zhengqiu +争取zhengqu +政权zhengquan +正确zhengque +证人zhengren +正是zhengshi +正式zhengshi +正视zhengshi +证实zhengshi +征收zhengshou +整数zhengshu +证书zhengshu +征税zhengshui +整套zhengtao +正题zhengti +政体zhengti +整体zhengti +整天zhengtian +征调zhengtiao +正统zhengtong +征途zhengtu +珍贵zhengui +政委zhengwei +正文zhengwen +征文zhengwen +政务zhengwu +争先zhengxian +政协zhengxie +整形zhengxing +整修zhengxiu +征询zhengxun +争艳zhengyan +正业zhengye +正义zhengyi +争议zhengyi +征用zhengyong +正月zhengyue +正在zhengzai +挣扎zhengzha +整整zhengzheng +正直zhengzhi +政治zhengzhi +争执zhengzhi +正中zhengzhong +郑重zhengzhong +郑州zhengzhou +症状zhengzhuang +正宗zhengzong +震撼zhenhan +侦缉zhenji +真假zhenjia +阵脚zhenjiao +贞节zhenjie +贞洁zhenjie +镇静zhenjing +震惊zhenjing +真空zhenkong +真理zhenli +诊疗zhenliao +珍品zhenpin +珍奇zhenqi +真切zhenqie +真情zhenqing +真确zhenque +真人zhenren +阵容zhenrong +真是zhenshi +真实zhenshi +阵势zhenshi +珍视zhenshi +侦探zhentan +阵亡zhenwang +珍惜zhenxi +阵线zhenxian +真相zhenxiang +振兴zhenxing +镇压zhenya +阵阵zhenzhen +真正zhenzheng +真知zhenzhi +真挚zhenzhi +珍重zhenzhong +珍珠zhenzhu +斟酌zhenzhuo +振作zhenzuo +这是zheshi +这时zheshi +折腾zheteng +这些zhexie +哲学zhexue +遮掩zheyan +这样zheyang +这种zhezhong +折中zhezhong +之zhi +制zhi +治zhi +只zhi +质zhi +指zhi +直zhi +支zhi +织zhi +止zhi +至zhi +置zhi +志zhi +值zhi +知zhi +识*zhi +执zhi +职zhi +植zhi +纸zhi +致zhi +枝zhi +殖zhi +脂zhi +智zhi +氏*zhi +肢zhi +秩zhi +址zhi +滞zhi +汁zhi +芝zhi +吱zhi +蜘zhi +侄zhi +趾zhi +旨zhi +挚zhi +掷zhi +帜zhi +峙zhi +稚zhi +炙zhi +痔zhi +窒zhi +卮zhi +陟zhi +郅zhi +埴zhi +芷zhi +摭zhi +帙zhi +徵*zhi +忮zhi +彘zhi +咫zhi +骘zhi +栉zhi +枳zhi +栀zhi +桎zhi +轵zhi +轾zhi +贽zhi +胝zhi +膣zhi +祉zhi +祗zhi +黹zhi +雉zhi +鸷zhi +痣zhi +蛭zhi +絷zhi +酯zhi +跖zhi +踬zhi +踯zhi +豸zhi +觯zhi +治安zhian +值班zhiban +植保zhibao +置备zhibei +质变zhibian +指标zhibiao +职别zhibie +支部zhibu +制裁zhicai +支撑zhicheng +职称zhicheng +支持zhichi +指出zhichu +支出zhichu +至此zhici +值此zhici +直达zhida +只当zhidang +直到zhidao +指导zhidao +知道zhidao +只得zhide +值得zhide +质地zhidi +指点zhidian +制定zhiding +指定zhiding +制订zhiding +制度zhidu +支队zhidui +至多zhiduo +知法zhifa +执法zhifa +制服zhifu +支付zhifu +职工zhigong +只顾zhigu +只管zhiguan +直观zhiguan +治国zhiguo +只好zhihao +之后zhihou +指挥zhihui +智慧zhihui +知己zhiji +指甲zhijia +之间zhijian +只见zhijian +指教zhijiao +直接zhijie +枝节zhijie +至今zhijin +直经zhijing +直径zhijing +止境zhijing +致敬zhijing +知觉zhijue +治理zhili +致力zhili +智力zhili +质量zhiliang +治疗zhiliao +指令zhiling +直流zhiliu +支流zhiliu +殖民zhimin +致命zhiming +指明zhiming +知名zhiming +智谋zhimou +指南zhinan +智囊zhinang +之内zhinei +只能zhineng +职能zhineng +智能zhineng +只怕zhipa +指派zhipai +支配zhipei +支票zhipiao +制品zhipin +志气zhiqi +之前zhiqian +支前zhiqian +值勤zhiqin +执勤zhiqin +知情zhiqing +知青zhiqing +智取zhiqu +志趣zhiqu +知趣zhiqu +职权zhiquan +值日zhiri +治丧zhisang +之上zhishang +直上zhishang +至上zhishang +至少zhishao +制胜zhisheng +之声zhisheng +只是zhishi +指使zhishi +支使zhishi +致使zhishi +知事zhishi +指示zhishi +知识zhishi +指数zhishu +支书zhishu +直属zhishu +植树zhishu +直爽zhishuang +治水zhishui +直说zhishuo +致死zhisi +之外zhiwai +指望zhiwang +职位zhiwei +质问zhiwen +植物zhiwu +职务zhiwu +窒息zhixi +之下zhixia +直线zhixian +指向zhixiang +志向zhixiang +知心zhixin +执行zhixing +只许zhixu +秩序zhixu +直言zhiyan +只要zhiyao +职业zhiye +致意zhiyi +旨意zhiyi +质疑zhiyi +指引zhiyin +知音zhiyin +只有zhiyou +至于zhiyu +置于zhiyu +智育zhiyu +职员zhiyuan +支援zhiyuan +志愿zhiyuan +制约zhiyue +制造zhizao +指责zhize +职责zhize +纸张zhizhang +职掌zhizhang +执照zhizhao +指正zhizheng +执政zhizheng +制止zhizhi +直至zhizhi +之中zhizhong +支助zhizhu +支柱zhizhu +知足zhizu +制作zhizuo +走后门zhm +中华民国zhmg +中华民族zhmz +中zhong +种zhong +重zhong +众zhong +钟zhong +终zhong +忠zhong +肿zhong +仲zhong +盅zhong +衷zhong +冢zhong +忪*zhong +锺zhong +螽zhong +舯zhong +踵zhong +钟爱zhongai +重办zhongban +重兵zhongbing +中部zhongbu +仲裁zhongcai +中层zhongceng +衷肠zhongchang +忠诚zhongcheng +重大zhongda +重担zhongdan +中等zhongdeng +种地zhongdi +重地zhongdi +重点zhongdian +终点zhongdian +中东zhongdong +中断zhongduan +终端zhongduan +中队zhongdui +众多zhongduo +重犯zhongfan +忠告zhonggao +中共zhonggong +中国zhongguo +忠厚zhonghou +中华zhonghua +中级zhongji +终极zhongji +重价zhongjia +中间zhongjian +中坚zhongjian +中奖zhongjiang +终结zhongjie +终究zhongjiu +终久zhongjiu +终局zhongju +中肯zhongken +种类zhonglei +中立zhongli +重量zhongliang +终了zhongliao +中流zhongliu +肿瘤zhongliu +中美zhongmei +众目zhongmu +中年zhongnian +终年zhongnian +中秋zhongqiu +重任zhongren +中日zhongri +终日zhongri +中伤zhongshang +重赏zhongshang +终身zhongshen +终生zhongsheng +重视zhongshi +忠实zhongshi +中枢zhongshu +众说zhongshuo +中苏zhongsu +终天zhongtian +中途zhongtu +重托zhongtuo +中外zhongwai +重围zhongwei +中文zhongwen +中午zhongwu +中西zhongxi +中心zhongxin +忠心zhongxin +衷心zhongxin +中性zhongxing +中学zhongxue +中旬zhongxun +忠言zhongyan +中央zhongyang +中药zhongyao +重要zhongyao +中医zhongyi +重用zhongyong +中庸zhongyong +中游zhongyou +终于zhongyu +忠于zhongyu +忠贞zhongzhen +中止zhongzhi +种植zhongzhi +终止zhongzhi +种种zhongzhong +中专zhongzhuan +种族zhongzu +轴zhou +周zhou +洲zhou +州zhou +皱zhou +骤zhou +舟zhou +诌zhou +粥zhou +肘zhou +帚zhou +咒zhou +宙zhou +昼zhou +荮zhou +啁zhou +妯zhou +纣zhou +绉zhou +胄zhou +碡zhou +籀zhou +繇*zhou +酎zhou +周到zhoudao +咒骂zhouma +周密zhoumi +周末zhoumo +周期zhouqi +周全zhouquan +周围zhouwei +周旋zhouxuan +昼夜zhouye +周折zhouzhe +周知zhouzhi +周转zhouzhuan +总后勤部zhqb +中华人民共和国zhrg +主zhu +注zhu +著zhu +住zhu +助zhu +猪zhu +铸zhu +属*zhu +株zhu +筑zhu +柱zhu +术*zhu +驻zhu +逐zhu +祝zhu +竹zhu +贮zhu +珠zhu +朱zhu +诸zhu +蛛zhu +诛zhu +烛zhu +煮zhu +拄zhu +瞩zhu +嘱zhu +蛀zhu +伫zhu +侏zhu +邾zhu +茱zhu +洙zhu +渚zhu +潴zhu +杼zhu +槠zhu +橥zhu +炷zhu +铢zhu +疰zhu +瘃zhu +褚*zhu +竺zhu +箸zhu +舳zhu +翥zhu +躅zhu +麈zhu +抓zhua +挝*zhua +抓好zhuahao +转*zhuai +曳*zhuai +拽zhuai +抓紧zhuajin +转zhuan +专zhuan +传*zhuan +砖zhuan +撰zhuan +赚zhuan +篆zhuan +啭zhuan +馔zhuan +沌*zhuan +颛zhuan +转变zhuanbian +转播zhuanbo +专长zhuanchang +专程zhuancheng +转达zhuanda +转发zhuanfa +装zhuang +状zhuang +壮zhuang +庄zhuang +撞zhuang +幢*zhuang +桩zhuang +妆zhuang +僮zhuang +奘*zhuang +转告zhuangao +装扮zhuangban +装备zhuangbei +壮大zhuangda +装订zhuangding +壮观zhuangguan +装甲zhuangjia +庄稼zhuangjia +庄嫁zhuangjia +壮举zhuangju +状况zhuangkuang +壮阔zhuangkuo +壮丽zhuangli +壮烈zhuanglie +装配zhuangpei +装饰zhuangshi +状态zhuangtai +装卸zhuangxie +庄严zhuangyan +庄园zhuangyuan +装运zhuangyun +装置zhuangzhi +壮志zhuangzhi +庄重zhuangzhong +转化zhuanhua +转换zhuanhuan +转给zhuanji +专家zhuanjia +专科zhuanke +专利zhuanli +专门zhuanmen +转让zhuanrang +专题zhuanti +转向zhuanxiang +专心zhuanxin +转眼zhuanyan +专业zhuanye +转移zhuanyi +专员zhuanyuan +转载zhuanzai +转折zhuanzhe +转正zhuanzheng +专政zhuanzheng +专制zhuanzhi +专职zhuanzhi +专注zhuanzhu +专著zhuanzhu +主办zhuban +逐步zhubu +贮藏zhucang +注册zhuce +助长zhuchang +主持zhuchi +主次zhuci +主导zhudao +注定zhuding +主动zhudong +主队zhudui +主犯zhufan +住房zhufang +祝福zhufu +嘱咐zhufu +逐个zhuge +主攻zhugong +助工zhugong +主管zhuguan +主观zhuguan +追zhui +锥zhui +椎zhui +赘zhui +坠zhui +缀zhui +惴zhui +骓zhui +缒zhui +追捕zhuibu +追查zhuicha +追悼zhuidao +追赶zhuigan +坠毁zhuihui +追加zhuijia +追究zhuijiu +追求zhuiqiu +追认zhuiren +追溯zhuisu +追随zhuisui +追问zhuiwen +追逐zhuizhu +追踪zhuizong +主机zhuji +主见zhujian +逐渐zhujian +主将zhujiang +主讲zhujiang +主教zhujiao +主角zhujiao +注解zhujie +祝酒zhujiu +主力zhuli +助理zhuli +株连zhulian +主粮zhuliang +主流zhuliu +驻留zhuliu +著名zhuming +主谋zhumou +注目zhumu +瞩目zhumu +准zhun +屯*zhun +谆zhun +肫zhun +窀zhun +准备zhunbei +逐年zhunian +准确zhunque +准绳zhunsheng +准时zhunshi +准许zhunxu +准则zhunze +着*zhuo +著*zhuo +捉zhuo +桌zhuo +缴*zhuo +拙zhuo +卓zhuo +琢zhuo +茁zhuo +酌zhuo +啄zhuo +灼zhuo +浊zhuo +倬zhuo +诼zhuo +擢zhuo +浞zhuo +涿zhuo +濯zhuo +棹*zhuo +焯zhuo +禚zhuo +斫zhuo +镯zhuo +拙劣zhuolie +琢磨zhuomo +捉弄zhuonong +酌情zhuoqing +卓越zhuoyue +茁壮zhuozhuang +主权zhuquan +主人zhuren +主任zhuren +诸如zhuru +注色zhuse +注视zhushi +柱石zhushi +注释zhushi +助手zhushou +主送zhusong +住宿zhusu +珠算zhusuan +主题zhuti +主体zhuti +逐条zhutiao +嘱托zhutuo +诸位zhuwei +主席zhuxi +注销zhuxiao +主要zhuyao +逐一zhuyi +主义zhuyi +主意zhuyi +注意zhuyi +祝愿zhuyuan +逐月zhuyue +主宰zhuzai +铸造zhuzao +驻扎zhuzha +住宅zhuzhai +主张zhuzhang +住址zhuzhi +注重zhuzhong +著作zhuzuo +子zi +自zi +资zi +字zi +紫zi +仔zi +籽zi +姿zi +吱*zi +兹zi +咨zi +滋zi +淄zi +孜zi +滓zi +渍zi +谘zi +茈*zi +呲*zi +嵫zi +姊zi +孳zi +缁zi +梓zi +辎zi +赀zi +恣zi +眦zi +锱zi +秭zi +耔zi +笫zi +粢zi +趑zi +觜zi +訾zi +龇zi +鲻zi +髭zi +自爱ziai +自白zibai +自卑zibei +资本ziben +资产zichan +滋长zichang +自称zicheng +自传zichuan +自从zicong +子弟zidi +字典zidian +自动zidong +自发zifa +自费zifei +自封zifeng +自负zifu +字符zifu +资格zige +字根zigen +自豪zihao +自给ziji +自己ziji +字迹ziji +字节zijie +资金zijin +自救zijiu +自居ziju +自觉zijue +字库ziku +自夸zikua +自理zili +资历zili +资料ziliao +自满ziman +自勉zimian +字母zimu +字幕zimu +子女zinu +自强ziqiang +自然ziran +滋润zirun +自杀zisha +自身zishen +姿势zishi +自述zishu +自私zisi +姿态zitai +字体ziti +字帖zitie +自卫ziwei +滋味ziwei +自问ziwen +自我ziwo +仔细zixi +自信zixin +自修zixiu +自叙zixu +自选zixuan +自学zixue +咨询zixun +滋养ziyang +自由ziyou +自愿ziyuan +资源ziyuan +自找zizhao +自治zizhi +自重zizhong +资助zizhu +自尊zizun +直截了当zjld +浙江省zjs +这就是说zjss +中纪委zjw +再接再厉zjzl +中联部zlb +专利法zlf +质量管理zlgl +自力更生zlgs +展览会zlh +智力开发zlkf +专利权zlq +知名人士zmrs +这么些zmx +这么样zmy +怎么样zmy +总zong +纵zong +宗zong +综zong +棕zong +鬃zong +踪zong +偬zong +枞zong +腙zong +粽zong +总部zongbu +总裁zongcai +总参zongcan +总队zongdui +总额zonge +总纲zonggang +总共zonggong +纵贯zongguan +总和zonghe +综合zonghe +纵横zongheng +总后zonghou +总计zongji +踪迹zongji +宗教zongjiao +总结zongjie +总局zongju +总括zongkuo +总理zongli +总论zonglun +宗派zongpai +纵情zongqing +纵深zongshen +总是zongshi +纵使zongshi +总数zongshu +总算zongsuan +总体zongti +总统zongtong +总务zongwu +踪影zongying +总帐zongzhang +总政zongzheng +总之zongzhi +宗旨zongzhi +走zou +邹zou +奏zou +揍zou +诹zou +陬zou +鄹zou +驺zou +鲰zou +走访zoufang +邹虹zouhong +走私zousi +奏效zouxiao +酌情处理zqcl +中青年zqn +朝气蓬勃zqpb +准确无误zqww +正确性zqx +诸如此类zrcl +责任感zrg +自然界zrj +主人翁zrw +责任心zrx +责任制zrz +再生产zsc +自上而下zsex +知识分子zsfz +这时候zsh +知识化zsh +株式会社zshs +总书记zsj +装饰品zsp +综上所述zsss +之所以zsy +自始至终zszz +众所周知zszz +座谈会zth +组zu +族zu +足zu +阻zu +祖zu +租zu +卒zu +诅zu +俎zu +菹zu +镞zu +阻碍zuai +钻zuan +赚*zuan +纂zuan +攥zuan +缵zuan +躜zuan +钻研zuanyan +组成zucheng +阻挡zudang +组阁zuge +足够zugou +祖国zuguo +组合zuhe +最zui +罪zui +嘴zui +堆*zui +咀*zui +醉zui +蕞zui +最初zuichu +最大zuida +最低zuidi +罪恶zuie +罪犯zuifan +最高zuigao +罪过zuiguo +最好zuihao +最后zuihou +最坏zuihuai +最佳zuijia +最近zuijin +嘴脸zuilian +罪名zuiming +罪孽zuinie +罪人zuiren +最先zuixian +最小zuixiao +最新zuixin +醉心zuixin +罪行zuixing +罪责zuize +罪证zuizheng +最终zuizhong +罪状zuizhuang +阻击zuji +租界zujie +租借zujie +阻拦zulan +阻力zuli +租赁zulin +尊zun +遵zun +撙zun +樽zun +鳟zun +阻挠zunao +遵从zuncong +尊贵zungui +尊敬zunjing +遵守zunshou +遵循zunxun +尊严zunyan +遵照zunzhao +尊重zunzhong +作zuo +做zuo +左zuo +座zuo +坐zuo +昨zuo +撮*zuo +凿*zuo +搓*zuo +琢*zuo +佐zuo +柞zuo +阼zuo +唑zuo +嘬zuo +怍zuo +胙zuo +祚zuo +笮*zuo +作案zuoan +作弊zuobi +左边zuobian +坐标zuobiao +做到zuodao +作法zuofa +做法zuofa +作废zuofei +作风zuofeng +做工zuogong +作怪zuoguai +做好zuohao +作家zuojia +作客zuoke +作乐zuole +作乱zuoluan +坐落zuoluo +左派zuopai +作品zuopin +左倾zuoqing +做人zuoren +昨日zuori +做事zuoshi +坐视zuoshi +座谈zuotan +昨天zuotian +昨晚zuowan +作为zuowei +座位zuowei +坐位zuowei +作文zuowen +作物zuowu +作业zuoye +昨夜zuoye +作用zuoyong +左右zuoyou +作战zuozhan +作者zuozhe +作证zuozheng +作主zuozhu +做主zuozhu +做作zuozuo +足球zuqiu +阻塞zuse +祖师zushi +祖先zuxian +组长zuzhang +组织zuzhi +阻止zuzhi +祖宗zuzong +中外合资zwhz +责无旁贷zwpd +中宣部zxb +自行车zxc +自下而上zxes +忠心耿耿zxgg +展销会zxh +照相机zxj +争先恐后zxkh +中学生zxs +主席团zxt +中小学zxx +自信心zxx +中央办公厅zybt +着眼点zyd +专业对口zydk +中央电视台zydt +中央各部委zygw +专业化zyh +专业户zyh +中央军委zyjw +座右铭zym +中央全会zyqh +中央人民广播电台zyrt +主要人员zyry +专业人员zyry +中央书记处zysc +中央委员会zywh +中央委员zywy +重要性zyx +主要原因zyyy +中央政治局zyzj +专业知识zyzs +中组部zzb +组织部zzb +政治部zzb +政治处zzc +转折点zzd +置之度外zzdw +政治局zzj +自治区zzq +蒸蒸日上zzrs +组织上zzs +郑州市zzs +组织性zzx +自尊心zzx +赵紫阳zzy +总政治部zzzb +喷码pm +优喷yp +科技kj +比洋by +公司gs +有限公司yxgz +股份公司gfgs +企业qy +标准bz +喷码机pmj +电线dx +电缆dl +电线电缆dxdl +电力电缆dldl +绝缘jy +绝缘层jyc +导体dt +导线dx +电力dl +通信tx +控制电缆kzdl +补偿电缆bcdl +屏蔽电缆pbdl +高温电缆gwdl +计算机电缆jsjdl +信号电缆xhdl +同轴电缆tzdl +耐火电缆nhdl +船用电缆cydl +铝合金电缆lhjdl +单股dg +多股dg +连接lj +电路dl +电器dq +型号xh +铜t +铝l +铅包qb +铝包qb +聚氯乙烯jlyx +电磁线dcx +北京市bj +东城区dcq +西城区xcq +崇文区cwq +宣武区xwq +朝阳区zyq +海淀区hdq +丰台区ftq +房山区fsq +通州区tzq +顺义区syq +昌平区cpq +大兴区txq +怀柔区hrq +平谷区pgq +门头沟区mtgq +石景山区sjsq +天津市tjs +和平区hpq +河东区hdq +河西区hxq +南开区nkq +河北区hbq +红桥区hqq +塘沽区tgq +汉沽区hgq +大港区tgq +东丽区dlq +西青区xqq +北辰区bcq +津南区jnq +武清区wqq +宝坻区bdq +河北省hbs +辛集市xjs +藁城市gcs +晋州市jzs +新乐市xls +鹿泉市lqs +唐山市tss +遵化市zhs +安市as +邯郸市hds +武安市was +邢台市xts +南宫市ngs +沙河市shs +保定市bds +涿州市zzs +定州市dzs +安国市ags +承德市cds +沧州市czs +泊头市bts +任丘市rqs +黄骅市hhs +河间市hjs +廊坊市lfs +霸州市bzs +三河市shs +衡水市hss +冀州市jzs +深州市szs +石家庄市sjzs +张家口市zjks +高碑店市gbds +秦皇岛市qhds +山西省sxs +太原市tys +古交市gjs +大同市dts +阳泉市yqs +长治市czs +潞城市lcs +晋城市jcs +高平市gps +朔州市szs +晋中市jzs +介休市jxs +运城市ycs +河津市hjs +永济市sjs +忻州市xzs +原平市yps +临汾市lfs +侯马市hms +霍州市hzs +吕梁市lls +孝义市xys +汾阳市fys +内蒙古自治区nmg +包头市bts +乌海市whs +赤峰市cfs +通辽市tls +根河市ghs +丰镇市fzs +辽宁省LNS +沈阳市sys +新民市xms +大连市dls +庄河市zhs +鞍山市ass +海城市hcs +抚顺市fss +本溪市bxs +丹东市dds +东港市dgs +凤城市fcs +锦州市jzs +凌海市lhs +北宁市bns +营口市yks +盖州市gzs +阜新市fxs +辽阳市lys +灯塔市dts +盘锦市pjs +铁岭市tls +开原市kys +朝阳市zys +凌源市lys +北票市bps +兴城市xcs +大石桥市dsqs +瓦房店市wfds +普兰店市plds +调兵山市dbss +葫芦岛市hlds +吉林省jls +长春市ccs +九台市jts +榆树市yss +德惠市dhs +吉林市jls +舒兰市sls +桦甸市hds +蛟河市jhs +磐石市pss +四平市sps +双辽市sls +辽源市lys +通化市ths +集安市jas +白山市bss +临江市ljs +松原市sys +白城市bcs +大安市das +洮南市tns +延吉市yjs +图们市tms +敦化市ghs +龙井市ljs +珲春市hcs +和龙市hls +公主岭市gzls +梅河口市mhks +黑龙江省hljs +阿城市acs +尚志市szs +双城市scs +五常市wcs +讷河市nhs +鹤岗市hgs +鸡西市jxs +密山市mss +虎林市hls +大庆市dqs +伊春市ycs +铁力市tls +宁安市nas +海林市hls +穆棱市mls +同江市tjs +富锦市fjs +黑河市hhs +北安市bas +绥化市shs +安达市ads +肇东市zds +海伦市hls +七台河市qths +双鸭山市syss +牡丹江市mdjs +佳木斯市jmss +绥芬河市sfhs +哈尔滨市hebs +齐齐哈尔市qqhes +五大连池市wdlcs +上海市shs +黄浦区hpq +卢湾区lwq +徐汇区xhq +长宁区cnq +静安区jaq +普陀区ptq +闸北区zbq +虹口区hkq +杨浦区ypq +宝山区bsq +闵行区mxq +嘉定区jdq +松江区sjq +金山区jsq +青浦区qpq +南汇区nhq +奉贤区fxq +崇明县浦东新区cmxpdxq +江苏省jss +南京市njs +无锡市wxs +江阴市jys +宜兴市yxs +徐州市xzs +邳州市pzs +新沂市xys +常州市czs +金坛市jts +溧阳市lys +苏州市szs +常熟市css +太仓市dcs +昆山市hss +吴江市wjs +南通市nns +如皋市rgs +通州市tzs +海门市hms +启东市qds +淮安市has +盐城市ycs +东台市dts +大丰市dfs +扬州市yzs +高邮市gys +江都市jds +仪征市yzs +镇江市zjs +丹阳市dys +扬中市yzs +句容市jrs +泰州市dzs +泰兴市dxs +姜堰市jys +靖江市jjs +兴化市xhs +宿迁市sqs +连云港市lygs +张家港市zjgs +浙江省zjs +杭州市hzs +建德市jds +富阳市fys +临安市las +宁波市nbx +余姚市yys +慈溪市cxs +奉化市fhs +温州市wzs +瑞安市ras +乐清市lqs +嘉兴市jxs +海宁市hns +平湖市phs +桐乡市txs +湖州市hzs +绍兴市sxs +诸暨市zjs +上虞市sys +嵊州市szs +金华市jhs +兰溪市lxs +义乌市yws +东阳市dys +永康市yks +衢州市qzs +江山市jss +舟山市zss +台州市tzs +临海市lhs +丽水市lss +龙泉市lqs +安徽省ahs +合肥市hfs +芜湖市whs +蚌埠市bbs +淮南市hns +淮北市hbs +铜陵市tls +安庆市aqs +桐城市tcs +黄山市hss +滁州市czs +天长市dcs +明光市mgs +阜阳市fys +界首市jss +宿州市szs +巢湖市chs +六安市las +亳州市hzs +池州市czs +宣城市ycs +宁国市ngs +马鞍山市mass +福建省fjs +福州市fjs +福清市fqs +长乐市cls +厦门市xms +莆田市pts +三明市sms +永安市yas +泉州市qzs +石狮市sss +晋江市jjs +南安市nas +漳州市zzs +龙海市lhs +南平市nps +建瓯市jos +邵武市sws +建阳市jys +龙岩市lys +漳平市zps +宁德市nds +福安市fas +福鼎市fds +武夷山市wyss +江西省jxs +南昌市ncs +乐平市lps +萍乡市pxs +九江市jjs +瑞昌市rcs +新余市xys +鹰潭市yts +贵溪市gxs +赣州市gzs +瑞金市rjs +南康市nks +吉安市jas +宜春市ycs +丰城市fcs +樟树市zss +高安市gas +抚州市fzs +上饶市srs +德兴市dxs +井冈山市jgss +景德镇市jdzs +山东省sds +济南市jns +章丘市zqs +青岛市qds +胶南市jns +胶州市jzs +平度市pds +莱西市lxs +即墨市jms +淄博市zbs +枣庄市zzs +滕州市tzs +烟台市yts +龙口市lks +莱阳市lys +莱州市lzs +招远市zys +蓬莱市pls +栖霞市qxs +海阳市hys +潍坊市wfs +青州市qzs +诸城市zcs +寿光市sgs +安丘市aqs +高密市gms +昌邑市cys +济宁市jns +曲阜市qfs +兖州市yzs +邹城市zcs +泰安市tas +新泰市xts +肥城市fcs +威海市whs +乳山市rss +文登市wds +荣成市rcs +日照市rzs +莱芜市lws +临沂市lys +德州市dzs +乐陵市lls +禹城市ycs +聊城市lcs +临清市lqs +滨州市bzs +菏泽市hzs +河南省hns +郑州市zzs +巩义市gys +新郑市xzs +新密市xms +登封市dfs +荥阳市xys +开封市kfs +洛阳市lys +偃师市yss +汝州市rzs +舞钢市wgs +安阳市ays +林州市lzs +新乡市xxs +卫辉市whs +辉县市hxs +焦作市jzs +沁阳市qys +孟州市mzs +濮阳市pys +许昌市xcs +禹州市yzs +长葛市cgs +漯河市lhs +义马市yms +灵宝市lbs +南阳市nys +邓州市dzs +商丘市sqs +永城市ycs +信阳市xys +周口市zks +项城市dcs +济源市jys +三门峡市smxs +平顶山市pdss +驻马店市zmds +湖北省hbs +武汉市whs +黄石市hss +大冶市dys +十堰市sys +荆州市jzs +洪湖市hhs +石首市sss +松滋市szs +宜昌市ycs +宜都市yds +当阳市dys +枝江市jjs +襄樊市xfs +枣阳市zys +宜城市ycs +鄂州市ezs +荆门市jms +钟祥市zxs +孝感市xgs +应城市ycs +安陆市als +汉川市hcs +黄冈市hgs +麻城市mcs +武穴市wxs +咸宁市xns +赤壁市cbs +随州市szs +广水市gss +仙桃市xts +天门市tms +潜江市qjs +恩施市ess +利川市lcs +丹江口市djks +老河口市lhks +神农架林区snjlq +湖南省hns +长沙市css +浏阳市lys +株洲市zzs +醴陵市lls +湘潭市xts +湘乡市xxs +韶山市sss +衡阳市hys +耒阳市lys +常宁市cns +邵阳市sys +武冈市wgs +岳阳市yys +临湘市lxs +汨罗市mls +常德市cds +津市市jss +益阳市yys +沅江市yjs +郴州市czs +资兴市zxs +永州市yzs +怀化市hhs +洪江市hjs +娄底市lds +涟源市lys +吉首市jss +冷水江市lsjs +张家界市zjjs +广东省gds +广州市gzs +从化市chs +增城市zcs +深圳市szs +珠海市zhs +汕头市sts +韶关市sgs +乐昌市lcs +南雄市nxs +佛山市fss +江门市jms +台山市tss +开平市kps +鹤山市hss +恩平市eps +湛江市zjs +廉江市ljs +雷州市lzs +吴川市wcs +茂名市mms +西昌市xcs +峨眉山市emss +都江堰市djys +攀枝花市pzhs +贵州省gzs +贵阳市gys +清镇市qzs +遵义市zys +赤水市css +仁怀市rhs +安顺市ass +毕节市bjs +兴义市xys +凯里市kls +都匀市dys +福泉市fqs +六盘水市lpss +六枝特区lztq +万山特区wstq +云南省yns +昆明市kms +安宁市ans +曲靖市qjs +宣威市xws +玉溪市yxs +保山市bss +昭通市zts +丽江市ljs +思茅市sms +临沧市lqs +个旧市gjs +开远市kys +景洪市jhs +楚雄市cxs +大理市dls +潞西市lxs +瑞丽市rls +西藏自治区xzzzq +拉萨市lss +陕西省sxs +西安市xas +铜川市tcs +宝鸡市bjs +咸阳市xys +渭南市wns +韩城市hcs +华阴市hys +延安市yas +汉中市azs +榆林市yls +安康市aks +商洛市sls +甘肃省gss +兰州市lzs +金昌市jcs +白银市bys +天水市tss +武威市wws +张掖市zys +平凉市pls +酒泉市jqs +玉门市yms +敦煌市dhs +庆阳市qys +定西市dxs +陇南市lns +临夏市lxs +合作市hzs +嘉峪关市jygs +青海省qhs +西宁市xns +德令哈市dlhs +格尔木市gems +宁夏回族自治区nxhzzzq +银川市ycs +灵武市lws +吴忠市wzs +固原市gys +中卫市zws +石嘴山市szss +青铜峡市qtxs +新疆维吾尔自治区xjwwezzq +喀什市kss +昌吉市cjs +阜康市fks +米泉市mqs +博乐市bls +伊宁市yns +奎屯市kts +塔城市tcs +乌苏市wss +石河子市shzs +阿拉尔市ales +五家渠市wjqs +吐鲁番市tlfs +阿克苏市akss +阿图什市atss +库尔勒市kels +阿勒泰市alts +乌鲁木齐市wlmqs +克拉玛依市klmys +图木舒克市tmsks +香港特别行政区 +中西区zxq +东区dq +观塘区gtq +南区nq +湾仔区wzq +离岛区ldq +葵青区kqq +北区bq +西贡区xgq +沙田区stq +屯门区tmq +大埔区dpq +荃湾区qwq +元朗区ylq +九龙城区jtcq +油尖旺区yjwq +深水埗区ssbq +黄大仙区hdxq +台湾省tws +台北市tbs +高雄市gxs +基隆市jls +台中市tzs +台南市tns +新竹市xzs +嘉义市jys +板桥市bqs +宜兰市yls +竹北市zbs +桃园市tys +苗栗市mls +丰原市fys +彰化市zhs +南投市nts +太保市tbs +斗六市dls +新营市xys +凤山市fss +屏东市pds +台东市tds +花莲市hls +马公市mgs diff --git a/YN_utf8.txt b/YN_utf8.txt new file mode 100644 index 0000000..a847c21 --- /dev/null +++ b/YN_utf8.txt @@ -0,0 +1,21061 @@ +Šsw +šsw +Žzw +žzw +Œce +œce +aÀ +aÁ +aẢ +aà +aẠ +aÄ +aÅ +aeÆ +a +asá +afà +arả +axã +ajạ +awă +aaâ +aeă +äa +åa +aaâ +aa +Äa +Åa +Æae +AFÀ +ASÁ +ARẢ +AXà +AJẠ +AÄ +AÅ +AEÆ +AA +eÉ +eÈ +eẺ +eẼ +eẸ +eÊ +eË +esé +efè +erẻ +exẽ +ejẹ +eeê +ESÉ +EFÈ +ERẺ +EXẼ +EJẸ +EEÊ +eeÊ +EË +DDĐ +ddđ +ddĐ +íis +ìif +ỉir +ĩix +ịij +ÌIF +ÍIS +ỈIR +ĨIX +ỊIj +IIÎ +iÌ +iÍ +iỈ +iĨ +ij +iÎ +iÏ +nÑ +osó +ofò +orỏ +oxõ +ojọ +owơ +ooô +OSÓ +OFÒ +ORỎ +OXÕ +OJỌ +OWƠ +OEÒ +OOÔ +ooÔ +OÖ +ooÖ +oÓ +oÒ +oỎ +oÕ +oỌ +oƠ +oÒ +oÔ +usú +ufù +urủ +uxũ +ujụ +uwư +USÚ +UFÙ +URỦ +UXŨ +UJỤ +UWƯ +ÜU +ÛU +uÚ +uÙ +uỦ +uŨ +uỤ +uƯ +uÜ +uÛ +YFỲ +YSÝ +YRỶ +YXỸ +YJỴ +yỲ +yÝ +yỶ +yỸ +yỴ +yfỳ +ysý +yrỷ +yxỹ +ỵyj +安a +按a +爱a +阿a +暗a +啊a +埃a +碍a +凹a +奥a +岸a +矮a +案a +俺a +挨a +唉a +昂a +氨a +胺a +哎a +吖a +嗄a +腌a +锕a +安徽省ahs +爱ai +埃ai +碍ai +矮ai +挨ai +唉ai +哎ai +哀ai +皑ai +癌ai +蔼ai +艾ai +隘ai +呆*ai +捱ai +嗳ai +嗌ai +嫒ai +瑷ai +暧ai +砹ai +锿ai +霭ai +安an +按an +暗an +岸an +案an +俺an +氨an +胺an +鞍an +谙an +埯an +揞an +犴an +庵an +桉an +铵an +鹌an +黯an +昂ang +肮ang +盎ang +安徽anhui +凹ao +奥ao +敖ao +熬ao +翱ao +袄ao +傲ao +懊ao +澳ao +嚣*ao +坳ao +拗ao +嗷ao +岙ao +廒ao +遨ao +媪ao +骜ao +獒ao +聱ao +螯ao +鏊ao +鳌ao +鏖ao +不b +部b +本b +表b +把b +变b +比b +并b +别b +百b +报b +保b +病b +北b +被b +步b +边b +八b +办b +布b +把ba +八ba +吧ba +巴ba +拔ba +霸ba +罢ba +爸ba +坝ba +芭ba +捌ba +扒ba +叭ba +笆ba +疤ba +跋ba +靶ba +耙ba +茇ba +菝ba +岜ba +灞ba +钯ba +粑ba +鲅ba +魃ba +百bai +白bai +败bai +摆bai +伯*bai +柏bai +佰bai +拜bai +稗bai +捭bai +掰bai +办ban +半ban +板ban +班ban +般ban +版ban +拌ban +搬ban +斑ban +扳ban +伴ban +颁ban +扮ban +瓣ban +绊ban +阪ban +坂ban +钣ban +瘢ban +癍ban +舨ban +帮bang +棒bang +邦bang +榜bang +梆bang +膀bang +绑bang +磅bang +蚌bang +镑bang +傍bang +谤bang +蒡bang +浜bang +报bao +保bao +包bao +剥bao +薄bao +胞bao +暴bao +宝bao +饱bao +抱bao +爆bao +炮*bao +堡bao +刨*bao +苞bao +褒bao +雹bao +豹bao +鲍bao +曝*bao +瀑*bao +葆bao +孢bao +煲bao +鸨bao +褓bao +趵bao +龅bao +北bei +被bei +倍bei +备bei +背bei +辈bei +贝bei +杯bei +卑bei +臂*bei +悲bei +碑bei +钡bei +狈bei +惫bei +焙bei +孛bei +陂bei +邶bei +埤bei +萆bei +蓓bei +呗bei +悖bei +碚bei +鹎bei +褙bei +鐾bei +鞴bei +本ben +奔ben +苯ben +笨ben +夯*ben +畚ben +坌ben +贲ben +锛ben +本报benbao +奔波benbo +本部benbu +本厂benchang +奔驰benchi +本地bendi +奔放benfang +泵beng +崩beng +蚌*beng +绷beng +甭beng +蹦beng +迸beng +嘣beng +甏beng +比bi +必bi +避bi +闭bi +辟bi +笔bi +壁bi +臂bi +毕bi +彼bi +逼bi +币bi +鼻bi +蔽bi +秘*bi +鄙bi +碧bi +蓖bi +毙bi +毖bi +庇bi +痹bi +敝bi +弊bi +陛bi +拂*bi +泌*bi +匕bi +俾bi +埤*bi +芘*bi +荜bi +荸bi +萆*bi +薜bi +吡bi +哔bi +狴bi +庳bi +愎bi +滗bi +濞bi +弼bi +妣bi +婢bi +嬖bi +璧bi +贲*bi +睥*bi +畀bi +铋bi +秕bi +裨bi +筚bi +箅bi +篦bi +舭bi +襞bi +跸bi +髀bi +变bian +边bian +便bian +编bian +遍bian +辩bian +扁bian +辨bian +鞭bian +贬bian +卞bian +辫bian +匾bian +弁bian +苄bian +忭bian +汴bian +缏bian +飚bian +煸bian +砭bian +碥bian +窆bian +褊bian +蝙bian +笾bian +鳊bian +表biao +标biao +彪biao +膘biao +勺*biao +婊biao +骠biao +杓biao +飑biao +飙biao +镖biao +镳biao +瘭biao +裱biao +鳔biao +髟biao +别bie +鳖bie +憋bie +瘪bie +蹩bie +宾bin +彬bin +斌bin +濒bin +滨bin +摈bin +傧bin +豳bin +缤bin +玢bin +槟bin +殡bin +膑bin +镔bin +髌bin +鬓bin +并bing +病bing +兵bing +柄bing +冰bing +丙bing +饼bing +秉bing +炳bing +屏*bing +禀bing +邴bing +摒bing +槟*bing +波bo +播bo +剥*bo +伯bo +拨bo +薄*bo +博bo +勃bo +驳bo +玻bo +泊bo +柏*bo +卜*bo +菠bo +钵bo +搏bo +铂bo +箔bo +帛bo +舶bo +脖bo +膊bo +渤bo +魄*bo +孛*bo +亳bo +啵bo +饽bo +檗bo +掰*bo +擘bo +礴bo +钹bo +鹁bo +簸bo +趵*bo +跛bo +踣bo +不bu +部bu +步bu +布bu +补bu +捕bu +埔*bu +卜bu +堡*bu +哺bu +埠bu +簿bu +怖bu +卟bu +逋bu +瓿bu +晡bu +钚bu +钸bu +醭bu +不安buan +不比bubi +不必bubi +不变bubian +不便bubian +步兵bubing +步步bubu +不曾buceng +补偿buchang +不啻buchi +补充buchong +不错bucuo +不大buda +不待budai +不但budan +不当budang +不得bude +不等budeng +步调budiao +不动budong +不断buduan +不对budui +部队budui +不法bufa +补发bufa +步伐bufa +不凡bufan +不妨bufang +不分bufen +部分bufen +不服bufu +不符bufu +不该bugai +不敢bugan +不甘bugan +布告bugao +不够bugou +不顾bugu +不管buguan +不过buguo +不会buhui +补给buji +部件bujian +不借bujie +不尽bujin +不仅bujin +不禁bujin +布景bujing +不久bujiu +补救bujiu +布局buju +不堪bukan +不可buke +不快bukuai +不愧bukui +不理buli +不利buli +不良buliang +不料buliao +步履bulu +不论bulun +部落buluo +不满buman +部门bumen +不免bumian +不能buneng +不怕bupa +补品bupin +不平buping +步枪buqiang +不屈buqu +不然buran +不如buru +不少bushao +不是bushi +不识bushi +部首bushou +部属bushu +部署bushu +补贴butie +不同butong +不妥butuo +部位buwei +部委buwei +不问buwen +不惜buxi +补习buxi +部下buxia +不行buxing +不幸buxing +步行buxing +不朽buxiu +不许buxu +哺养buyang +不要buyao +不宜buyi +不用buyong +哺育buyu +不在buzai +部长buzhang +不振buzhen +不只buzhi +不止buzhi +不知buzhi +不致buzhi +布置buzhi +步骤buzhou +补助buzhu +捕捉buzhuo +步子buzi +不足buzu +博物馆bwg +产c +成c +出c +长c +从c +此c +常c +处c +车c +场c +传c +采c +层c +厂c +才c +次c +虫c +除c +查c +差c +擦ca +拆*ca +嚓ca +礤ca +采cai +才cai +材cai +菜cai +财cai +裁cai +彩cai +猜cai +睬cai +踩cai +蔡cai +参can +残can +蚕can +灿can +餐can +惭can +惨can +孱can +骖can +璨can +粲can +黪can +惨案canan +惨白canbai +残暴canbao +惨怛canda +残废canfei +藏cang +仓cang +苍cang +舱cang +沧cang +苍白cangbai +仓促cangcu +仓库cangku +苍老canglao +苍茫cangmang +藏匿cangni +苍穹cangqiong +沧桑cangsang +苍天cangtian +参观canguan +残骸canhai +残疾canji +参加canjia +参见canjian +残局canju +惨剧canju +参军canjun +参看cankan +参考cankao +残酷canku +惭愧cankui +灿烂canlan +参谋canmou +残缺canque +残忍canren +孱弱canruo +残杀cansha +残生cansheng +蚕食canshi +参数canshu +惨痛cantong +参与canyu +残余canyu +残月canyue +参阅canyue +参赞canzan +惨遭canzao +参战canzhan +参照canzhao +参政canzheng +惨重canzhong +草cao +槽cao +操cao +糙cao +曹cao +嘈cao +漕cao +螬cao +艚cao +草案caoan +草稿caogao +槽糕caogao +操劳caolao +操练caolian +草率caolu +草木caomu +草拟caoni +草签caoqian +操心caoxin +草原caoyuan +嘈杂caoza +操纵caozong +操作caozuo +差不多cbd +成本核算cbhs +出版社cbs +层出不穷ccbq +从长计议ccjy +存储器ccq +长春市ccs +成都市cds +测ce +策ce +侧ce +册ce +厕ce +恻ce +测定ceding +策动cedong +策反cefan +策划cehua +测量celiang +策略celue +侧面cemian +参*cen +岑cen +涔cen +涔涔cencen +层ceng +曾*ceng +蹭ceng +层层cengceng +层次cengci +曾经cengjing +测试ceshi +厕所cesuo +测验ceyan +侧重cezhong +出发点cfd +充分发挥cffh +唱高调cgd +从古到今cgdj +查cha +差cha +插cha +察cha +茶cha +叉cha +茬cha +碴cha +搽cha +岔cha +诧cha +刹*cha +喳*cha +嚓*cha +猹cha +馇cha +汊cha +姹cha +杈cha +楂cha +槎cha +檫cha +锸cha +镲cha +衩cha +查办chaban +差别chabie +差错chacuo +差点chadian +查对chadui +差额chae +查访chafang +察访chafang +查封chafeng +查获chahuo +差*chai +柴chai +拆chai +豺chai +侪chai +钗chai +瘥chai +虿chai +拆穿chaichuan +豺狼chailang +拆散chaisan +差使chaishi +拆卸chaixie +柴油chaiyou +差价chajia +差距chaju +察觉chajue +查看chakan +察看chakan +查考chakao +查明chaming +产chan +单*chan +铲chan +阐chan +搀chan +掺chan +蝉chan +馋chan +谗chan +缠chan +颤chan +冁chan +谄chan +蒇chan +廛chan +忏chan +潺chan +澶chan +孱*chan +羼chan +婵chan +骣chan +觇chan +禅chan +镡chan +蟾chan +躔chan +铲除chanchu +产地chandi +阐发chanfa +搀扶chanfu +长chang +常chang +场chang +厂chang +唱chang +肠chang +昌chang +倡chang +偿chang +畅chang +猖chang +尝chang +敞chang +裳*chang +倘*chang +伥chang +鬯chang +苌chang +菖chang +徜chang +怅chang +惝chang +阊chang +娼chang +嫦chang +昶chang +氅chang +鲳chang +长安changan +常常changchang +长城changcheng +长春changchun +畅达changda +倡导changdao +长度changdu +长短changduan +唱歌changge +常规changgui +长河changhe +场合changhe +偿还changhuan +厂家changjia +常见changjian +长江changjiang +长久changjiu +猖獗changjue +长空changkong +畅快changkuai +猖狂changkuang +场面changmian +长眠changmian +长年changnian +长篇changpian +长期changqi +长驱changqu +常任changren +长沙changsha +厂商changshang +常识changshi +尝试changshi +长寿changshou +常数changshu +场所changsuo +畅谈changtan +长途changtu +怅惘changwang +常委changwei +倘未changwei +常温changwen +常务changwu +畅想changxiang +畅销changxiao +倡议changyi +畅饮changyin +常用changyong +常有changyou +畅游changyou +长远changyuan +厂长changzhang +长征changzheng +厂址changzhi +常驻changzhu +婵娟chanjuan +蝉联chanlian +产量chanliang +缠绵chanmian +阐明chanming +产品chanpin +产权chanquan +缠绕chanrao +产生chansheng +禅师chanshi +阐述chanshu +产物chanwu +产销chanxiao +产业chanye +产值chanzhi +朝chao +超chao +潮chao +巢chao +抄chao +钞chao +嘲chao +吵chao +炒chao +绰*chao +剿*chao +怊chao +晁chao +焯*chao +耖chao +抄报chaobao +超产chaochan +超出chaochu +朝代chaodai +超额chaoe +嘲讽chaofeng +超过chaoguo +朝晖chaohui +超级chaoji +吵架chaojia +潮解chaojie +潮流chaoliu +抄录chaolu +吵闹chaonao +嘲弄chaonong +潮湿chaoshi +潮水chaoshui +抄送chaosong +超脱chaotuo +抄袭chaoxi +朝鲜chaoxian +嘲笑chaoxiao +巢穴chaoxue +朝阳chaoyang +朝野chaoye +超越chaoyue +超支chaozhi +查清chaqing +插曲chaqu +插入charu +查哨chashao +插手chashou +查收chashou +插图chatu +查问chawen +查询chaxun +茶叶chaye +差异chayi +查阅chayue +查证chazheng +岔子chazi +插足chazu +车che +彻che +尺*che +撤che +扯che +掣che +澈che +坼che +砗che +彻底chedi +车祸chehuo +车间chejian +车辆cheliang +陈chen +沉chen +称chen +衬chen +尘chen +臣chen +晨chen +沈*chen +郴chen +辰chen +忱chen +趁chen +伧chen +谌chen +谶chen +抻chen +嗔chen +宸chen +琛chen +榇chen +碜chen +龀chen +尘埃chenai +沉淀chendian +陈腐chenfu +沉浮chenfu +成cheng +程cheng +称cheng +城cheng +承cheng +乘cheng +呈cheng +盛*cheng +撑cheng +诚cheng +橙cheng +惩cheng +澄cheng +逞cheng +骋cheng +秤cheng +丞cheng +埕cheng +噌cheng +枨cheng +柽cheng +塍cheng +瞠cheng +铖cheng +铛cheng +裎cheng +蛏cheng +酲cheng +成败chengbai +承办chengban +惩办chengban +呈报chengbao +承包chengbao +成本chengben +成材chengcai +惩处chengchu +乘除chengchu +承担chengdan +承当chengdang +成都chengdu +程度chengdu +乘法chengfa +惩罚chengfa +成功chenggong +成规chenggui +成果chengguo +称号chenghao +称呼chenghu +成绩chengji +乘机chengji +成家chengjia +成见chengjian +成交chengjiao +承接chengjie +惩戒chengjie +成就chengjiu +乘客chengke +诚恳chengken +成立chengli +乘凉chengliang +成名chengming +成年chengnian +成批chengpi +成品chengpin +诚朴chengpu +逞强chengqiang +澄清chengqing +城区chengqu +成全chengquan +诚然chengran +成人chengren +承认chengren +成色chengse +成事chengshi +诚实chengshi +城市chengshi +承受chengshou +成熟chengshu +成为chengwei +称谓chengwei +成文chengwen +呈现chengxian +呈献chengxian +城乡chengxiang +成效chengxiao +称心chengxin +诚心chengxin +程序chengxu +乘虚chengxu +撑腰chengyao +诚意chengyi +成语chengyu +成员chengyuan +称赞chengzan +成长chengzhang +城镇chengzhen +称职chengzhi +诚挚chengzhi +趁机chenji +沉积chenji +陈迹chenji +沉浸chenjin +沉静chenjing +陈旧chenjiu +陈列chenlie +沉沦chenlun +沉闷chenmen +沉湎chenmian +沉默chenmo +沉溺chenni +陈设chenshe +陈述chenshu +陈说chenshuo +沉思chensi +沉痛chentong +衬托chentuo +沉吟chenyin +衬映chenying +趁早chenzao +沉重chenzhong +沉着chenzhuo +车皮chepi +扯皮chepi +撤退chetui +撤消chexiao +车站chezhan +撤职chezhi +持chi +尺chi +齿chi +吃chi +赤chi +池chi +迟chi +翅chi +斥chi +耻chi +痴chi +匙chi +弛chi +驰chi +侈chi +炽chi +傺chi +坻chi +墀chi +茌chi +叱chi +哧chi +啻chi +嗤chi +彳chi +饬chi +媸chi +敕chi +眵chi +鸱chi +瘛chi +褫chi +蚩chi +螭chi +笞chi +篪chi +豉chi +踟chi +魑chi +翅膀chibang +赤诚chicheng +驰骋chicheng +尺寸chicun +迟到chidao +赤道chidao +尺度chidu +迟钝chidun +吃喝chihe +迟缓chihuan +吃紧chijin +吃惊chijing +持久chijiu +吃苦chiku +吃亏chikui +吃力chili +炽烈chilie +齿轮chilun +持平chiping +痴情chiqing +炽热chire +耻辱chiru +池塘chitang +耻笑chixiao +赤心chixin +痴心chixin +迟疑chiyi +迟早chizao +斥责chize +叱咤chizha +持重chizhong +吃重chizhong +赤字chizi +催化剂chj +种*chong +虫chong +重*chong +充chong +冲chong +崇chong +涌*chong +宠chong +茺chong +忡chong +憧chong +铳chong +舂chong +艟chong +宠爱chongai +崇拜chongbai +充斥chongchi +冲刺chongci +冲淡chongdan +充当chongdang +重叠chongdie +冲动chongdong +宠儿chonger +充分chongfen +冲锋chongfeng +重复chongfu +崇高chonggao +重合chonghe +重婚chonghun +冲击chongji +重建chongjian +崇敬chongjing +憧憬chongjing +充满chongman +充沛chongpei +冲破chongpo +重庆chongqing +崇尚chongshang +重申chongshen +充实chongshi +冲刷chongshua +冲天chongtian +冲突chongtu +重温chongwen +冲洗chongxi +重新chongxin +重演chongyan +重印chongyin +充裕chongyu +充足chongzu +抽chou +仇chou +臭chou +酬chou +畴chou +踌chou +稠chou +愁chou +筹chou +绸chou +瞅chou +丑chou +俦chou +帱chou +惆chou +瘳chou +雠chou +筹办chouban +筹备choubei +惆怅chouchang +抽搐chouchu +踌躇chouchu +筹措choucuo +抽调choudiao +丑恶choue +仇恨chouhen +丑化chouhua +筹划chouhua +筹集chouji +筹建choujian +酬金choujin +抽空choukong +酬劳choulao +丑陋choulou +筹码chouma +稠密choumi +筹谋choumou +愁容chourong +抽象chouxiang +酬谢chouxie +抽噎chouye +出chu +处chu +除chu +初chu +础chu +触chu +楚chu +锄chu +储chu +畜*chu +橱chu +厨chu +躇chu +雏chu +滁chu +矗chu +搐chu +亍chu +刍chu +怵chu +憷chu +绌chu +杵chu +楮chu +樗chu +褚chu +蜍chu +蹰chu +黜chu +揣chuai +搋chuai +啜chuai +嘬*chuai +膪chuai +踹chuai +揣度chuaidu +揣摩chuaimo +传chuan +船chuan +穿chuan +串chuan +川chuan +椽chuan +喘chuan +舛chuan +遄chuan +巛chuan +氚chuan +钏chuan +舡chuan +传遍chuanbian +传标chuanbiao +传播chuanbo +船舶chuanbo +船埠chuanbu +穿插chuancha +传达chuanda +传单chuandan +传导chuandao +传递chuandi +床chuang +创chuang +窗chuang +闯chuang +疮chuang +幢chuang +怆chuang +创办chuangban +闯荡chuangdang +窗户chuanghu +创见chuangjian +创建chuangjian +闯劲chuangjin +创举chuangju +窗口chuangkou +创立chuangli +窗帘chuanglian +创始chuangshi +创新chuangxin +创业chuangye +创造chuangzao +创作chuangzuo +串联chuanlian +喘气chuanqi +传奇chuanqi +传染chuanran +传授chuanshou +传输chuanshu +传述chuanshu +传说chuanshuo +传送chuansong +传统chuantong +串通chuantong +喘息chuanxi +传讯chuanxun +传扬chuanyang +传阅chuanyue +传真chuanzhen +船只chuanzhi +穿着chuanzhuo +出版chuban +出榜chubang +储备chubei +出兵chubing +初步chubu +储藏chucang +出差chucha +出产chuchan +出场chuchang +出厂chuchang +处处chuchu +橱窗chuchuang +初次chuci +储存chucun +初等chudeng +出动chudong +触动chudong +出发chufa +触发chufa +除法chufa +处罚chufa +触犯chufan +出访chufang +除非chufei +处分chufen +出轨chugui +出海chuhai +吹chui +垂chui +锤chui +椎*chui +炊chui +捶chui +陲chui +棰chui +槌chui +吹棒chuibang +吹风chuifeng +吹拂chuifu +锤炼chuilian +吹牛chuiniu +垂青chuiqing +垂涎chuixian +吹嘘chuixu +垂直chuizhi +初级chuji +出击chuji +出界chujie +出境chujing +处境chujing +处决chujue +触觉chujue +除开chukai +出口chukou +出来chulai +除了chule +出力chuli +处理chuli +矗立chuli +初恋chulian +出笼chulong +出路chulu +出马chuma +出卖chumai +出面chumian +出名chuming +除名chuming +出没chumo +春chun +纯chun +醇chun +椿chun +唇chun +淳chun +蠢chun +莼chun +鹑chun +蝽chun +出纳chuna +春播chunbo +纯粹chuncui +纯度chundu +春分chunfen +春风chunfeng +春耕chungeng +春光chunguang +醇厚chunhou +春辉chunhui +春季chunji +春节chunjie +纯洁chunjie +纯净chunjing +纯利chunli +纯朴chunpu +春秋chunqiu +春色chunse +春笋chunsun +春天chuntian +处女chunu +触怒chunu +春意chunyi +纯真chunzhen +纯正chunzheng +戳chuo +绰chuo +啜*chuo +辍chuo +踔chuo +龊chuo +戳穿chuochuan +绰号chuohao +啜泣chuoqi +出品chupin +出奇chuqi +初期chuqi +出勤chuqin +出去chuqu +出让churang +出任churen +出入churu +出色chuse +出身chushen +出神chushen +出生chusheng +畜生chusheng +出事chushi +出世chushi +处世chushi +厨师chushi +出售chushou +处所chusuo +出庭chuting +锄头chutou +出土chutu +出外chuwai +除外chuwai +出席chuxi +出息chuxi +除夕chuxi +出现chuxian +初小chuxiao +雏形chuxing +储蓄chuxu +刍议chuyi +处于chuyu +初战chuzhan +处长chuzhang +出诊chuzhen +出征chuzheng +处置chuzhi +初中chuzhong +出租chuzu +此ci +次ci +刺ci +磁ci +雌ci +词ci +茨ci +疵ci +辞ci +慈ci +瓷ci +赐ci +伺*ci +兹*ci +茈ci +呲ci +祠ci +鹚ci +糍ci +慈爱ciai +辞别cibie +磁场cichang +磁带cidai +磁道cidao +此地cidi +词典cidian +辞典cidian +刺耳cier +词根cigen +刺骨cigu +此后cihou +词汇cihui +刺激ciji +赐教cijiao +此刻cike +刺客cike +词类cilei +辞令ciling +磁盘cipan +次品cipin +辞去ciqu +刺杀cisha +此时cishi +次数cishu +辞书cishu +词素cisu +祠堂citang +辞退citui +此外ciwai +慈祥cixiang +辞行cixing +词性cixing +雌雄cixiong +次序cixu +词序cixu +刺眼ciyan +次要ciyao +词语ciyu +赐予ciyu +此致cizhi +辞职cizhi +词缀cizhui +词组cizu +超级大国cjdg +参考书cks +参考消息ckxx +参考资料ckzl +触类旁通clpt +藏龙卧虎clwh +参谋长cmc +聪明才智cmcz +出谋划策cmhc +从难从严cncy +从cong +丛cong +聪cong +葱cong +囱cong +匆cong +苁cong +淙cong +骢cong +琮cong +璁cong +从此congci +匆匆congcong +匆促congcu +从而conger +从犯congfan +聪慧conghui +从来conglai +丛林conglin +匆忙congmang +聪明congming +从前congqian +从容congrong +从事congshi +丛书congshu +从速congsu +从新congxin +从严congyan +聪颖congying +葱郁congyu +从中congzhong +凑cou +楱cou +辏cou +腠cou +凑合couhe +凑巧couqiao +成品率cpl +成千上万cqsw +从容不迫crbp +承认错误crcw +趁热打铁crdt +措手不及csbj +出生率csl +长沙市css +炊事员csy +彻头彻尾ctcw +垂头丧气ctsq +粗cu +促cu +醋cu +簇cu +卒*cu +蔟cu +徂cu +猝cu +殂cu +酢cu +蹙cu +蹴cu +篡cuan +蹿cuan +窜cuan +攒*cuan +汆cuan +撺cuan +爨cuan +镩cuan +篡夺cuanduo +窜犯cuanfan +篡改cuangai +篡权cuanquan +粗暴cubao +粗糙cucao +粗犷cuguang +催cui +脆cui +淬cui +粹cui +摧cui +衰*cui +崔cui +瘁cui +翠cui +萃cui +啐cui +悴cui +璀cui +榱cui +毳cui +隹cui +摧残cuican +脆弱cuiruo +促进cujin +存cun +村cun +寸cun +蹲*cun +忖cun +皴cun +存储cunchu +存档cundang +存放cunfang +存款cunkuan +村落cunluo +存亡cunwang +存在cunzai +村镇cunzhen +村庄cunzhuang +村子cunzi +错cuo +措cuo +撮cuo +磋cuo +搓cuo +挫cuo +厝cuo +嵯cuo +脞cuo +锉cuo +矬cuo +痤cuo +瘥*cuo +鹾cuo +蹉cuo +错案cuoan +挫败cuobai +错处cuochu +措辞cuoci +错怪cuoguai +错过cuoguo +撮合cuohe +错觉cuojue +磋商cuoshang +挫伤cuoshang +措施cuoshi +错误cuowu +挫折cuozhe +错综cuozong +粗浅cuqian +促使cushi +粗俗cusu +粗心cuxin +粗壮cuzhuang +常委会cwh +崇文区cwq +常务委员会cwwh +乘务员cwy +诚心诚意cxcy +程序控制cxkz +程序设计cxsj +长远利益cyly +朝阳区cyq +财政部czb +错综复杂czfz +操之过急czgj +出租汽车czqc +此之外czw +财政危机czwj +创造性czx +操作系统czxt +操作员czy +持之以恒czyh +的d +大d +地d +动d +到d +对d +度d +多d +电d +党d +得d +定d +等d +斗d +当d +队d +都d +点d +代d +道d +大da +打da +达da +答da +搭da +塔*da +瘩da +耷da +哒da +嗒da +怛da +妲da +沓*da +疸da +褡da +笪da +靼da +鞑da +答案daan +打败dabai +大办daban +大半daban +打扮daban +答辩dabian +大伯dabo +大部dabu +达成dacheng +大胆dadan +搭档dadang +大道dadao +达到dadao +打倒dadao +大地dadi +大敌dadi +大抵dadi +打断daduan +大队dadui +大多daduo +大凡dafan +大夫dafu +大幅dafu +答复dafu +大概dagai +大纲dagang +大国daguo +大海dahai +大好dahao +大河dahe +大亨daheng +大会dahui +大*dai +代dai +带dai +待dai +袋dai +戴dai +呆dai +歹dai +傣dai +殆dai +贷dai +逮dai +怠dai +埭dai +甙dai +呔dai +岱dai +迨dai +骀dai +绐dai +玳dai +黛dai +呆板daiban +代表daibiao +逮捕daibu +逮逋daibu +代词daici +带动daidong +怠工daigong +代价daijia +贷款daikuan +带来dailai +代理daili +带领dailing +带路dailu +黛绿dailu +代码daima +怠慢daiman +待命daiming +代数daishu +代替daiti +带头daitou +歹徒daitu +待遇daiyu +呆滞daizhi +呆子daizi +打击daji +大家dajia +打搅dajiao +大街dajie +大捷dajie +打劫dajie +搭救dajiu +大局daju +答卷dajuan +打开dakai +耷拉dala +大力dali +大连dalian +大量daliang +打量daliang +大陆dalu +大略dalue +大妈dama +单dan +但dan +弹dan +担dan +石*dan +蛋dan +淡dan +胆dan +氮dan +丹dan +旦dan +耽dan +郸dan +掸dan +惮dan +诞dan +儋dan +萏dan +啖dan +澹*dan +殚dan +赕dan +眈dan +疸dan +瘅dan +聃dan +箪dan +大脑danao +担保danbao +单薄danbao +淡薄danbao +单产danchan +诞辰danchen +单纯danchun +单词danci +担当dandang +单调dandiao +单独dandu +单方danfang +担负danfu +党dang +当dang +档dang +挡dang +荡dang +谠dang +凼dang +菪dang +宕dang +砀dang +裆dang +单干dangan +胆敢dangan +档案dangan +当场dangchang +当初dangchu +当代dangdai +当地dangdi +单个dange +耽搁dange +党风dangfeng +党纲danggang +党纪dangji +党籍dangji +当即dangji +当家dangjia +当今dangjin +当局dangju +当量dangliang +当面dangmian +党内dangnei +当年dangnian +党派dangpai +当铺dangpu +当前dangqian +当然dangran +当日dangri +当时dangshi +当天dangtian +当头dangtou +党团dangtuan +当晚dangwan +党委dangwei +当先dangxian +党校dangxiao +当心dangxin +党性dangxing +荡漾dangyang +党员dangyuan +当月dangyue +党章dangzhang +当真dangzhen +党政dangzheng +当政dangzheng +当中dangzhong +当众dangzhong +当做dangzuo +单价danjia +担架danjia +胆量danliang +胆略danlue +淡漠danmo +胆怯danqie +丹青danqing +担任danren +单身danshen +诞生dansheng +但是danshi +胆识danshi +单体danti +丹田dantian +单位danwei +耽误danwu +单项danxiang +胆小danxiao +担心danxin +淡雅danya +弹药danyao +单一danyi +单元danyuan +但愿danyuan +单质danzhi +担子danzi +掸子danzi +单字danzi +到dao +道dao +导dao +刀dao +倒dao +稻dao +岛dao +捣dao +盗dao +蹈dao +祷dao +悼dao +叨dao +帱*dao +忉dao +氘dao +焘*dao +纛dao +倒闭daobi +到处daochu +悼词daoci +到达daoda +导弹daodan +道德daode +到底daodi +倒戈daoge +捣鬼daogui +捣毁daohui +到来daolai +到了daole +道理daoli +倒立daoli +道路daolu +捣乱daoluan +倒霉daomei +叨念daonian +道歉daoqian +刀枪daoqiang +盗窃daoqie +到时daoshi +导师daoshi +倒数daoshu +导体daoti +倒退daotui +导演daoyan +道义daoyi +盗用daoyong +岛屿daoyu +导致daozhi +大批dapi +大破dapo +打破dapo +大气daqi +大庆daqing +打扰darao +打扫dasao +大厦dasha +搭讪dashan +大赦dashe +大使dashi +大事dashi +大师dashi +大势dashi +大肆dasi +打算dasuan +大体dati +大厅dating +打听dating +大同datong +大小daxiao +大写daxie +答谢daxie +大选daxuan +大学daxue +大业daye +达因dayin +打印dayin +答应daying +大于dayu +大院dayuan +大约dayue +打仗dazhang +大致dazhi +大众dazhong +打字dazi +代办处dbc +得不偿失dbcs +大部分dbf +电报挂号dbgh +大不了dbl +大步流星dblx +对不起dbq +代表团dbt +电冰箱dbx +东城区dcq +到此为止dcwz +独创性dcx +调查研究dcyj +打成一片dcyp +打电话ddh +电动机ddj +对得起ddq +大多数dds +的de +得de +地*de +德de +底*de +锝de +得逞decheng +的当dedang +得当dedang +得到dedao +得分defen +德国deguo +得奖dejiang +得救dejiu +得了dele +得力deli +等deng +灯deng +登deng +邓deng +澄*deng +蹬deng +瞪deng +凳deng +噔deng +嶝deng +戥deng +磴deng +镫deng +簦deng +登场dengchang +等待dengdai +等到dengdao +灯光dengguang +等候denghou +等级dengji +登记dengji +等价dengjia +灯具dengju +登门dengmen +灯谜dengmi +登攀dengpan +登山dengshan +灯塔dengta +登台dengtai +等同dengtong +等闲dengxian +等于dengyu +登载dengzai +得胜desheng +得失deshi +得体deti +德行dexing +得以deyi +得意deyi +德育deyu +得志dezhi +得知dezhi +得罪dezui +大幅度dfd +多方面dfm +单方面dfm +电风扇dfs +大规模dgm +多功能dgn +大公无私dgws +帝国主义dgzy +电话号码dhhm +电化教育dhjy +大会堂dht +的*di +地di +第di +低di +敌di +底di +提*di +帝di +抵di +滴di +弟di +递di +堤di +迪di +笛di +狄di +涤di +翟di +嫡di +蒂di +缔di +氐di +籴di +诋di +谛di +邸di +坻*di +荻di +嘀di +娣di +绨di +柢di +棣di +觌di +砥di +碲di +睇di +镝di +羝di +骶di +嗲dia +电dian +点dian +垫dian +典dian +店dian +颠dian +淀dian +掂dian +滇dian +碘dian +靛dian +佃dian +甸dian +惦dian +奠dian +殿dian +阽dian +坫dian +巅dian +玷dian +钿dian +癜dian +癫dian +簟dian +踮dian +电报dianbao +点播dianbo +电场dianchang +电车dianche +电池dianchi +电传dianchuan +颠倒diandao +电灯diandeng +点滴diandi +奠定dianding +电动diandong +典范dianfan +淀粉dianfen +垫付dianfu +颠覆dianfu +电感diangan +典故diangu +电荷dianhe +电弧dianhu +电话dianhua +电汇dianhui +电机dianji +电极dianji +奠基dianji +惦记dianji +典籍dianji +点将dianjiang +电解dianjie +殿军dianjun +癫狂diankuang +电缆dianlan +电力dianli +电离dianli +典礼dianli +电流dianliu +电路dianlu +电脑diannao +电能dianneng +店铺dianpu +电气dianqi +电器dianqi +点燃dianran +电容dianrong +电扇dianshan +电视dianshi +电台diantai +电梯dianti +点头diantou +电网dianwang +电位dianwei +玷污dianwu +殿下dianxia +电线dianxian +癫痫dianxian +电信dianxin +典型dianxing +电讯dianxun +电压dianya +电影dianying +店员dianyuan +点阵dianzhen +点缀dianzhui +电子dianzi +点子dianzi +电阻dianzu +调diao +掉diao +吊diao +鸟*diao +碉diao +叼diao +雕diao +凋diao +刁diao +钓diao +铞diao +铫diao +貂diao +鲷diao +碉堡diaobao +凋敝diaobi +调查diaocha +吊车diaoche +调动diaodong +调度diaodu +钓饵diaoer +调换diaohuan +掉换diaohuan +雕刻diaoke +调令diaoling +刁难diaonan +调遣diaoqian +调任diaoren +雕塑diaosu +吊唁diaoyan +调用diaoyong +钓鱼diaoyu +调子diaozi +第八diba +地板diban +地步dibu +低沉dichen +抵触dichu +抵达dida +地带didai +低档didang +抵挡didang +地道didao +弟弟didi +地点didian +地段diduan +敌对didui +迭die +跌die +爹die +碟die +蝶die +谍die +叠die +垤die +堞die +揲die +喋die +牒die +瓞die +耋die +踮*die +蹀die +鲽die +迭起dieqi +第二dier +地方difang +低估digu +敌国diguo +帝国diguo +敌后dihou +诋毁dihui +低级diji +递加dijia +递减dijian +地窖dijiao +递交dijiao +缔交dijiao +缔结dijie +第九dijiu +敌军dijun +抵抗dikang +地牢dilao +地理dili +低劣dilie +第六diliu +低落diluo +地貌dimao +地面dimian +抵命diming +定ding +顶ding +钉ding +丁ding +订ding +盯ding +叮ding +鼎ding +锭ding +仃ding +啶ding +玎ding +腚ding +碇ding +町ding +铤*ding +疔ding +耵ding +酊ding +定案dingan +定产dingchan +丁当dingdang +顶点dingdian +定夺dingduo +定额dinge +顶峰dingfeng +顶锋dingfeng +定购dinggou +订购dinggou +订户dinghu +定货dinghuo +订货dinghuo +定价dingjia +定局dingju +定居dingju +定理dingli +订立dingli +鼎立dingli +定量dingliang +定律dinglu +定期dingqi +定然dingran +盯梢dingshao +定时dingshi +顶替dingti +定性dingxing +定型dingxing +定义dingyi +定语dingyu +定员dingyuan +订阅dingyue +订正dingzheng +叮嘱dingzhu +顶撞dingzhuang +钉子dingzi +嫡派dipai +地盘dipan +第七diqi +嫡亲diqin +敌情diqing +地球diqiu +地区diqu +的确dique +敌人diren +第三disan +地势dishi +第十dishi +滴水dishui +第四disi +地铁ditie +地图ditu +丢diu +铥diu +丢掉diudiao +丢脸diulian +丢失diushi +地位diwei +敌伪diwei +第五diwu +嫡系dixi +底细dixi +地下dixia +低下dixia +底下dixia +地形dixing +弟兄dixiong +第一diyi +敌意diyi +地域diyu +抵御diyu +缔造dizao +递增dizeng +地震dizhen +敌阵dizhen +地质dizhi +地址dizhi +抵制dizhi +底子dizi +弟子dizi +党纪国法djgf +当机立断djld +多劳多得dldd +大力发展dlfz +大力加强dljq +大力开展dlkz +独立自主dlzz +多面手dms +对内搞活dngh +多年来dnl +东南亚dny +动dong +东dong +冬dong +懂dong +洞dong +冻dong +董dong +栋dong +侗dong +恫dong +垌dong +咚dong +岽dong +峒dong +氡dong +胨dong +胴dong +硐dong +鸫dong +东北dongbei +东边dongbian +东部dongbu +洞察dongcha +动词dongci +动荡dongdang +懂得dongde +东方dongfang +东风dongfeng +动工donggong +东海donghai +恫吓donghe +动机dongji +冬季dongji +东家dongjia +冻结dongjie +动静dongjing +东京dongjing +动力dongli +动量dongliang +栋梁dongliang +动乱dongluan +动脉dongmai +东南dongnan +东欧dongou +动人dongren +动身dongshen +董事dongshi +动手dongshou +动态dongtai +冬天dongtian +动听dongting +动物dongwu +东西dongxi +洞悉dongxi +动向dongxiang +动心dongxin +东亚dongya +东洋dongyang +动摇dongyao +动用dongyong +动员dongyuan +动辄dongzhe +动作dongzuo +斗dou +都*dou +豆dou +读*dou +兜dou +抖dou +陡dou +逗dou +痘dou +蔸dou +窦dou +蚪dou +篼dou +兜风doufeng +逗号douhao +逗留douliu +斗室doushi +兜售doushou +斗争douzheng +斗志douzhi +斗智douzhi +抖嘴douzui +打破常规dpcg +地平线dpx +电器化dqh +待人接物drjw +第三产业dscy +第十二届dsej +大使馆dsg +到时候dsh +电视机dsj +多少年dsn +大失所望dssw +电视台dst +低三下四dsxs +第十一届dsyj +大踏步dtb +到头来dtl +大体上dts +大同小异dtxy +度du +都du +毒du +独du +读du +渡du +杜du +堵du +镀du +顿du +督du +犊du +睹du +赌du +肚du +妒du +芏du +嘟du +渎du +椟du +牍du +蠹du +笃du +髑du +黩du +断duan +端duan +段duan +短duan +锻duan +缎duan +椴duan +煅duan +簖duan +短波duanbo +短处duanchu +短促duancu +断定duanding +短短duanduan +断交duanjiao +断绝duanjue +锻练duanlian +锻炼duanlian +短路duanlu +段落duanluo +短评duanping +短期duanqi +短缺duanque +断然duanran +煅烧duanshao +断送duansong +短途duantu +端午duanwu +端详duanxiang +短小duanxiao +断言duanyan +端阳duanyang +短语duanyu +短暂duanzan +端正duanzheng +端庄duanzhuang +读报dubao +读本duben +赌博dubo +独裁ducai +毒草ducao +独唱duchang +独创duchuang +督促ducu +毒打duda +独到dudao +度过duguo +毒害duhai +毒化duhua +都会duhui +对dui +队dui +堆dui +敦*dui +兑dui +怼dui +憝dui +碓dui +对比duibi +队部duibu +对策duice +对称duichen +对此duici +对待duidai +对等duideng +对调duidiao +对方duifang +对付duifu +对话duihua +兑换duihuan +对讲duijiang +对抗duikang +对口duikou +对垒duilei +对立duili +对联duilian +队列duilie +对流duiliu +对面duimian +对内duinei +对偶duiou +对手duishou +对数duishu +对外duiwai +队伍duiwu +兑现duixian +对象duixiang +对应duiying +对于duiyu +队员duiyuan +堆栈duizhan +队长duizhang +对照duizhao +对证duizheng +对质duizhi +对峙duizhi +对准duizhun +镀金dujin +杜绝dujue +渡口dukou +都来dulai +独立duli +度量duliang +盾dun +吨dun +顿dun +蹲dun +敦dun +墩dun +囤dun +钝dun +遁dun +沌dun +炖dun +砘dun +礅dun +盹dun +镦dun +趸dun +蹲点dundian +顿号dunhao +囤积dunji +遁迹dunji +钝角dunjiao +顿时dunshi +敦实dunshi +多duo +度*duo +夺duo +朵duo +掇duo +哆duo +垛duo +躲duo +跺duo +舵duo +剁duo +惰duo +堕duo +驮*duo +咄duo +哚duo +沲duo +缍duo +柁duo +铎duo +裰duo +踱duo +多半duoban +躲避duobi +多变duobian +多边duobian +躲藏duocang +多次duoci +夺得duode +多端duoduan +多方duofang +躲开duokai +多亏duokui +夺魁duokui +堕落duoluo +多么duome +夺目duomu +多年duonian +多情duoqing +夺取duoqu +多少duoshao +多事duoshi +掇拾duoshi +舵手duoshou +多数duoshu +多谢duoxie +多心duoxin +惰性duoxing +多样duoyang +多余duoyu +多种duozhong +肚皮dupi +毒品dupin +毒气duqi +读取duqu +度日duri +读入duru +堵塞duse +毒蛇dushe +都是dushi +毒手dushou +读数dushu +读书dushu +毒素dusu +独特dute +读物duwu +毒药duyao +独占duzhan +读者duzhe +毒汁duzhi +渎职duzhi +赌注duzhu +杜撰duzhuan +独自duzi +党委会dwh +对外开放dwkf +敌我矛盾dwmd +对外贸易dwmy +大无畏dww +动物园dwy +当务之急dwzj +邓小平dxp +大学生dxs +大显身手dxss +大西洋dxy +大跃进dyj +打印机dyj +大有可为dykw +待业青年dyqn +掉以轻心dyqx +电影院dyy +大洋洲dyz +大有作为dyzw +党支部dzb +多种多样dzdy +党政机关dzjg +多种经营dzjy +断章取义dzqy +大自然dzr +德智体dzt +电子学dzx +党中央dzy +而e +二e +尔e +儿e +恶e +额e +恩e +俄e +耳e +饵e +蛾e +饿e +峨e +鹅e +讹e +娥e +厄e +扼e +遏e +鄂e +噩e +谔e +垩e +苊e +莪e +萼e +呃e +愕e +屙e +婀e +轭e +腭e +锇e +锷e +鹗e +颚e +鳄e +恶霸eba +恶毒edu +恶感egan +恶棍egun +噩耗ehao +恶化ehua +诶ei +二极管ejg +二进制ejz +恶劣elie +鹅毛emao +噩梦emeng +恶魔emo +耳目一新emyx +恩en +蒽en +摁en +恩爱enai +恩赐enci +恩典endian +恩惠enhui +恩情enqing +而er +二er +尔er +儿er +耳er +饵er +洱er +贰er +佴er +迩er +珥er +铒er +鸸er +鲕er +耳朵erduo +儿歌erge +耳光erguang +而后erhou +尔后erhou +二届erjie +而今erjin +而况erkuang +而且erqie +而是ershi +儿童ertong +儿戏erxi +而已eryi +耳语eryu +二月eryue +儿子erzi +扼杀esha +额外ewai +扼腕ewan +额外负担ewfd +恶习exi +恶心exin +恶性exing +恶性循环exxh +扼要eyao +厄运eyun +讹诈ezha +遏止ezhi +分f +发f +方f +法f +反f +放f +复f +风f +防f +非f +服f +肥f +副f +粉f +府f +夫f +负f +封f +富f +翻f +发fa +法fa +阀fa +乏fa +伐fa +罚fa +筏fa +珐fa +垡fa +砝fa +发报fabao +法宝fabao +发表fabiao +发布fabu +发财facai +发愁fachou +发出fachu +发达fada +发电fadian +法典fadian +法定fading +发动fadong +发放fafang +发奋fafen +发愤fafen +法官faguan +法规fagui +法国faguo +发慌fahuang +发挥fahui +发火fahuo +发给faji +发迹faji +法纪faji +发家fajia +发奖fajiang +发酵fajiao +罚金fajin +发觉fajue +发掘fajue +罚款fakuan +发狂fakuang +法郎falang +法令faling +法律falu +发落faluo +发明faming +反fan +翻fan +范fan +犯fan +饭fan +繁fan +泛fan +番fan +凡fan +烦fan +返fan +藩fan +帆fan +樊fan +矾fan +钒fan +贩fan +蕃fan +蘩fan +幡fan +梵fan +燔fan +畈fan +蹯fan +翻版fanban +反比fanbi +反驳fanbo +帆布fanbu +反常fanchang +范畴fanchou +犯愁fanchou +帆船fanchuan +饭店fandian +反动fandong +翻动fandong +反对fandui +繁多fanduo +反而faner +反复fanfu +方fang +放fang +防fang +访fang +房fang +纺fang +仿fang +妨fang +芳fang +肪fang +坊fang +邡fang +彷*fang +枋fang +钫fang +舫fang +鲂fang +妨碍fangai +方案fangan +反感fangan +防备fangbei +方便fangbian +防潮fangchao +方程fangcheng +放大fangda +放荡fangdang +防盗fangdao +方法fangfa +防范fangfan +防风fangfeng +防腐fangfu +仿佛fangfu +妨害fanghai +防护fanghu +防火fanghuo +放假fangjia +房间fangjian +方面fangmian +放牧fangmu +返工fangong +反攻fangong +放屁fangpi +放弃fangqi +防区fangqu +放任fangren +放哨fangshao +放射fangshe +方式fangshi +防守fangshou +放肆fangsi +放松fangsong +仿宋fangsong +翻滚fangun +方位fangwei +防卫fangwei +访问fangwen +房屋fangwu +放下fangxia +防线fangxian +方向fangxiang +芳香fangxiang +仿效fangxiao +放心fangxin +放行fangxing +方言fangyan +防疫fangyi +防御fangyu +仿造fangzao +仿照fangzhao +方针fangzhen +仿真fangzhen +防治fangzhi +仿制fangzhi +放置fangzhi +防止fangzhi +纺织fangzhi +房子fangzi +放纵fangzong +房租fangzu +番号fanhao +繁华fanhua +反悔fanhui +返回fanhui +反击fanji +反抗fankang +反馈fankui +泛滥fanlan +范例fanli +凡例fanli +翻脸fanlian +贩卖fanmai +繁忙fanmang +烦闷fanmen +反面fanmian +反目fanmu +烦恼fannao +反叛fanpan +犯人fanren +繁荣fanrong +反射fanshe +翻身fanshen +繁盛fansheng +凡是fanshi +凡事fanshi +繁琐fansuo +烦琐fansuo +翻腾fanteng +繁体fanti +饭桶fantong +发怒fanu +饭碗fanwan +范围fanwei +反问fanwen +反响fanxiang +返销fanxiao +反省fanxing +翻修fanxiu +繁衍fanyan +翻译fanyi +翻印fanyin +反应fanying +反映fanying +繁育fanyu +翻越fanyue +翻阅fanyue +贩运fanyun +繁杂fanza +烦燥fanzao +反正fanzheng +反之fanzhi +繁殖fanzhi +繁重fanzhong +贩子fanzi +犯罪fanzui +发起faqi +法权faquan +发射fashe +发生fasheng +发誓fashi +发售fashou +法庭fating +发现faxian +发泄faxie +发行faxing +发言fayan +发扬fayang +法医fayi +发育fayu +发源fayuan +法院fayuan +法则faze +发展fazhan +法制fazhi +法治fazhi +发作fazuo +奋不顾身fbgs +分崩离析fblx +副产品fcp +发电机fdj +发动机fdj +反动派fdp +分道扬镳fdyb +非fei +肥fei +飞fei +费fei +废fei +肺fei +沸fei +菲fei +匪fei +啡fei +诽fei +吠fei +芾fei +狒fei +悱fei +淝fei +妃fei +绯fei +榧fei +腓fei +斐fei +扉fei +镄fei +痱fei +蜚fei +篚fei +翡fei +霏fei +鲱fei +匪帮feibang +诽谤feibang +飞奔feiben +非常feichang +飞驰feichi +废除feichu +非但feidan +非得feide +沸点feidian +非法feifa +非凡feifan +肺腑feifu +绯红feihong +废话feihua +飞机feiji +飞溅feijian +费解feijie +费劲feijin +飞快feikuai +费力feili +肥料feiliao +废料feiliao +肥胖feipang +废品feipin +废弃feiqi +费神feishen +废水feishui +飞速feisu +沸腾feiteng +匪徒feitu +肥沃feiwo +废物feiwu +飞舞feiwu +飞翔feixiang +费心feixin +飞行feixing +废墟feixu +飞扬feiyang +扉页feiye +非议feiyi +费用feiyong +飞跃feiyue +肥皂feizao +飞涨feizhang +废止feizhi +非洲feizhou +妃子feizi +分fen +粉fen +奋fen +份fen +粪fen +纷fen +芬fen +愤fen +酚fen +吩fen +氛fen +坟fen +焚fen +汾fen +忿fen +偾fen +瀵fen +玢*fen +棼fen +鲼fen +鼢fen +分贝fenbei +分辩fenbian +分辨fenbian +粪便fenbian +分别fenbie +分部fenbu +分布fenbu +分册fence +分寸fencun +分担fendan +分得fende +分店fendian +奋斗fendou +分队fendui +分发fenfa +奋发fenfa +纷纷fenfen +吩咐fenfu +风feng +封feng +蜂feng +丰feng +缝feng +峰feng +锋feng +疯feng +奉feng +枫feng +烽feng +逢feng +冯feng +讽feng +凤feng +俸feng +酆feng +葑feng +唪feng +沣feng +砜feng +风暴fengbao +丰碑fengbei +封闭fengbi +风波fengbo +丰产fengchan +奉承fengcheng +讽刺fengci +封存fengcun +风度fengdu +分割fenge +分隔fenge +风发fengfa +风帆fengfan +丰富fengfu +奉告fenggao +风格fengge +奉公fenggong +风光fengguang +风寒fenghan +奉还fenghuan +凤凰fenghuang +烽火fenghuo +封建fengjian +风景fengjing +疯狂fengkuang +风浪fenglang +风力fengli +风流fengliu +丰满fengman +锋芒fengmang +风貌fengmao +奉命fengming +丰年fengnian +分工fengong +奉陪fengpei +风气fengqi +风情fengqing +风趣fengqu +奉劝fengquan +缝纫fengren +风骚fengsao +风沙fengsha +风尚fengshang +风声fengsheng +丰盛fengsheng +丰收fengshou +风霜fengshuang +风水fengshui +丰硕fengshuo +奉祀fengsi +风俗fengsu +封锁fengsuo +疯瘫fengtan +封条fengtiao +风头fengtou +分管fenguan +风味fengwei +缝隙fengxi +风险fengxian +奉献fengxian +风向fengxiang +风行fengxing +奉行fengxing +蜂拥fengyong +风云fengyun +风韵fengyun +风灾fengzai +疯子fengzi +风姿fengzi +分号fenhao +分毫fenhao +分红fenhong +粉红fenhong +分化fenhua +分会fenhui +焚毁fenhui +分级fenji +分解fenjie +分界fenjie +奋进fenjin +分居fenju +分开fenkai +愤慨fenkai +分类fenlei +分离fenli +奋力fenli +分量fenliang +分裂fenlie +纷乱fenluan +分娩fenmian +分秒fenmiao +分明fenming +粉末fenmo +坟墓fenmu +愤怒fennu +分派fenpai +分配fenpei +分批fenpi +分期fenqi +分歧fenqi +奋起fenqi +分清fenqing +分区fenqu +分散fensan +焚烧fenshao +分数fenshu +分说fenshuo +粉碎fensui +分摊fentan +粪土fentu +分外fenwai +氛围fenwei +分析fenxi +奋勇fenyong +分赃fenzang +奋战fenzhan +分支fenzhi +分子fenzi +分组fenzu +丰富多采ffdc +奋发图强fftq +反过来说fgls +反革命fgm +福建省fjs +封建主义fjzy +翻来覆去flfq +法律顾问flgw +分秒必争fmbz +发明创造fmcz +否fou +缶fou +否定fouding +否决foujue +否认fouren +否则fouze +费品率fpl +废寝忘食fqws +缝纫机frj +分水岭fsl +翻天复地ftfd +丰台区ftq +非同小可ftxk +繁体字ftz +复fu +服fu +副fu +府fu +夫fu +负fu +富fu +附fu +福fu +伏fu +符fu +幅fu +腐fu +浮fu +辅fu +付fu +腹fu +妇fu +孵fu +覆fu +扶fu +辐fu +傅fu +佛fu +缚fu +父fu +弗fu +甫fu +肤fu +氟fu +敷fu +拂fu +俘fu +涪fu +袱fu +抚fu +俯fu +釜fu +斧fu +脯fu +腑fu +赴fu +赋fu +阜fu +讣fu +咐fu +匐fu +凫fu +郛fu +芙fu +芾*fu +苻fu +茯fu +莩fu +菔fu +拊fu +呋fu +幞fu +怫fu +滏fu +艴fu +孚fu +驸fu +绂fu +绋fu +桴fu +赙fu +祓fu +砩fu +黻fu +黼fu +罘fu +稃fu +馥fu +蚨fu +蜉fu +蝠fu +蝮fu +麸fu +趺fu +跗fu +鲋fu +鳆fu +腐败fubai +复辟fubi +复查fucha +浮沉fuchen +扶持fuchi +付出fuchu +副词fuci +服从fucong +附带fudai +负担fudan +辅导fudao +浮雕fudiao +浮动fudong +幅度fudu +复发fufa +伏法fufa +夫妇fufu +覆盖fugai +讣告fugao +富贵fugui +符号fuhao +附和fuhe +符合fuhe +负荷fuhe +腐化fuhua +浮华fuhua +复活fuhuo +俘获fuhuo +伏击fuji +附加fujia +附件fujian +福建fujian +佛教fujiao +附近fujin +副刊fukan +俯瞰fukan +浮夸fukua +付款fukuan +腐烂fulan +福利fuli +浮力fuli +富丽fuli +妇联fulian +附录fulu +俘虏fulu +覆灭fumie +覆没fumo +父母fumu +富农funong +妇女funu +扶贫fupin +服气fuqi +福气fuqi +夫妻fuqi +付讫fuqi +肤浅fuqian +富强fuqiang +父亲fuqin +富饶furao +夫人furen +芙蓉furong +妇孺furu +负伤fushang +辐射fushe +复试fushi +腐蚀fushi +俯视fushi +副手fushou +复数fushu +负数fushu +附属fushu +富庶fushu +赋税fushui +伏特fute +覆亡fuwang +富翁fuweng +服务fuwu +复习fuxi +浮现fuxian +赋闲fuxian +浮想fuxiang +腐朽fuxiu +抚恤fuxu +敷衍fuyan +扶养fuyang +抚养fuyang +俯仰fuyang +副业fuye +服役fuyi +复印fuyin +富有fuyou +赋有fuyou +赋于fuyu +抚育fuyu +富裕fuyu +赋予fuyu +复员fuyuan +复原fuyuan +负约fuyue +复杂fuza +负载fuzai +附则fuze +负责fuze +负债fuzhai +付帐fuzhang +复制fuzhi +扶植fuzhi +附中fuzhong +福州fuzhou +抚州fuzhou +附注fuzhu +辅助fuzhu +扶助fuzhu +服装fuzhuang +附着fuzhuo +富足fuzu +辅佐fuzuo +服务部fwb +服务态度fwtd +服务员fwy +方兴未艾fxwa +奋勇当先fydx +翻一番fyf +风言风语fyfy +发扬光大fygd +复印机fyj +发言人fyr +风雨同舟fytz +房租费fzf +副总理fzl +纺织品fzp +福州市fzs +反作用fzy +副作用fzy +负责制fzz +发展中国家fzzj +个g +国g +工g +过g +高g +干g +关g +各g +革g +公g +根g +更g +改g +管g +光g +广g +果g +格g +共g +搞g +夹*ga +噶ga +嘎ga +胳*ga +尬ga +尕ga +尜ga +旮ga +钆ga +公安部gab +改gai +该gai +盖gai +概gai +钙gai +溉gai +芥*gai +丐gai +陔gai +垓gai +戤gai +赅gai +改变gaibian +改编gaibian +该当gaidang +改道gaidao +改动gaidong +改革gaige +改观gaiguan +改过gaiguo +改悔gaihui +改建gaijian +改进gaijin +概况gaikuang +概括gaikuo +改良gailiang +概率gailu +概论gailun +概貌gaimao +概念gainian +改期gaiqi +改善gaishan +概述gaishu +概叹gaitan +改天gaitian +改选gaixuan +概要gaiyao +改造gaizao +改正gaizheng +改装gaizhuang +改组gaizu +公安局gaj +干gan +杆gan +感gan +敢gan +赶gan +甘gan +肝gan +秆gan +柑gan +竿gan +赣gan +乾*gan +坩gan +苷gan +尴gan +擀gan +泔gan +淦gan +澉gan +绀gan +橄gan +旰gan +矸gan +疳gan +酐gan +干部ganbu +感触ganchu +干脆gancui +敢当gandang +甘当gandang +感到gandao +感动gandong +感恩ganen +刚gang +钢gang +缸gang +纲gang +岗gang +港gang +杠gang +冈gang +肛gang +扛*gang +戆gang +罡gang +筻gang +尴尬ganga +港澳gangao +刚才gangcai +钢材gangcai +刚刚ganggang +刚好ganghao +港口gangkou +纲领gangling +岗哨gangshao +钢铁gangtie +港湾gangwan +岗位gangwei +港务gangwu +刚要gangyao +纲要gangyao +刚毅gangyi +干旱ganhan +感化ganhua +干活ganhuo +肝火ganhuo +感激ganji +干劲ganjin +赶紧ganjin +干净ganjing +感觉ganjue +感慨gankai +甘苦ganku +赶快gankuai +赶忙ganmang +感冒ganmao +感情ganqing +感染ganran +干扰ganrao +干涉ganshe +干事ganshi +感受ganshou +甘肃gansu +感叹gantan +干线ganxian +感想ganxiang +敢想ganxiang +感谢ganxie +甘心ganxin +感性ganxing +感应ganying +敢于ganyu +干预ganyu +甘愿ganyuan +干燥ganzao +感召ganzhao +赣州ganzhou +敢做ganzuo +高gao +搞gao +告gao +稿gao +膏gao +篙gao +皋gao +羔gao +糕gao +镐gao +睾gao +诰gao +郜gao +藁gao +缟gao +槔gao +槁gao +杲gao +锆gao +高矮gaoai +高昂gaoang +告别gaobie +高产gaochan +高超gaochao +高潮gaochao +告成gaocheng +告辞gaoci +高大gaoda +高档gaodang +高等gaodeng +高地gaodi +高低gaodi +糕点gaodian +高度gaodu +告发gaofa +高峰gaofeng +高高gaogao +高歌gaoge +高贵gaogui +高喊gaohan +搞好gaohao +高呼gaohu +搞坏gaohuai +高级gaoji +告急gaoji +高价gaojia +高见gaojian +稿件gaojian +告捷gaojie +告诫gaojie +高龄gaoling +高楼gaolou +告密gaomi +高明gaoming +高能gaoneng +高攀gaopan +高频gaopin +高强gaoqiang +高山gaoshan +高尚gaoshang +高深gaoshen +告示gaoshi +高耸gaosong +高速gaosu +告诉gaosu +高温gaowen +高小gaoxiao +高校gaoxiao +高兴gaoxing +膏药gaoyao +高原gaoyuan +高涨gaozhang +高招gaozhao +高中gaozhong +告终gaozhong +告状gaozhuang +稿子gaozi +港澳同胞gatb +怪不得gbd +各部门gbm +各部委gbw +供不应求gbyq +故步自封gbzf +共产党gcd +共产党员gcdy +工程师gcs +顾此失彼gcsb +贯彻执行gczx +共产主义gczy +各地方gdf +各大军区gdjq +广东省gds +高档商品gdsp +各单位gdw +高等院校gdyx +固定资产gdzc +个ge +各ge +革ge +合*ge +格ge +割ge +歌ge +隔ge +盖*ge +哥ge +铬ge +阁ge +戈ge +葛ge +搁ge +鸽ge +胳ge +疙ge +蛤ge +咯*ge +屹*ge +鬲ge +仡ge +哿ge +圪ge +塥ge +嗝ge +纥*ge +搿ge +膈ge +硌ge +镉ge +袼ge +颌*ge +虼ge +舸ge +骼ge +隔壁gebi +戈壁gebi +个别gebie +歌唱gechang +各处gechu +革除gechu +疙瘩geda +各地gedi +格调gediao +隔断geduan +个个gege +各个gege +各国geguo +隔阂gehe +歌喉gehou +各级geji +各界gejie +格局geju +割据geju +隔绝gejue +各类gelei +隔离geli +割裂gelie +格律gelu +革命geming +隔膜gemo +给gei +根gen +跟gen +亘gen +茛gen +哏gen +艮gen +根本genben +根除genchu +根底gendi +更geng +耕geng +颈geng +庚geng +羹geng +埂geng +耿geng +梗geng +哽geng +赓geng +绠geng +鲠geng +耕地gengdi +更迭gengdie +更动gengdong +更多gengduo +更改genggai +梗概genggai +更高genggao +更换genghuan +更加gengjia +更为gengwei +颈项gengxiang +更新gengxin +哽咽gengyan +耕耘gengyun +更正gengzheng +耿直gengzhi +梗直gengzhi +耕种gengzhong +梗阻gengzu +耕作gengzuo +根基genji +根据genju +跟前genqian +跟随gensui +根源genyuan +根治genzhi +跟着genzhuo +根子genzi +跟踪genzong +搁浅geqian +歌曲gequ +个人geren +格式geshi +歌颂gesong +个体geti +格外gewai +各位gewei +歌舞gewu +阁下gexia +各项gexiang +革新gexin +个性gexing +格言geyan +各样geyang +歌咏geyong +搁置gezhi +各种gezhong +各族gezu +国防部gfb +各方面gfm +格格不入ggbr +归根到底ggdd +恭恭敬敬ggjj +滚瓜烂熟ggls +歌功颂德ggsd +共和国ghg +各行各业ghgy +干劲冲天gjct +各级党委gjdw +各级领导gjld +国家利益gjly +国计民生gjms +工具书gjs +各尽所能gjsn +国库券gkq +工矿企业gkqy +孤陋寡闻glgw +规律性glx +国民党gmd +革命化gmh +革命家gmj +国民经济gmjj +购买力gml +光明磊落gmll +光明日报gmrb +顾名思义gmsy +冠冕堂皇gmth +刮目相看gmxk +光明正大gmzd +工农兵gnb +国内外gnw +工农业gny +工gong +公gong +共gong +供gong +功gong +攻gong +红*gong +巩gong +贡gong +汞gong +宫gong +恭gong +龚gong +躬gong +弓gong +拱gong +珙gong +肱gong +蚣gong +觥gong +公安gongan +公报gongbao +工本gongben +公布gongbu +公差gongcha +公拆gongchai +工厂gongchang +功臣gongchen +工程gongcheng +共处gongchu +供词gongci +共存gongcun +公道gongdao +公德gongde +功德gongde +工地gongdi +公敌gongdi +宫殿gongdian +攻读gongdu +公费gongfei +公愤gongfen +工夫gongfu +功夫gongfu +公告gonggao +公共gonggong +巩固gonggu +公关gongguan +公害gonghai +公函gonghan +共和gonghe +工会gonghui +供给gongji +共计gongji +攻击gongji +功绩gongji +公家gongjia +公斤gongjin +恭敬gongjing +工具gongju +公开gongkai +功课gongke +公款gongkuan +功劳gonglao +公理gongli +公里gongli +公历gongli +公路gonglu +功率gonglu +公民gongmin +共鸣gongming +公墓gongmu +功能gongneng +工农gongnong +公判gongpan +公平gongping +公仆gongpu +供求gongqiu +工区gongqu +公然gongran +工人gongren +公认gongren +供认gongren +工伤gongshang +公社gongshe +公审gongshen +工时gongshi +公事gongshi +共事gongshi +公式gongshi +公署gongshu +公司gongsi +公私gongsi +公诉gongsu +宫廷gongting +共同gongtong +恭维gongwei +公文gongwen +公物gongwu +公务gongwu +恭喜gongxi +贡献gongxian +工效gongxiao +功效gongxiao +供销gongxiao +共性gongxing +工序gongxu +共需gongxu +功勋gongxun +供养gongyang +工业gongye +工艺gongyi +供应gongying +公用gongyong +共有gongyou +公元gongyuan +公园gongyuan +公约gongyue +公允gongyun +公债gongzhai +公章gongzhang +共振gongzhen +工整gongzheng +公正gongzheng +公证gongzheng +供职gongzhi +公众gongzhong +工资gongzi +工作gongzuo +够gou +构gou +沟gou +句*gou +狗gou +钩gou +勾gou +购gou +苟gou +垢gou +佝gou +诟gou +岣gou +遘gou +媾gou +缑gou +枸gou +觏gou +彀gou +笱gou +篝gou +鞲gou +构成goucheng +勾搭gouda +勾当goudang +媾和gouhe +沟壑gouhe +构件goujian +勾结goujie +购买goumai +苟且gouqie +构思gousi +沟通goutong +勾通goutong +构陷gouxian +勾销gouxiao +购销gouxiao +勾引gouyin +构造gouzao +购置gouzhi +钩子gouzi +国庆节gqj +共青团gqt +光荣榜grb +根深蒂固gsdg +瓜熟蒂落gsdl +公使馆gsg +各式各样gsgy +甘肃省gss +工商业gsy +个体户gth +改头换面gthm +高谈阔论gtkl +鼓gu +固gu +古gu +骨gu +故gu +顾gu +股gu +谷gu +估gu +雇gu +孤gu +姑gu +贾*gu +辜gu +菇gu +咕gu +箍gu +沽gu +蛊gu +嘏gu +诂gu +菰gu +呱gu +崮gu +汩gu +梏gu +轱gu +牯gu +牿gu +臌gu +毂gu +瞽gu +罟gu +钴gu +锢gu +鸪gu +鹄*gu +痼gu +蛄gu +酤gu +觚gu +鲴gu +鹘gu +挂gua +刮gua +瓜gua +括*gua +剐gua +寡gua +褂gua +卦gua +诖gua +呱gua +栝gua +胍gua +鸹gua +瓜分guafen +瓜葛guage +挂号guahao +怪guai +乖guai +拐guai +乖舛guaichuan +乖戾guaili +乖僻guaipi +乖巧guaiqiao +怪物guaiwu +怪异guaiyi +拐杖guaizhang +挂名guaming +关guan +管guan +观guan +官guan +灌guan +贯guan +惯guan +冠guan +馆guan +罐guan +棺guan +纶*guan +倌guan +莞guan +掼guan +涫guan +盥guan +鹳guan +矜guan +鳏guan +关闭guanbi +观测guance +观察guancha +贯彻guanche +贯穿guanchuan +管道guandao +官邸guandi +观点guandian +官方guanfang +光guang +广guang +逛guang +咣guang +犷guang +桄guang +胱guang +灌溉guangai +光标guangbiao +广播guangbo +广博guangbo +光彩guangcai +广场guangchang +光大guangda +广大guangda +广东guangdong +广度guangdu +广泛guangfan +广告guanggao +光顾guanggu +光滑guanghua +光辉guanghui +光景guangjing +广阔guangkuo +光芒guangmang +广袤guangmao +光明guangming +光盘guangpan +光谱guangpu +光荣guangrong +观光guanguang +广西guangxi +光线guangxian +广义guangyi +光阴guangyin +光涌guangyong +广州guangzhou +关怀guanhuai +挂念guanian +管家guanjia +关键guanjian +管教guanjiao +关节guanjie +冠军guanjun +关卡guanka +观看guankan +关口guankou +管理guanli +贯例guanli +惯例guanli +官吏guanli +关联guanlian +官僚guanliao +观摩guanmo +灌木guanmu +官能guanneng +观念guannian +关切guanqie +观赏guanshang +管事guanshi +管束guanshu +灌输guanshu +关税guanshui +官司guansi +贯通guantong +关头guantou +观望guanwang +关系guanxi +管辖guanxia +官衔guanxian +关心guanxin +惯性guanxing +关押guanya +惯用guanyong +关于guanyu +官员guanyuan +观战guanzhan +关照guanzhao +管制guanzhi +观止guanzhi +观众guanzhong +关注guanzhu +贯注guanzhu +馆子guanzi +挂失guashi +挂帅guashuai +鼓吹guchui +故此guci +古代gudai +孤单gudan +故地gudi +古典gudian +固定guding +鼓动gudong +股东gudong +古董gudong +孤独gudu +咕嘟gudu +孤儿guer +股份gufen +辜负gufu +骨干gugan +雇工gugong +故宫gugong +古怪guguai +蛊惑guhuo +规gui +贵gui +归gui +硅gui +鬼gui +轨gui +龟gui +桂gui +瑰gui +圭gui +闺gui +诡gui +癸gui +柜gui +跪gui +刽gui +傀*gui +炔*gui +匦gui +刿gui +庋gui +宄gui +妫gui +桧gui +炅gui +晷gui +皈gui +簋gui +鲑gui +鳜gui +诡辩guibian +贵宾guibin +归并guibing +规程guicheng +归档guidang +轨道guidao +规定guiding +归队guidui +规范guifan +规格guige +归公guigong +归功guigong +桂冠guiguan +归国guiguo +规划guihua +鬼话guihua +归还guihuan +诡计guiji +轨迹guiji +贵贱guijian +归咎guijiu +规矩guiju +瑰丽guili +鬼脸guilian +龟裂guilie +规律guilu +诡秘guimi +规模guimo +归纳guina +闺女guinu +规劝guiquan +贵人guiren +归属guishu +龟缩guisuo +柜台guitai +闺秀guixiu +归于guiyu +规则guize +规章guizhang +贵重guizhong +贵州guizhou +鬼子guizi +贵族guizu +归罪guizui +顾及guji +估计guji +古迹guji +顾忌guji +估价gujia +古今gujin +古旧gujiu +故旧gujiu +故居guju +顾客guke +孤苦guku +古老gulao +孤立guli +鼓励guli +估量guliang +顾虑gulu +估摸gumo +滚gun +辊gun +棍gun +衮gun +绲gun +磙gun +鲧gun +滚动gundong +姑娘guniang +雇农gunong +滚烫guntang +棍子gunzi +国guo +过guo +果guo +锅guo +郭guo +涡*guo +裹guo +馘guo +埚guo +掴guo +呙guo +帼guo +崞guo +猓guo +椁guo +虢guo +聒guo +蜾guo +蝈guo +过半guoban +国策guoce +国产guochan +过程guocheng +过错guocuo +过度guodu +过渡guodu +果断guoduan +国法guofa +国防guofang +过分guofen +果腹guofu +果敢guogan +国歌guoge +过关guoguan +过后guohou +国会guohui +国际guoji +国籍guoji +国家guojia +国界guojie +国境guojing +国库guoku +过来guolai +过量guoliang +过虑guolu +锅炉guolu +国民guomin +过目guomu +果木guomu +国难guonan +国内guonei +果皮guopi +果品guopin +国旗guoqi +过期guoqi +国情guoqing +国庆guoqing +过去guoqu +果然guoran +过少guoshao +过甚guoshen +过剩guosheng +过时guoshi +国事guoshi +过失guoshi +果实guoshi +过头guotou +国外guowai +国王guowang +过问guowen +国务guowu +过细guoxi +国药guoyao +国营guoying +过硬guoying +过于guoyu +果园guoyuan +果真guozhen +锅子guozi +顾盼gupan +孤僻gupi +股票gupiao +骨气guqi +姑且guqie +顾全guquan +固然guran +古人guren +骨肉gurou +故事gushi +股市gushi +固守gushou +估算gusuan +固体guti +骨头gutou +故土gutu +顾问guwen +古文guwen +谷物guwu +鼓舞guwu +姑息guxi +故乡guxiang +故意guyi +雇佣guyong +固有guyou +雇员guyuan +鼓掌guzhang +故障guzhang +固执guzhi +拐弯抹角gwmj +国务委员gwwy +国务院gwy +改邪归正gxgz +更新换代gxhd +各行其事gxqs +感性认识gxrs +广西壮族gxzz +工业化gyh +工艺流程gylc +工艺美术gyms +工业品gyp +工艺品gyp +贵阳市gys +公有制gyz +各种各样gzgy +工资级别gzjb +各族人民gzrm +工作上gzs +广州市gzs +贵州省gzs +各自为政gzwz +高瞻远瞩gzyz +高瞻远嘱gzyz +工作者gzz +和h +会h +后h +化h +好h +合h +还h +活h +很h +回h +号h +毫h +花h +或h +海h +话h +红h +火h +黄h +害h +哈ha +蛤*ha +虾*ha +铪ha +哈达hada +还hai +海hai +害hai +孩hai +骸hai +氦hai +亥hai +骇hai +嘿*hai +咳*hai +嗨hai +胲hai +醢hai +海岸haian +海拔haiba +海报haibao +害虫haichong +害处haichu +海岛haidao +海港haigang +海关haiguan +还好haihao +海疆haijiang +海军haijun +海浪hailang +海绵haimian +害怕haipa +海上haishang +还是haishi +海外haiwai +海湾haiwan +海峡haixia +海啸haixiao +害羞haixiu +海洋haiyang +还要haiyao +还有haiyou +海域haiyu +海员haiyuan +孩子haizi +含han +焊han +旱han +喊han +汉han +寒han +汗han +函han +韩han +酣han +憨han +邯han +涵han +罕han +翰han +撼han +捍han +憾han +悍han +邗han +菡han +撖han +阚han +瀚han +晗han +焓han +顸han +颔han +蚶han +鼾han +寒潮hanchao +寒带handai +行*hang +航hang +夯hang +杭hang +吭*hang +巷*hang +沆hang +绗hang +珩hang +颃hang +航标hangbiao +航程hangcheng +航船hangchuan +行当hangdang +航道hangdao +航海hanghai +行家hangjia +行距hangju +航空hangkong +行列hanglie +航路hanglu +航模hangmo +函购hangou +行情hangqing +航天hangtian +航线hangxian +航向hangxiang +航行hangxing +航运hangyun +杭州hangzhou +含糊hanhu +含混hanhun +旱季hanji +函件hanjian +罕见hanjian +汉奸hanjian +喊叫hanjiao +焊接hanjie +寒冷hanleng +翰林hanlin +寒流hanliu +函授hanshou +函数hanshu +酣睡hanshui +寒酸hansuan +捍卫hanwei +含蓄hanxu +寒暄hanxuan +涵养hanyang +含义hanyi +涵义hanyi +汉语hanyu +含冤hanyuan +旱灾hanzai +汉字hanzi +汉族hanzu +好hao +号hao +毫hao +耗hao +豪hao +郝hao +浩hao +镐*hao +壕hao +嚎hao +貉*hao +蒿hao +薅hao +嗥hao +嚆hao +濠hao +灏hao +昊hao +皓hao +颢hao +蚝hao +好比haobi +毫不haobu +号称haocheng +好处haochu +浩大haoda +好歹haodai +浩荡haodang +好的haode +浩繁haofan +耗费haofei +好感haogan +好汉haohan +豪华haohua +好坏haohuai +号角haojiao +耗竭haojie +豪杰haojie +浩劫haojie +好看haokan +毫厘haoli +号令haoling +号码haoma +豪迈haomai +毫毛haomao +毫米haomi +浩淼haomiao +好奇haoqi +豪强haoqiang +豪情haoqing +好人haoren +豪绅haoshen +毫升haosheng +好事haoshi +豪爽haoshuang +好似haosi +耗损haosun +号啕haotao +好听haoting +好玩haowan +毫无haowu +好象haoxiang +好些haoxie +好样haoyang +好意haoyi +号召haozhao +好转haozhuan +汇编程序hbcx +货币回笼hbhl +货币流通hblt +河北省hbs +湖北省hbs +汇编语言hbyy +或多或少hdhs +海淀区hdq +和he +合he +河he +何he +核he +赫he +荷he +褐he +喝he +贺he +呵he +禾he +吓*he +盒he +菏he +貉he +阂he +涸he +鹤he +诃he +劾he +壑he +嗬he +阖he +纥he +曷he +盍he +颌he +蚵he +翮he +和蔼heai +哈尔滨heb +合办heban +荷包hebao +河北hebei +何必hebi +合并hebing +哈尔滨市hebs +何不hebu +喝彩hecai +合唱hechang +何尝hechang +合成hecheng +呵斥hechi +何处hechu +河川hechuan +河床hechuang +贺词heci +何等hedeng +贺电hedian +核定heding +核对hedui +合法hefa +何妨hefang +合肥hefei +合格hege +和好hehao +赫赫hehe +合乎hehu +合伙hehuo +黑hei +嘿hei +黑暗heian +黑白heibai +黑帮heibang +嘿嘿heihei +黑人heiren +黑色heise +黑市heishi +黑夜heiye +合计heji +核计heji +和解hejie +合金hejin +何苦heku +何况hekuang +合理heli +合力heli +合流heliu +河流heliu +合谋hemou +和睦hemu +很hen +狠hen +痕hen +恨hen +河南henan +狠毒hendu +很多henduo +河内henei +行*heng +横heng +衡heng +恒heng +哼heng +亨heng +蘅heng +珩*heng +桁heng +横财hengcai +哼哧hengchi +横幅hengfu +横亘henggen +横贯hengguan +横祸henghuo +横加hengjia +衡量hengliang +横蛮hengman +横批hengpi +衡器hengqi +横扫hengsao +横竖hengshu +恒心hengxin +横行hengxing +恒星hengxing +很好henhao +贺年henian +痕迹henji +很快henkuai +狠心henxin +狠抓henzhua +和平heping +和气heqi +河渠hequ +赫然heran +河山heshan +和尚heshang +合适heshi +核实heshi +合算hesuan +核算hesuan +河滩hetan +合同hetong +贺喜hexi +和谐hexie +核心hexin +贺信hexin +和煦hexu +何以heyi +合影heying +合营heying +核准hezhun +合资hezi +赫兹hezi +合作hezuo +合法权益hfqy +合肥市hfs +宏观世界hgsj +化公为私hgws +好高务远hgwy +核工业部hgyb +海关总署hgzs +后顾之忧hgzy +呼和浩特hhht +轰轰烈烈hhll +换句话说hjhs +黄金时代hjsd +环境卫生hjws +后继有人hjyr +海枯石烂hksl +合理化hlh +糊里糊涂hlht +黑龙江hlj +汗流浃背hljb +汗马功劳hmgl +海南岛hnd +河南省hns +湖南省hns +红hong +洪hong +轰hong +烘hong +哄hong +虹hong +鸿hong +宏hong +弘hong +黉hong +訇hong +讧hong +荭hong +蕻hong +薨hong +闳hong +泓hong +红尘hongchen +轰动hongdong +洪都hongdu +洪峰hongfeng +鸿沟honggou +宏观hongguan +红光hongguang +红花honghua +红军hongjun +红利hongli +洪亮hongliang +轰隆honglong +弘论honglun +鸿毛hongmao +轰鸣hongming +哄骗hongpian +红旗hongqi +红人hongren +红色hongse +洪水hongshui +哄抬hongtai +宏图hongtu +宏伟hongwei +红星hongxing +弘扬hongyang +鸿运hongyun +红晕hongyun +轰炸hongzha +后hou +候hou +厚hou +侯hou +喉hou +猴hou +吼hou +堠hou +後hou +逅hou +瘊hou +篌hou +糇hou +鲎hou +骺hou +后备houbei +后辈houbei +后边houbian +厚薄houbo +候补houbu +后尘houchen +后代houdai +厚道houdao +厚度houdu +后盾houdun +后方houfang +后果houguo +后患houhuan +后悔houhui +后记houji +后进houjin +后劲houjin +后来houlai +喉咙houlong +后门houmen +后面houmian +后期houqi +后勤houqin +后人houren +喉舌houshe +厚实houshi +后嗣housi +后台houtai +后天houtian +后退houtui +后续houxu +候选houxuan +后裔houyi +后缀houzhui +和平共处hpgc +黄埔江hpj +后勤部hqb +何去何从hqhc +合情合理hqhl +好容易hry +好事多磨hsdm +胡思乱想hslx +航天工业部htgb +昏头昏脑hthn +欢天喜地htxd +和*hu +护hu +互hu +湖hu +呼hu +户hu +弧hu +乎hu +胡hu +糊hu +虎hu +忽hu +核*hu +瑚hu +戏*hu +壶hu +葫hu +蝴hu +狐hu +唬hu +沪hu +冱hu +唿hu +囫hu +岵hu +猢hu +怙hu +惚hu +浒hu +滹hu +琥hu +槲hu +轷hu +觳hu +烀hu +煳hu +戽hu +扈hu +祜hu +瓠hu +鹄hu +鹕hu +鹱hu +笏hu +醐hu +斛hu +化hua +花hua +话hua +划hua +滑hua +华hua +画hua +哗hua +猾hua +豁*hua +骅hua +桦hua +砉hua +铧hua +画报huabao +华北huabei +哗变huabian +话柄huabing +划拨huabo +划策huace +画册huace +华东huadong +花朵huaduo +花儿huaer +化肥huafei +花费huafei +划分huafen +化工huagong +华贵huagui +化合huahe +花卉huahui +坏huai +怀huai +划*huai +淮huai +槐huai +徊huai +踝huai +怀抱huaibao +淮北huaibei +坏处huaichu +怀古huaigu +淮海huaihai +怀恨huaihen +怀旧huaijiu +淮南huainan +怀念huainian +坏人huairen +坏事huaishi +怀疑huaiyi +怀着huaizhe +滑稽huaji +画家huajia +话剧huaju +哗啦huala +画廊hualang +华丽huali +画面huamian +化名huaming +还*huan +环huan +换huan +欢huan +缓huan +患huan +幻huan +焕huan +桓huan +唤huan +痪huan +豢huan +涣huan +宦huan +郇huan +奂huan +萑huan +擐huan +圜huan +獾huan +洹huan +浣huan +漶huan +寰huan +逭huan +缳huan +锾huan +鲩huan +鬟huan +华南huanan +欢畅huanchang +缓冲huanchong +幻灯huandeng +欢度huandu +焕发huanfa +黄huang +簧huang +荒huang +皇huang +慌huang +蝗huang +磺huang +凰huang +惶huang +煌huang +晃huang +幌huang +恍huang +谎huang +隍huang +徨huang +湟huang +潢huang +遑huang +璜huang +肓huang +癀huang +蟥huang +篁huang +鳇huang +磺胺huangan +皇朝huangchao +荒诞huangdan +晃荡huangdang +皇帝huangdi +荒废huangfei +黄海huanghai +黄河huanghe +恍惚huanghu +谎话huanghua +黄昏huanghun +黄金huangjin +皇历huangli +荒凉huangliang +荒乱huangluan +慌乱huangluan +慌忙huangmang +荒谬huangmiu +恍然huangran +黄色huangse +黄山huangshan +皇上huangshang +荒唐huangtang +环顾huangu +宦官huanguan +谎言huangyan +慌张huangzhang +幌子huangzi +缓和huanhe +欢呼huanhu +环环huanhuan +滑腻huani +花鸟huaniao +还给huanji +缓急huanji +还价huanjia +环节huanjie +环境huanjing +幻境huanjing +幻景huanjing +欢聚huanju +幻觉huanjue +欢乐huanle +缓慢huanman +患难huannan +唤起huanqi +缓期huanqi +欢庆huanqing +环球huanqiu +寰球huanqiu +换取huanqu +环绕huanrao +涣散huansan +欢声huansheng +环视huanshi +欢送huansong +换算huansuan +欢腾huanteng +欢喜huanxi +幻想huanxiang +欢笑huanxiao +欢心huanxin +欢欣huanxin +环行huanxing +缓刑huanxing +唤醒huanxing +幻影huanying +欢迎huanying +寰宇huanyu +还原huanyuan +患者huanzhe +滑坡huapo +花腔huaqiang +华侨huaqiao +划清huaqing +花圈huaquan +划拳huaquan +哗然huaran +华人huaren +花色huase +化身huashen +化石huashi +划算huasuan +话题huati +滑头huatou +花纹huawen +华夏huaxia +化纤huaxian +画像huaxiang +花絮huaxu +化学huaxue +画押huaya +化验huayan +花样huayang +华裔huayi +话音huayin +话语huayu +花园huayuan +画展huazhan +花招huazhao +华中huazhong +化装huazhuang +化妆huazhuang +湖北hubei +胡扯huche +弧度hudu +忽而huer +呼喊huhan +呼号huhao +呼唤huhuan +互惠huhui +会hui +回hui +灰hui +挥hui +辉hui +汇hui +毁hui +慧hui +恢hui +绘hui +惠hui +徽hui +溃*hui +堕*hui +徊*hui +蛔hui +悔hui +卉hui +晦hui +贿hui +秽hui +烩hui +讳hui +诲hui +诙hui +茴hui +荟hui +蕙hui +咴hui +哕hui +喙hui +隳hui +洄hui +浍hui +彗hui +缋hui +珲hui +桧*hui +晖hui +恚hui +虺hui +蟪hui +麾hui +灰暗huian +回报huibao +汇报huibao +回避huibi +汇编huibian +会场huichang +回潮huichao +灰尘huichen +回春huichun +荟萃huicui +回答huida +回荡huidang +回电huidian +汇兑huidui +挥发huifa +汇费huifei +会风huifeng +回复huifu +恢复huifu +悔改huigai +回顾huigu +惠顾huigu +悔过huiguo +会合huihe +回合huihe +汇合huihe +悔恨huihen +恢弘huihong +会话huihua +回话huihua +绘画huihua +毁坏huihuai +辉煌huihuang +挥霍huihuo +会集huiji +回击huiji +汇集huiji +回家huijia +会见huijian +会聚huiju +汇聚huiju +回扣huikou +汇款huikuan +回来huilai +回笼huilong +汇率huilu +贿赂huilu +会面huimian +毁灭huimie +回民huimin +汇票huipiao +回去huiqu +挥洒huisa +灰色huise +晦涩huise +回收huishou +回首huishou +会谈huitan +会堂huitang +会同huitong +回头huitou +回味huiwei +会晤huiwu +挥舞huiwu +悔悟huiwu +麾下huixia +回想huixiang +回响huixiang +诙谐huixie +灰心huixin +彗星huixing +会演huiyan +汇演huiyan +会议huiyi +回忆huiyi +回音huiyin +辉映huiying +会员huiyuan +会战huizhan +徽章huizhang +会诊huizhen +绘制huizhi +回转huizhuan +汇总huizong +回族huizu +户籍huji +呼叫hujiao +户口hukou +虎口hukou +护理huli +互利huli +护林hulin +呼噜hulu +胡乱huluan +忽略hulue +互勉humian +混hun +浑hun +荤hun +昏hun +婚hun +魂hun +诨hun +馄hun +阍hun +溷hun +湖南hunan +胡闹hunao +昏沉hunchen +混合hunhe +浑厚hunhou +昏黄hunhuang +混迹hunji +婚礼hunli +混乱hunluan +糊弄hunong +婚配hunpei +混入hunru +浑身hunshen +混同huntong +混淆hunxiao +婚姻hunyin +昏庸hunyong +混杂hunza +混帐hunzhang +混浊hunzhuo +浑浊hunzhuo +和*huo +活huo +或huo +火huo +货huo +获huo +伙huo +霍huo +豁huo +惑huo +祸huo +劐huo +藿huo +攉huo +嚯huo +夥huo +钬huo +锪huo +镬huo +耠huo +蠖huo +火把huoba +伙伴huoban +火暴huobao +货币huobi +火柴huochai +火车huoche +豁达huoda +获得huode +霍地huodi +活动huodong +伙房huofang +祸根huogen +祸害huohai +火候huohou +火化huohua +火花huohua +祸患huohuan +活活huohuo +伙计huoji +火箭huojian +火警huojing +火炬huoju +火坑huokeng +活力huoli +霍乱huoluan +活泼huopo +获取huoqu +豁然huoran +货色huose +火山huoshan +获胜huosheng +或是huoshi +伙食huoshi +祸首huoshou +伙同huotong +货物huowu +获悉huoxi +火线huoxian +活现huoxian +或许huoxu +火药huoyao +活页huoye +活跃huoyue +货运huoyun +火灾huozai +火葬huozang +或则huoze +或者huozhe +获准huozhun +湖泊hupo +忽然huran +呼声husheng +护士hushi +忽视hushi +湖水hushui +胡说hushuo +护送husong +胡同hutong +互通hutong +户头hutou +糊涂hutu +护卫huwei +呼吸huxi +互相huxiang +呼啸huxiao +虎穴huxue +护养huyang +呼应huying +呼吁huyu +护照huzhao +互助huzhu +毫无疑问hwyw +互相爱护hxah +横行霸道hxbd +互相帮助hxbz +欢欣鼓舞hxgw +候选人hxr +合作化hzh +杭州市hzs +化整为零hzwl +级j +就j +进j +加j +经j +家j +结j +阶j +间j +件j +及j +解j +较j +机j +军j +接j +教j +极j +九j +见j +基本国策jbgc +基本上jbs +据不完全统计jbwj +饥不择食jbzs +坚持不懈jcbx +集成电路jcdl +基础上jcs +绝大部分jdbf +坚定不移jdby +绝大多数jdds +鉴定会jdh +绝对化jdh +经得起jdq +见多识广jdsg +精打细算jdxs +接二连三jels +解放后jfh +解放军jfj +解放军报jfjb +解放前jfq +仅供参考jgck +机构改革jggg +坚固耐用jgny +襟怀坦白jhtb +计划性jhx +级ji +及ji +机ji +极ji +几ji +积ji +给ji +基ji +其*ji +记ji +己ji +期*ji +系*ji +革*ji +计ji +集ji +即ji +际ji +季ji +激ji +济ji +技ji +击ji +继ji +急ji +剂ji +既ji +纪ji +寄ji +挤ji +鸡ji +迹ji +绩ji +齐*ji +奇*ji +吉ji +脊ji +辑ji +籍ji +疾ji +肌ji +棘ji +畸ji +圾ji +稽ji +箕ji +饥ji +讥ji +姬ji +缉ji +汲ji +嫉ji +蓟ji +冀ji +伎ji +祭ji +悸ji +寂ji +忌ji +妓ji +藉ji +丌ji +亟ji +乩ji +剞ji +佶ji +偈ji +诘ji +墼ji +芨ji +芰ji +荠ji +蒺ji +蕺ji +掎ji +叽ji +咭ji +哜ji +唧ji +岌ji +嵴ji +洎ji +屐ji +骥ji +畿ji +玑ji +楫ji +殛ji +戟ji +戢ji +赍ji +觊ji +犄ji +齑ji +矶ji +羁ji +嵇ji +稷ji +瘠ji +虮ji +笈ji +笄ji +暨ji +跻ji +跽ji +霁ji +鲚ji +鲫ji +髻ji +麂ji +加jia +家jia +架jia +价jia +甲jia +夹jia +假jia +钾jia +贾jia +稼jia +驾jia +嘉jia +枷jia +佳jia +荚jia +颊jia +嫁jia +茄*jia +挟*jia +嘏*jia +伽jia +郏jia +葭jia +岬jia +浃jia +迦jia +珈jia +戛jia +胛jia +恝jia +铗jia +镓jia +痂jia +瘕jia +袷jia +蛱jia +笳jia +袈jia +跏jia +加班jiaban +甲板jiaban +加倍jiabei +甲虫jiachong +家畜jiachu +家当jiadang +家底jiadi +假定jiading +加法jiafa +家访jiafang +价格jiage +加工jiagong +佳话jiahua +家伙jiahuo +加急jiaji +嘉奖jiajiang +家教jiajiao +嫁接jiajie +佳节jiajie +假借jiajie +加紧jiajin +家境jiajing +家具jiaju +加剧jiaju +加快jiakuai +加仑jialun +加码jiama +假冒jiamao +家门jiamen +加密jiami +加冕jiamian +价目jiamu +间jian +件jian +见jian +建jian +坚jian +减jian +检jian +践jian +尖jian +简jian +碱jian +剪jian +艰jian +渐jian +肩jian +键jian +健jian +柬jian +鉴jian +剑jian +歼jian +监jian +兼jian +浅*jian +奸jian +箭jian +茧jian +舰jian +俭jian +笺jian +煎jian +缄jian +硷jian +拣jian +捡jian +荐jian +槛jian +贱jian +饯jian +溅jian +涧jian +僭jian +谏jian +谫jian +菅jian +蒹jian +搛jian +囝*jian +湔jian +蹇jian +謇jian +缣jian +枧jian +楗jian +戋jian +戬jian +牮jian +犍jian +毽jian +腱jian +睑jian +锏jian +鹣jian +裥jian +笕jian +翦jian +趼jian +踺jian +鲣jian +鞯jian +吉安jian +煎熬jianao +简报jianbao +渐变jianbian +简便jianbian +简编jianbian +鉴别jianbie +兼并jianbing +尖兵jianbing +剪裁jiancai +剪彩jiancai +检测jiance +检查jiancha +检察jiancha +监察jiancha +减产jianchan +建成jiancheng +简称jiancheng +坚持jianchi +简单jiandan +建党jiandang +减低jiandi +检点jiandian +间谍jiandie +坚定jianding +鉴定jianding +监督jiandu +间断jianduan +尖端jianduan +简短jianduan +舰队jiandui +健儿jianer +减法jianfa +肩负jianfu +将jiang +降jiang +讲jiang +强*jiang +江jiang +浆jiang +蒋jiang +奖jiang +疆jiang +僵jiang +姜jiang +桨jiang +匠jiang +酱jiang +茳jiang +洚jiang +绛jiang +缰jiang +犟jiang +礓jiang +耩jiang +糨jiang +豇jiang +奖杯jiangbei +疆场jiangchang +奖惩jiangcheng +僵持jiangchi +降低jiangdi +间隔jiange +讲稿jianggao +江湖jianghu +僵化jianghua +讲话jianghua +降级jiangji +降价jiangjia +讲解jiangjie +疆界jiangjie +将近jiangjin +奖金jiangjin +讲究jiangjiu +僵局jiangju +将军jiangjun +讲课jiangke +将来jianglai +讲理jiangli +奖励jiangli +降临jianglin +将领jiangling +降落jiangluo +江南jiangnan +奖品jiangpin +讲评jiangping +奖券jiangquan +江山jiangshan +讲师jiangshi +僵尸jiangshi +讲授jiangshou +讲述jiangshu +降水jiangshui +江苏jiangsu +讲台jiangtai +讲坛jiangtan +疆土jiangtu +坚固jiangu +兼顾jiangu +监管jianguan +建国jianguo +降温jiangwen +江西jiangxi +讲习jiangxi +匠心jiangxin +讲学jiangxue +讲演jiangyan +将要jiangyao +讲义jiangyi +僵硬jiangying +奖章jiangzhang +讲座jiangzuo +监护jianhu +简化jianhua +间或jianhuo +奸计jianji +歼击jianji +剪辑jianji +减价jianjia +渐渐jianjian +健将jianjiang +建交jianjiao +间接jianjie +见解jianjie +简介jianjie +简洁jianjie +简捷jianjie +渐进jianjin +监禁jianjin +检举jianju +艰巨jianju +坚决jianjue +健康jiankang +尖刻jianke +坚苦jianku +艰苦jianku +监牢jianlao +建立jianli +尖利jianli +简历jianli +简练jianlian +简陋jianlou +简略jianlue +健美jianmei +减免jianmian +歼灭jianmie +简明jianming +缄默jianmo +艰难jiannan +键盘jianpan +简拼jianpin +简朴jianpu +俭朴jianpu +坚强jianqiang +减轻jianqing +健全jianquan +兼任jianren +坚韧jianren +兼容jianrong +尖锐jianrui +减弱jianruo +艰涩jianse +鉴赏jianshang +减少jianshao +建设jianshe +艰深jianshen +见识jianshi +坚实jianshi +监视jianshi +建树jianshu +减速jiansu +检索jiansuo +践踏jianta +健谈jiantan +检讨jiantao +简体jianti +舰艇jianting +减退jiantui +健忘jianwang +间文jianwen +见闻jianwen +间隙jianxi +奸细jianxi +艰险jianxian +见效jianxiao +间歇jianxie +简写jianxie +坚信jianxin +艰辛jianxin +减刑jianxing +检修jianxiu +简讯jianxun +检验jianyan +简要jianyao +建议jianyi +坚毅jianyi +简易jianyi +奸淫jianyin +坚硬jianying +剪影jianying +鉴于jianyu +监狱jianyu +减员jianyuan +检阅jianyue +建造jianzao +简则jianze +坚贞jianzhen +监制jianzhi +简直jianzhi +兼职jianzhi +建筑jianzhu +简装jianzhuang +健壮jianzhuang +较jiao +教jiao +交jiao +角jiao +叫jiao +脚jiao +胶jiao +浇jiao +焦jiao +觉*jiao +校*jiao +搅jiao +酵jiao +郊jiao +铰jiao +窖jiao +椒jiao +礁jiao +骄jiao +娇jiao +嚼jiao +矫jiao +侥jiao +狡jiao +饺jiao +缴jiao +绞jiao +剿jiao +轿jiao +佼jiao +僬jiao +艽jiao +茭jiao +挢jiao +噍jiao +峤jiao +徼jiao +湫*jiao +姣jiao +敫jiao +皎jiao +鹪jiao +蛟jiao +醮jiao +跤jiao +鲛jiao +骄傲jiaoao +搅拌jiaoban +狡辩jiaobian +教材jiaocai +交叉jiaocha +教程jiaocheng +交错jiaocuo +较大jiaoda +交代jiaodai +交淡jiaodan +教导jiaodao +交点jiaodian +焦点jiaodian +校订jiaoding +角度jiaodu +校对jiaodui +较多jiaoduo +焦耳jiaoer +交锋jiaofeng +交付jiaofu +浇灌jiaoguan +娇贵jiaogui +叫喊jiaohan +较好jiaohao +叫好jiaohao +狡猾jiaohua +交换jiaohuan +叫唤jiaohuan +教诲jiaohui +缴获jiaohuo +交际jiaoji +矫健jiaojian +交接jiaojie +交界jiaojie +叫苦jiaoku +较快jiaokuai +教练jiaolian +较量jiaoliang +交流jiaoliu +搅乱jiaoluan +角落jiaoluo +叫骂jiaoma +剿灭jiaomie +酵母jiaomu +交纳jiaona +缴纳jiaona +娇嫩jiaonen +交配jiaopei +骄气jiaoqi +交情jiaoqing +郊区jiaoqu +叫嚷jiaorang +角色jiaose +交涉jiaoshe +教师jiaoshi +教授jiaoshou +教唆jiaosuo +脚踏jiaota +交谈jiaotan +教堂jiaotang +交替jiaoti +教条jiaotiao +交通jiaotong +郊外jiaowai +交往jiaowang +较为jiaowei +狡黠jiaoxia +叫嚣jiaoxiao +侥幸jiaoxing +绞刑jiaoxing +教学jiaoxue +教训jiaoxun +教养jiaoyang +骄阳jiaoyang +教益jiaoyi +交易jiaoyi +交谊jiaoyi +教育jiaoyu +教员jiaoyuan +狡诈jiaozha +校正jiaozheng +脚注jiaozhu +角逐jiaozhu +浇铸jiaozhu +校准jiaozhun +焦灼jiaozhuo +娇纵jiaozong +叫做jiaozuo +家谱jiapu +假期jiaqi +价钱jiaqian +加强jiaqiang +假日jiari +加入jiaru +假如jiaru +假若jiaruo +加上jiashang +假设jiashe +加深jiashen +假使jiashi +架势jiashi +驾驶jiashi +家属jiashu +假说jiashuo +加速jiasu +枷锁jiasuo +家庭jiating +家乡jiaxiang +假想jiaxiang +家业jiaye +加以jiayi +佳音jiayin +家用jiayong +加油jiayou +家园jiayuan +夹杂jiaza +加载jiazai +家长jiazhang +价值jiazhi +加重jiazhong +假装jiazhuang +嫁妆jiazhuang +架子jiazi +家族jiazu +击败jibai +羁绊jiban +几倍jibei +基本jiben +击毙jibi +级别jibie +疾病jibing +计策jice +基层jiceng +稽查jicha +机场jichang +集成jicheng +继承jicheng +计酬jichou +基础jichu +机床jichuang +几次jici +急促jicu +积存jicun +寄存jicun +极大jida +亟待jidai +激荡jidang +记得jide +基地jidi +机电jidian +极点jidian +基调jidiao +机动jidong +激动jidong +极度jidu +几度jidu +即度jidu +季度jidu +基督jidu +嫉妒jidu +忌妒jidu +极端jiduan +结jie +阶jie +解jie +接jie +节jie +家*jie +界jie +截jie +介jie +借jie +价*jie +届jie +街jie +揭jie +洁jie +杰jie +竭jie +皆jie +秸jie +劫jie +桔jie +捷jie +睫jie +姐jie +戒jie +藉jie +芥jie +疥jie +诫jie +楷*jie +偈*jie +讦jie +诘*jie +拮jie +喈jie +嗟jie +婕jie +孑jie +桀jie +碣jie +疖jie +颉jie +蚧jie +羯jie +鲒jie +骱jie +饥饿jie +结案jiean +洁白jiebai +接班jieban +捷报jiebao +戒备jiebei +结彩jiecai +节操jiecao +阶层jieceng +劫持jiechi +杰出jiechu +解除jiechu +接触jiechu +戒除jiechu +揭穿jiechuan +结存jiecun +解答jieda +接待jiedai +借贷jiedai +街道jiedao +解冻jiedong +阶段jieduan +截断jieduan +揭发jiefa +借方jiefang +解放jiefang +街坊jiefang +结构jiegou +解雇jiegu +借故jiegu +结果jieguo +结合jiehe +结核jiehe +结婚jiehun +阶级jieji +接见jiejian +节俭jiejian +借鉴jiejian +结交jiejiao +姐姐jiejie +接近jiejin +竭尽jiejin +结晶jiejing +捷径jiejing +洁净jiejing +解救jiejiu +结局jieju +解决jiejue +孑孓jiejue +解开jiekai +揭开jiekai +解渴jieke +接口jiekou +借口jiekou +借款jiekuan +竭力jieli +接连jielian +揭露jielu +戒律jielu +结论jielun +解闷jiemen +结盟jiemeng +界面jiemian +节目jiemu +揭幕jiemu +接纳jiena +解聘jiepin +解剖jiepou +节气jieqi +接洽jieqia +截取jiequ +既而jier +节日jieri +介入jieru +解散jiesan +介绍jieshao +节省jiesheng +届时jieshi +结实jieshi +解释jieshi +揭示jieshi +解手jieshou +接受jieshou +接收jieshou +结束jieshu +解说jieshuo +结算jiesuan +解体jieti +阶梯jieti +接替jieti +接头jietou +街头jietou +解脱jietuo +结尾jiewei +解围jiewei +接吻jiewen +解析jiexi +界线jiexian +界限jiexian +揭晓jiexiao +戒严jieyan +结业jieye +介意jieyi +接应jieying +结余jieyu +节约jieyue +结帐jiezhang +接着jiezhao +节制jiezhi +介质jiezhi +戒指jiezhi +借支jiezhi +截止jiezhi +借助jiezhu +节奏jiezou +杰作jiezuo +激发jifa +技法jifa +讥讽jifeng +几个jige +及格jige +技工jigong +记功jigong +机构jigou +叽咕jigu +机关jiguan +籍贯jiguan +极光jiguang +激光jiguang +记过jiguo +极好jihao +记号jihao +集合jihe +几何jihe +稽核jihe +几乎jihu +激化jihua +计划jihua +饥荒jihuang +机会jihui +集会jihui +击毁jihui +忌讳jihui +积极jiji +机件jijian +计件jijian +急件jijian +击剑jijian +即将jijiang +计较jijiao +季节jijie +急进jijin +基金jijin +机警jijing +即景jijing +寂静jijing +急救jijiu +积聚jiju +急剧jiju +急遽jiju +寄居jiju +季刊jikan +即刻jike +疾苦jiku +击溃jikui +积累jilei +极力jili +吉利jili +激励jili +伎俩jilia +计量jiliang +寂寥jiliao +激烈jilie +吉林jilin +机灵jiling +激流jiliu +记录jilu +纪律jilu +纪录jilu +辑录jilu +击落jiluo +急忙jimang +机密jimi +寂寞jimo +计谋jimou +进jin +金jin +近jin +紧jin +斤jin +今jin +尽jin +仅jin +劲jin +浸jin +禁jin +津jin +筋jin +锦jin +晋jin +巾jin +襟jin +谨jin +靳jin +烬jin +卺jin +荩jin +堇jin +噤jin +馑jin +廑jin +妗jin +缙jin +瑾jin +槿jin +赆jin +觐jin +衿jin +缉拿jina +济南jinan +禁闭jinbi +锦标jinbiao +进步jinbu +浸沉jinchen +进程jincheng +进出jinchu +紧凑jincou +近代jindai +劲敌jindi +进度jindu +金额jine +机能jineng +技能jineng +进而jiner +进犯jinfan +经jing +精jing +京jing +径jing +井jing +静jing +竟jing +晶jing +净jing +境jing +镜jing +景jing +警jing +劲*jing +茎jing +敬jing +惊jing +睛jing +竞jing +荆jing +兢jing +鲸jing +粳jing +痉jing +靖jing +刭jing +儆jing +阱jing +菁jing +獍jing +憬jing +泾jing +迳jing +弪jing +婧jing +肼jing +胫jing +腈jing +旌jing +靓*jing +敬爱jingai +警报jingbao +警备jingbei +精兵jingbing +精采jingcai +精彩jingcai +警察jingcha +经常jingchang +精粹jingcui +静电jingdian +经典jingdian +惊动jingdong +精度jingdu +经费jingfei +精干jinggan +竟敢jinggan +警告jinggao +经过jingguo +净化jinghua +精华jinghua +经济jingji +竞技jingji +荆棘jingji +精简jingjian +境界jingjie +警戒jingjie +经久jingjiu +惊恐jingkong +经理jingli +经历jingli +精力jingli +敬礼jingli +精练jinglian +精良jingliang +经络jingluo +精美jingmei +精密jingmi +精明jingming +进攻jingong +敬佩jingpei +精辟jingpi +景气jingqi +惊奇jingqi +精巧jingqiao +精确jingque +竟然jingran +竞赛jingsai +景色jingse +经商jingshang +精神jingshen +经手jingshou +经受jingshou +精髓jingsui +静态jingtai +惊叹jingtan +晶体jingti +警惕jingti +精通jingtong +镜头jingtou +筋骨jingu +禁锢jingu +尽管jinguan +巾帼jinguo +经委jingwei +警卫jingwei +敬畏jingwei +景物jingwu +精细jingxi +京戏jingxi +惊险jingxian +景象jingxiang +经销jingxiao +经心jingxin +精心jingxin +惊心jingxin +惊醒jingxing +竞选jingxuan +惊讶jingya +经验jingyan +敬仰jingyang +经营jingying +晶莹jingying +经由jingyou +境遇jingyu +精湛jingzhan +竞争jingzheng +精制jingzhi +径直jingzhi +精致jingzhi +静止jingzhi +净值jingzhi +竟址jingzhi +净重jingzhong +镜子jingzi +静坐jingzuo +近海jinhai +今后jinhou +近乎jinhu +进化jinhua +几年jinian +记念jinian +纪念jinian +晋级jinji +紧急jinji +近郊jinjiao +紧紧jinjin +仅仅jinjin +进军jinjun +进口jinkou +尽快jinkuai +近况jinkuang +进来jinlai +近来jinlai +尽力jinli +尽量jinliang +斤两jinliang +禁令jinling +劲旅jinlu +紧密jinmi +近年jinnian +今年jinnian +金牌jinpai +紧迫jinpo +近期jinqi +近前jinqian +金钱jinqian +尽情jinqing +进去jinqu +进取jinqu +禁区jinqu +近日jinri +今日jinri +金融jinrong +进入jinru +浸入jinru +谨慎jinshen +晋升jinsheng +今是jinshi +尽是jinshi +近视jinshi +金属jinshu +近似jinsi +紧缩jinsuo +今天jintian +津贴jintie +尽头jintou +劲头jintou +浸透jintou +进退jintui +今晚jinwan +今昔jinxi +尽心jinxin +进行jinxing +进修jinxiu +锦秀jinxiu +谨严jinyan +紧要jinyao +进展jinzhan +紧张jinzhang +今朝jinzhao +紧着jinzhe +禁止jinzhi +尽职jinzhi +进驻jinzhu +金子jinzi +炯jiong +窘jiong +迥jiong +炅*jiong +扃jiong +窘迫jiongpo +迥然jiongran +击破jipo +急迫jipo +及其jiqi +极其jiqi +激起jiqi +机器jiqi +机枪jiqiang +技巧jiqiao +急切jiqie +激情jiqing +汲取jiqu +集权jiquan +既然jiran +己任jiren +继任jiren +即日jiri +吉日jiri +肌肉jirou +极少jishao +寄生jisheng +即是jishi +及时jishi +几时jishi +计时jishi +即时jishi +即使jishi +记事jishi +基石jishi +集市jishi +级数jishu +基数jishu +计数jishu +记述jishu +技术jishu +祭祀jisi +激素jisu +急速jisu +计算jisuan +机体jiti +集体jiti +肌体jiti +几天jitian +集团jituan +寄托jituo +就jiu +九jiu +旧jiu +究jiu +久jiu +救jiu +酒jiu +纠jiu +揪jiu +玖jiu +韭jiu +灸jiu +厩jiu +臼jiu +舅jiu +咎jiu +疚jiu +僦jiu +啾jiu +阄jiu +柩jiu +桕jiu +鸠jiu +鹫jiu +赳jiu +鬏jiu +就餐jiucan +纠察jiucha +纠缠jiuchan +就此jiuci +就地jiudi +就范jiufan +纠纷jiufen +纠葛jiuge +救国jiuguo +救护jiuhu +救火jiuhuo +纠集jiuji +鸠集jiuji +救济jiuji +救急jiuji +九江jiujiang +九届jiujie +就近jiujin +酒精jiujing +究竟jiujing +救命jiuming +救生jiusheng +就是jiushi +就事jiushi +救亡jiuwang +久违jiuwei +酒窝jiuwo +酒席jiuxi +救险jiuxian +揪心jiuxin +救星jiuxing +就绪jiuxu +就学jiuxue +久仰jiuyang +就要jiuyao +就业jiuye +久远jiuyuan +九月jiuyue +救灾jiuzai +纠正jiuzheng +就职jiuzhi +救治jiuzhi +九洲jiuzhou +救助jiuzhu +极为jiwei +纪委jiwei +极限jixian +迹象jixiang +吉祥jixiang +讥笑jixiao +机械jixie +记性jixing +急性jixing +畸形jixing +即兴jixing +吉凶jixiong +几许jixu +积蓄jixu +继续jixu +记叙jixu +急需jixu +集训jixun +积压jiya +羁押jiya +给养jiyang +机要jiyao +纪要jiyao +给以jiyi +记忆jiyi +技艺jiyi +基因jiyin +急用jiyong +基于jiyu +急于jiyu +机遇jiyu +给予jiyu +寄予jiyu +觊觎jiyu +纪元jiyuan +集约jiyue +记载jizai +及早jizao +急躁jizao +激增jizeng +记帐jizhang +记者jizhe +集镇jizhen +机制jizhi +及至jizhi +机智jizhi +集中jizhong +击中jizhong +记住jizhu +基准jizhun +集资jizi +经济核算jjhs +聚精会神jjhs +将计就计jjjj +戒骄戒躁jjjz +近几年来jjnl +竭尽全力jjql +节假日jjr +积极性jjx +经济效益jjxy +兢兢业业jjyy +精简整编jjzb +叽叽喳喳jjzz +艰苦奋斗jkfd +尽可能jkn +教科书jks +俱乐部jlb +交流电jld +吉林省jls +价廉物美jlwm +纪律性jlx +纪念碑jnb +几年来jnl +近年来jnl +纪念品jnp +济南市jns +吉普车jpc +坚强不屈jqbq +奖勤罚懒jqfl +机器人jqr +急起直追jqzz +截然不同jrbt +兼容性jrx +积少成多jscd +金山公司jsgs +集思广益jsgy +精神焕发jshf +计算机jsj +尽善尽美jsjm +集市贸易jsmy +介绍人jsr +就是说jss +计算所jss +江苏省jss +举世闻名jswm +介绍信jsx +技术员jsy +计算中心jszx +交通部jtb +家庭出身jtcs +惊天动地jtdd +具体地说jtds +晶体管jtg +交通工具jtgj +脚踏实地jtsd +具体说来jtsl +具ju +据ju +局ju +举ju +车*ju +句ju +聚ju +距ju +巨ju +居ju +锯ju +剧ju +矩ju +拒ju +柜*ju +桔*ju +鞠ju +拘ju +狙ju +疽ju +驹ju +菊ju +咀ju +沮ju +踞ju +俱ju +惧ju +炬ju +倨ju +讵ju +苣ju +苴ju +莒ju +掬ju +遽ju +屦ju +琚ju +枸*ju +椐ju +榘ju +榉ju +橘ju +犋ju +飓ju +钜ju +锔ju +窭ju +裾ju +趄ju +醵ju +踽ju +龃ju +雎ju +瞿*ju +鞫ju +卷juan +捐juan +鹃juan +娟juan +倦juan +眷juan +绢juan +俊*juan +鄄juan +狷juan +涓juan +桊juan +蠲juan +锩juan +镌juan +隽juan +卷进juanjin +捐款juankuan +眷恋juanlian +眷念juannian +捐躯juanqu +卷入juanru +眷属juanshu +捐献juanxian +卷烟juanyan +卷帙juanzhi +捐助juanzhu +卷宗juanzong +举办juban +具备jubei +剧本juben +巨变jubian +局部jubu +拘捕jubu +剧场juchang +据此juci +巨大juda +举动judong +居多juduo +决jue +觉jue +绝jue +角*jue +脚*jue +掘jue +嚼*jue +撅jue +攫jue +抉jue +倔jue +爵jue +诀jue +厥jue +劂jue +谲jue +矍jue +蕨jue +嗟*jue +噘jue +噱jue +崛jue +獗jue +孓jue +珏jue +桷jue +橛jue +爝jue +镢jue +蹶jue +觖jue +巨额jue +诀别juebie +决不juebu +绝不juebu +决策juece +觉察juecha +觉得juede +决定jueding +决断jueduan +绝对juedui +绝迹jueji +倔强juejiang +绝交juejiao +绝径juejing +绝境juejing +绝句jueju +决裂juelie +绝路juelu +绝密juemi +绝妙juemiao +崛起jueqi +诀窍jueqiao +决赛juesai +绝食jueshi +决死juesi +决算juesuan +绝望juewang +爵位juewei +觉悟juewu +决心juexin +觉醒juexing +决议jueyi +绝缘jueyuan +抉择jueze +决战juezhan +绝招juezhao +绝症juezheng +巨幅jufu +居功jugong +鞠躬jugong +句号juhao +聚合juhe +聚会juhui +聚集juji +巨匠jujiang +拘谨jujin +拒绝jujue +咀嚼jujue +距离juli +举例juli +剧烈julie +拘留juliu +局面jumian +居民jumin +剧目jumu +军jun +均jun +菌jun +君jun +龟*jun +钧jun +峻jun +俊jun +竣jun +浚jun +郡jun +骏jun +捃jun +皲jun +筠jun +麇jun +军操juncao +君臣junchen +均等jundeng +军队jundui +军法junfa +军阀junfa +军服junfu +军港jungang +军工jungong +竣工jungong +均衡junheng +军火junhuo +拘泥juni +军机junji +军纪junji +军舰junjian +俊杰junjie +军垦junken +军粮junliang +军令junling +骏马junma +军民junmin +军旗junqi +峻峭junqiao +俊俏junqiao +军区junqu +军权junquan +军人junren +军事junshi +军师junshi +军属junshu +军团juntuan +军委junwei +军衔junxian +军校junxiao +军械junxie +军心junxin +俊秀junxiu +军需junxu +军训junxun +军医junyi +军营junying +军用junyong +军邮junyou +均匀junyun +军长junzhang +军政junzheng +君主junzhu +军装junzhuang +君子junzi +俱全juquan +居然juran +遽然juran +沮丧jusang +局势jushi +举手jushou +拘束jushu +据说jushuo +具体juti +剧团jutuan +据悉juxi +局限juxian +居心juxin +举行juxing +矩形juxing +巨型juxing +具有juyou +据有juyou +剧院juyuan +局长juzhang +剧照juzhao +举止juzhi +居中juzhong +剧终juzhong +巨著juzhu +居住juzhu +句子juzi +节外生枝jwsz +惊心动魄jxdp +继续革命jxgm +机械化jxh +江西省jxs +谨小慎微jxsw +局限性jxx +教育部jyb +进一步jyb +家用电器jydq +教育方针jyfz +家喻户晓jyhx +加以解决jyjj +记忆力jyl +精益求精jyqj +教研室jys +见义勇为jyyw +旧中国jzg +建筑物jzw +可k +开k +看k +克k +孔k +科k +口k +空k +苦k +快k +考k +刻k +靠k +况k +块k +困k +宽k +矿k +抗k +卡k +卡ka +喀ka +咖ka +咯ka +佧ka +咔ka +胩ka +喀嚓kacha +卡车kache +咖啡kafei +开kai +凯kai +揩kai +楷kai +慨kai +剀kai +垲kai +蒈kai +忾kai +恺kai +铠kai +锎kai +锴kai +开办kaiban +开遍kaibian +开采kaicai +开场kaichang +开车kaiche +开除kaichu +开创kaichuang +开导kaidao +开刀kaidao +开动kaidong +开端kaiduan +开发kaifa +开放kaifang +开封kaifeng +开赴kaifu +凯歌kaige +开关kaiguan +开航kaihang +开户kaihu +开花kaihua +开怀kaihuai +开荒kaihuang +开会kaihui +开掘kaijue +开垦kaiken +开口kaikou +开矿kaikuang +开阔kaikuo +开朗kailang +开郎kailang +开路kailu +开明kaiming +楷模kaimo +开幕kaimu +开炮kaipao +开辟kaipi +开启kaiqi +开枪kaiqiang +开窍kaiqiao +开设kaishe +开始kaishi +开庭kaiting +开头kaitou +开脱kaituo +开拓kaituo +开外kaiwai +开销kaixiao +开心kaixin +凯旋kaixuan +开学kaixue +开颜kaiyan +开业kaiye +开战kaizhan +开展kaizhan +开张kaizhang +开支kaizhi +看kan +刊kan +坎kan +槛*kan +堪kan +勘kan +砍kan +嵌*kan +侃kan +莰kan +阚*kan +戡kan +龛kan +瞰kan +勘测kance +勘察kancha +看出kanchu +看待kandai +看到kandao +刊登kandeng +看法kanfa +砍伐kanfa +抗kang +康kang +炕kang +慷kang +糠kang +扛kang +亢kang +伉kang +闶kang +钪kang +亢奋kangfen +康复kangfu +抗衡kangheng +抗击kangji +亢进kangjin +抗拒kangju +伉俪kangli +抗日kangri +看管kanguan +抗议kangyi +看见kanjian +坎坷kanke +看来kanlai +看齐kanqi +刊头kantou +看望kanwang +刊物kanwu +勘误kanwu +看样kanyang +刊载kanzai +考kao +靠kao +拷kao +烤kao +尻kao +栲kao +犒kao +铐kao +拷贝kaobei +靠边kaobian +考查kaocha +考察kaocha +考核kaohe +靠近kaojin +考究kaojiu +靠拢kaolong +考虑kaolu +考勤kaoqin +靠山kaoshan +考试kaoshi +考题kaoti +考验kaoyan +考证kaozheng +卡片kapian +看不惯kbg +看不起kbq +刻不容缓kbrh +开诚布公kcbg +矿产资源kczy +扩大化kdh +可ke +克ke +科ke +刻ke +客ke +壳ke +颗ke +棵ke +柯ke +呵*ke +坷ke +苛ke +磕ke +咳ke +渴ke +课ke +嗑ke +岢ke +恪ke +溘ke +骒ke +缂ke +珂ke +轲ke +氪ke +瞌ke +钶ke +锞ke +稞ke +疴ke +窠ke +颏ke +蝌ke +髁ke +可爱keai +科班keban +课本keben +可比kebi +刻薄kebo +可不kebu +客车keche +课程kecheng +可耻kechi +可恶kee +可风kefeng +可否kefou +克服kefu +可观keguan +客观keguan +可贵kegui +可好kehao +可恨kehen +刻划kehua +刻画kehua +克己keji +客机keji +科技keji +可见kejian +科教kejiao +可敬kejing +窠臼kejiu +科举keju +可靠kekao +苛刻keke +可口kekou +克扣kekou +刻苦keku +克拉kela +克朗kelang +颗粒keli +可怜kelian +科目kemu +肯ken +啃ken +垦ken +恳ken +裉ken +肯定kending +可能keneng +坑keng +吭keng +铿keng +坑道kengdao +坑害kenghai +铿锵kengqiang +恳切kenqie +恳求kenqiu +垦殖kenzhi +可怕kepa +磕碰kepeng +科普kepu +客气keqi +可亲keqin +可取kequ +客人keren +客商keshang +可是keshi +科室keshi +课堂ketang +客套ketao +课题keti +客体keti +客厅keting +磕头ketou +可望kewang +渴望kewang +可喜kexi +可惜kexi +可行kexing +科学kexue +科研keyan +可以keyi +可疑keyi +刻意keyi +科员keyuan +科长kezhang +可知kezhi +克制kezhi +狂风暴雨kfby +克己奉公kjfg +科技司kjs +苦口婆心kkpx +昆明市kms +可能性knx +孔kong +空kong +控kong +恐kong +倥kong +崆kong +箜kong +空白kongbai +恐怖kongbu +控拆kongchai +空洞kongdong +空额konge +空乏kongfa +控告konggao +空喊konghan +恐吓konghe +空话konghua +恐慌konghuang +空间kongjian +空降kongjiang +恐惧kongju +空军kongjun +空旷kongkuang +恐龙konglong +空虑konglu +恐怕kongpa +空气kongqi +空前kongqian +孔雀kongque +控诉kongsu +空谈kongtan +空头kongtou +空文kongwen +空隙kongxi +空闲kongxian +空想kongxiang +空虚kongxu +空运kongyun +控制kongzhi +空中kongzhong +口kou +扣kou +抠kou +寇kou +芤kou +蔻kou +叩kou +眍kou +筘kou +口岸kouan +叩拜koubai +口才koucai +扣除kouchu +口传kouchuan +口服koufu +口供kougong +口号kouhao +口红kouhong +口角koujiao +口径koujing +口诀koujue +口令kouling +扣留kouliu +口气kouqi +口腔kouqiang +口哨koushao +口试koushi +口述koushu +口头koutou +叩头koutou +口信kouxin +扣押kouya +口语kouyu +看起来kql +口若悬河krxh +口是心非ksxf +苦ku +库ku +枯ku +酷ku +哭ku +窟ku +裤ku +刳ku +堀ku +喾ku +绔ku +骷ku +跨kua +夸kua +垮kua +挎kua +胯kua +侉kua +跨步kuabu +夸大kuada +跨度kuadu +会*kuai +快kuai +块kuai +筷kuai +侩kuai +蒯kuai +郐kuai +哙kuai +狯kuai +浍*kuai +脍kuai +会计kuaiji +快乐kuaile +快速kuaisu +宽kuan +款kuan +髋kuan +宽敞kuanchang +宽绰kuanchuo +宽大kuanda +宽待kuandai +款待kuandai +宽度kuandu +况kuang +矿kuang +狂kuang +框kuang +匡kuang +筐kuang +眶kuang +旷kuang +诓kuang +诳kuang +邝kuang +圹kuang +夼kuang +哐kuang +纩kuang +贶kuang +矿藏kuangcang +矿产kuangchan +狂风kuangfeng +矿工kuanggong +旷工kuanggong +矿井kuangjing +框框kuangkuang +哐啷kuanglang +况且kuangqie +矿区kuangqu +矿泉kuangquan +狂热kuangre +矿山kuangshan +矿石kuangshi +框图kuangtu +宽广kuanguang +狂妄kuangwang +矿物kuangwu +旷野kuangye +宽宏kuanhong +宽厚kuanhou +宽阔kuankuo +宽容kuanrong +款式kuanshi +宽恕kuanshu +款项kuanxiang +宽心kuanxin +宽裕kuanyu +垮台kuatai +跨越kuayue +夸张kuazhang +裤衩kucha +库存kucun +哭喊kuhan +奎kui +溃kui +馈kui +亏kui +盔kui +岿kui +窥kui +葵kui +魁kui +傀kui +愧kui +馗kui +匮kui +夔kui +隗kui +蒉kui +揆kui +喹kui +喟kui +悝kui +愦kui +逵kui +暌kui +睽kui +聩kui +蝰kui +篑kui +跬kui +亏本kuiben +窥测kuice +亏待kuidai +愧疚kuijiu +亏空kuikong +亏损kuisun +魁梧kuiwu +溃疡kuiyang +枯竭kujie +库仑kulun +苦闷kumen +枯木kumu +困kun +昆kun +坤kun +捆kun +悃kun +阃kun +琨kun +锟kun +醌kun +鲲kun +髡kun +苦难kunan +苦恼kunao +困厄kune +困乏kunfa +困惑kunhuo +困境kunjing +困苦kunku +昆明kunming +困难kunnan +扩kuo +括kuo +适*kuo +阔kuo +廓kuo +栝*kuo +蛞kuo +阔别kuobie +扩充kuochong +阔绰kuochuo +扩大kuoda +括号kuohao +扩建kuojian +阔气kuoqi +扩展kuozhan +扩张kuozhang +哭泣kuqi +酷暑kushu +苦头kutou +苦维kuwei +枯萎kuwei +酷刑kuxing +苦于kuyu +枯燥kuzao +可想而知kxez +科学家kxj +科学技术kxjs +可行性kxx +科学院kxy +科研部kyb +开源节流kyjl +看样子kyz +了l +来l +量l +理l +路l +里l +论l +两l +利l +领l +流l +力l +立l +料l +连l +老l +六l +轮l +类l +列l +拉la +落*la +啦la +蜡la +腊la +蓝la +垃la +喇la +辣la +剌la +邋la +旯la +砬la +瘌la +喇叭laba +来lai +赖lai +莱lai +崃lai +徕lai +涞lai +濑lai +赉lai +睐lai +铼lai +癞lai +籁lai +来宾laibin +来到laidao +来犯laifan +来访laifang +来函laihan +来回laihui +来历laili +来临lailin +赖皮laipi +来日lairi +来势laishi +来头laitou +来往laiwang +来信laixin +来源laiyuan +来者laizhe +来自laizi +癞子laizi +辣椒lajiao +拉拢lalong +喇嘛lama +腊梅lamei +兰lan +烂lan +蓝lan +览lan +栏lan +婪lan +拦lan +篮lan +阑lan +澜lan +谰lan +揽lan +懒lan +缆lan +滥lan +岚lan +漤lan +榄lan +斓lan +罱lan +镧lan +褴lan +蓝本lanben +懒怠landai +滥调landiao +懒惰landuo +浪lang +朗lang +郎lang +狼lang +琅lang +榔lang +廊lang +莨lang +蒗lang +啷lang +阆lang +锒lang +稂lang +螂lang +栏杆langan +狼狈langbei +浪潮langchao +浪荡langdang +朗读langdu +浪费langfei +狼藉langji +浪漫langman +朗诵langsong +郎中langzhong +兰花lanhua +拦截lanjie +烂漫lanman +懒散lansan +蓝色lanse +缆绳lansheng +烂熟lanshu +蓝天lantian +蓝图lantu +阑尾lanwei +拦腰lanyao +滥用lanyong +兰州lanzhou +老lao +劳lao +落*lao +牢lao +涝lao +捞lao +络*lao +佬lao +姥lao +酪lao +烙lao +潦*lao +唠lao +崂lao +栳lao +铑lao +铹lao +痨lao +耢lao +醪lao +老板laoban +老伴laoban +老本laoben +劳动laodong +牢固laogu +老汉laohan +老化laohua +牢记laoji +劳驾laojia +牢靠laokao +劳苦laoku +牢牢laolao +劳累laolei +劳力laoli +老练laolian +牢笼laolong +劳模laomo +老年laonian +老人laoren +牢骚laosao +老少laoshao +老是laoshi +老实laoshi +老师laoshi +老乡laoxiang +老爷laoye +烙印laoyin +劳支laozhi +劳资laozi +劳作laozuo +腊月layue +狼狈不堪lbbk +力不从心lbcx +来不及lbj +来不了lbl +了不起lbq +劳动保险ldbx +来得及ldj +劳动量ldl +劳动力ldl +灵丹妙药ldmy +拉丁美洲ldmz +劳动者ldz +劳动致富ldzf +了le +乐le +勒le +肋le +仂le +叻le +泐le +鳓le +乐观leguan +类lei +雷lei +累lei +勒*lei +垒lei +泪lei +镭lei +蕾lei +磊lei +儡lei +擂lei +肋lei +羸lei +诔lei +嘞lei +嫘lei +缧lei +檑lei +耒lei +酹lei +类别leibie +类次leici +雷达leida +雷管leiguan +泪痕leihen +泪花leihua +累积leiji +累计leiji +累进leijin +磊落leiluo +累年leinian +类似leisi +擂台leitai +雷同leitong +类推leitui +类型leixing +雷雨leiyu +累月leiyue +累赘leizhui +勒令leling +冷leng +棱leng +楞leng +塄leng +愣leng +冷藏lengcang +冷淡lengdan +冷宫lenggong +棱角lengjiao +冷静lengjing +冷落lengluo +冷门lengmen +冷漠lengmo +冷暖lengnuan +冷僻lengpi +冷气lengqi +冷却lengque +冷水lengshui +冷遇lengyu +乐趣lequ +勒索lesuo +乐意leyi +乐园leyuan +两个文明lgwm +拉关系lgx +联合国lhg +联合会lhh +两回事lhs +联合体lht +理li +里li +利li +力li +立li +离li +例li +历li +粒li +厘li +礼li +李li +隶li +黎li +璃li +励li +犁li +梨li +丽li +厉li +篱li +狸li +漓li +鲤li +莉li +荔li +吏li +栗li +砾li +傈li +俐li +痢li +沥li +哩li +鬲*li +俪li +俚li +郦li +坜li +苈li +莅li +蓠li +藜li +呖li +唳li +喱li +猁li +悝*li +溧li +澧li +逦li +娌li +嫠li +骊li +缡li +枥li +栎li +轹li +戾li +砺li +詈li +罹li +锂li +鹂li +疠li +疬li +蛎li +蜊li +蠡li +笠li +篥li +粝li +醴li +跞li +雳li +鲡li +鳢li +黧li +俩lia +连lian +联lian +练lian +炼lian +脸lian +链lian +莲lian +镰lian +廉lian +怜lian +涟lian +帘lian +敛lian +恋lian +蔹lian +奁lian +潋lian +濂lian +琏lian +楝lian +殓lian +臁lian +裢lian +裣lian +蠊lian +鲢lian +立案lian +恋爱lianai +联邦lianbang +练兵lianbing +联播lianbo +练达lianda +连队liandui +量liang +两liang +粮liang +良liang +亮liang +梁liang +凉liang +辆liang +粱liang +晾liang +谅liang +墚liang +莨*liang +椋liang +踉liang +靓liang +魉liang +炼钢liangang +两半liangban +量变liangbian +两边liangbian +两便liangbian +两侧liangce +两次liangci +两地liangdi +两点liangdian +量度liangdu +良方liangfang +两广liangguang +良好lianghao +两极liangji +良机liangji +谅解liangjie +量具liangju +凉快liangkuai +两立liangli +两面liangmian +练功liangong +两栖liangqi +两讫liangqi +两全liangquan +粮食liangshi +两手liangshou +凉爽liangshuang +亮堂liangtang +两条liangtiao +两头liangtou +连贯lianguan +联贯lianguan +亮相liangxiang +良心liangxin +两性liangxing +量刑liangxing +两样liangyang +粮油liangyou +良缘liangyuan +粮站liangzhan +两者liangzhe +两重liangzhong +良种liangzhong +量子liangzi +联合lianhe +联欢lianhuan +廉价lianjia +联结lianjie +连接lianjie +联接lianjie +廉洁lianjie +联军lianjun +连累lianlei +联络lianluo +连忙lianmang +联盟lianmeng +怜悯lianmin +连年liannian +脸谱lianpu +连日lianri +炼乳lianru +联赛liansai +脸色lianse +连锁liansuo +练武lianwu +联系lianxi +练习lianxi +怜惜lianxi +联想lianxiang +连续lianxu +涟漪lianyi +联姻lianyin +联营lianying +炼油lianyou +联运lianyun +连载lianzai +了*liao +料liao +疗liao +辽liao +僚liao +撩liao +聊liao +燎liao +寥liao +潦liao +撂liao +镣liao +廖liao +蓼liao +尥liao +嘹liao +獠liao +寮liao +缭liao +钌liao +鹩liao +撩拨liaobo +潦草liaocao +疗程liaocheng +料到liaodao +潦倒liaodao +料定liaoding +了结liaojie +了解liaojie +辽阔liaokuo +料理liaoli +寥寥liaoliao +寥落liaoluo +辽宁liaoning +了却liaoque +了事liaoshi +聊天liaotian +料想liaoxiang +疗养liaoyang +礼拜libai +利弊libi +里边libian +理财licai +理睬licai +立场lichang +里程licheng +历程licheng +立春lichun +历次lici +历代lidai +理当lidang +立冬lidong +列lie +裂lie +烈lie +劣lie +猎lie +冽lie +埒lie +捩lie +咧lie +洌lie +趔lie +躐lie +鬣lie +裂变liebian +列车lieche +列出liechu +列岛liedao +裂缝liefeng +列国lieguo +烈火liehuo +劣迹lieji +列举lieju +裂开liekai +裂口liekou +列宁liening +猎奇lieqi +列强lieqiang +猎取liequ +烈日lieri +列入lieru +劣绅lieshen +烈士lieshi +劣势lieshi +烈属lieshu +裂纹liewen +列席liexi +烈性liexing +立法lifa +立方lifang +礼服lifu +立功ligong +利害lihai +厉害lihai +理化lihua +礼花lihua +理会lihui +离婚lihun +立即liji +理解lijie +礼节lijie +历届lijie +力矩liju +离开likai +理科like +立刻like +理亏likui +历来lilai +历历lili +力量liliang +利率lilu +理论lilun +立论lilun +礼貌limao +里面limian +利民limin +黎民limin +黎明liming +林lin +磷lin +临lin +邻lin +淋lin +麟lin +琳lin +霖lin +鳞lin +凛lin +赁lin +吝lin +蔺lin +啉lin +嶙lin +廪lin +懔lin +遴lin +檩lin +辚lin +膦lin +瞵lin +粼lin +躏lin +淋巴linba +临别linbie +淋病linbing +林场linchang +临床linchuang +临到lindao +领ling +另ling +零ling +令ling +灵ling +岭ling +铃ling +龄ling +凌ling +棱*ling +陵ling +拎ling +玲ling +菱ling +伶ling +羚ling +酃ling +苓ling +呤ling +囹ling +泠ling +绫ling +柃ling +棂ling +瓴ling +聆ling +蛉ling +翎ling +鲮ling +令爱lingai +凌晨lingchen +灵丹lingdan +领导lingdao +领地lingdi +零点lingdian +领队lingdui +灵感linggan +领海linghai +领航linghang +领会linghui +灵魂linghun +灵活linghuo +灵机lingji +零件lingjian +领教lingjiao +灵杰lingjie +领空lingkong +凌空lingkong +玲珑linglong +零乱lingluan +凌乱lingluan +领略linglue +灵敏lingmin +陵墓lingmu +灵巧lingqiao +领取lingqu +令人lingren +凌辱lingru +零散lingsan +领事lingshi +领受lingshou +领司lingsi +零碎lingsui +灵堂lingtang +零头lingtou +领土lingtu +磷光linguang +另外lingwai +领悟lingwu +领先lingxian +领衔lingxian +零星lingxing +领袖lingxiu +另选lingxuan +灵验lingyan +领域lingyu +令尊lingzun +磷火linhuo +历年linian +临界linjie +临近linjin +邻近linjin +邻里linli +淋漓linli +凛冽linlie +临摹linmo +里弄linong +鳞伤linshang +临时linshi +临死linsi +吝惜linxi +临行linxing +林业linye +临战linzhan +临终linzhong +礼炮lipao +李鹏lipeng +礼品lipin +力气liqi +离奇liqi +力求liqiu +立秋liqiu +历任liren +例如liru +利润lirun +离散lisan +理事lishi +历史lishi +隶属lishu +礼堂litang +立体liti +例题liti +力图litu +流liu +六liu +留liu +刘liu +硫liu +柳liu +陆*liu +馏liu +瘤liu +溜liu +琉liu +榴liu +碌*liu +浏liu +遛liu +骝liu +绺liu +旒liu +熘liu +锍liu +镏liu +鹨liu +鎏liu +留步liubu +流产liuchan +流畅liuchang +流程liucheng +流传liuchuan +流窜liucuan +流动liudong +流毒liudu +流放liufang +六届liujie +浏览liulan +流利liuli +留恋liulian +流露liulu +流落liuluo +流氓liumang +留念liunian +流失liushi +流逝liushi +流体liuti +流通liutong +流亡liuwang +流泻liuxie +留心liuxin +流行liuxing +流星liuxing +留学liuxue +流血liuxue +流言liuyan +留言liuyan +留洋liuyang +留影liuying +留用liuyong +流域liuyu +六月liuyue +流转liuzhuan +例外liwai +礼物liwu +利息lixi +立夏lixia +理想lixiang +立新lixin +离心lixin +理性lixing +力行lixing +厉行lixing +离休lixiu +立意liyi +利益liyi +离异liyi +利用liyong +理由liyou +力争lizheng +立正lizheng +理智lizhi +立志lizhi +离职lizhi +例子lizi +粒子lizi +立足lizu +屡见不鲜ljbx +两极分化ljfh +逻辑设计ljsj +逻辑思维ljsw +逻辑性ljx +灵机一动ljyd +落落大方lldf +拦路虎llh +来龙去脉llqm +零零碎碎llss +来来往往llww +联绵不断lmbd +灵敏度lmd +辽宁省lns +列宁主义lnzy +龙long +垄long +弄*long +笼long +隆long +聋long +咙long +窿long +拢long +陇long +垅long +茏long +泷long +珑long +栊long +胧long +砻long +癃long +隆冬longdong +垄断longduan +隆隆longlong +笼络longluo +笼统longtong +笼罩longzhao +隆重longzhong +漏lou +露*lou +楼lou +娄lou +搂lou +篓lou +陋lou +偻lou +蒌lou +喽lou +嵝lou +镂lou +瘘lou +耧lou +蝼lou +髅lou +漏洞loudong +漏斗loudou +镂空loukong +漏网louwang +来日方长lrfc +来人来函lrlh +了如指掌lrzz +理所当然lsdr +连锁反应lsfy +领事馆lsg +理事会lsh +力所能及lsnj +拉萨市lss +流水线lsx +良师益友lsyy +路lu +六*lu +率lu +露lu +绿lu +炉lu +律lu +虑lu +滤lu +陆lu +氯lu +鲁lu +铝lu +录lu +旅lu +卢lu +吕lu +芦lu +颅lu +庐lu +掳lu +卤lu +虏lu +麓lu +碌lu +赂lu +鹿lu +潞lu +禄lu +戮lu +驴lu +侣lu +履lu +屡lu +缕lu +垆lu +蓼*lu +撸lu +噜lu +闾lu +泸lu +渌lu +漉lu +逯lu +璐lu +栌lu +榈lu +橹lu +轳lu +辂lu +辘lu +氇lu +胪lu +膂lu +镥lu +稆lu +鸬lu +鹭lu +褛lu +簏lu +舻lu +鲈lu +卵luan +乱luan +峦luan +挛luan +孪luan +滦luan +脔luan +娈luan +栾luan +鸾luan +銮luan +卵巢luanchao +乱伦luanlun +乱子luanzi +旅伴luban +路标lubiao +路程lucheng +旅程lucheng +露出luchu +屡次luci +陆地ludi +露底ludi +旅店ludian +略lue +掠lue +锊lue +掠夺lueduo +旅费lufei +露骨lugu +旅馆luguan +路过luguo +绿化luhua +炉火luhuo +路径lujing +路局luju +陆军lujun +旅客luke +履历luli +率领luling +鲁莽lumang +露面lumian +论lun +轮lun +伦lun +抡lun +仑lun +沦lun +纶lun +囵lun +论处lunchu +轮船lunchuan +论点lundian +论调lundiao +伦敦lundun +轮换lunhuan +论据lunju +轮廓lunkuo +论理lunli +伦理lunli +轮流lunliu +论述lunshu +轮胎luntai +论坛luntan +沦为lunwei +论文lunwen +沦陷lunxian +轮训lunxun +论战lunzhan +论正lunzheng +论证lunzheng +轮轴lunzhou +论著lunzhu +落luo +罗luo +螺luo +洛luo +络luo +逻luo +咯*luo +烙*luo +萝luo +锣luo +箩luo +骡luo +裸luo +骆luo +倮luo +蠃luo +荦luo +捋luo +摞luo +猡luo +泺luo +漯luo +珞luo +椤luo +脶luo +硌*luo +镙luo +瘰luo +雒luo +萝卜luobu +落成luocheng +螺钉luoding +罗汉luohan +落后luohou +落户luohu +逻辑luoji +落空luokong +落款luokuan +箩筐luokuang +罗列luolie +罗马luoma +螺母luomu +罗盘luopan +落泊luopo +落实luoshi +螺栓luoshuan +裸体luoti +骆驼luotuo +罗网luowang +螺纹luowen +落伍luowu +落选luoxuan +螺旋luoxuan +络绎luoyi +录取luqu +路人luren +绿色luse +庐山lushan +旅社lushe +律师lushi +露天lutian +路途lutu +旅途lutu +路线luxian +率先luxian +录像luxiang +旅行luxing +履行luxing +陆续luxu +录音luyin +绿荫luyin +录用luyong +旅游luyou +绿洲luzhou +露珠luzhu +路子luzi +炉子luzi +另行安排lxap +例行公事lxgs +联系人lxr +留学生lxs +另行通知lxtz +林业部lyb +老一辈lyb +另一方面lyfm +劳逸结合lyjh +利用率lyl +老一套lyt +留有余地lyyd +来者不拒lzbj +立足点lzd +老中青lzq +理直气壮lzqz +兰州市lzs +两重性lzx +面m +命m +们m +民m +毛m +没m +米m +明m +马m +么m +每m +门m +名m +磨m +美m +密m +苗m +满m +亩m +目m +呒m +马ma +么*ma +麻ma +吗ma +妈ma +骂ma +嘛ma +码ma +摩*ma +抹*ma +玛ma +蚂ma +唛ma +犸ma +嬷ma +杩ma +蟆ma +马鞍maan +麻痹mabi +马达mada +麻烦mafan +麻纺mafang +马虎mahu +麦mai +脉mai +卖mai +买mai +埋mai +迈mai +劢mai +荬mai +霾mai +买办maiban +脉搏maibo +迈步maibu +埋藏maicang +脉冲maichong +脉动maidong +埋伏maifu +卖国maiguo +脉络mailuo +买卖maimai +卖命maiming +埋没maimo +卖弄mainong +埋头maitou +卖淫maiyin +埋怨maiyuan +埋葬maizang +买帐maizhang +卖座maizuo +马力mali +麻利mali +马路malu +妈妈mama +麻木mamu +满man +慢man +曼man +漫man +蔓man +瞒man +馒man +蛮man +谩man +墁man +幔man +缦man +熳man +镘man +颟man +螨man +鳗man +鞔man +漫长manchang +忙mang +芒mang +盲mang +茫mang +氓mang +莽mang +邙mang +漭mang +硭mang +蟒mang +忙碌manglu +莽莽mangmang +盲目mangmu +茫然mangran +盲人mangren +忙于mangyu +莽原mangyuan +蛮横manheng +漫画manhua +满怀manhuai +谩骂manma +满目manmu +满腔manqiang +蔓延manyan +满意manyi +满载manzai +满足manzu +毛mao +矛mao +冒mao +貌mao +贸mao +帽mao +猫mao +茅mao +锚mao +铆mao +卯mao +茂mao +袤mao +茆mao +峁mao +泖mao +瑁mao +昴mao +牦mao +耄mao +旄mao +懋mao +瞀mao +蟊mao +髦mao +毛病maobing +毛糙maocao +冒充maochong +铆钉maoding +矛盾maodun +冒犯maofan +毛纺maofang +冒号maohao +冒尖maojian +冒进maojin +茅坑maokeng +毛利maoli +冒昧maomei +茂密maomi +冒牌maopai +毛坯maopi +贸然maoran +茂盛maosheng +冒失maoshi +矛头maotou +冒险maoxian +贸易maoyi +冒雨maoyu +毛重maozhong +帽子maozi +马上mashang +马桶matong +码头matou +马戏maxi +麻醉mazui +免不了mbl +明辨是非mbsf +满不在乎mbzh +默不作声mbzs +满城风雨mcfy +目的地mdd +目瞪口呆mdkd +描淡写mdx +么me +麽me +秘而不宣mebx +没mei +每mei +美mei +煤mei +霉mei +酶mei +梅mei +妹mei +眉mei +玫mei +枚mei +媒mei +镁mei +昧mei +寐mei +媚mei +糜*mei +谜*mei +莓mei +嵋mei +猸mei +浼mei +湄mei +楣mei +镅mei +鹛mei +袂mei +魅mei +每次meici +每当meidang +美德meide +没法meifa +每逢meifeng +每个meige +美观meiguan +玫瑰meigui +美国meiguo +美好meihao +美化meihua +媒介meijie +眉睫meijie +枚举meiju +煤矿meikuang +霉烂meilan +魅力meili +美丽meili +美满meiman +眉毛meimao +美貌meimao +妹妹meimei +美妙meimiao +眉目meimu +每年meinian +煤气meiqi +每人meiren +每日meiri +美容meirong +眉梢meishao +每时meishi +美术meishu +媒妁meishuo +煤炭meitan +每天meitian +煤田meitian +美学meixue +没有meiyou +煤油meiyou +美元meiyuan +每月meiyue +没治meizhi +每周meizhou +们men +门men +闷men +扪men +焖men +懑men +钔men +门房menfang +孟meng +猛meng +蒙meng +盟meng +梦meng +萌meng +锰meng +氓*meng +檬meng +勐meng +甍meng +瞢meng +懵meng +朦meng +礞meng +虻meng +蜢meng +蠓meng +艋meng +艨meng +蒙蔽mengbi +萌发mengfa +蒙古menggu +盟国mengguo +梦幻menghuan +蒙混menghun +梦见mengjian +猛进mengjin +梦境mengjing +猛烈menglie +蒙胧menglong +蒙昧mengmei +猛然mengran +萌生mengsheng +猛士mengshi +蒙受mengshou +梦想mengxiang +梦乡mengxiang +猛醒mengxing +萌芽mengya +盟友mengyou +盟约mengyue +猛增mengzeng +门户menhu +门路menlu +门牌menpai +门票menpiao +闷气menqi +门诊menzhen +名副其实mfqs +眉飞色舞mfsw +没关系mgx +蒙古族mgz +蒙混过关mhgg +米mi +密mi +迷mi +蜜mi +秘mi +眯mi +醚mi +靡mi +糜mi +谜mi +弥mi +觅mi +泌mi +幂mi +芈mi +谧mi +蘼mi +咪mi +嘧mi +猕mi +汨mi +宓mi +弭mi +脒mi +祢mi +敉mi +糸mi +縻mi +麋mi +面mian +棉mian +免mian +绵mian +眠mian +冕mian +勉mian +娩mian +缅mian +沔mian +渑mian +湎mian +腼mian +眄mian +面部mianbu +免除mianchu +免得miande +面对miandui +面额miane +棉花mianhua +缅怀mianhuai +面积mianji +面具mianju +面孔miankong +勉励mianli +面临mianlin +面貌mianmao +面面mianmian +绵绵mianmian +面目mianmu +面庞mianpang +面前mianqian +勉强mianqiang +面容mianrong +面色mianse +棉纱miansha +面授mianshou +免税mianshui +面谈miantan +面向mianxiang +免刑mianxing +棉絮mianxu +绵延mianyan +面议mianyi +免疫mianyi +面罩mianzhao +免职mianzhi +面子mianzi +苗miao +秒miao +描miao +庙miao +妙miao +瞄miao +藐miao +渺miao +喵miao +邈miao +缈miao +缪miao +杪miao +淼miao +眇miao +鹋miao +秒表miaobiao +描绘miaohui +妙龄miaoling +渺茫miaomang +描摹miaomo +藐视miaoshi +描述miaoshu +苗条miaotiao +苗头miaotou +描写miaoxie +瞄准miaozhun +弥补mibu +谜底midi +密度midu +灭mie +蔑mie +乜*mie +咩mie +蠛mie +篾mie +灭火miehuo +灭迹mieji +灭绝miejue +灭口miekou +蔑视mieshi +灭亡miewang +密封mifeng +蜜蜂mifeng +眯缝mifeng +迷航mihang +迷糊mihu +迷惑mihuo +密集miji +密件mijian +迷津mijin +秘诀mijue +糜烂milan +迷恋milian +密令miling +迷路milu +密码mima +迷漫miman +弥漫miman +秘密mimi +汨汨mimi +谜面mimian +密谋mimou +民min +敏min +抿min +皿min +悯min +闽min +苠min +岷min +闵min +泯min +缗min +玟min +珉min +愍min +黾min +鳘min +民办minban +民兵minbing +民法minfa +民愤minfen +民风minfeng +命ming +明ming +名ming +鸣ming +螟ming +盟*ming +铭ming +冥ming +茗ming +溟ming +暝ming +瞑ming +酩ming +敏感mingan +明白mingbai +名册mingce +名称mingcheng +明处mingchu +名次mingci +名词mingci +名单mingdan +明灯mingdeng +民歌minge +名额minge +名贵minggui +铭记mingji +名家mingjia +铭刻mingke +明快mingkuai +明朗minglang +名利mingli +明亮mingliang +明了mingliao +命令mingling +名流mingliu +明码mingma +明媚mingmei +明明mingming +名目mingmu +明年mingnian +名牌mingpai +名片mingpian +名气mingqi +明确mingque +明人mingren +名人mingren +名胜mingsheng +名声mingsheng +名堂mingtang +明天mingtian +名望mingwang +明文mingwen +明细mingxi +明显mingxian +鸣谢mingxie +明星mingxing +名言mingyan +名义mingyi +名誉mingyu +命运mingyun +明知mingzhi +明智mingzhi +明珠mingzhu +名著mingzhu +名字mingzi +民航minhang +民间minjian +敏捷minjie +民警minjing +民情minqing +敏锐minrui +民事minshi +民心minxin +民意minyi +民用minyong +民运minyun +民政minzheng +民众minzhong +民主minzhu +民族minzu +密切miqie +迷人miren +迷失mishi +秘书mishu +密探mitan +迷途mitu +谬miu +谬论miulun +谬误miuwu +迷惘miwang +迷雾miwu +迷信mixin +密友miyou +谜语miyu +蜜月miyue +马克思mks +眉开眼笑mkyx +马列主义mlzy +满面春风mmcf +马马虎虎mmhh +面面俱到mmjd +莫名其妙mmqm +默默无闻mmww +明目张胆mmzd +无*mo +磨mo +没*mo +万*mo +末mo +模mo +膜mo +摸mo +墨mo +摩mo +脉*mo +莫mo +抹mo +冒*mo +默mo +貉*mo +嘿*mo +摹mo +蘑mo +魔mo +沫mo +漠mo +寞mo +陌mo +谟mo +茉mo +蓦mo +馍mo +嫫mo +殁mo +镆mo +秣mo +瘼mo +耱mo +貊mo +貘mo +默哀moai +莫不mobu +磨擦moca +摩擦moca +磨蹭moceng +莫大moda +磨刀modao +摩登modeng +摸底modi +模范mofan +模仿mofang +摹仿mofang +莫非mofei +魔鬼mogui +模糊mohu +墨迹moji +模块mokuai +磨砺moli +磨练molian +末了moliao +末路molu +没落moluo +磨灭momie +默默momo +磨难monan +模拟moni +摹拟moni +末期moqi +默契moqi +默然moran +漠然moran +默认moren +末日mori +莫如moru +抹杀mosha +抹煞mosha +末梢moshao +陌生mosheng +模式moshi +没收moshou +魔术moshu +磨损mosun +摸索mosuo +模特mote +摩托motuo +某mou +谋mou +牟mou +侔mou +哞mou +缪*mou +眸mou +蛑mou +蝥mou +鍪mou +某地moudi +某个mouge +谋害mouhai +谋划mouhua +某军moujun +牟利mouli +谋略moulue +谋求mouqiu +牟取mouqu +谋杀mousha +谋生mousheng +某些mouxie +末尾mowei +默写moxie +模型moxing +默许moxu +模样moyang +魔掌mozhang +模子mozi +妙趣横生mqhs +门市部msb +名胜古迹msgj +妙手回春mshc +莫斯科msk +没什么msm +每时每刻msmk +秘书长msz +没事找事mszs +摩托车mtc +埋头工作mtgz +埋头苦干mtkg +亩mu +目mu +木mu +母mu +墓mu +模*mu +幕mu +牧mu +姆mu +穆mu +姥*mu +牟*mu +拇mu +牡mu +暮mu +募mu +慕mu +睦mu +仫mu +坶mu +苜mu +沐mu +毪mu +钼mu +母爱muai +墓碑mubei +目标mubiao +木材mucai +牧草mucao +目测muce +牧场muchang +目次muci +牡丹mudan +目的mudi +牧歌muge +目光muguang +幕后muhou +目击muji +募集muji +木刻muke +木料muliao +幕僚muliao +目录mulu +牧民mumin +木讷mune +木偶muou +目前muqian +母亲muqin +牧区muqu +木然muran +暮色muse +牧师mushi +目送musong +牧童mutong +牧业muye +沐浴muyu +民意测验mycy +贸易市场mysc +贸易协定myxd +民政部mzb +美中不足mzbz +毛泽东mzd +满载而归mzeg +明知故犯mzgf +毛织品mzp +目中无人mzwr +毛主席mzx +年n +能n +内n +那n +农n +你n +南n +难n +呢n +女n +泥n +哪n +拿n +念n +牛n +宁n +脑n +粘n +尼n +纳n +嗯n +那na +南na +哪na +拿na +纳na +呢*na +钠na +呐na +娜na +捺na +肭na +镎na +衲na +那边nabian +纳粹nacui +哪儿naer +那个nage +哪个nage +呐喊nahan +哪会nahui +耐nai +哪*nai +奶nai +乃nai +氖nai +奈nai +鼐nai +艿nai +萘nai +柰nai +耐烦naifan +奈何naihe +耐久naijiu +耐劳nailao +奶奶nainai +耐心naixin +耐性naixing +耐用naiyong +奶油naiyou +乃至naizhi +那里nali +哪里nali +那么name +南nan +难nan +男nan +喃nan +囝nan +囡nan +楠nan +腩nan +蝻nan +赧nan +难办nanban +南北nanbei +南边nanbian +难产nanchan +南昌nanchang +难处nanchu +难道nandao +难得nande +难点nandian +难度nandu +哪能naneng +南方nanfang +南非nanfei +难分nanfen +南风nanfeng +囊nang +攮nang +囔nang +馕nang +曩nang +囊括nangkuo +难怪nanguai +难关nanguan +南国nanguo +难过nanguo +南海nanhai +南货nanhuo +南极nanji +难解nanjie +南京nanjing +难看nankan +难堪nankan +南面nanmian +难免nanmian +难民nanmin +南宁nanning +男女nannu +赧然nanran +男人nanren +难色nanse +难事nanshi +难受nanshou +难说nanshuo +难题nanti +难听nanting +难为nanwei +男性nanxing +南亚nanya +南洋nanyang +难以nanyi +难友nanyou +难于nanyu +脑nao +闹nao +努*nao +挠nao +恼nao +淖nao +孬nao +垴nao +呶nao +猱nao +瑙nao +硇nao +铙nao +蛲nao +脑袋naodai +脑海naohai +恼火naohuo +脑筋naojin +闹剧naoju +闹事naoshi +哪怕napa +纳入naru +那时nashi +拿手nashou +纳税nashui +那些naxie +哪些naxie +纳新naxin +那样nayang +哪样nayang +那种nazhong +年产量ncl +农产品ncp +南昌市ncs +难道说nds +呢ne +哪*ne +呐*ne +讷ne +内nei +那*nei +哪*nei +馁nei +内部neibu +内存neicun +内地neidi +内阁neige +内涵neihan +内行neihang +内奸neijian +内疚neijiu +内科neike +内乱neiluan +内幕neimu +内勤neiqin +内容neirong +内外neiwai +内销neixiao +内心neixin +内因neiyin +内应neiying +内在neizai +嫩nen +恁nen +能neng +能动nengdong +能否nengfou +能干nenggan +能够nenggou +能力nengli +能量nengliang +能耐nengnai +能人nengren +能手nengshou +能源nengyuan +能者nengzhe +农副产品nfcp +年富力强nflq +能工巧匠ngqj +你ni +泥ni +尼ni +呢*ni +逆ni +拟ni +尿ni +妮ni +霓ni +倪ni +匿ni +腻ni +溺ni +伲ni +坭ni +猊ni +怩ni +昵ni +旎ni +祢*ni +慝ni +睨ni +铌ni +鲵ni +年nian +念nian +粘nian +蔫nian +拈nian +碾nian +撵nian +捻nian +酿nian +廿nian +埝nian +辇nian +黏nian +鲇nian +鲶nian +年初nianchu +年代niandai +念叨niandao +年底niandi +年度niandu +年份nianfen +娘niang +年华nianhua +年画nianhua +年级nianji +年纪nianji +年鉴nianjian +年来nianlai +年利nianli +年历nianli +拈量nianliang +年龄nianling +年迈nianmai +年年niannian +年青nianqing +年轻nianqing +年岁niansui +年头niantou +念头niantou +年限nianxian +年月nianyue +酿造nianzao +年终nianzhong +尿niao +鸟niao +溺*niao +茑niao +嬲niao +脲niao +袅niao +鸟瞰niaokan +逆差nicha +你处nichu +你的nide +拟定niding +拟订niding +镍nie +啮nie +涅nie +捏nie +聂nie +孽nie +镊nie +乜nie +陧nie +蘖nie +嗫nie +颞nie +臬nie +蹑nie +捏造niezao +腻烦nifan +泥浆nijiang +逆境nijing +泥坑nikeng +逆流niliu +你们nimen +您nin +宁ning +凝ning +拧ning +柠ning +狞ning +泞ning +佞ning +苎ning +咛ning +甯ning +聍ning +凝固ninggu +凝结ningjie +宁静ningjing +凝聚ningju +宁可ningke +宁肯ningken +宁日ningri +凝视ningshi +凝望ningwang +宁夏ningxia +宁愿ningyuan +泥泞nining +泥塑nisu +牛niu +扭niu +钮niu +纽niu +拗*niu +狃niu +忸niu +妞niu +纽带niudai +牛犊niudu +纽扣niukou +纽约niuyue +扭转niuzhuan +腻味niwei +你我niwo +拟议niyi +泥沼nizhao +逆转nizhuan +难解难分njnf +南京市njs +南极洲njz +扭亏为盈nkwy +脑力劳动nlld +年老体弱nltr +内蒙古nmg +农贸市场nmsc +那么些nmx +那么样nmy +念念不忘nnbw +难能可贵nnkg +南宁市nns +农nong +弄nong +浓nong +脓nong +侬nong +哝nong +脓包nongbao +农村nongcun +浓度nongdu +农妇nongfu +浓厚nonghou +农会nonghui +农活nonghuo +农具nongju +农历nongli +农林nonglin +农忙nongmang +农民nongmin +弄清nongqing +农时nongshi +农药nongyao +农业nongye +农艺nongyi +浓郁nongyu +耨nou +年轻化nqh +年轻人nqr +那时候nsh +能说会道nshd +南斯拉夫nslf +能上能下nsnx +逆水行舟nsxz +农田水利ntsl +女nu +奴nu +努nu +怒nu +弩nu +胬nu +孥nu +驽nu +恧nu +钕nu +衄nu +暖nuan +暖和nuanhe +暖流nuanliu +暖气nuanqi +奴婢nubi +奴才nucai +虐nue +虐待nuedai +虐疾nueji +女儿nuer +女工nugong +怒吼nuhou +奴化nuhua +怒火nuhuo +努力nuli +奴隶nuli +诺nuo +娜*nuo +挪nuo +懦nuo +糯nuo +傩nuo +搦nuo +喏nuo +锘nuo +挪用nuoyong +奴仆nupu +女人nuren +女色nuse +女士nushi +女性nuxing +女婿nuxu +女子nuzi +能文能武nwnw +弄虚作假nxzj +农作物nzw +你争我夺nzwd +欧o +偶o +哦o +鸥o +殴o +藕o +呕o +沤o +讴o +噢o +怄o +瓯o +耦o +偶然性orx +区*ou +欧ou +偶ou +鸥ou +殴ou +藕ou +呕ou +沤ou +讴ou +怄ou +瓯ou +耦ou +殴打ouda +偶尔ouer +讴歌ouge +偶合ouhe +耦合ouhe +欧姆oumu +怄气ouqi +偶然ouran +藕色ouse +偶数oushu +呕吐outu +欧阳ouyang +欧洲ouzhou +批p +平p +判p +配p +片p +派p +破p +排p +品p +皮p +喷p +盘p +偏p +评p +怕p +培p +普p +贫p +跑p +炮p +怕pa +派pa +爬pa +帕pa +扒*pa +耙*pa +啪pa +趴pa +琶pa +葩pa +杷pa +钯*pa +筢pa +派pai +排pai +拍pai +牌pai +迫*pai +哌pai +徘pai +湃pai +俳pai +蒎pai +排版paiban +拍板paiban +排比paibi +派别paibie +排场paichang +排斥paichi +排除paichu +排队paidui +牌号paihao +徘徊paihuai +排挤paiji +牌价paijia +排列pailie +拍卖paimai +派遣paiqian +排球paiqiu +派生paisheng +派头paitou +排外paiwai +排泄paixie +排演paiyan +牌照paizhao +判pan +盘pan +叛pan +番*pan +潘pan +攀pan +磐pan +盼pan +畔pan +胖pan +拚*pan +爿pan +泮pan +袢pan +襻pan +蟠pan +蹒pan +叛变panbian +判别panbie +盘缠panchan +盘存pancun +叛党pandang +攀登pandeng +盘点pandian +判定panding +判断panduan +攀附panfu +旁pang +膀*pang +磅*pang +乓pang +庞pang +耪pang +胖pang +彷pang +滂pang +逄pang +螃pang +旁边pangbian +庞大pangda +盘亘pangen +旁观pangguan +旁听pangting +旁通pangtong +滂沱pangtuo +庞杂pangza +盘踞panju +判决panjue +叛乱panluan +判明panming +叛逆panni +盘算pansuan +蟠桃pantao +叛徒pantu +盼望panwang +判刑panxing +盘旋panxuan +跑pao +炮pao +刨pao +抛pao +泡pao +咆pao +袍pao +匏pao +狍pao +庖pao +脬pao +疱pao +炮兵paobing +跑步paobu +炮弹paodan +跑道paodao +抛光paoguang +炮火paohuo +炮击paoji +抛锚paomao +泡沫paomo +抛弃paoqi +炮手paoshou +炮台paotai +炮艇paoting +咆哮paoxiao +泡影paoying +炮仗paozhang +炮制paozhi +怕死pasi +疲惫不堪pbbk +迫不急待pbjd +破除迷信pcmx +平等互利pdhl +配pei +培pei +陪pei +胚pei +呸pei +裴pei +赔pei +佩pei +沛pei +辔pei +帔pei +旆pei +锫pei +醅pei +霈pei +陪伴peiban +配备peibei +赔本peiben +赔偿peichang +陪衬peichen +配方peifang +佩服peifu +配合peihe +配给peiji +配件peijian +配角peijiao +赔款peikuan +赔礼peili +配偶peiou +陪审peishen +陪送peisong +胚胎peitai +配套peitao +陪同peitong +培训peixun +培养peiyang +配音peiyin +培育peiyu +配乐peiyue +陪葬peizang +配制peizhi +配置peizhi +培植peizhi +喷pen +盆pen +湓pen +盆地pendi +碰peng +棚peng +蓬peng +朋peng +捧peng +膨peng +砰peng +抨peng +烹peng +澎peng +彭peng +硼peng +篷peng +鹏peng +堋peng +嘭peng +怦peng +蟛peng +碰杯pengbei +碰壁pengbi +蓬勃pengbo +捧场pengchang +抨击pengji +蓬莱penglai +蓬乱pengluan +澎湃pengpai +烹饪pengren +硼砂pengsha +蓬松pengsong +烹调pengtiao +朋友pengyou +膨胀pengzhang +喷溅penjian +盆景penjing +喷射penshe +喷嚏penti +平方公里pfgl +平分秋色pfqs +批pi +皮pi +坏*pi +否*pi +辟*pi +坯pi +脾pi +疲pi +砒pi +霹pi +披pi +劈pi +琵pi +毗pi +啤pi +匹pi +痞pi +僻pi +屁pi +譬pi +丕pi +仳pi +陂*pi +陴pi +邳pi +郫pi +圮pi +埤*pi +鼙pi +芘pi +擗pi +吡*pi +噼pi +庀pi +淠pi +媲pi +纰pi +枇pi +甓pi +睥pi +罴pi +铍pi +癖pi +裨*pi +疋pi +蚍pi +蜱pi +貔pi +片pian +偏pian +便*pian +篇pian +骗pian +扁*pian +谝pian +骈pian +缏*pian +犏pian +胼pian +翩pian +蹁pian +偏差piancha +片断pianduan +片段pianduan +偏废pianfei +篇幅pianfu +偏激pianji +偏见pianjian +骗局pianju +片刻pianke +偏离pianli +片面pianmian +偏旁pianpang +偏僻pianpi +偏颇pianpo +骗取pianqu +骗人pianren +骗术pianshu +偏袒piantan +翩跹pianxian +偏向pianxiang +偏移pianyi +便宜pianyi +篇章pianzhang +骗子pianzi +票piao +漂piao +朴*piao +飘piao +瓢piao +剽piao +莩*piao +嘌piao +嫖piao +骠*piao +缥piao +殍piao +瞟piao +螵piao +漂泊piaobo +票房piaofang +漂浮piaofu +票价piaojia +票据piaoju +漂亮piaoliang +漂流piaoliu +飘流piaoliu +飘落piaoluo +票面piaomian +飘渺piaomiao +飘泊piaopo +剽窃piaoqie +飘然piaoran +飘散piaosan +飘扬piaoyang +飘游piaoyou +疲惫pibei +批驳pibo +撇pie +瞥pie +丿pie +苤pie +氕pie +批发pifa +批复pifu +皮肤pifu +皮革pige +屁股pigu +疲倦pijuan +疲劳pilao +纰漏pilou +披露pilu +品pin +贫pin +频pin +拼pin +苹pin +聘pin +拚pin +姘pin +嫔pin +榀pin +牝pin +颦pin +品尝pinchang +频传pinchuan +拼凑pincou +频带pindai +频道pindao +品德pinde +贫乏pinfa +频繁pinfan +平ping +评ping +瓶ping +凭ping +苹ping +冯*ping +乒ping +坪ping +萍ping +屏ping +俜ping +娉ping +枰ping +鲆ping +平安pingan +评比pingbi +屏蔽pingbi +平常pingchang +平川pingchuan +平淡pingdan +平等pingdeng +平地pingdi +平定pingding +评定pingding +品格pinge +平反pingfan +平凡pingfan +平方pingfang +平分pingfen +评分pingfen +评功pinggong +平衡pingheng +评级pingji +平价pingjia +评价pingjia +评奖pingjiang +凭借pingjie +平静pingjing +平均pingjun +平空pingkong +凭空pingkong +评理pingli +评论pinglun +平面pingmian +平民pingmin +屏幕pingmu +评判pingpan +乒乓pingpang +平平pingping +平壤pingrang +平日pingri +平时pingshi +平手pingshou +评说pingshuo +平素pingsu +平坦pingtan +乒坛pingtan +平稳pingwen +平息pingxi +萍乡pingxiang +平行pingxing +平易pingyi +评议pingyi +平庸pingyong +平原pingyuan +平仄pingze +屏障pingzhang +凭着pingzhe +平整pingzheng +凭证pingzheng +评注pingzhu +贫寒pinhan +品级pinji +贫困pinkun +频率pinlu +品貌pinmao +拼命pinming +品名pinming +品评pinping +聘请pinqing +贫穷pinqiong +聘任pinren +聘书pinshu +拼写pinxie +品行pinxing +品性pinxing +拼音pinyin +品质pinzhi +品种pinzhong +批判pipan +匹配pipei +批评piping +脾气piqi +譬如piru +疲软piruan +批示pishi +脾胃piwei +脾性pixing +辟谣piyao +批语piyu +批阅piyue +批注pizhu +批准pizhun +平均数pjs +披荆斩棘pjzj +评论员ply +跑马观花pmgh +破po +迫po +坡po +泼po +繁*po +朴*po +泊*po +颇po +婆po +魄po +粕po +叵po +陂*po +鄱po +泺*po +珀po +攴po +钋po +钷po +钹*po +皤po +笸po +破案poan +破产pochan +破除pochu +坡度podu +泼妇pofu +破格poge +迫害pohai +破坏pohuai +破获pohuo +迫近pojin +破旧pojiu +泼辣pola +破烂polan +魄力poli +破例poli +破裂polie +破灭pomie +迫切poqie +迫使poshi +破碎posui +破损posun +破土potu +剖pou +裒pou +掊pou +剖解poujie +剖析pouxi +破绽pozhan +蓬蓬勃勃ppbb +普普通通pptt +旁若无人prwr +普通话pth +抛头露面ptlm +普pu +谱pu +扑pu +埔pu +铺pu +暴*pu +葡pu +朴pu +蒲pu +堡*pu +脯*pu +仆pu +莆pu +菩pu +圃pu +浦pu +曝pu +瀑pu +匍pu +噗pu +溥pu +濮pu +璞pu +氆pu +镤pu +镨pu +蹼pu +普遍pubian +普查pucha +扑哧puchi +扑打puda +铺盖pugai +普及puji +铺平puping +仆人puren +菩萨pusa +铺设pushe +朴实pushi +朴素pusu +葡萄putao +普通putong +扑通putong +铺位puwei +谱写puxie +普选puxuan +铺张puzhang +普照puzhao +朴直puzhi +平易近人pyjr +拼音字母pyzm +铺张浪费pzlf +起q +前q +其q +去q +气q +全q +期q +群q +情q +区q +强q +切q +取q +七q +求q +清q +确q +权q +且q +青q +亲爱的qad +情报所qbs +千百万qbw +千变万化qbwh +取长补短qcbd +千锤百炼qcbl +恰到好处qdhc +全党全军和全国qdqg +取而代之qedz +轻而易举qeyj +千方百计qfbj +清规戒律qgjl +勤工俭学qgjx +旗鼓相当qgxd +轻工业qgy +轻工业部qgyb +勤工助学qgzx +权衡利弊qhlb +骑虎难下qhnx +青海省qhs +青红皂白qhzb +起qi +其qi +气qi +期qi +七qi +器qi +齐qi +奇qi +汽qi +企qi +漆qi +欺qi +旗qi +畦qi +启qi +弃qi +歧qi +稽*qi +缉*qi +栖qi +戚qi +妻qi +凄qi +柒qi +沏qi +棋qi +崎qi +脐qi +祈qi +祁qi +骑qi +岂qi +乞qi +契qi +砌qi +迄qi +泣qi +讫qi +亟*qi +亓qi +俟qi +圻qi +芑qi +芪qi +荠*qi +萁qi +萋qi +葺qi +蕲qi +嘁qi +屺qi +岐qi +岖*qi +汔qi +淇qi +骐qi +绮qi +琪qi +琦qi +杞qi +桤qi +槭qi +耆qi +欹qi +祺qi +憩qi +碛qi +颀qi +蛴qi +蜞qi +綦qi +綮qi +蹊qi +鳍qi +麒qi +卡*qia +恰qia +掐qia +洽qia +伽*qia +葜qia +袷*qia +髂qia +恰当qiadang +恰好qiahao +前qian +千qian +钱qian +浅qian +签qian +迁qian +铅qian +潜qian +牵qian +钳qian +纤*qian +谴qian +扦qian +钎qian +仟qian +谦qian +乾qian +黔qian +遣qian +堑qian +嵌qian +欠qian +歉qian +倩qian +佥qian +阡qian +芊qian +芡qian +茜qian +荨qian +掮qian +岍qian +悭qian +慊qian +骞qian +搴qian +褰qian +缱qian +椠qian +犍*qian +肷qian +愆qian +钤qian +虔qian +箬qian +箝qian +前辈qianbei +前边qianbian +浅薄qianbo +钱财qiancai +欠产qianchan +前程qiancheng +签到qiandao +前敌qiandi +签订qianding +签发qianfa +遣返qianfan +前方qianfang +强qiang +将*qiang +枪qiang +抢qiang +墙qiang +腔qiang +呛qiang +羌qiang +蔷qiang +戕qiang +嫱qiang +樯qiang +戗qiang +炝qiang +锖qiang +锵qiang +镪qiang +襁qiang +蜣qiang +羟qiang +跄qiang +墙壁qiangbi +枪毙qiangbi +强辩qiangbian +强大qiangda +枪弹qiangdan +强盗qiangdao +强调qiangdiao +腔调qiangdiao +强度qiangdu +抢夺qiangduo +强攻qianggong +强国qiangguo +强化qianghua +强加qiangjia +强奸qiangjian +抢劫qiangjie +强劲qiangjin +抢救qiangjiu +枪决qiangjue +强烈qianglie +强迫qiangpo +强权qiangquan +强弱qiangruo +枪杀qiangsha +强盛qiangsheng +千古qiangu +牵挂qiangua +蔷薇qiangwei +抢险qiangxian +强行qiangxing +强硬qiangying +强占qiangzhan +强者qiangzhe +强制qiangzhi +枪支qiangzhi +强壮qiangzhuang +前后qianhou +前进qianjin +前景qianjing +迁就qianjiu +歉疚qianjiu +迁居qianju +乾坤qiankun +千里qianli +前例qianli +潜力qianli +牵连qianlian +前列qianlie +浅陋qianlou +前面qianmian +签名qianming +前年qiannian +前期qianqi +千秋qianqiu +前驱qianqu +欠缺qianque +前人qianren +前任qianren +纤弱qianruo +前哨qianshao +牵涉qianshe +歉收qianshou +签署qianshu +遣送qiansong +前提qianti +前天qiantian +欠条qiantiao +前途qiantu +千瓦qianwa +千万qianwan +前往qianwang +前夕qianxi +纤细qianxi +前线qianxian +浅显qianxian +谦虚qianxu +谦逊qianxun +前言qianyan +前沿qianyan +前夜qianye +歉意qianyi +迁移qianyi +牵引qianyin +潜在qianzai +谴责qianze +前者qianzhe +签证qianzheng +牵制qianzhi +钳制qianzhi +签字qianzi +前奏qianzou +桥qiao +瞧qiao +壳*qiao +巧qiao +敲qiao +乔qiao +蕉qiao +橇qiao +锹qiao +悄qiao +侨qiao +鞘qiao +撬qiao +翘qiao +峭qiao +俏qiao +窍qiao +雀*qiao +劁qiao +诮qiao +谯qiao +荞qiao +峤*qiao +愀qiao +憔qiao +缲*qiao +樵qiao +硗qiao +跷qiao +鞒qiao +侨胞qiaobao +桥墩qiaodun +巧计qiaoji +瞧见qiaojian +侨居qiaoju +桥梁qiaoliang +窍门qiaomen +巧妙qiaomiao +桥牌qiaopai +乔迁qiaoqian +悄然qiaoran +侨务qiaowu +敲诈qiaozha +恰似qiasi +洽谈qiatan +岂不qibu +起步qibu +器材qicai +奇才qicai +凄惨qican +起草qicao +汽车qiche +骑车qiche +启程qicheng +起初qichu +凄楚qichu +其次qici +期待qidai +脐带qidai +岂但qidan +启迪qidi +起点qidian +启动qidong +气度qidu +切qie +且qie +砌*qie +茄qie +怯qie +窃qie +伽*qie +郄qie +惬qie +慊*qie +妾qie +挈qie +锲qie +箧qie +窃案qiean +切断qieduan +切合qiehe +窃据qieju +窃取qiequ +怯弱qieruo +切身qieshen +切实qieshi +切题qieti +窃听qieting +切削qiexiao +惬意qieyi +启发qifa +起飞qifei +岂非qifei +气愤qifen +气氛qifen +欺负qifu +气概qigai +乞丐qigai +岂敢qigan +气功qigong +奇怪qiguai +器官qiguan +旗号qihao +漆黑qihei +气候qihou +期货qihuo +契机qiji +奇迹qiji +期间qijian +起见qijian +器件qijian +七届qijie +迄今qijin +起来qilai +凄凉qiliang +欺凌qiling +气流qiliu +歧路qilu +起码qima +骑马qima +启蒙qimeng +奇妙qimiao +器皿qimin +亲qin +侵qin +勤qin +秦qin +钦qin +琴qin +芹qin +擒qin +禽qin +寝qin +沁qin +芩qin +揿qin +吣qin +嗪qin +噙qin +廑*qin +溱qin +檎qin +锓qin +矜*qin +覃qin +螓qin +衾qin +亲爱qinai +亲笔qinbi +岂能qineng +侵犯qinfan +勤奋qinfen +情qing +清qing +青qing +轻qing +倾qing +请qing +亲*qing +庆qing +氢qing +晴qing +卿qing +擎qing +氰qing +顷qing +苘qing +圊qing +檠qing +磬qing +蜻qing +罄qing +箐qing +綮*qing +謦qing +鲭qing +黥qing +清白qingbai +青白qingbai +情报qingbao +情操qingcao +青草qingcao +清查qingcha +清除qingchu +清楚qingchu +青春qingchun +青翠qingcui +清单qingdan +倾倒qingdao +清点qingdian +情调qingdiao +轻浮qingfu +青工qinggong +青海qinghai +庆贺qinghe +清华qinghua +情怀qinghuai +清还qinghuan +请假qingjia +请柬qingjian +请教qingjiao +情节qingjie +清洁qingjie +情景qingjing +顷刻qingke +晴空qingkong +轻快qingkuai +情况qingkuang +青睐qinglai +晴朗qinglang +情理qingli +清理qingli +轻率qinglu +轻蔑qingmie +青年qingnian +氢气qingqi +轻巧qingqiao +请求qingqiu +情趣qingqu +青山qingshan +请示qingshi +清爽qingshuang +青松qingsong +轻松qingsong +倾诉qingsu +青天qingtian +晴天qingtian +倾听qingting +倾吐qingtu +请问qingwen +倾向qingxiang +倾销qingxiao +情形qingxing +清醒qingxing +情绪qingxu +情谊qingyi +轻易qingyi +轻盈qingying +情愿qingyuan +请愿qingyuan +请战qingzhan +轻重qingzhong +倾注qingzhu +庆祝qingzhu +请罪qingzui +侵害qinhai +勤俭qinjian +亲近qinjin +亲眷qinjuan +勤快qinkuai +勤劳qinlao +亲历qinli +亲临qinlin +侵略qinlue +亲密qinmi +勤勉qinmian +钦佩qinpei +亲戚qinqi +亲切qinqie +亲热qinre +亲人qinren +侵入qinru +亲身qinshen +侵蚀qinshi +寝室qinshi +亲手qinshou +亲属qinshu +侵吞qintun +勤务qinwu +亲信qinxin +亲眼qinyan +亲友qinyou +侵占qinzhan +亲自qinzi +穷qiong +琼qiong +邛qiong +茕qiong +穹qiong +蛩qiong +筇qiong +跫qiong +銎qiong +穷国qiongguo +穷苦qiongku +穷困qiongkun +穹隆qionglong +穷期qiongqi +穷人qiongren +穷途qiongtu +气派qipai +欺骗qipian +气魄qipo +乞求qiqiu +崎岖qiqu +齐全qiquan +凄然qiran +起色qise +气色qise +其实qishi +起始qishi +启事qishi +气势qishi +启示qishi +歧视qishi +奇数qishu +汽水qishui +起诉qisu +其他qita +其它qita +奇特qite +气体qiti +汽艇qiting +企图qitu +歧途qitu +求qiu +球qiu +秋qiu +丘qiu +仇*qiu +龟*qiu +邱qiu +囚qiu +酋qiu +泅qiu +俅qiu +巯qiu +犰qiu +湫qiu +逑qiu +遒qiu +楸qiu +赇qiu +虬qiu +蚯qiu +蝤qiu +裘qiu +糗qiu +鳅qiu +鼽qiu +秋播qiubo +球场qiuchang +囚犯qiufan +秋风qiufeng +秋季qiuji +求教qiujiao +囚禁qiujin +求救qiujiu +丘陵qiuling +秋千qiuqian +求情qiuqing +求全qiuquan +秋色qiuse +求实qiushi +秋收qiushou +秋天qiutian +求学qiuxue +求战qiuzhan +求证qiuzheng +求知qiuzhi +求助qiuzhu +期望qiwang +气味qiwei +气温qiwen +奇闻qiwen +欺侮qiwu +气息qixi +栖息qixi +起先qixian +期限qixian +气象qixiang +器械qixie +齐心qixin +气压qiya +欺压qiya +气焰qiyan +企业qiye +起义qiyi +歧义qiyi +起因qiyin +启用qiyong +汽油qiyou +其余qiyu +起源qiyuan +七月qiyue +契约qiyue +欺诈qizha +气质qizhi +旗帜qizhi +其中qizhong +器重qizhong +旗子qizi +妻子qizi +勤俭建国qjjg +勤俭节约qjjy +迄今为止qjwz +取决于qjy +千钧一发qjyf +旗开得胜qkds +全力以赴qlyf +勤劳致富qlzf +千里之行qlzx +亲密无间qmwj +青年人qnr +千篇一律qpyl +清清楚楚qqcc +勤勤恳恳qqkk +切切实实qqss +确确实实qqss +恰恰相反qqxf +求全责备qqzb +恰如其分qrqf +欺人之谈qrzt +七手八脚qsbj +全神贯注qsgz +全世界qsj +切实可行qskx +切身利益qsly +青少年qsn +前所未闻qsww +前所未有qswy +气势汹汹qsxx +齐头并进qtbj +奇谈怪论qtgl +千头万绪qtwx +前提下qtx +去qu +区qu +取qu +曲qu +且*qu +渠qu +屈qu +趋qu +驱qu +趣qu +蛆qu +躯qu +娶qu +龋qu +戌*qu +诎qu +劬qu +苣*qu +蕖qu +蘧qu +岖qu +衢qu +阒qu +璩qu +觑qu +氍qu +朐qu +祛qu +磲qu +鸲qu +癯qu +蛐qu +蠼qu +麴qu +瞿qu +黢qu +全quan +权quan +圈quan +劝quan +泉quan +醛quan +颧quan +痊quan +拳quan +犬quan +券quan +诠quan +荃quan +悛quan +绻quan +辁quan +畎quan +铨quan +蜷quan +筌quan +鬈quan +全部quanbu +全党quandang +劝导quandao +蜷伏quanfu +劝告quangao +全国quanguo +权衡quanheng +全会quanhui +拳击quanji +劝解quanjie +全局quanju +全军quanjun +全力quanli +权利quanli +权力quanli +全貌quanmao +全面quanmian +劝勉quanmian +全民quanmin +全能quanneng +全年quannian +全盘quanpan +全拼quanpin +全球quanqiu +蜷曲quanqu +全权quanquan +全然quanran +全胜quansheng +权术quanshu +泉水quanshui +劝说quanshuo +圈套quantao +全体quanti +拳头quantou +权威quanwei +劝慰quanwei +全文quanwen +全县quanxian +权限quanxian +全校quanxiao +权益quanyi +权宜quanyi +劝诱quanyou +痊愈quanyu +劝止quanzhi +劝阻quanzu +区别qubie +屈才qucai +驱除quchu +取代qudai +渠道qudao +取得qude +取缔qudi +曲调qudiao +驱动qudong +确que +却que +缺que +炔que +瘸que +鹊que +榷que +雀que +阕que +阙que +悫que +确保quebao +缺点quedian +确定queding +缺乏quefa +缺口quekou +确立queli +确切queqie +确认queren +缺少queshao +缺省quesheng +确实queshi +缺席quexi +缺陷quexian +确信quexin +确凿quezao +瘸子quezi +区分qufen +屈服qufu +躯干qugan +区划quhua +曲解qujie +取经qujing +取决qujue +躯壳quke +取乐qule +群qun +裙qun +逡qun +裙带qundai +群岛qundao +去年qunian +群众qunzhong +区区ququ +屈辱quru +驱散qusan +取舍qushe +取胜qusheng +去世qushi +驱使qushi +趋势qushi +躯体quti +区位quwei +区委quwei +趣味quwei +区县quxian +去向quxiang +趋向quxiang +取消quxiao +取信quxin +曲艺quyi +区域quyu +区长quzhang +曲折quzhe +屈指quzhi +驱逐quzhu +曲子quzi +奇形怪状qxgz +全心全意qxqy +气象台qxt +气象万千qxwq +齐心协力qxxl +岂有此理qycl +前因后果qyhg +情有可原qyky +强有力qyl +求之不得qzbd +取之不尽qzbj +轻重缓急qzhj +气壮山河qzsh +千真万确qzwq +人r +如r +日r +认r +入r +任r +热r +然r +容r +让r +润r +弱r +燃r +染r +壤r +绕r +仁r +溶r +刃r +仍r +然ran +燃ran +染ran +冉ran +苒ran +蚺ran +髯ran +燃点randian +然而raner +让rang +壤rang +嚷rang +瓤rang +攘rang +禳rang +穰rang +让步rangbu +让位rangwei +让贤rangxian +然后ranhou +燃料ranliao +染料ranliao +冉冉ranran +燃烧ranshao +绕rao +扰rao +饶rao +荛rao +娆rao +桡rao +扰乱raoluan +如此而已rcey +人才济济rcjj +热re +若*re +惹re +热爱reai +热潮rechao +热忱rechen +热诚recheng +热带redai +热火rehuo +热量reliang +热烈relie +人ren +认ren +任ren +仁ren +刃ren +忍ren +壬ren +韧ren +妊ren +纫ren +仞ren +荏ren +葚ren +饪ren +轫ren +稔ren +衽ren +热闹renao +人才rencai +人次renci +仁慈renci +认错rencuo +人大renda +韧带rendai +人道rendao +认得rende +认定rending +人防renfang +仍reng +扔reng +扔掉rengdiao +人格renge +仍旧rengjiu +人工rengong +认购rengou +仍然rengran +任何renhe +人家renjia +人间renjian +人杰renjie +认可renke +人口renkou +人类renlei +人力renli +人们renmen +任免renmian +人民renmin +任命renming +忍耐rennai +任凭renping +任期renqi +认清renqing +人权renquan +荏苒renran +忍让renrang +人人renren +人参renshen +人生rensheng +人事renshi +人士renshi +认识renshi +人手renshou +忍受renshou +认输renshu +忍痛rentong +人为renwei +认为renwei +人物renwu +任务renwu +人心renxin +忍心renxin +人选renxuan +任意renyi +仁义renyi +任用renyong +人员renyuan +认帐renzhang +认真renzhen +人质renzhi +任职renzhi +认罪renzui +认作renzuo +热切reqie +热情reqing +惹事reshi +热线rexian +热心rexin +热血rexue +人工合成rghc +热火朝天rhct +如虎添翼rhty +日ri +日报ribao +日本riben +日产richan +日常richang +日程richeng +日光riguang +日后rihou +日记riji +日久rijiu +日历rili +日落riluo +日内rinei +日期riqi +日夜riye +日益riyi +日用riyong +日照rizhao +日中rizhong +日子rizi +软件包rjb +人杰地灵rjdl +人尽其才rjqc +如饥似渴rjsk +日久天长rjtc +任劳任怨rlry +热泪盈眶rlyk +人民币rmb +人民代表大会rmdh +人民日报rmrb +燃眉之急rmzj +容rong +溶rong +荣rong +熔rong +融rong +绒rong +戎rong +茸rong +蓉rong +冗rong +嵘rong +狨rong +榕rong +肜rong +蝾rong +熔点rongdian +容光rongguang +融合ronghe +溶化ronghua +熔化ronghua +融化ronghua +融会ronghui +荣获ronghuo +容积rongji +溶解rongjie +容量rongliang +戎马rongma +容貌rongmao +容纳rongna +融洽rongqia +容忍rongren +荣辱rongru +容身rongshen +绒线rongxian +荣幸rongxing +容许rongxu +荣耀rongyao +溶液rongye +容易rongyi +荣誉rongyu +溶质rongzhi +肉rou +揉rou +柔rou +糅rou +蹂rou +鞣rou +柔和rouhe +肉麻rouma +柔软rouruan +肉体routi +任人为贤rrwx +日日夜夜rryy +人生观rsg +认识论rsl +惹事生非rssf +如上所述rsss +如ru +入ru +儒ru +乳ru +茹ru +蠕ru +孺ru +辱ru +汝ru +褥ru +蓐ru +薷ru +嚅ru +洳ru +溽ru +濡ru +缛ru +铷ru +襦ru +颥ru +软ruan +阮ruan +朊ruan +软骨ruangu +软件ruanjian +软禁ruanjin +软盘ruanpan +如常ruchang +如此ruci +入党rudang +蠕动rudong +乳房rufang +如果ruguo +如何ruhe +瑞rui +锐rui +蕊rui +芮rui +蕤rui +枘rui +睿rui +蚋rui +锐利ruili +瑞雪ruixue +锐意ruiyi +儒家rujia +如今rujin +辱骂ruma +入门rumen +入迷rumi +润run +闰run +润滑runhua +弱ruo +若ruo +偌ruo +弱点ruodian +若干ruogan +若是ruoshi +弱小ruoxiao +如期ruqi +入侵ruqin +如若ruruo +儒生rusheng +入手rushou +如同rutong +如下ruxia +入选ruxuan +如意ruyi +如愿ruyuan +入帐ruzhang +人武部rwb +若无其事rwqs +人言可畏rykw +日用品ryp +若有所思ryss +人之长情rzcq +是s +上s +时s +生s +说s +社s +深s +水s +所s +三s +十s +使s +事s +数s +四s +实s +少s +式s +山s +手s +撒sa +萨sa +洒sa +卅sa +仨sa +挲sa +脎sa +飒sa +撒谎sahuang +塞sai +思*sai +赛sai +腮sai +鳃sai +噻sai +赛车saiche +塞子saizi +撒娇sajiao +三san +散san +叁san +伞san +馓san +毵san +糁san +散步sanbu +散布sanbu +散发sanfa +三废sanfei +桑sang +丧sang +嗓sang +搡sang +磉sang +颡sang +丧命sangming +丧失sangshi +三国sanguo +三好sanhao +散会sanhui +三角sanjiao +三届sanjie +散失sanshi +散文sanwen +三月sanyue +扫sao +梢*sao +搔sao +骚sao +嫂sao +埽sao +缫sao +缲sao +臊sao +瘙sao +鳋sao +扫除saochu +扫荡saodang +扫地saodi +骚动saodong +骚乱saoluan +扫描saomiao +扫墓saomu +骚扰saorao +瘙痒saoyang +扫帚saozhou +洒脱satuo +说不定sbd +舍不得sbd +说不过去sbgq +说不来sbl +数不胜数sbss +素不相识sbxs +身不由己sbyj +上层建筑scjz +生产力scl +生产率scl +水产品scp +四川省scs +市场调节sctj +市场信息scxx +生动活泼sdhp +山东省sds +水电站sdz +色se +塞*se +瑟se +涩se +啬se +铯se +穑se +视而不见sebj +色彩secai +色调sediao +色盲semang +森sen +僧seng +僧侣senglu +森林senlin +森严senyan +色情seqing +瑟瑟sese +十二月sey +色泽seze +司法部sfb +赏罚分明sffm +说服力sfl +手风琴sfq +三番五次sfwc +四个现代化sgxh +手工业sgy +沙sha +杀sha +砂sha +啥sha +纱sha +莎sha +刹sha +傻sha +煞sha +杉sha +厦*sha +唼sha +嗄*sha +挲*sha +歃sha +铩sha +痧sha +裟sha +霎sha +鲨sha +煞白shabai +刹车shache +煞车shache +沙发shafa +傻瓜shagua +沙皇shahuang +色*shai +筛shai +晒shai +晒台shaitai +砂烬shajin +沙龙shalong +沙漠shamo +山shan +单*shan +闪shan +善shan +珊shan +扇shan +陕shan +掸*shan +苫shan +杉shan +删shan +煽shan +衫shan +擅shan +赡shan +膳shan +汕shan +缮shan +栅*shan +剡shan +讪shan +鄯shan +埏shan +芟shan +潸shan +姗shan +嬗shan +骟shan +膻shan +禅*shan +钐shan +疝shan +蟮shan +舢shan +跚shan +鳝shan +刹那shana +山坳shanao +陕北shanbei +擅长shanchang +删除shanchu +山川shanchuan +山地shandi +闪电shandian +扇动shandong +煽动shandong +山东shandong +山峰shanfeng +上shang +商shang +伤shang +尚shang +汤*shang +墒shang +赏shang +晌shang +裳shang +垧shang +绱shang +殇shang +熵shang +觞shang +删改shangai +山岗shangang +山冈shangang +上班shangban +上报shangbao +上边shangbian +商标shangbiao +上部shangbu +上策shangce +上层shangceng +商场shangchang +上次shangci +赏赐shangci +上当shangdang +上等shangdeng +上帝shangdi +商店shangdian +上调shangdiao +商定shangding +上访shangfang +伤感shanggan +上告shanggao +赏光shangguang +上海shanghai +伤害shanghai +商行shanghang +上级shangji +上集shangji +上进shangjin +上空shangkong +上来shanglai +商量shangliang +上流shangliu +上门shangmen +上面shangmian +上年shangnian +山沟shangou +商品shangpin +商洽shangqia +上前shangqian +尚且shangqie +上去shangqu +商榷shangque +商人shangren +上任shangren +上山shangshan +上升shangsheng +赏识shangshi +上述shangshu +上司shangsi +上诉shangsu +商谈shangtan +商讨shangtao +闪光shanguang +上文shangwen +上午shangwu +商务shangwu +上下shangxia +上限shangxian +伤心shangxin +上旬shangxun +上演shangyan +商业shangye +商议shangyi +上映shangying +上游shangyou +上涨shangzhang +上阵shangzhen +山河shanhe +善后shanhou +删节shanjie +善良shanliang +山林shanlin +山岭shanling +山脉shanmai +杉木shanmu +山区shanqu +扇区shanqu +山水shanshui +闪烁shanshuo +山头shantou +山西shanxi +陕西shanxi +赡养shanyang +闪耀shanyao +善意shanyi +善于shanyu +善战shanzhan +擅自shanzi +少shao +烧shao +稍shao +绍shao +召*shao +哨shao +梢shao +鞘*shao +捎shao +芍shao +勺shao +韶shao +邵shao +劭shao +苕shao +潲shao +杓*shao +蛸shao +筲shao +艄shao +哨兵shaobing +艄公shaogong +烧毁shaohui +少见shaojian +哨卡shaoka +少量shaoliang +少年shaonian +少女shaonu +烧伤shaoshang +少数shaoshu +哨所shaosuo +稍微shaowei +少许shaoxu +稍许shaoxu +少爷shaoye +少有shaoyou +少于shaoyu +少壮shaozhuang +沙哑shaya +砂眼shayan +傻子shazi +社she +设she +射she +摄she +舌she +折*she +涉she +舍she +蛇she +奢she +赊she +赦she +慑she +厍she +佘she +摺*she +猞she +滠she +歙she +畲she +麝she +设备shebei +射程shecheng +奢侈shechi +舍得shede +设法shefa +慑服shefu +赊购shegou +奢华shehua +社会shehui +社稷sheji +涉及sheji +设计sheji +射击sheji +舍己sheji +社交shejiao +设立sheli +涉猎shelie +社论shelun +深shen +身shen +神shen +什*shen +伸shen +参*shen +甚shen +渗shen +沈shen +肾shen +审shen +申shen +慎shen +砷shen +呻shen +娠shen +绅shen +婶shen +诜shen +谂shen +莘shen +葚*shen +哂shen +渖shen +椹shen +胂shen +矧shen +蜃shen +深奥shenao +申报shenbao +身边shenbian +申辩shenbian +身材shencai +审查shencha +深沉shenchen +深处shenchu +审处shenchu +审定shending +深度shendu +甚而shener +身分shenfen +身份shenfen +生sheng +胜sheng +声sheng +省sheng +升sheng +盛sheng +绳sheng +剩sheng +圣sheng +牲sheng +乘*sheng +甥sheng +嵊sheng +渑*sheng +晟sheng +眚sheng +笙sheng +生财shengcai +生产shengchan +生成shengcheng +牲畜shengchu +生存shengcun +盛大shengda +省得shengde +胜地shengdi +盛典shengdian +声调shengdiao +生动shengdong +省份shengfen +胜负shengfu +省府shengfu +生根shenggen +升华shenghua +省会shenghui +盛会shenghui +生活shenghuo +生机shengji +生计shengji +升级shengji +圣洁shengjie +圣经shengjing +盛开shengkai +牲口shengkou +盛况shengkuang +生理shengli +胜利shengli +省力shengli +省略shenglue +生命shengming +声明shengming +盛名shengming +生怕shengpa +生僻shengpi +生平shengping +升旗shengqi +生前shengqian +升迁shengqian +盛情shengqing +生趣shengqu +省去shengqu +胜任shengren +生日shengri +省事shengshi +盛事shengshi +声势shengshi +生疏shengshu +生死shengsi +胜似shengsi +胜诉shengsu +绳索shengsuo +生态shengtai +声讨shengtao +声望shengwang +省委shengwei +生物shengwu +生息shengxi +剩下shengxia +盛夏shengxia +圣贤shengxian +生效shengxiao +生肖shengxiao +盛行shengxing +生涯shengya +生意shengyi +声音shengyin +生于shengyu +生育shengyu +胜于shengyu +声誉shengyu +剩余shengyu +声援shengyuan +生长shengzhang +省长shengzhang +声张shengzhang +胜仗shengzhang +生殖shengzhi +圣旨shengzhi +盛装shengzhuang +审核shenhe +深厚shenhou +深化shenhua +神话shenhua +甚或shenhuo +审计shenji +神经shenjing +深刻shenke +审理shenli +什么shenme +审美shenmei +神秘shenmi +申明shenming +审判shenpan +身旁shenpang +审批shenpi +神气shenqi +神奇shenqi +深浅shenqian +深切shenqie +深情shenqing +申请shenqing +身躯shenqu +深入shenru +渗入shenru +神圣shensheng +身世shenshi +绅士shenshi +伸手shenshou +申述shenshu +神速shensu +申诉shensu +伸缩shensuo +神态shentai +身体shenti +神通shentong +渗透shentou +审问shenwen +神仙shenxian +审讯shenxun +沈阳shenyang +审议shenyi +呻吟shenyin +身影shenying +深远shenyuan +申冤shenyuan +审阅shenyue +深造shenzao +伸张shenzhang +深圳shenzhen +甚至shenzhi +深重shenzhong +慎重shenzhong +神州shenzhou +舍弃sheqi +赊欠sheqian +设施sheshi +社团shetuan +奢望shewang +射线shexian +涉嫌shexian +设想shexiang +赊销shexiao +设宴sheyan +摄影sheying +社员sheyuan +社长shezhang +设置shezhi +涉足shezu +社会公德shgd +是shi +时shi +十shi +使shi +事shi +实shi +式shi +识shi +世shi +试shi +石shi +什shi +示shi +市shi +史shi +师shi +始shi +施shi +士shi +势shi +湿shi +适shi +食shi +失shi +视shi +室shi +氏shi +似*shi +蚀shi +诗shi +释shi +殖*shi +拾shi +饰shi +驶shi +匙*shi +狮shi +尸shi +虱shi +矢shi +屎shi +柿shi +拭shi +誓shi +逝shi +嗜shi +噬shi +仕shi +侍shi +恃shi +嘘*shi +峙*shi +谥shi +埘shi +莳shi +蓍shi +弑shi +轼shi +贳shi +炻shi +铈shi +螫shi +舐shi +筮shi +酾shi +豕shi +鲥shi +鲺shi +失败shibai +势必shibi +事变shibian +师表shibiao +识别shibie +失策shice +史册shice +视察shicha +时常shichang +失常shichang +市场shichang +时辰shichen +失传shichuan +侍从shicong +时代shidai +世代shidai +适当shidang +是的shide +实地shidi +试点shidian +失调shidiao +失掉shidiao +事端shiduan +拾掇shiduo +时而shier +示范shifan +师范shifan +施放shifang +释放shifang +是非shifei +时分shifen +十分shifen +侍奉shifeng +是否shifou +师傅shifu +实干shigan +是个shige +诗歌shige +施工shigong +事故shigu +世故shigu +尸骨shigu +使馆shiguan +时光shiguang +嗜好shihao +适合shihe +时候shihou +事后shihou +侍候shihou +使唤shihuan +实惠shihui +失火shihuo +时机shiji +事迹shiji +实际shiji +世纪shiji +试剂shiji +史籍shiji +施加shijia +市价shijia +时间shijian +事件shijian +世间shijian +实践shijian +视角shijiao +市郊shijiao +使节shijie +十届shijie +世界shijie +使劲shijin +市井shijing +时局shiju +视觉shijue +时刻shike +石刻shike +市侩shikuai +实况shikuang +事理shili +实力shili +事例shili +势利shili +失利shili +势力shili +视力shili +示例shili +失恋shilian +适量shiliang +矢量shiliang +拾零shiling +失灵shiling +适龄shiling +时髦shimao +失密shimi +市民shimin +使命shiming +市内shinei +室内shinei +诗篇shipian +食品shipin +视频shipin +识破shipo +时期shiqi +事前shiqian +失窃shiqie +事情shiqing +实情shiqing +时区shiqu +时取shiqu +失去shiqu +市区shiqu +诗人shiren +市容shirong +湿润shirun +示弱shiruo +失散shisan +失色shise +施舍shishe +师生shisheng +失声shisheng +时时shishi +时事shishi +适时shishi +事实shishi +失事shishi +实施shishi +失实shishi +逝世shishi +史诗shishi +失势shishi +誓师shishi +尸首shishou +失守shishou +实数shishu +施属shishu +世俗shisu +失算shisuan +事态shitai +试探shitan +食堂shitang +实体shiti +尸体shiti +石头shitou +势头shitou +师团shituan +十万shiwan +失望shiwang +市委shiwei +示威shiwei +时务shiwu +事物shiwu +事务shiwu +实物shiwu +食物shiwu +饰物shiwu +失误shiwu +实习shixi +事先shixian +视线shixian +实现shixian +试想shixiang +事项shixiang +实效shixiao +试销shixiao +失信shixin +实行shixing +试行shixing +施行shixing +失修shixiu +实学shixue +史学shixue +实验shiyan +试验shiyan +食言shiyan +誓言shiyan +式样shiyang +事业shiye +实业shiye +失业shiye +视野shiye +时宜shiyi +事宜shiyi +示意shiyi +诗意shiyi +适宜shiyi +释疑shiyi +适应shiying +使用shiyong +实用shiyong +试用shiyong +适用shiyong +事由shiyou +石油shiyou +誓由shiyou +适于shiyu +誓愿shiyuan +十月shiyue +失约shiyue +实在shizai +实战shizhan +施展shizhan +市长shizhang +师长shizhang +使者shizhe +侍者shizhe +失真shizhen +市镇shizhen +市政shizheng +试制shizhi +实质shizhi +市制shizhi +食指shizhi +失职shizhi +适中shizhong +示众shizhong +始终shizhong +时装shizhuang +师资shizi +十足shizu +实足shizu +失足shizu +始祖shizu +手shou +受shou +收shou +首shou +守shou +熟*shou +授shou +寿shou +兽shou +售shou +瘦shou +狩shou +绶shou +艏shou +守备shoubei +手表shoubiao +收兵shoubing +收藏shoucang +手册shouce +首倡shouchang +寿辰shouchen +收成shoucheng +首创shouchuang +首次shouci +收存shoucun +寿诞shoudan +受到shoudao +守敌shoudi +首度shoudu +首都shoudu +手段shouduan +守法shoufa +首犯shoufan +收复shoufu +首府shoufu +手感shougan +手稿shougao +收割shouge +收购shougou +受害shouhai +守候shouhou +守护shouhu +收回shouhui +受贿shouhui +收获shouhuo +收集shouji +售价shoujia +受奖shoujiang +授奖shoujiang +手脚shoujiao +收缴shoujiao +首届shoujie +守旧shoujiu +收据shouju +授课shouke +受理shouli +收敛shoulian +首领shouling +收留shouliu +收录shoulu +收买shoumai +授命shouming +寿命shouming +首脑shounao +首批shoupi +授权shouquan +收容shourong +收入shouru +手软shouruan +瘦弱shouruo +首饰shoushi +手术shoushu +收缩shousuo +收条shoutiao +收听shouting +收尾shouwei +首尾shouwei +首先shouxian +首相shouxiang +瘦小shouxiao +收效shouxiao +手续shouxu +瘦削shouxue +收养shouyang +首要shouyao +受益shouyi +收益shouyi +兽医shouyi +受用shouyong +授予shouyu +守则shouze +首长shouzhang +收支shouzhi +生活上shs +上海市shs +数shu +书shu +树shu +属shu +术shu +输shu +述shu +熟shu +束shu +鼠shu +疏shu +殊shu +舒shu +蔬shu +薯shu +叔shu +署shu +枢shu +梳shu +抒shu +淑shu +赎shu +孰shu +暑shu +曙shu +蜀shu +黍shu +戍shu +竖shu +墅shu +庶shu +漱shu +恕shu +俞*shu +丨shu +倏shu +塾shu +菽shu +摅shu +沭shu +澍shu +姝shu +纾shu +毹shu +腧shu +殳shu +秫shu +刷shua +耍shua +唰shua +衰shuai +帅shuai +摔shuai +甩shuai +蟀shuai +衰败shuaibai +摔打shuaida +摔交shuaijiao +衰竭shuaijie +衰老shuailao +衰弱shuairuo +衰退shuaitui +衰亡shuaiwang +耍赖shualai +栓shuan +拴shuan +闩shuan +涮shuan +双shuang +霜shuang +爽shuang +泷*shuang +孀shuang +双边shuangbian +双方shuangfang +爽口shuangkou +爽快shuangkuai +爽朗shuanglang +双拼shuangpin +双重shuangzhong +耍弄shuanong +刷洗shuaxi +刷新shuaxin +书报shubao +书本shuben +蔬菜shucai +舒畅shuchang +输出shuchu +树丛shucong +疏导shudao +书店shudian +数额shue +抒发shufa +书法shufa +舒服shufu +束缚shufu +曙光shuguang +蜀汉shuhan +疏忽shuhu +倏忽shuhu +书画shuhua +水shui +说*shui +谁shui +睡shui +税shui +水稻shuidao +水电shuidian +水分shuifen +水果shuiguo +水火shuihuo +水晶shuijing +水库shuiku +水利shuili +水流shuiliu +睡眠shuimian +水平shuiping +税收shuishou +税务shuiwu +水下shuixia +水性shuixing +水源shuiyuan +水灾shuizai +谁知shuizhi +书记shuji +书籍shuji +暑假shujia +数据shuju +书刊shukan +数理shuli +树立shuli +竖立shuli +熟练shulian +数量shuliang +数列shulie +疏漏shulou +数落shuluo +数码shuma +书面shumian +庶民shumin +数目shumu +书目shumu +树木shumu +顺shun +吮shun +瞬shun +舜shun +顺便shunbian +顺差shuncha +顺次shunci +顺从shuncong +顺当shundang +顺道shundao +顺风shunfeng +枢纽shuniu +顺利shunli +顺路shunlu +瞬时shunshi +顺势shunshi +顺心shunxin +顺序shunxu +顺应shunying +顺着shunzhuo +说shuo +数*shuo +硕shuo +朔shuo +烁shuo +蒴shuo +搠shuo +妁shuo +槊shuo +铄shuo +说到shuodao +说道shuodao +说动shuodong +说法shuofa +说服shuofu +硕果shuoguo +说话shuohua +说教shuojiao +说明shuoming +说情shuoqing +硕士shuoshi +述评shuping +署期shuqi +暑期shuqi +抒情shuqing +熟人shuren +输入shuru +疏散shusan +属实shushi +熟识shushi +舒适shushi +束手shushou +叔叔shushu +数说shushuo +述说shushuo +输送shusong +疏松shusong +舒坦shutan +疏通shutong +熟悉shuxi +属相shuxiang +舒心shuxin +书信shuxin +属性shuxing +数学shuxue +属于shuyu +术语shuyu +疏远shuyuan +舒展shuzhan +数值shuzhi +树脂shuzhi +梳妆shuzhuang +数字shuzi +赎罪shuzui +售货员shy +社会主义shzy +四si +思si +死si +斯si +丝si +似si +司si +饲si +食*si +私si +厕*si +撕si +嘶si +肆si +寺si +嗣si +伺si +巳si +厮si +俟*si +兕si +厶si +咝si +汜si +泗si +澌si +姒si +驷si +缌si +祀si +锶si +鸶si +耜si +蛳si +笥si +死板siban +四边sibian +死别sibie +思潮sichao +丝绸sichou +四处sichu +四川sichuan +死党sidang +死敌sidi +司法sifa +四方sifang +四海sihai +丝毫sihao +嗣后sihou +似乎sihu +四化sihua +死缓sihuan +撕毁sihui +死活sihuo +四季siji +司机siji +私交sijiao +四届sijie +思考sikao +私利sili +私了siliao +司令siling +思路silu +四面simian +思念sinian +私念sinian +死去siqu +私人siren +死伤sishang +私事sishi +死尸sishi +死水sishui +思索sisuo +四体siti +私吞situn +死亡siwang +思维siwei +斯文siwen +私下sixia +思想sixiang +四项sixiang +死心sixin +私心sixin +肆行sixing +死刑sixing +私有siyou +私欲siyu +寺院siyuan +四月siyue +死者sizhe +四周sizhou +私自sizi +死罪sizui +拾金不昧sjbm +身经百战sjbz +书记处sjc +世界观sjg +舍己救人sjjr +数据库sjk +省军区sjq +杀鸡取蛋sjqd +实际上sjs +设计所sjs +试金石sjs +舍己为人sjwr +设计院sjy +随机应变sjyb +十进制sjz +石家庄sjz +适可而止skez +数理化slh +收录机slj +十六进制sljz +三令五申slws +司令员sly +四面八方smbf +手忙脚乱smjl +生命力sml +说明书sms +什么样smy +深谋远虑smyl +数目字smz +松song +送song +宋song +颂song +耸song +怂song +讼song +诵song +凇song +菘song +崧song +嵩song +忪song +悚song +淞song +竦song +松绑songbang +送别songbie +松弛songchi +松动songdong +颂歌songge +松劲songjin +松快songkuai +耸立songli +送礼songli +松散songsan +松涛songtao +松懈songxie +颂扬songyang +怂恿songyong +送葬songzang +送终songzhong +搜sou +艘sou +擞sou +嗽sou +叟sou +薮sou +嗖sou +嗾sou +馊sou +溲sou +飕sou +瞍sou +锼sou +螋sou +搜查soucha +搜集souji +搜索sousuo +搜寻souxun +售票处spc +食品工业spgy +水平线spx +生气勃勃sqbb +诗情画意sqhy +盛气凌人sqlr +山穷水尽sqsj +十全十美sqsm +首屈一指sqyz +四人帮srb +损人利己srlj +深入浅出srqc +似是而非ssef +时时刻刻sskk +姗姗来迟sslc +实事求是ssqs +事实上sss +随时随地sssd +善始善终sssz +顺水推舟sstz +四通公司stgs +四通集团stjt +身体力行stlx +生态平衡stph +素su +速su +苏su +塑su +缩su +俗su +诉su +宿su +肃su +酥su +粟su +僳su +溯su +夙su +谡su +蔌su +嗉su +愫su +涑su +簌su +觫su +稣su +算suan +酸suan +蒜suan +狻suan +酸楚suanchu +算法suanfa +算计suanji +算了suanle +算盘suanpan +算术suanshu +酸疼suanteng +酸痛suantong +素材sucai +速成sucheng +苏丹sudan +速度sudu +俗话suhua +随sui +穗sui +碎sui +虽sui +岁sui +尿*sui +隋sui +绥sui +髓sui +遂sui +隧sui +祟sui +谇sui +荽sui +濉sui +邃sui +燧sui +眭sui +睢sui +随笔suibi +随便suibian +随处suichu +随从suicong +随地suidi +随和suihe +随后suihou +随机suiji +随即suiji +虽然suiran +随身suishen +随时suishi +随手suishou +岁数suishu +虽说suishuo +随同suitong +随心suixin +随行suixing +随意suiyi +遂意suiyi +岁月suiyue +虽则suize +随着suizhe +诉苦suku +苏联sulian +塑料suliao +速率sulu +素描sumiao +肃穆sumu +损sun +孙sun +笋sun +荪sun +狲sun +飧sun +榫sun +隼sun +损害sunhai +损耗sunhao +损坏sunhuai +损伤sunshang +损失sunshi +孙子sunzi +所suo +缩suo +锁suo +索suo +莎*suo +蓑suo +梭suo +唆suo +琐suo +唢suo +嗦suo +嗍suo +娑suo +桫suo +挲*suo +睃suo +羧suo +所得suode +缩短suoduan +缩减suojian +锁链suolian +所能suoneng +索取suoqu +唆使suoshi +所属suoshu +琐碎suosui +所为suowei +所谓suowei +缩小suoxiao +缩写suoxie +琐屑suoxie +索性suoxing +所以suoyi +索引suoyin +缩影suoying +所有suoyou +所在suozai +所长suozhang +所至suozhi +梭子suozi +肃清suqing +苏区suqu +宿舍sushe +素数sushu +诉说sushuo +诉讼susong +速效suxiao +速写suxie +苏醒suxing +素养suyang +宿营suying +溯源suyuan +宿愿suyuan +夙愿suyuan +塑造suzao +速战suzhan +素质suzhi +苏州suzhou +苏维埃swa +税务局swj +手舞足蹈swzd +少先队sxd +身心健康sxjk +思想上sxs +山西省sxs +陕西省sxs +顺息万变sxwb +所向无敌sxwd +思想性sxx +商业部syb +说一不二sybe +收音机syj +使用价值syjz +所有权syq +沈阳市sys +实用性syx +十一月syy +所有制syz +私有制syz +时至今日szjr +三中全会szqh +始终如一szry +深圳四通szst +所作所为szsw +甚至于szy +他t +同t +它t +提t +题t +体t +图t +天t +头t +通t +条t +特t +土t +团t +统t +台t +她t +太t +套t +铁t +他ta +它ta +她ta +塔ta +踏ta +塌ta +獭ta +挞ta +蹋ta +拓*ta +嗒*ta +闼ta +溻ta +漯*ta +遢ta +榻ta +沓ta +铊ta +趿ta +鳎ta +踏步tabu +他的tade +它的tade +她的tade +塌方tafang +台tai +太tai +态tai +胎tai +抬tai +泰tai +苔tai +酞tai +汰tai +邰tai +薹tai +呔*tai +骀*tai +肽tai +炱tai +钛tai +跆tai +鲐tai +台北taibei +台词taici +态度taidu +台风taifeng +台阶taijie +太平taiping +泰然tairan +泰山taishan +态势taishi +太太taitai +抬头taitou +台湾taiwan +太阳taiyang +太原taiyuan +天安门tam +他们tamen +它们tamen +她们tamen +谈tan +碳tan +探tan +炭tan +弹*tan +坦tan +贪tan +滩tan +坍tan +摊tan +瘫tan +坛tan +檀tan +痰tan +潭tan +谭tan +毯tan +袒tan +叹tan +郯tan +澹tan +昙tan +忐tan +钽tan +锬tan +镡*tan +坦白tanbai +探测tance +探访tanfang +谈锋tanfeng +叹服tanfu +堂tang +糖tang +唐tang +塘tang +汤tang +搪tang +棠tang +膛tang +倘tang +躺tang +淌tang +趟tang +烫tang +傥tang +帑tang +溏tang +瑭tang +樘tang +铴tang +镗tang +耥tang +螗tang +螳tang +羰tang +醣tang +倘不tangbu +搪瓷tangci +弹弓tangong +倘若tangruo +搪塞tangsai +烫伤tangshang +堂堂tangtang +唐突tangtu +弹劾tanhe +袒护tanhu +谈话tanhua +瘫痪tanhuan +探究tanjiu +坦克tanke +贪婪tanlan +坦率tanlu +谈论tanlun +摊派tanpai +谈判tanpan +叹气tanqi +探亲tanqin +弹琴tanqin +坦然tanran +探索tansuo +探讨tantao +谈天tantian +探听tanting +贪图tantu +谈吐tantu +滩涂tantu +探望tanwang +探问tanwen +贪污tanwu +叹息tanxi +探险tanxian +谈心tanxin +弹性tanxing +探询tanxun +贪赃tanzang +套tao +讨tao +逃tao +陶tao +萄tao +桃tao +掏tao +涛tao +滔tao +绦tao +淘tao +鼗tao +叨*tao +啕tao +洮tao +韬tao +焘tao +饕tao +逃奔taoben +逃避taobi +逃兵taobing +逃窜taocuan +逃遁taodun +讨伐taofa +讨饭taofan +套购taogou +讨好taohao +讨还taohuan +讨价taojia +桃李taoli +韬略taolue +讨论taolun +逃命taoming +逃难taonan +逃跑taopao +淘气taoqi +逃生taosheng +淘汰taotai +滔滔taotao +逃脱taotuo +逃亡taowang +讨厌taoyan +陶冶taoye +桃子taozi +逃走taozou +陶醉taozui +踏青taqing +他人taren +踏实tashi +他说tashuo +他乡taxiang +挑拨离间tblj +台北市tbs +贪便宜tby +统筹兼顾tcjg +铁道部tdb +土地改革tdgg +同等学历tdxl +特te +忒te +忑te +慝*te +铽te +特别tebie +特产techan +特长techang +特出techu +特此teci +特大teda +特等tedeng +特地tedi +特点tedian +特定teding +特级teji +特技teji +特急teji +特将tejiang +特刊tekan +特快tekuai +特例teli +腾teng +疼teng +藤teng +誊teng +滕teng +疼爱tengai +腾达tengda +誊写tengxie +特派tepai +特区tequ +特权tequan +托儿所tes +特色tese +特使teshi +特殊teshu +特为tewei +特务tewu +特效texiao +特写texie +特性texing +特邀teyao +特意teyi +特有teyou +特约teyue +特征tezheng +特制tezhi +特种tezhong +突飞猛进tfmj +铁饭碗tfw +同甘共苦tggk +提货单thd +谈何容易thry +提ti +题ti +体ti +替ti +梯ti +惕ti +剔ti +踢ti +锑ti +蹄ti +啼ti +嚏ti +涕ti +剃ti +屉ti +倜ti +荑*ti +悌ti +逖ti +绨*ti +缇ti +鹈ti +裼ti +醍ti +天tian +田tian +添tian +填tian +甜tian +佃*tian +恬tian +舔tian +腆tian +掭tian +忝tian +阗tian +殄tian +畋tian +填报tianbao +天边tianbian +填表tianbiao +填补tianbu +天才tiancai +天长tianchang +填充tianchong +天地tiandi +田地tiandi +天鹅tiane +天府tianfu +天赋tianfu +天机tianji +天际tianji +添加tianjia +天津tianjin +恬静tianjing +天空tiankong +填空tiankong +天理tianli +天良tianliang +天亮tianliang +甜美tianmei +甜蜜tianmi +天明tianming +天平tianping +天气tianqi +天桥tianqiao +天然tianran +天壤tianrang +天色tianse +天上tianshang +天生tiansheng +天使tianshi +天堂tiantang +天体tianti +天天tiantian +甜头tiantou +天文tianwen +天下tianxia +天险tianxian +天仙tianxian +天性tianxing +天涯tianya +田野tianye +天真tianzhen +天职tianzhi +添置tianzhi +天资tianzi +条tiao +调*tiao +跳tiao +挑tiao +迢tiao +眺tiao +佻tiao +苕*tiao +祧tiao +窕tiao +蜩tiao +笤tiao +粜tiao +龆tiao +鲦tiao +髫tiao +挑拔tiaoba +跳动tiaodong +挑动tiaodong +挑逗tiaodou +跳高tiaogao +调和tiaohe +调剂tiaoji +条件tiaojian +调解tiaojie +调节tiaojie +条款tiaokuan +调理tiaoli +条理tiaoli +条例tiaoli +条令tiaoling +调配tiaopei +挑剔tiaoti +调停tiaoting +条文tiaowen +跳舞tiaowu +调戏tiaoxi +挑衅tiaoxin +挑选tiaoxuan +条约tiaoyue +挑战tiaozhan +调整tiaozheng +条子tiaozi +提拨tibo +题材ticai +体裁ticai +体操ticao +体察ticha +提倡tichang +提成ticheng +提出tichu +剔除tichu +题词tici +替代tidai +梯队tidui +铁tie +贴tie +帖tie +萜tie +餮tie +贴补tiebu +铁道tiedao +贴近tiejin +铁路tielu +贴切tieqie +贴身tieshen +铁证tiezheng +提法tifa +提防tifang +提纲tigang +提高tigao +体格tige +提供tigong +替换tihuan +体会tihui +提货tihuo +体积tiji +提价tijia +体力tili +体例tili +提炼tilian +体谅tiliang +体面timian +提名timing +题名timing +题目timu +听ting +停ting +庭ting +挺ting +廷ting +厅ting +烃ting +汀ting +亭ting +艇ting +莛ting +葶ting +婷ting +梃ting +町*ting +铤ting +蜓ting +霆ting +挺拔tingba +停办tingban +停泊tingbo +停产tingchan +听从tingcong +停顿tingdun +停工tinggong +挺括tinggua +听候tinghou +听话tinghua +停火tinghuo +听见tingjian +厅局tingju +听觉tingjue +停留tingliu +听凭tingping +听取tingqu +听任tingren +听说tingshuo +听信tingxin +厅长tingzhang +停止tingzhi +停职tingzhi +停滞tingzhi +听众tingzhong +提起tiqi +提前tiqian +提取tiqu +提升tisheng +提示tishi +体坛titan +体贴titie +提问tiwen +体温tiwen +体系tixi +体现tixian +体型tixing +提醒tixing +体验tiyan +提要tiyao +提议tiyi +体育tiyu +体制tizhi +体质tizhi +题字tizi +统计表tjb +条件反射tjfs +讨价还价tjhj +天津市tjs +条件下tjx +讨论会tlh +拖拉机tlj +他们的tmd +同盟会tmh +天南地北tndb +同tong +通tong +统tong +铜tong +痛tong +筒tong +童tong +桶tong +侗*tong +恫*tong +桐tong +酮tong +瞳tong +彤tong +捅tong +佟tong +仝tong +垌*tong +茼tong +嗵tong +峒*tong +恸tong +潼tong +砼tong +同伴tongban +同胞tongbao +通报tongbao +同辈tongbei +通病tongbing +同步tongbu +通常tongchang +通称tongcheng +统称tongcheng +痛斥tongchi +统筹tongchou +痛楚tongchu +同窗tongchuang +同道tongdao +通道tongdao +同等tongdeng +通电tongdian +通牒tongdie +通读tongdu +通告tonggao +统购tonggou +通过tongguo +通航tonghang +痛恨tonghen +同化tonghua +通话tonghua +童话tonghua +痛悔tonghui +通婚tonghun +统计tongji +通辑tongji +痛击tongji +同居tongju +痛苦tongku +痛哭tongku +痛快tongkuai +同僚tongliao +通令tongling +同盟tongmeng +同年tongnian +童年tongnian +同期tongqi +通气tongqi +同情tongqing +通融tongrong +同上tongshang +通商tongshang +同时tongshi +同事tongshi +统属tongshu +统帅tongshuai +通顺tongshun +通俗tongsu +通往tongwang +痛恶tongwu +痛惜tongxi +统辖tongxia +通向tongxiang +同乡tongxiang +统销tongxiao +通宵tongxiao +通晓tongxiao +同心tongxin +痛心tongxin +通信tongxin +同行tongxing +通行tongxing +同性tongxing +同学tongxue +通讯tongxun +同样tongyang +统一tongyi +同意tongyi +通用tongyong +通邮tongyou +统战tongzhan +同志tongzhi +统治tongzhi +通知tongzhi +头tou +投tou +透tou +偷tou +钭tou +骰tou +投案touan +头版touban +投奔touben +投标toubiao +投产touchan +透彻touche +头等toudeng +投放toufang +投机touji +投靠toukao +投篮toulan +偷懒toulan +头颅toulu +透露toulu +头面toumian +透明touming +头目toumu +头脑tounao +投票toupiao +透气touqi +投入touru +投身toushen +透视toushi +头痛toutong +偷闲touxian +投降touxiang +头绪touxu +投影touying +投掷touzhi +头子touzi +投资touzi +突破口tpk +太平洋tpy +通情达理tqdl +天气预报tqyb +突然袭击trxj +妥善处理tscl +通俗读物tsdw +挺身而出tsec +图书馆tsg +滔滔不绝ttbj +痛痛快快ttkk +团体赛tts +踏踏实实ttss +图tu +土tu +突tu +途tu +徒tu +凸tu +涂tu +吐tu +兔tu +屠tu +秃tu +堍tu +荼tu +菟tu +钍tu +酴tu +团tuan +湍tuan +抟tuan +彖tuan +疃tuan +图案tuan +湍急tuanji +团结tuanjie +团聚tuanju +湍流tuanliu +团体tuanti +团员tuanyuan +团圆tuanyuan +团长tuanzhang +突变tubian +图表tubiao +土产tuchan +突出tuchu +土地tudi +徒弟tudi +土匪tufei +土改tugai +涂改tugai +图画tuhua +土话tuhua +推tui +退tui +腿tui +颓tui +蜕tui +褪tui +忒*tui +煺tui +蜕变tuibian +退步tuibu +推测tuice +推迟tuichi +推崇tuichong +退出tuichu +推导tuidao +推动tuidong +推断tuiduan +推翻tuifan +颓废tuifei +推广tuiguang +退化tuihua +蜕化tuihua +退回tuihui +推荐tuijian +推进tuijin +推举tuiju +推开tuikai +推理tuili +推论tuilun +推敲tuiqiao +推却tuique +退却tuique +推让tuirang +退让tuirang +颓丧tuisang +退色tuise +推算tuisuan +退缩tuisuo +颓唐tuitang +推托tuituo +退伍tuiwu +推向tuixiang +推销tuixiao +推卸tuixie +推行tuixing +退休tuixiu +退学tuixue +推移tuiyi +退职tuizhi +突击tuji +图解tujie +途径tujing +徒劳tulao +图例tuli +吐露tulu +囤*tun +褪*tun +吞tun +屯tun +臀tun +氽tun +饨tun +暾tun +豚tun +吞并tunbing +吞没tunmo +吞吐tuntu +脱tuo +拖tuo +托tuo +妥tuo +椭tuo +舵*tuo +魄*tuo +鸵tuo +陀tuo +驮tuo +驼tuo +拓tuo +唾tuo +乇tuo +佗tuo +坨tuo +庹tuo +沱tuo +柝tuo +柁*tuo +橐tuo +砣tuo +铊*tuo +箨tuo +酡tuo +跎tuo +鼍tuo +驼背tuobei +拓补tuobu +脱出tuochu +妥当tuodang +脱轨tuogui +拓荒tuohuang +脱节tuojie +拖拉tuola +脱离tuoli +唾骂tuoma +唾弃tuoqi +妥善tuoshan +脱身tuoshen +妥协tuoxie +拖延tuoyan +唾液tuoye +图片tupian +突破tupo +突起tuqi +突然turan +徒然turan +土壤turang +屠杀tusha +徒手tushou +图书tushu +吐痰tutan +突围tuwei +突兀tuwu +图象tuxiang +图像tuxiang +图形tuxing +徒刑tuxing +图章tuzhang +图纸tuzhi +途中tuzhong +土著tuzhu +秃子tuzi +贪污盗窃twdq +台湾省tws +贪污受贿twsh +提心吊胆txdd +通讯社txs +同心同德txtd +同心协力txxl +推心置腹txzf +体育场tyc +体育锻炼tydl +体育馆tyg +腾云驾雾tyjw +太阳能tyn +太原市tys +天衣无缝tywf +通用性tyx +体育运动tyyd +团支部tzb +停滞不前tzbq +同志们tzm +天灾人祸tzrh +听之任之tzrz +通知书tzs +为w +我w +无w +问w +外w +五w +位w +物w +委w +完w +温w +万w +文w +往w +武w +务w +王w +围w +误w +晚w +瓦wa +挖wa +凹*wa +哇wa +蛙wa +洼wa +娃wa +袜wa +佤wa +娲wa +腽wa +外wai +歪wai +外币waibi +外边waibian +外表waibiao +外宾waibin +外部waibu +外传waichuan +外存waicun +外地waidi +外调waidiao +歪风waifeng +外观waiguan +外国waiguo +外行waihang +外汇waihui +外加waijia +外交waijiao +外界waijie +外景waijing +外科waike +外快waikuai +外流wailiu +外貌waimao +外贸waimao +外面waimian +外勤waiqin +歪曲waiqu +外商waishang +外伤waishang +外设waishe +外省waisheng +外甥waisheng +外事waishi +外围waiwei +外文waiwen +外线waixian +外销waixiao +歪斜waixie +外延waiyan +外因waiyin +外语waiyu +外援waiyuan +外在waizai +外债waizhai +外资waizi +瓦解wajie +挖掘wajue +挖苦waku +瓦砾wali +完wan +万wan +晚wan +弯wan +碗wan +顽wan +湾wan +挽wan +玩wan +蔓*wan +娩*wan +豌wan +丸wan +烷wan +皖wan +惋wan +宛wan +婉wan +腕wan +剜wan +芄wan +莞*wan +菀wan +纨wan +绾wan +琬wan +脘wan +畹wan +蜿wan +万般wanban +晚报wanbao +完备wanbei +完毕wanbi +完成wancheng +万代wandai +顽敌wandi +万吨wandun +万恶wane +万分wanfen +往wang +王wang +望wang +网wang +忘wang +妄wang +亡wang +旺wang +芒*wang +汪wang +枉wang +罔wang +尢wang +惘wang +辋wang +魍wang +往常wangchang +王朝wangchao +忘掉wangdiao +妄动wangdong +枉法wangfa +往返wangfan +枉费wangfei +往复wangfu +王国wangguo +亡国wangguo +往后wanghou +忘怀wanghuai +忘记wangji +旺季wangji +往来wanglai +网络wangluo +亡命wangming +往年wangnian +完工wangong +忘却wangque +枉然wangran +惘然wangran +往日wangri +旺盛wangsheng +往事wangshi +妄图wangtu +万古wangu +顽固wangu +往往wangwang +汪汪wangwang +忘我wangwo +往昔wangxi +妄想wangxiang +汪洋wangyang +望远wangyuan +王子wangzi +完好wanhao +晚会wanhui +挽回wanhui +晚婚wanhun +晚间wanjian +完结wanjie +挽救wanjiu +玩具wanju +顽抗wankang +完了wanle +挽力wanli +弯路wanlu +完美wanmei +万能wanneng +万年wannian +晚年wannian +玩弄wannong +晚期wanqi +顽强wanqiang +弯曲wanqu +完全wanquan +完善wanshan +晚上wanshang +玩赏wanshang +万事wanshi +万世wanshi +玩耍wanshua +万岁wansui +万万wanwan +万物wanwu +晚霞wanxia +万象wanxiang +玩笑wanxiao +万幸wanxing +婉言wanyan +万一wanyi +万元wanyuan +完整wanzheng +顽症wanzheng +万众wanzhong +宛转wanzhuan +瓦斯wasi +瓦特wate +娃娃wawa +外部设备wbsb +微不足道wbzd +无产阶级wcjj +微处理机wclj +无产者wcz +为wei +位wei +委wei +围wei +维wei +唯wei +卫wei +微wei +伟wei +未wei +威wei +危wei +尾wei +谓wei +喂wei +味wei +胃wei +魏wei +伪wei +遗*wei +违wei +韦wei +畏wei +纬wei +巍wei +桅wei +惟wei +潍wei +苇wei +萎wei +蔚wei +渭wei +尉wei +慰wei +偎wei +诿wei +隈wei +隗*wei +圩*wei +葳wei +薇wei +囗wei +帏wei +帷wei +崴wei +嵬wei +猥wei +猬wei +闱wei +沩wei +洧wei +涠wei +逶wei +娓wei +玮wei +韪wei +軎wei +炜wei +煨wei +痿wei +艉wei +鲔wei +尾巴weiba +违背weibei +未必weibi +威逼weibi +微波weibo +微薄weibo +未曾weiceng +未尝weichang +维持weichi +为此weici +伟大weida +味道weidao +纬度weidu +唯独weidu +巍峨weie +违法weifa +违反weifan +违犯weifan +威风weifeng +桅杆weigan +微观weiguan +危害weihai +为何weihe +维护weihu +危及weiji +微机weiji +危机weiji +危急weiji +围歼weijian +围剿weijiao +慰藉weijie +违禁weijin +未经weijing +畏惧weiju +违抗weikang +未可weike +唯恐weikong +惟恐weikong +胃口weikou +未来weilai +慰劳weilao +为了weile +威力weili +委靡weimi +未免weimian +微妙weimiao +帷幕weimu +危难weinan +畏难weinan +未能weineng +委派weipai +为期weiqi +畏怯weiqie +委曲weiqu +委屈weiqu +未然weiran +巍然weiran +围绕weirao +伟人weiren +委任weiren +微弱weiruo +威慑weishe +为生weisheng +卫生weisheng +尾声weisheng +卫士weishi +威势weishi +为首weishou +为数weishu +尾随weisui +未遂weisui +畏缩weisuo +萎缩weisuo +猥琐weisuo +委托weituo +委婉weiwan +危亡weiwang +巍巍weiwei +慰问weiwen +唯物weiwu +威武weiwu +微细weixi +威吓weixia +危险weixian +微小weixiao +微笑weixiao +威协weixie +威胁weixie +猥亵weixie +维新weixin +唯心weixin +违心weixin +威信weixin +微型weixing +卫星weixing +维修weixiu +威严weiyan +伟业weiye +唯一weiyi +位移weiyi +位于weiyu +谓语weiyu +委员weiyuan +为止weizhi +位置weizhi +未知weizhi +为重weizhong +为主weizhu +伪装weizhuang +问wen +温wen +文wen +稳wen +纹wen +闻wen +蚊wen +瘟wen +吻wen +紊wen +刎wen +阌wen +汶wen +璺wen +雯wen +文本wenben +瘟病wenbing +稳步wenbu +问答wenda +稳定wending +温度wendu +嗡weng +翁weng +瓮weng +蓊weng +蕹weng +稳固wengu +问好wenhao +温和wenhe +吻合wenhe +文化wenhua +文件wenjian +稳健wenjian +问津wenjin +文静wenjing +文具wenju +文科wenke +文盲wenmang +文明wenming +闻名wenming +温暖wennuan +文凭wenping +文人wenren +温柔wenrou +问世wenshi +文坛wentan +问题wenti +文体wenti +稳妥wentuo +文物wenwu +文献wenxian +文选wenxuan +文学wenxue +问讯wenxun +闻讯wenxun +文艺wenyi +瘟疫wenyi +文娱wenyu +文摘wenzhai +文章wenzhang +稳重wenzhong +文字wenzi +问罪wenzui +望而生畏wesw +闻风而动wfed +违法乱纪wflj +歪风邪气wfxq +温故知新wgzx +文化部whb +文汇报whb +文化馆whg +文化宫whg +武汉市whs +五湖四海whsh +忘乎所以whsy +问寒问暖whwn +文化娱乐whyl +玩忽职守whzs +外交部wjb +无纪律wjl +五讲四美wjsm +无拘无束wjws +无可奉告wkfg +无可非议wkfy +无可奈何wknh +乌鲁木齐wlmq +无理取闹wlqn +无论如何wlrh +物美价廉wmjl +误码率wml +文明礼貌wmlm +无名英雄wmyx +无能为力wnwl +我wo +握wo +窝wo +蜗wo +涡wo +沃wo +挝wo +卧wo +斡wo +倭wo +莴wo +喔wo +幄wo +渥wo +肟wo +硪wo +龌wo +窝藏wocang +卧床wochuang +我党wodang +卧倒wodao +我的wode +窝工wogong +我国woguo +我军wojun +我们women +窝囊wonang +我省wosheng +我校woxiao +为期不远wqby +无穷无尽wqwj +误入歧途wrqt +卫生部wsb +纹丝不动wsbd +万事大吉wsdj +万事俱备wsjb +为什么wsm +无所谓wsw +为所欲为wsyw +无所作为wszw +无wu +五wu +物wu +武wu +务wu +误wu +伍wu +舞wu +污wu +悟wu +雾wu +午wu +恶*wu +屋wu +乌wu +吴wu +亡*wu +诬wu +钨wu +巫wu +呜wu +芜wu +梧wu +吾wu +毋wu +捂wu +侮wu +坞wu +戊wu +晤wu +勿wu +兀wu +仵wu +阢wu +邬wu +圬wu +芴wu +唔wu +庑wu +怃wu +忤wu +浯wu +寤wu +迕wu +妩wu +婺wu +骛wu +杌wu +牾wu +於*wu +焐wu +鹉wu +鹜wu +痦wu +蜈wu +鋈wu +鼯wu +吾辈wubei +无比wubi +五笔wubi +务必wubi +舞弊wubi +无边wubian +无不wubu +五彩wucai +误差wucha +无常wuchang +无偿wuchang +舞场wuchang +武昌wuchang +无耻wuchi +无从wucong +武打wuda +舞蹈wudao +无敌wudi +舞动wudong +武斗wudou +武断wuduan +无法wufa +无妨wufang +无非wufei +武功wugong +污垢wugou +无故wugu +无关wuguan +五官wuguan +武官wuguan +无害wuhai +诬害wuhai +武汉wuhan +无何wuhe +乌黑wuhei +五湖wuhu +呜呼wuhu +误会wuhui +舞会wuhui +污秽wuhui +无及wuji +无机wuji +物价wujia +无间wujian +物件wujian +误解wujie +五届wujie +五金wujin +无愧wukui +无赖wulai +诬赖wulai +无理wuli +物理wuli +无礼wuli +物力wuli +武力wuli +无聊wuliao +无虑wulu +无论wulun +污蔑wumie +诬蔑wumie +无奈wunai +无能wuneng +毋宁wuning +务农wunong +物品wupin +无期wuqi +五七wuqi +武器wuqi +无情wuqing +无穷wuqiong +舞曲wuqu +无权wuquan +污染wuran +无任wuren +污辱wuru +侮辱wuru +物色wuse +无上wushang +误伤wushang +无声wusheng +午时wushi +务使wushi +无视wushi +误事wushi +务实wushi +无数wushu +武术wushu +无双wushuang +午睡wushui +五四wusi +无私wusi +舞台wutai +无题wuti +物体wuti +舞厅wuting +无为wuwei +无谓wuwei +无物wuwu +无暇wuxia +无限wuxian +诬陷wuxian +无效wuxiao +五星wuxing +午休wuxiu +无须wuxu +无需wuxu +务虚wuxu +午夜wuye +五一wuyi +无益wuyi +无疑wuyi +无垠wuyin +无用wuyong +毋庸wuyong +无余wuyu +无缘wuyuan +五月wuyue +物证wuzheng +无知wuzhi +物质wuzhi +武装wuzhuang +物资wuzi +兀自wuzi +误字wuzi +无罪wuzui +无微不至wwbz +唯物论wwl +卧薪尝胆wxcd +无线电wxd +微型机wxj +唯心论wxl +问心无愧wxwk +委员会wyh +无缘无故wywg +委员长wyz +误字率wzl +无足轻重wzqz +未知数wzs +完整无缺wzwq +学x +下x +行x +小x +线x +性x +新x +些x +想x +心x +向x +相x +系x +席x +现x +西x +修x +象x +先x +形x +心安理得xald +西安市xas +西半球xbq +相比之下xbzx +宣传部xcb +新陈代谢xcdx +新产品xcp +畜产品xcp +西城区xcq +喜出望外xcww +相对而言xdey +现代化xdh +想当然xdr +相对误差xdwc +先睹为快xdwk +形而上学xesx +显而易见xeyj +西方国家xfgj +消费品xfp +想方设法xfsf +先发制人xfzr +兴高采烈xgcl +新华社xhs +新华书店xhsd +系xi +席xi +西xi +习xi +细xi +吸xi +析xi +喜xi +洗xi +铣xi +稀xi +戏xi +隙xi +希xi +息xi +袭xi +锡xi +烯xi +牺xi +悉xi +惜xi +溪xi +腊*xi +栖*xi +昔xi +熙xi +硒xi +矽xi +晰xi +嘻xi +膝xi +夕xi +熄xi +汐xi +犀xi +檄xi +媳xi +僖xi +兮xi +隰xi +郗xi +茜*xi +菥xi +葸xi +蓰xi +奚xi +唏xi +徙xi +饩xi +阋xi +浠xi +淅xi +屣xi +嬉xi +玺xi +樨xi +曦xi +觋xi +欷xi +歙*xi +熹xi +禊xi +禧xi +皙xi +穸xi +裼*xi +蜥xi +螅xi +蟋xi +舄xi +舾xi +羲xi +粞xi +翕xi +醯xi +蹊*xi +鼷xi +下xia +夏xia +吓xia +狭xia +霞xia +唬*xia +瞎xia +虾xia +匣xia +辖xia +暇xia +峡xia +侠xia +厦xia +呷xia +狎xia +遐xia +瑕xia +柙xia +硖xia +瘕*xia +罅xia +黠xia +狭隘xiaai +下班xiaban +下辈xiabei +下边xiabian +下策xiace +下层xiaceng +下场xiachang +下沉xiachen +下次xiaci +瑕疵xiaci +下达xiada +吓倒xiadao +下等xiadeng +下毒xiadu +下发xiafa +下放xiafang +峡谷xiagu +霞光xiaguang +瞎话xiahua +喜爱xiai +下级xiaji +下集xiaji +夏季xiaji +下降xiajiang +侠客xiake +下来xialai +下联xialian +夏粮xialiang +下列xialie +下令xialing +下流xialiu +下落xialuo +下马xiama +厦门xiamen +下面xiamian +线xian +现xian +先xian +县xian +限xian +见*xian +显xian +鲜xian +献xian +险xian +陷xian +宪xian +纤xian +洗*xian +掀xian +弦xian +铣*xian +腺xian +锨xian +仙xian +咸xian +贤xian +衔xian +舷xian +闲xian +涎xian +嫌xian +馅xian +羡xian +冼xian +苋xian +莶xian +藓xian +岘xian +猃xian +暹xian +娴xian +氙xian +燹xian +祆xian +鹇xian +痫xian +蚬xian +筅xian +籼xian +酰xian +跣xian +跹xian +霰xian +西安xian +献宝xianbao +先辈xianbei +现场xianchang +现成xiancheng +县城xiancheng +献丑xianchou +献词xianci +现存xiancun +现代xiandai +先导xiandao +显得xiande +险地xiandi +限定xianding +限度xiandu +线段xianduan +限额xiane +险恶xiane +宪法xianfa +先锋xianfeng +险峰xianfeng +想xiang +向xiang +相xiang +象xiang +响xiang +项xiang +箱xiang +乡xiang +降*xiang +香xiang +像xiang +详xiang +橡xiang +享xiang +湘xiang +厢xiang +镶xiang +襄xiang +翔xiang +祥xiang +巷xiang +芗xiang +葙xiang +饷xiang +庠xiang +骧xiang +缃xiang +蟓xiang +鲞xiang +飨xiang +相爱xiangai +相比xiangbi +想必xiangbi +相差xiangcha +相称xiangcheng +相处xiangchu +相传xiangchuan +乡村xiangcun +相当xiangdang +向导xiangdao +相等xiangdeng +相对xiangdui +想法xiangfa +相反xiangfan +相仿xiangfang +相干xianggan +香港xianggang +相隔xiangge +相关xiangguan +相好xianghao +相互xianghu +相继xiangji +相加xiangjia +相见xiangjian +相减xiangjian +相交xiangjiao +橡胶xiangjiao +相近xiangjin +详尽xiangjin +巷口xiangkou +向来xianglai +相连xianglian +向量xiangliang +响亮xiangliang +相貌xiangmao +项目xiangmu +想念xiangnian +相片xiangpian +想起xiangqi +详情xiangqing +向上xiangshang +相声xiangsheng +响声xiangsheng +相识xiangshi +翔实xiangshi +享受xiangshou +相思xiangsi +相似xiangsi +香甜xiangtian +相同xiangtong +相投xiangtou +显贵xiangui +向往xiangwang +详细xiangxi +向下xiangxia +乡下xiangxia +象限xiangxian +想象xiangxiang +相信xiangxin +香烟xiangyan +相依xiangyi +相宜xiangyi +相应xiangying +相映xiangying +响应xiangying +享用xiangyong +相遇xiangyu +相约xiangyue +乡镇xiangzhen +象征xiangzheng +箱子xiangzi +陷害xianhai +显赫xianhe +鲜红xianhong +先后xianhou +鲜花xianhua +献花xianhua +闲话xianhua +贤惠xianhui +献计xianji +献技xianji +显见xianjian +衔接xianjie +先进xianjin +现金xianjin +险境xianjing +陷阱xianjing +现款xiankuan +现况xiankuang +先例xianli +献礼xianli +先烈xianlie +线路xianlu +显露xianlu +鲜美xianmei +鲜明xianming +贤明xianming +显目xianmu +羡慕xianmu +贤能xianneng +先期xianqi +掀起xianqi +限期xianqi +嫌弃xianqi +先前xianqian +先遣xianqian +险情xianqing +先驱xianqu +显然xianran +贤人xianren +闲人xianren +现任xianren +陷入xianru +闲散xiansan +献身xianshen +先生xiansheng +先是xianshi +现实xianshi +显示xianshi +娴熟xianshu +线索xiansuo +闲谈xiantan +险滩xiantan +先天xiantian +线条xiantiao +县委xianwei +纤维xianwei +显现xianxian +现象xianxiang +现行xianxing +鲜血xianxue +显眼xianyan +鲜艳xianyan +显要xianyao +险要xianyao +显耀xianyao +现役xianyi +嫌疑xianyi +现有xianyou +限于xianyu +闲杂xianza +现在xianzai +县长xianzhang +宪章xianzhang +限制xianzhi +先知xianzhi +闲置xianzhi +闲职xianzhi +显著xianzhu +现状xianzhuang +险阻xianzu +小xiao +消xiao +削xiao +效xiao +笑xiao +校xiao +销xiao +硝xiao +萧xiao +肖xiao +孝xiao +霄xiao +哮xiao +嚣xiao +宵xiao +淆xiao +晓xiao +啸xiao +哓xiao +崤xiao +潇xiao +逍xiao +骁xiao +绡xiao +枭xiao +枵xiao +蛸*xiao +筱xiao +箫xiao +魈xiao +小报xiaobao +小辈xiaobei +笑柄xiaobing +消沉xiaochen +消除xiaochu +消毒xiaodu +效法xiaofa +小贩xiaofan +消防xiaofang +消费xiaofei +校风xiaofeng +小鬼xiaogui +效果xiaoguo +小孩xiaohai +消耗xiaohao +消化xiaohua +笑话xiaohua +小惠xiaohui +销毁xiaohui +销魂xiaohun +消极xiaoji +削减xiaojian +小结xiaojie +小姐xiaojie +孝敬xiaojing +校刊xiaokan +小康xiaokang +效劳xiaolao +效力xiaoli +销路xiaolu +效率xiaolu +消灭xiaomie +消磨xiaomo +效能xiaoneng +消气xiaoqi +消遣xiaoqian +笑容xiaorong +削弱xiaoruo +潇洒xiaosa +校舍xiaoshe +小时xiaoshi +消失xiaoshi +消逝xiaoshi +消瘦xiaoshou +销售xiaoshou +小数xiaoshu +小说xiaoshuo +萧条xiaotiao +消息xiaoxi +肖像xiaoxiang +小心xiaoxin +枭雄xiaoxiong +小学xiaoxue +效验xiaoyan +逍遥xiaoyao +效益xiaoyi +效应xiaoying +校友xiaoyou +小于xiaoyu +校园xiaoyuan +销赃xiaozang +校长xiaozhang +嚣张xiaozhang +效忠xiaozhong +小组xiaozu +下情xiaqing +下去xiaqu +辖区xiaqu +下手xiashou +夏收xiashou +下属xiashu +下水xiashui +下台xiatai +夏天xiatian +下文xiawen +下午xiawu +下限xiaxian +下乡xiaxiang +遐想xiaxiang +狭义xiayi +下游xiayou +狭窄xiazhai +夏至xiazhi +夏种xiazhong +喜报xibao +细胞xibao +西北xibei +西边xibian +稀薄xibo +锡箔xibo +西餐xican +洗涤xidi +吸毒xidu +些xie +解*xie +写xie +斜xie +谢xie +协xie +械xie +叶*xie +血*xie +卸xie +屑xie +鞋xie +歇xie +邪xie +胁xie +蟹xie +泄xie +泻xie +契*xie +楔xie +蝎xie +挟xie +携xie +谐xie +懈xie +偕xie +亵xie +勰xie +燮xie +薤xie +撷xie +獬xie +廨xie +渫xie +瀣xie +邂xie +绁xie +缬xie +榭xie +榍xie +颉*xie +躞xie +写出xiechu +协从xiecong +携带xiedai +邪道xiedao +协调xiediao +协定xieding +亵渎xiedu +邪恶xiee +协和xiehe +谐和xiehe +协会xiehui +谢绝xiejue +协力xieli +泄漏xielou +邪路xielu +泄露xielu +泄密xiemi +邪念xienian +胁迫xiepo +邪气xieqi +协商xieshang +写生xiesheng +携手xieshou +邪说xieshuo +协同xietong +歇息xiexi +谢谢xiexie +协议xieyi +谐音xieyin +协约xieyue +写照xiezhao +协助xiezhu +鞋子xiezi +写作xiezuo +协作xiezuo +西方xifang +西风xifeng +西服xifu +吸附xifu +媳妇xifu +习惯xiguan +西汉xihan +稀罕xihan +希罕xihan +喜欢xihuan +袭击xiji +细节xijie +洗劫xijie +喜剧xiju +戏剧xiju +席卷xijuan +细菌xijun +犀利xili +系列xilie +奚落xiluo +熄灭ximie +新xin +心xin +信xin +锌xin +芯xin +辛xin +寻*xin +欣xin +薪xin +忻xin +衅xin +囟xin +馨xin +昕xin +歆xin +镡*xin +鑫xin +心爱xinai +西南xinan +新春xinchun +信贷xindai +心得xinde +心烦xinfan +心服xinfu +信服xinfu +行xing +性xing +形xing +型xing +星xing +兴xing +省*xing +醒xing +姓xing +幸xing +腥xing +猩xing +惺xing +刑xing +邢xing +杏xing +陉xing +荇xing +荥xing +擤xing +饧xing +悻xing +硎xing +心甘xingan +兴办xingban +性别xingbie +姓别xingbie +刑场xingchang +星辰xingchen +形成xingcheng +行程xingcheng +行动xingdong +幸而xinger +刑法xingfa +刑罚xingfa +兴奋xingfen +幸福xingfu +性格xingge +幸好xinghao +型号xinghao +行贿xinghui +星火xinghuo +性急xingji +形迹xingji +兴建xingjian +行径xingjing +行军xingjun +星空xingkong +幸亏xingkui +行李xingli +行旅xinglu +幸免xingmian +性命xingming +姓名xingming +醒目xingmu +性能xingneng +行期xingqi +兴起xingqi +星期xingqi +性情xingqing +星球xingqiu +兴趣xingqu +形容xingrong +行商xingshang +兴盛xingsheng +行使xingshi +行事xingshi +行驶xingshi +形式xingshi +幸事xingshi +刑事xingshi +形势xingshi +姓氏xingshi +行署xingshu +兴衰xingshuai +形态xingtai +形体xingti +兴亡xingwang +兴旺xingwang +行为xingwei +行文xingwen +醒悟xingwu +形象xingxiang +行销xingxiao +星星xingxing +行凶xingxiong +兴修xingxiu +行业xingye +星夜xingye +幸运xingyun +行政xingzheng +性质xingzhi +兴致xingzhi +形状xingzhuang +行走xingzou +信号xinhao +心狠xinhen +心慌xinhuang +信汇xinhui +细腻xini +西宁xining +心急xinji +信件xinjian +新疆xinjiang +新近xinjin +新居xinju +心坎xinkan +辛苦xinku +信赖xinlai +辛劳xinlao +心理xinli +心里xinli +心灵xinling +心目xinmu +信念xinnian +戏弄xinong +新奇xinqi +辛勤xinqin +心情xinqing +新区xinqu +新人xinren +信任xinren +欣赏xinshang +新生xinsheng +心声xinsheng +新事xinshi +新式xinshi +新书xinshu +薪水xinshui +心酸xinsuan +辛酸xinsuan +心疼xinteng +心田xintian +心跳xintiao +心头xintou +欣慰xinwei +新闻xinwen +心细xinxi +信息xinxi +欣喜xinxi +新鲜xinxian +心想xinxiang +信箱xinxiang +馨香xinxiang +信心xinxin +新型xinxing +新星xinxing +新兴xinxing +心虚xinxu +心血xinxue +信仰xinyang +心意xinyi +新异xinyi +新颖xinying +信用xinyong +新余xinyu +信誉xinyu +心愿xinyuan +心脏xinzang +新址xinzhi +心中xinzhong +雄xiong +胸xiong +兄xiong +凶xiong +熊xiong +匈xiong +汹xiong +芎xiong +雄辩xiongbian +雄兵xiongbing +凶残xiongcan +兄弟xiongdi +凶恶xionge +雄关xiongguan +凶狠xionghen +雄厚xionghou +胸怀xionghuai +雄健xiongjian +胸口xiongkou +熊猫xiongmao +凶猛xiongmeng +匈奴xiongnu +凶器xiongqi +凶杀xiongsha +雄师xiongshi +凶手xiongshou +胸膛xiongtang +雄伟xiongwei +雄心xiongxin +汹涌xiongyong +雄壮xiongzhuang +雄姿xiongzi +西欧xiou +习气xiqi +吸气xiqi +喜气xiqi +稀奇xiqi +希奇xiqi +喜庆xiqing +吸取xiqu +戏曲xiqu +昔日xiri +牺牲xisheng +西式xishi +喜事xishi +稀释xishi +吸收xishou +系数xishu +洗刷xishua +吸吮xishun +习俗xisu +习题xiti +西天xitian +系统xitong +修xiu +锈xiu +休xiu +袖xiu +秀xiu +朽xiu +宿*xiu +臭*xiu +羞xiu +嗅xiu +绣xiu +咻xiu +岫xiu +馐xiu +庥xiu +溴xiu +鸺xiu +貅xiu +髹xiu +修补xiubu +秀才xiucai +羞耻xiuchi +修辞xiuci +修订xiuding +修复xiufu +修改xiugai +修建xiujian +修剪xiujian +嗅觉xiujue +休克xiuke +羞愧xiukui +修理xiuli +秀丽xiuli +秀气xiuqi +羞辱xiuru +羞涩xiuse +修饰xiushi +休息xiuxi +休想xiuxiang +修养xiuyang +休养xiuyang +修造xiuzao +袖章xiuzhang +袖珍xiuzhen +修正xiuzheng +修筑xiuzhu +希望xiwang +席位xiwei +细微xiwei +西文xiwen +檄文xiwen +细小xixiao +细心xixin +悉心xixin +喜讯xixun +吸烟xiyan +西洋xiyang +西医xiyi +吸引xiyin +希有xiyou +戏院xiyuan +喜悦xiyue +西藏xizang +洗澡xizao +细则xize +细致xizhi +习作xizuo +下基层xjc +现阶段xjd +新技术xjs +献计献策xjxc +先见之明xjzm +兴利除弊xlcb +系列化xlh +稀里糊涂xlht +狭路相逢xlxf +畜牧业xmy +心满意足xmyz +西宁市xns +小朋友xpy +向前看xqk +喜气洋洋xqyy +先人后己xrhj +兴师动众xsdz +销售额xse +刑事犯罪xsfz +小时候xsh +新时期xsq +新生事物xssw +形式主义xszy +相提并论xtbl +续xu +许xu +须xu +需xu +序xu +虚xu +絮xu +畜xu +叙xu +蓄xu +绪xu +徐xu +墟xu +戌xu +嘘xu +酗xu +旭xu +恤xu +婿xu +吁*xu +诩xu +勖xu +圩xu +蓿xu +洫xu +浒*xu +溆xu +顼xu +栩xu +煦xu +砉*xu +盱xu +胥xu +糈xu +醑xu +选xuan +旋xuan +宣xuan +悬xuan +玄xuan +券*xuan +轩xuan +喧xuan +癣xuan +眩xuan +绚xuan +儇xuan +谖xuan +萱xuan +揎xuan +泫xuan +渲xuan +漩xuan +璇xuan +楦xuan +暄xuan +炫xuan +煊xuan +碹xuan +铉xuan +镟xuan +痃xuan +悬案xuanan +轩昂xuanang +选拔xuanba +宣布xuanbu +选材xuancai +选场xuanchang +宣称xuancheng +宣传xuanchuan +选定xuanding +宣读xuandu +宣告xuangao +选购xuangou +悬挂xuangua +玄乎xuanhu +喧哗xuanhua +选集xuanji +宣讲xuanjiang +选举xuanju +绚烂xuanlan +绚丽xuanli +选录xuanlu +旋律xuanlu +选民xuanmin +喧闹xuannao +悬念xuannian +选派xuanpai +宣判xuanpan +选配xuanpei +选票xuanpiao +选区xuanqu +选取xuanqu +喧嚷xuanrang +宣誓xuanshi +选手xuanshou +悬殊xuanshu +旋涡xuanwo +玄虚xuanxu +悬崖xuanya +宣言xuanyan +宣扬xuanyang +炫耀xuanyao +选用xuanyong +选择xuanze +宣战xuanzhan +选种xuanzhong +旋转xuanzhuan +许多xuduo +学xue +血xue +削*xue +雪xue +穴xue +靴xue +薛xue +谑xue +噱*xue +泶xue +踅xue +鳕xue +学报xuebao +学部xuebu +学潮xuechao +学费xuefei +学风xuefeng +学府xuefu +血汗xuehan +学好xuehao +学会xuehui +学籍xueji +血迹xueji +学科xueke +血泪xuelei +学历xueli +学龄xueling +学年xuenian +学派xuepai +学期xueqi +血肉xuerou +学生xuesheng +学时xueshi +学识xueshi +学士xueshi +学术xueshu +血书xueshu +学说xueshuo +血统xuetong +学徒xuetu +学位xuewei +学问xuewen +学习xuexi +血洗xuexi +学校xuexiao +血压xueya +学业xueye +血液xueye +学友xueyou +学员xueyuan +学院xueyuan +血晕xueyun +血战xuezhan +学者xuezhe +学制xuezhi +虚构xugou +序号xuhao +蓄积xuji +虚假xujia +叙旧xujiu +许可xuke +序列xulie +绪论xulun +虚名xuming +序幕xumu +畜牧xumu +训xun +旬xun +迅xun +讯xun +寻xun +循xun +巡xun +荤*xun +浚*xun +勋xun +熏xun +询xun +驯xun +殉xun +汛xun +逊xun +巽xun +郇*xun +埙xun +荀xun +蕈xun +薰xun +峋xun +徇xun +獯xun +恂xun +洵xun +浔xun +曛xun +窨*xun +醺xun +鲟xun +巡捕xunbu +巡查xuncha +寻常xunchang +驯服xunfu +殉国xunguo +巡航xunhang +循环xunhuan +巡回xunhui +虚拟xuni +寻机xunji +巡警xunjing +勋爵xunjue +训练xunlian +巡逻xunluo +迅猛xunmeng +寻求xunqiu +逊色xunse +巡视xunshi +徇私xunsi +迅速xunsu +熏陶xuntao +许诺xunuo +讯问xunwen +询问xunwen +寻衅xunxin +循序xunxu +勋章xunzhang +寻找xunzhao +殉职xunzhi +寻址xunzhi +需求xuqiu +序曲xuqu +虚荣xurong +虚弱xuruo +虚设xushe +叙事xushi +虚实xushi +序数xushu +虚数xushu +叙述xushu +叙说xushuo +虚伪xuwei +虚心xuxin +序言xuyan +需要xuyao +须臾xuyu +许愿xuyuan +须知xuzhi +宣武区xwq +信息处理xxcl +循序见进xxjj +辛辛苦苦xxkk +信息量xxl +熙熙攘攘xxrr +小学生xxs +欣欣向荣xxxr +小心翼翼xxyy +下一步xyb +胸有成竹xycz +洗衣机xyj +小意思xys +习以为常xywc +新颖性xyx +兴致勃勃xzbb +新中国xzg +行政区域xzqy +雪中送炭xzst +心中无数xzws +选择性xzx +心中有数xzys +行之有效xzyx +一y +有y +用y +要y +以y +于y +也y +样y +义y +与y +由y +压y +员y +月y +意y +又y +运y +原y +油y +验y +压ya +亚ya +呀ya +牙ya +芽ya +雅ya +蚜ya +鸭ya +匹*ya +押ya +鸦ya +丫ya +崖ya +衙ya +涯ya +哑ya +讶ya +伢ya +垭ya +揠ya +岈ya +迓ya +娅ya +琊ya +桠ya +氩ya +砑ya +睚ya +痖ya +哑巴yaba +牙齿yachi +压倒yadao +压服yafu +牙关yaguan +雅观yaguan +压价yajia +押金yajin +亚军yajun +压力yali +验yan +研yan +严yan +眼yan +言yan +盐yan +演yan +岩yan +沿yan +烟yan +延yan +掩yan +宴yan +炎yan +颜yan +燕yan +衍yan +铅*yan +焉yan +咽yan +阉yan +淹yan +蜒yan +阎yan +奄yan +艳yan +堰yan +厌yan +砚yan +雁yan +唁yan +彦yan +焰yan +谚yan +殷*yan +厣yan +赝yan +剡*yan +俨yan +偃yan +兖yan +谳yan +阽*yan +郾yan +鄢yan +芫*yan +菸yan +崦yan +恹yan +闫yan +阏yan +湮yan +滟yan +妍yan +嫣yan +琰yan +檐yan +晏yan +胭yan +腌*yan +焱yan +罨yan +筵yan +酽yan +魇yan +餍yan +鼹yan +沿岸yanan +严办yanban +掩蔽yanbi +演变yanbian +烟草yancao +延长yanchang +演唱yanchang +严惩yancheng +延迟yanchi +演出yanchu +唁电yandian +严冬yandong +厌恶yane +厌烦yanfan +样yang +养yang +氧yang +扬yang +洋yang +阳yang +羊yang +秧yang +央yang +杨yang +仰yang +殃yang +鸯yang +佯yang +疡yang +痒yang +漾yang +徉yang +怏yang +泱yang +炀yang +烊yang +恙yang +蛘yang +鞅yang +掩盖yangai +样板yangban +样本yangben +洋财yangcai +养成yangcheng +沿革yange +严格yange +阳光yangguang +洋行yanghang +养护yanghu +氧化yanghua +养料yangliao +杨柳yangliu +仰面yangmian +殃民yangmin +仰慕yangmu +样品yangpin +洋气yangqi +扬弃yangqi +央求yangqiu +养伤yangshang +样式yangshi +阳台yangtai +眼光yanguang +仰望yangwang +洋务yangwu +洋相yangxiang +扬言yangyan +样样yangyang +洋溢yangyi +养育yangyu +养殖yangzhi +样子yangzi +沿海yanhai +严寒yanhan +眼红yanhong +咽喉yanhou +掩护yanhu +眼花yanhua +延缓yanhuan +宴会yanhui +焰火yanhuo +演讲yanjiang +眼界yanjie +严禁yanjin +严谨yanjin +眼镜yanjing +眼睛yanjing +研究yanjiu +严峻yanjun +眼看yankan +严酷yanku +眼眶yankuang +眼泪yanlei +眼力yanli +严厉yanli +艳丽yanli +眼帘yanlian +眼亮yanliang +言路yanlu +沿路yanlu +言论yanlun +掩埋yanmai +严密yanmi +严明yanming +烟幕yanmu +延年yannian +延期yanqi +眼前yanqian +宴请yanqing +俨然yanran +炎热yanre +眼色yanse +颜色yanse +延伸yanshen +岩石yanshi +演示yanshi +掩饰yanshi +验收yanshou +严守yanshou +延寿yanshou +演说yanshuo +严肃yansu +演算yansuan +言谈yantan +研讨yantao +沿途yantu +阎王yanwang +延误yanwu +烟雾yanwu +宴席yanxi +筵席yanxi +演习yanxi +沿袭yanxi +眼下yanxia +沿线yanxian +言行yanxing +严刑yanxing +延续yanxu +艳阳yanyang +演义yanyi +演绎yanyi +掩映yanying +沿用yanyong +言语yanyu +演员yanyuan +厌战yanzhan +沿着yanzhe +验证yanzheng +研制yanzhi +严重yanzhong +演奏yanzou +要yao +药yao +约*yao +摇yao +腰yao +咬yao +邀yao +耀yao +陶*yao +侥*yao +疟yao +妖yao +瑶yao +尧yao +遥yao +窑yao +谣yao +姚yao +舀yao +钥*yao +夭yao +爻yao +吆yao +崾yao +徭yao +幺yao +珧yao +杳yao +轺yao +曜yao +肴yao +铫*yao +鹞yao +窈yao +繇yao +鳐yao +摇摆yaobai +腰包yaobao +要不yaobu +谣传yaochuan +要得yaode +要点yaodian +摇动yaodong +窑洞yaodong +遥感yaogan +妖怪yaoguai +要害yaohai +摇撼yaohan +摇晃yaohuang +要件yaojian +要紧yaojin +摇控yaokong +遥控yaokong +摇篮yaolan +要领yaoling +要么yaome +妖魔yaomo +要目yaomu +邀请yaoqing +要求yaoqiu +要塞yaosai +要是yaoshi +钥匙yaoshi +要素yaosu +窈窕yaotiao +摇头yaotou +要闻yaowen +药物yaowu +要挟yaoxie +耀眼yaoyan +谣言yaoyan +妖艳yaoyan +夭折yaozhe +要职yaozhi +鸦片yapian +压迫yapo +压强yaqiang +压缩yasuo +雅兴yaxing +压仰yayang +压抑yayi +压榨yazha +压制yazhi +雅致yazhi +亚洲yazhou +鸭子yazi +雅座yazuo +要不得ybd +一般的说ybds +一部分ybf +要不然ybr +要不是ybs +一般说来ybsl +要不要yby +一辈子ybz +一把抓ybz +用不着ybz +扬长避短ycbd +由此可见yckj +银川市ycs +与此同时ycts +有偿转让yczr +邮电部ydb +有道德ydd +邮电局ydj +一刀切ydq +运动员ydy +印度洋ydy +因地制宜ydzy +也ye +业ye +页ye +叶ye +液ye +夜ye +野ye +爷ye +冶ye +邪*ye +哗*ye +咽*ye +椰ye +噎ye +耶ye +掖ye +曳ye +腋ye +拽*ye +靥ye +谒ye +邺ye +揶ye +晔ye +烨ye +铘ye +夜餐yecan +野餐yecan +野火yehuo +业绩yeji +夜间yejian +冶金yejin +夜里yeli +冶练yelian +野蛮yeman +夜幕yemu +夜色yese +也是yeshi +夜市yeshi +野兽yeshou +液体yeti +野外yewai +夜晚yewan +业务yewu +夜校yexiao +野心yexin +野性yexing +也许yexu +幼儿园yey +爷爷yeye +野营yeying +业余yeyu +野战yezhan +叶子yezi +一方面yfm +一分为二yfwe +阳奉阴违yfyw +一概而论ygel +一国两制yglz +有根有据ygyj +严格要求ygyq +有何特长yhtc +银行帐号yhzh +炎黄子孙yhzs +一yi +以yi +义yi +意yi +已yi +移yi +医yi +议yi +依yi +易yi +乙yi +艺yi +益yi +异yi +宜yi +仪yi +亿yi +遗yi +伊yi +役yi +衣yi +疑yi +亦yi +谊yi +翼yi +译yi +抑yi +忆yi +疫yi +壹yi +揖yi +铱yi +颐yi +夷yi +胰yi +沂yi +姨yi +彝yi +椅yi +蚁yi +倚yi +矣yi +邑yi +屹yi +臆yi +逸yi +肄yi +裔yi +毅yi +溢yi +诣yi +翌yi +绎yi +刈yi +劓yi +仡*yi +佚yi +佾yi +诒yi +圯yi +埸yi +懿yi +苡yi +荑yi +薏yi +弈yi +奕yi +挹yi +弋yi +呓yi +咦yi +咿yi +嗌*yi +噫yi +峄yi +嶷yi +猗yi +饴yi +怿yi +怡yi +悒yi +漪yi +迤yi +驿yi +缢yi +殪yi +轶yi +贻yi +欹*yi +旖yi +熠yi +眙yi +钇yi +镒yi +镱yi +痍yi +瘗yi +癔yi +翊yi +蜴yi +舣yi +羿yi +翳yi +酏yi +黟yi +议案yian +疑案yian +一半yiban +一般yiban +一斑yiban +一边yibian +以便yibian +仪表yibiao +一并yibing +异步yibu +遗产yichan +异常yichang +议程yicheng +益处yichu +遗传yichuan +一次yici +依次yici +依从yicong +一代yidai +一带yidai +一旦yidan +一点yidian +一定yiding +议定yiding +移动yidong +一度yidu +遗毒yidu +一端yiduan +臆断yiduan +亿吨yidun +一发yifa +依法yifa +义愤yifen +衣服yifu +依附yifu +一概yigai +一个yige +一共yigong +议购yigou +已故yigu +一贯yiguan +异国yiguo +遗憾yihan +遗恨yihen +以后yihou +异化yihua +议会yihui +疑惑yihuo +以及yiji +异己yiji +遗迹yiji +议价yijia +意见yijian +移交yijiao +一届yijie +一经yijing +已经yijing +意境yijing +依旧yijiu +一举yiju +依据yiju +移居yiju +议决yijue +依靠yikao +倚靠yikao +一刻yike +医科yike +一块yikuai +以来yilai +依赖yilai +一览yilan +一例yili +毅力yili +屹立yili +一连yilian +意料yiliao +医疗yiliao +遗留yiliu +遗漏yilou +一律yilu +疑虑yilu +议论yilun +一面yimian +以免yimian +疫苗yimiao +移民yimin +因yin +引yin +阴yin +印yin +音yin +银yin +烟*yin +隐yin +饮yin +荫yin +茵yin +殷yin +姻yin +吟yin +淫yin +寅yin +尹yin +胤yin +鄞yin +圻*yin +垠yin +堙yin +茚yin +吲yin +喑yin +狺yin +夤yin +洇yin +湮*yin +氤yin +铟yin +瘾yin +窨yin +蚓yin +霪yin +龈yin +疑难yinan +阴暗yinan +隐蔽yinbi +音标yinbiao +隐藏yincang +阴沉yinchen +银川yinchuan +因此yinci +引导yindao +音调yindiao +印度yindu +引渡yindu +以内yinei +因而yiner +印发yinfa +音符yinfu +应ying +影ying +硬ying +营ying +英ying +映ying +迎ying +樱ying +婴ying +鹰ying +缨ying +莹ying +萤ying +荧ying +蝇ying +赢ying +盈ying +颖ying +嬴ying +郢ying +茔ying +荥*ying +莺ying +萦ying +蓥ying +撄ying +嘤ying +膺ying +滢ying +潆ying +瀛ying +瑛ying +璎ying +楹ying +媵ying +鹦ying +瘿ying +颍ying +罂ying +英镑yingbang +硬币yingbi +应变yingbian +映衬yingchen +应酬yingchou +迎春yingchun +应当yingdang +赢得yingde +婴儿yinger +营房yingfang +迎风yingfeng +应付yingfu +应该yinggai +英国yingguo +樱花yinghua +英魂yinghun +应急yingji +硬件yingjian +迎接yingjie +应届yingjie +英杰yingjie +营救yingjiu +英俊yingjun +盈亏yingkui +赢利yingli +盈利yingli +英烈yinglie +迎面yingmian +英明yingming +硬盘yingpan +影片yingpian +硬拼yingpin +影射yingshe +映射yingshe +樱桃yingtao +迎头yingtou +因果yinguo +影响yingxiang +硬性yingxing +英雄yingxiong +营养yingyang +应邀yingyao +营业yingye +应用yingyong +英勇yingyong +应有yingyou +英语yingyu +盈余yingyu +营造yingzao +应战yingzhan +迎战yingzhan +映照yingzhao +应征yingzheng +影子yingzi +英姿yingzi +银行yinhang +引号yinhao +殷红yinhong +隐患yinhuan +淫秽yinhui +阴魂yinhun +意念yinian +姨娘yiniang +阴极yinji +印鉴yinjian +引进yinjin +引力yinli +阴历yinli +阴凉yinliang +引路yinlu +隐瞒yinman +阴谋yinmou +银幕yinmu +隐慝yinni +银牌yinpai +引起yinqi +殷切yinqie +殷勤yinqin +引擎yinqing +引人yinren +饮食yinshi +印刷yinshua +饮水yinshui +因素yinsu +阴天yintian +引退yintui +因为yinwei +淫威yinwei +阴险yinxian +印象yinxiang +音响yinxiang +音信yinxin +因循yinxun +引言yinyan +阴影yinying +引用yinyong +引诱yinyou +阴雨yinyu +姻缘yinyuan +隐约yinyue +音乐yinyue +引证yinzheng +印证yinzheng +一片yipian +一瞥yipie +一起yiqi +一齐yiqi +义气yiqi +意气yiqi +仪器yiqi +遗弃yiqi +以前yiqian +一切yiqie +依然yiran +亦然yiran +毅然yiran +艺人yiren +宜人yiren +遗容yirong +以上yishang +一生yisheng +医生yisheng +一时yishi +一事yishi +意识yishi +议事yishi +逸事yishi +仪式yishi +医师yishi +医士yishi +遗失yishi +一手yishou +遗书yishu +艺术yishu +意思yisi +一体yiti +议题yiti +遗体yiti +一天yitian +一同yitong +异同yitong +一头yitou +意图yitu +疑团yituan +以外yiwai +意外yiwai +亿万yiwan +以往yiwang +遗忘yiwang +以为yiwei +意味yiwei +意文yiwen +疑问yiwen +译文yiwen +一无yiwu +义务yiwu +遗物yiwu +医务yiwu +贻误yiwu +一下yixia +以下yixia +一线yixian +一向yixiang +一项yixiang +意向yixiang +遗像yixiang +一些yixie +一心yixin +疑心yixin +异性yixing +医学yixue +一言yiyan +义演yiyan +遗言yiyan +一样yiyang +医药yiyao +意义yiyi +异议yiyi +义勇yiyong +易于yiyu +议员yiyuan +意愿yiyuan +医院yiyuan +亿元yiyuan +遗愿yiyuan +疑云yiyun +一再yizai +一早yizao +臆造yizao +依仗yizhang +仪仗yizhang +一朝yizhao +衣着yizhao +依照yizhao +一阵yizhen +一直yizhi +一致yizhi +以至yizhi +以致yizhi +意志yizhi +抑制yizhi +医治yizhi +抑止yizhi +移植yizhi +遗址yizhi +一种yizhong +遗嘱yizhu +研究会yjh +有纪律yjl +研究生yjs +研究所yjs +研究室yjs +养精畜锐yjxr +研究员yjy +拥军优属yjys +一技之长yjzc +一口气ykq +一览表ylb +以理服人ylfr +阅览室yls +有理想ylx +有利于yly +越来越yly +有目共睹ymgd +一目了然ymlr +有没有ymy +云南省yns +育*yo +哟yo +唷yo +用yong +勇yong +永yong +拥yong +涌yong +蛹yong +庸yong +佣yong +臃yong +痈yong +雍yong +踊yong +咏yong +泳yong +恿yong +俑yong +壅yong +墉yong +喁yong +慵yong +邕yong +镛yong +甬yong +鳙yong +饔yong +拥抱yongbao +永别yongbie +永不yongbu +用处yongchu +用度yongdu +用法yongfa +用费yongfei +勇敢yonggan +用功yonggong +永恒yongheng +用户yonghu +拥护yonghu +拥挤yongji +永久yongjiu +用具yongju +永诀yongjue +用力yongli +庸碌yonglu +勇猛yongmeng +用品yongpin +勇气yongqi +勇士yongshi +庸俗yongsu +咏叹yongtan +用途yongtu +涌现yongxian +用心yongxin +用意yongyi +拥有yongyou +用于yongyu +勇于yongyu +永远yongyuan +踊跃yongyue +有you +由you +又you +油you +右you +友you +优you +幼you +游you +尤you +诱you +犹you +幽you +悠you +忧you +邮you +铀you +酉you +佑you +釉you +卣you +攸you +侑you +莠you +莜you +莸you +尢*you +呦you +囿you +宥you +柚you +猷you +牖you +铕you +疣you +蚰you +蚴you +蝣you +蝤*you +繇*you +鱿you +黝you +鼬you +有碍youai +友爱youai +幽暗youan +友邦youbang +右边youbian +忧愁youchou +由此youci +有错youcuo +有待youdai +优待youdai +诱导youdao +有的youde +优等youdeng +有点youdian +邮电youdian +优点youdian +诱发youfa +有功yougong +有关youguan +有害youhai +友好youhao +优化youhua +油画youhua +幽会youhui +优惠youhui +诱惑youhuo +有机youji +游击youji +有劲youjin +幽静youjing +悠久youjiu +邮局youju +由来youlai +游览youlan +有劳youlao +有利youli +有力youli +游离youli +优良youliang +优劣youlie +幽灵youling +忧虑youlu +优美youmei +幼苗youmiao +有名youming +幽默youmo +右派youpai +诱骗youpian +邮票youpiao +尤其youqi +油漆youqi +友情youqing +右倾youqing +有趣youqu +油然youran +犹如youru +有色youse +优胜yousheng +有时youshi +有事youshi +有失youshi +优势youshi +有数youshu +油水youshui +有所yousuo +有望youwang +有为youwei +游戏youxi +有限youxian +优先youxian +悠闲youxian +有效youxiao +幼小youxiao +有些youxie +有心youxin +游行youxing +优秀youxiu +幽雅youya +悠扬youyang +又要youyao +有益youyi +优异youyi +友谊youyi +有用youyong +游泳youyong +有余youyu +由于youyu +犹豫youyu +忧郁youyu +悠远youyuan +优越youyue +有着youzhe +邮政youzheng +优质youzhi +幼稚youzhi +由衷youzhong +邮资youzi +有求必应yqby +以权谋私yqms +有气无力yqwl +迎刃而解yrej +因人而异yrey +与人为善yrws +引人注目yrzm +意识到ysd +艺术家ysj +因势利导ysld +印刷体yst +意识形态ysxt +衣食住行yszx +以身作则yszz +研讨会yth +一条龙ytl +一条心ytx +有条有理ytyl +于yu +与yu +育yu +鱼yu +雨yu +玉yu +余yu +遇yu +预yu +域yu +语yu +愈yu +渔yu +予yu +羽yu +愚yu +御yu +谷*yu +欲yu +宇yu +蔚*yu +尉*yu +迂yu +淤yu +盂yu +榆yu +虞yu +舆yu +俞yu +逾yu +愉yu +渝yu +隅yu +娱yu +屿yu +禹yu +芋yu +郁yu +吁yu +喻yu +峪yu +狱yu +誉yu +浴yu +寓yu +裕yu +豫yu +驭yu +粥*yu +禺yu +毓yu +伛yu +俣yu +谀yu +谕yu +萸yu +菀*yu +蓣yu +揄yu +圄yu +圉yu +嵛yu +狳yu +饫yu +馀yu +庾yu +阈yu +鬻yu +妪yu +妤yu +纡yu +瑜yu +昱yu +觎yu +腴yu +腧*yu +欤yu +於yu +煜yu +熨yu +燠yu +聿yu +钰yu +鹆yu +鹬yu +瘐yu +瘀yu +窬yu +窳yu +蜮yu +蝓yu +竽yu +臾yu +舁yu +雩yu +龉yu +员yuan +原yuan +圆yuan +源yuan +元yuan +远yuan +愿yuan +院yuan +缘yuan +援yuan +园yuan +怨yuan +鸳yuan +渊yuan +冤yuan +垣yuan +袁yuan +辕yuan +猿yuan +苑yuan +垸yuan +塬yuan +芫yuan +掾yuan +圜*yuan +沅yuan +媛yuan +瑗yuan +橼yuan +爰yuan +眢yuan +鸢yuan +螈yuan +箢yuan +鼋yuan +原本yuanben +渊博yuanbo +冤仇yuanchou +远大yuanda +元旦yuandan +园地yuandi +园丁yuanding +远东yuandong +远方yuanfang +缘分yuanfen +原告yuangao +原故yuangu +缘故yuangu +圆滑yuanhua +原籍yuanji +冤家yuanjia +元件yuanjian +远见yuanjian +远近yuanjin +远景yuanjing +援救yuanjiu +原来yuanlai +原理yuanli +原谅yuanliang +原料yuanliao +远虑yuanlu +圆满yuanman +远谋yuanmou +远期yuanqi +冤屈yuanqu +源泉yuanquan +原始yuanshi +远视yuanshi +元首yuanshou +元帅yuanshuai +元素yuansu +援外yuanwai +愿望yuanwang +冤枉yuanwang +原先yuanxian +远销yuanxiao +元宵yuanxiao +院校yuanxiao +原形yuanxing +怨言yuanyan +原野yuanye +愿意yuanyi +园艺yuanyi +原因yuanyin +援引yuanyin +原有yuanyou +缘由yuanyou +远游yuanyou +远远yuanyuan +渊源yuanyuan +元月yuanyue +原则yuanze +院长yuanzhang +远征yuanzheng +援助yuanzhu +原子yuanzi +院子yuanzi +预报yubao +预备yubei +愚笨yuben +余步yubu +预测yuce +愚蠢yuchun +遇到yudao +预定yuding +预订yuding +余毒yudu +月yue +说*yue +越yue +约yue +乐*yue +跃yue +曰yue +阅yue +钥yue +岳yue +粤yue +悦yue +龠yue +瀹yue +栎*yue +樾yue +刖yue +钺yue +月报yuebao +月初yuechu +月底yuedi +约定yueding +月度yuedu +阅读yuedu +乐队yuedui +约法yuefa +月份yuefen +月光yueguang +越轨yuegui +约会yuehui +越界yuejie +跃进yuejin +越境yuejing +阅览yuelan +阅历yueli +月亮yueliang +月末yuemo +约莫yuemo +越南yuenan +乐谱yuepu +乐器yueqi +月球yueqiu +乐曲yuequ +月色yuese +越是yueshi +约束yueshu +月台yuetai +乐团yuetuan +约有yueyou +乐章yuezhang +预防yufang +预风yufeng +预付yufu +预感yugan +预告yugao +预购yugou +遇害yuhai +宇航yuhang +与会yuhui +迂回yuhui +雨季yuji +预计yuji +遇见yujian +预见yujian +语句yuju +豫剧yuju +愉快yukuai +娱乐yule +鱼雷yulei +预料yuliao +雨露yulu +舆论yulun +愚昧yumei +育苗yumiao +预谋yumou +运yun +员*yun +云yun +匀yun +均*yun +允yun +孕yun +耘yun +郧yun +陨yun +蕴yun +酝yun +晕yun +韵yun +郓yun +芸yun +狁yun +恽yun +愠yun +纭yun +韫yun +殒yun +昀yun +氲yun +熨yun +遇难yunan +云彩yuncai +蕴藏yuncang +匀称yuncheng +运动yundong +熨斗yundou +云海yunhai +运河yunhe +韵律yunlu +陨落yunluo +云南yunnan +酝酿yunnian +允诺yunnuo +愚弄yunong +运气yunqi +运输yunshu +运算yunsuan +云梯yunti +运往yunwang +韵味yunwei +云雾yunwu +云霞yunxia +运行yunxing +允许yunxu +运用yunyong +孕育yunyu +运载yunzai +运转yunzhuan +与其yuqi +语气yuqi +预期yuqi +预审yushen +于是yushi +预示yushi +预售yushou +雨水yushui +预算yusuan +欲望yuwang +语文yuwen +预习yuxi +预先yuxian +遇险yuxian +预想yuxiang +预言yuyan +语言yuyan +寓言yuyan +预演yuyan +予以yuyi +寓于yuyu +愉悦yuyue +预兆yuzhao +预支yuzhi +宇宙yuzhou +有文化ywh +业务联系ywlx +意味着ywz +有限公司yxgs +一系列yxl +有效期yxq +医学院yxy +一心一意yxyy +游泳池yyc +营业额yye +夜以继日yyjr +应用科学yykx +一言堂yyt +引以为戒yywj +优越性yyx +营业员yyy +隐隐约约yyyy +运用自如yyzr +拥政爱民yzam +原子能yzn +已知数yzs +有助于yzy +言之有理yzyl +在z +这z +主z +中z +种z +着z +争z +战z +作z +正z +之z +制z +重z +组z +治z +只z +子z +自z +质z +指z +杂za +扎*za +咱za +匝za +砸za +咋za +咂za +在zai +再zai +载zai +栽zai +灾zai +仔*zai +哉zai +宰zai +崽zai +甾zai +再版zaiban +再不zaibu +在场zaichang +再度zaidu +宰割zaige +灾害zaihai +再好zaihao +在乎zaihu +灾荒zaihuang +再会zaihui +灾祸zaihuo +再见zaijian +在理zaili +灾民zaimin +灾难zainan +栽培zaipei +再起zaiqi +灾情zaiqing +灾区zaiqu +再三zaisan +在世zaishi +再说zaishuo +载体zaiti +在下zaixia +再现zaixian +宰相zaixiang +在意zaiyi +在于zaiyu +再造zaizao +再则zaize +在职zaizhi +再植zaizhi +杂技zaji +杂粮zaliang +杂乱zaluan +赞zan +咱zan +暂zan +攒zan +拶zan +瓒zan +昝zan +簪zan +糌zan +趱zan +錾zan +赞成zancheng +暂定zanding +藏*zang +脏zang +葬zang +赃zang +奘zang +驵zang +臧zang +赞歌zange +赃款zangkuan +葬送zangsong +赃物zangwu +藏族zangzu +杂念zanian +赞美zanmei +咱们zanmen +暂且zanqie +暂缺zanque +赞赏zanshang +暂时zanshi +赞颂zansong +赞叹zantan +暂停zanting +赞同zantong +暂行zanxing +赞扬zanyang +暂用zanyong +赞助zanzhu +造zao +早zao +遭zao +燥zao +凿zao +糟zao +枣zao +皂zao +藻zao +澡zao +蚤zao +躁zao +噪zao +灶zao +唣zao +早晨zaochen +造成zaocheng +凿穿zaochuan +造次zaoci +造词zaoci +遭到zaodao +早稻zaodao +造反zaofan +早饭zaofan +造福zaofu +糟糕zaogao +造化zaohua +造价zaojia +造就zaojiu +造林zaolin +早年zaonian +糟粕zaopo +早期zaoqi +早日zaori +早上zaoshang +遭受zaoshou +早衰zaoshuai +糟蹋zaota +早晚zaowan +造型zaoxing +遭殃zaoyang +造谣zaoyao +造诣zaoyi +早已zaoyi +噪音zaoyin +遭遇zaoyu +造字zaozi +杂谈zatan +杂文zawen +杂质zazhi +杂志zazhi +资本主义zbzy +资产阶级zcjj +增长率zcl +总参谋部zcmb +真才实学zcsx +自动化zdh +自动检测zdjc +自动检索zdjs +自动控制zdkz +主动权zdq +招待所zds +总的说来zdsl +主动性zdx +则ze +择ze +责ze +侧*ze +泽ze +咋*ze +仄ze +赜ze +啧ze +帻ze +迮ze +昃ze +笮ze +箦ze +舴ze +责备zebei +责成zecheng +责罚zefa +责怪zeguai +贼zei +责令zeling +责骂zema +怎zen +谮zen +增zeng +曾zeng +综*zeng +憎zeng +赠zeng +缯zeng +甑zeng +罾zeng +锃zeng +增补zengbu +增产zengchan +增长zengchang +增大zengda +增订zengding +增多zengduo +增高zenggao +憎恨zenghen +增加zengjia +增减zengjian +增进zengjin +增量zengliang +赠品zengpin +增强zengqiang +增删zengshan +增设zengshe +赠送zengsong +增添zengtian +赠言zengyan +增益zengyi +增援zengyuan +怎么zenme +怎奈zennai +怎样zenyang +责任zeren +责问zewen +总而言之zeyz +争分夺秒zfdm +针锋相对zfxd +自负盈亏zfyk +中关村zgc +自告奋勇zgfy +中国共产党zggd +总工会zgh +中国特色的zgtd +中国银行zgyh +自古以来zgyl +中国政府zgzf +中共中央zgzy +查*zha +扎zha +炸zha +闸zha +铡zha +轧zha +渣zha +蜡*zha +喳zha +札zha +眨zha +栅zha +榨zha +咋*zha +乍zha +诈zha +柞*zha +揸zha +吒zha +咤zha +哳zha +喋*zha +楂*zha +砟zha +痄zha +蚱zha +齄zha +炸弹zhadan +扎根zhagen +炸毁zhahui +寨zhai +侧*zhai +择*zhai +摘zhai +窄zhai +斋zhai +翟*zhai +祭*zhai +宅zhai +债zhai +砦zhai +瘵zhai +摘录zhailu +债权zhaiquan +债务zhaiwu +窄小zhaixiao +摘要zhaiyao +札记zhaji +战zhan +展zhan +站zhan +占zhan +粘*zhan +颤*zhan +瞻zhan +毡zhan +詹zhan +沾zhan +盏zhan +斩zhan +辗zhan +崭zhan +蘸zhan +栈zhan +湛zhan +绽zhan +谵zhan +搌zhan +旃zhan +战败zhanbai +战报zhanbao +战备zhanbei +战场zhanchang +展翅zhanchi +展出zhanchu +战地zhandi +战斗zhandou +战犯zhanfan +长*zhang +张zhang +章zhang +掌zhang +仗zhang +障zhang +胀zhang +涨zhang +账zhang +樟zhang +彰zhang +漳zhang +杖zhang +丈zhang +帐zhang +瘴zhang +仉zhang +鄣zhang +幛zhang +嶂zhang +獐zhang +嫜zhang +璋zhang +蟑zhang +障碍zhangai +站岗zhangang +长辈zhangbei +章程zhangcheng +长大zhangda +战歌zhange +章法zhangfa +帐房zhangfang +丈夫zhangfu +掌管zhangguan +帐号zhanghao +章节zhangjie +帐目zhangmu +战功zhangong +掌权zhangquan +张贴zhangtie +战鼓zhangu +沾光zhanguang +战国zhanguo +战果zhanguo +张望zhangwang +掌握zhangwo +张扬zhangyang +战壕zhanhao +战后zhanhou +战机zhanji +战绩zhanji +战局zhanju +占据zhanju +展开zhankai +战况zhankuang +展览zhanlan +占领zhanling +战略zhanlue +战马zhanma +展品zhanpin +战区zhanqu +沾染zhanran +战胜zhansheng +战时zhanshi +战事zhanshi +战士zhanshi +展示zhanshi +战术zhanshu +展望zhanwang +战线zhanxian +展现zhanxian +展销zhanxiao +崭新zhanxin +瞻仰zhanyang +战役zhanyi +占用zhanyong +占有zhanyou +战友zhanyou +站长zhanzhang +战争zhanzheng +着*zhao +照zhao +找zhao +招zhao +朝*zhao +召zhao +赵zhao +爪zhao +罩zhao +沼zhao +兆zhao +嘲*zhao +昭zhao +肇zhao +诏zhao +啁*zhao +棹zhao +钊zhao +笊zhao +照办zhaoban +照搬zhaoban +招标zhaobiao +照常zhaochang +照抄zhaochao +招待zhaodai +照发zhaofa +招工zhaogong +照顾zhaogu +招呼zhaohu +召唤zhaohuan +照会zhaohui +着急zhaoji +招集zhaoji +召集zhaoji +招架zhaojia +召开zhaokai +招考zhaokao +招揽zhaolan +着力zhaoli +照例zhaoli +照料zhaoliao +着落zhaoluo +着迷zhaomi +照明zhaoming +招聘zhaopin +朝气zhaoqi +招惹zhaore +照射zhaoshe +招生zhaosheng +着手zhaoshou +招手zhaoshou +招收zhaoshou +招贴zhaotie +朝夕zhaoxi +朝霞zhaoxia +着想zhaoxiang +照相zhaoxiang +昭雪zhaoxue +找寻zhaoxun +着眼zhaoyan +照样zhaoyang +照耀zhaoyao +照应zhaoying +招展zhaozhan +招致zhaozhi +着重zhaozhong +照着zhaozhuo +诈骗zhapian +榨取zhaqu +诈取zhaqu +扎实zhashi +炸药zhayao +渣滓zhazi +这zhe +着zhe +者zhe +折zhe +哲zhe +浙zhe +遮zhe +蛰zhe +辙zhe +锗zhe +蔗zhe +谪zhe +摺zhe +柘zhe +辄zhe +磔zhe +鹧zhe +褶zhe +蜇zhe +赭zhe +这般zheban +这边zhebian +这次zheci +遮挡zhedang +这点zhedian +折叠zhedie +折服zhefu +遮盖zhegai +这个zhege +折合zhehe +浙江zhejiang +折旧zhejiu +折扣zhekou +这里zheli +哲理zheli +这么zheme +折磨zhemo +真zhen +针zhen +阵zhen +镇zhen +振zhen +震zhen +珍zhen +诊zhen +斟zhen +甄zhen +砧zhen +臻zhen +贞zhen +侦zhen +枕zhen +疹zhen +圳zhen +蓁zhen +浈zhen +溱*zhen +缜zhen +桢zhen +椹*zhen +榛zhen +轸zhen +赈zhen +胗zhen +朕zhen +祯zhen +畛zhen +稹zhen +鸩zhen +箴zhen +珍爱zhenai +珍宝zhenbao +针砭zhenbian +珍藏zhencang +贞操zhencao +侦察zhencha +真诚zhencheng +震荡zhendang +阵地zhendi +真谛zhendi +震动zhendong +诊断zhenduan +针对zhendui +振奋zhenfen +争zheng +正zheng +政zheng +整zheng +证zheng +征zheng +蒸zheng +症zheng +丁*zheng +郑zheng +挣zheng +睁zheng +狰zheng +怔zheng +拯zheng +帧zheng +诤zheng +峥zheng +徵zheng +钲zheng +铮zheng +筝zheng +争霸zhengba +整备zhengbei +正比zhengbi +政变zhengbian +争辩zhengbian +整编zhengbian +征兵zhengbing +政策zhengce +正常zhengchang +争吵zhengchao +征程zhengcheng +争持zhengchi +正大zhengda +正当zhengdang +政党zhengdang +整党zhengdang +正道zhengdao +争端zhengduan +整顿zhengdun +争夺zhengduo +蒸发zhengfa +政法zhengfa +正反zhengfan +整风zhengfeng +政府zhengfu +征服zhengfu +整改zhenggai +整个zhengge +征购zhenggou +争光zhengguang +正规zhenggui +正轨zhenggui +正好zhenghao +政绩zhengji +征集zhengji +证件zhengjian +政见zhengjian +整洁zhengjie +政局zhengju +证据zhengju +正理zhengli +整理zhengli +正梁zhengliang +政令zhengling +争论zhenglun +政论zhenglun +正面zhengmian +争鸣zhengming +证明zhengming +正派zhengpai +征聘zhengpin +争气zhengqi +正气zhengqi +蒸气zhengqi +整齐zhengqi +正巧zhengqiao +征求zhengqiu +争取zhengqu +政权zhengquan +正确zhengque +证人zhengren +正是zhengshi +正式zhengshi +正视zhengshi +证实zhengshi +征收zhengshou +整数zhengshu +证书zhengshu +征税zhengshui +整套zhengtao +正题zhengti +政体zhengti +整体zhengti +整天zhengtian +征调zhengtiao +正统zhengtong +征途zhengtu +珍贵zhengui +政委zhengwei +正文zhengwen +征文zhengwen +政务zhengwu +争先zhengxian +政协zhengxie +整形zhengxing +整修zhengxiu +征询zhengxun +争艳zhengyan +正业zhengye +正义zhengyi +争议zhengyi +征用zhengyong +正月zhengyue +正在zhengzai +挣扎zhengzha +整整zhengzheng +正直zhengzhi +政治zhengzhi +争执zhengzhi +正中zhengzhong +郑重zhengzhong +郑州zhengzhou +症状zhengzhuang +正宗zhengzong +震撼zhenhan +侦缉zhenji +真假zhenjia +阵脚zhenjiao +贞节zhenjie +贞洁zhenjie +镇静zhenjing +震惊zhenjing +真空zhenkong +真理zhenli +诊疗zhenliao +珍品zhenpin +珍奇zhenqi +真切zhenqie +真情zhenqing +真确zhenque +真人zhenren +阵容zhenrong +真是zhenshi +真实zhenshi +阵势zhenshi +珍视zhenshi +侦探zhentan +阵亡zhenwang +珍惜zhenxi +阵线zhenxian +真相zhenxiang +振兴zhenxing +镇压zhenya +阵阵zhenzhen +真正zhenzheng +真知zhenzhi +真挚zhenzhi +珍重zhenzhong +珍珠zhenzhu +斟酌zhenzhuo +振作zhenzuo +这是zheshi +这时zheshi +折腾zheteng +这些zhexie +哲学zhexue +遮掩zheyan +这样zheyang +这种zhezhong +折中zhezhong +之zhi +制zhi +治zhi +只zhi +质zhi +指zhi +直zhi +支zhi +织zhi +止zhi +至zhi +置zhi +志zhi +值zhi +知zhi +识*zhi +执zhi +职zhi +植zhi +纸zhi +致zhi +枝zhi +殖zhi +脂zhi +智zhi +氏*zhi +肢zhi +秩zhi +址zhi +滞zhi +汁zhi +芝zhi +吱zhi +蜘zhi +侄zhi +趾zhi +旨zhi +挚zhi +掷zhi +帜zhi +峙zhi +稚zhi +炙zhi +痔zhi +窒zhi +卮zhi +陟zhi +郅zhi +埴zhi +芷zhi +摭zhi +帙zhi +徵*zhi +忮zhi +彘zhi +咫zhi +骘zhi +栉zhi +枳zhi +栀zhi +桎zhi +轵zhi +轾zhi +贽zhi +胝zhi +膣zhi +祉zhi +祗zhi +黹zhi +雉zhi +鸷zhi +痣zhi +蛭zhi +絷zhi +酯zhi +跖zhi +踬zhi +踯zhi +豸zhi +觯zhi +治安zhian +值班zhiban +植保zhibao +置备zhibei +质变zhibian +指标zhibiao +职别zhibie +支部zhibu +制裁zhicai +支撑zhicheng +职称zhicheng +支持zhichi +指出zhichu +支出zhichu +至此zhici +值此zhici +直达zhida +只当zhidang +直到zhidao +指导zhidao +知道zhidao +只得zhide +值得zhide +质地zhidi +指点zhidian +制定zhiding +指定zhiding +制订zhiding +制度zhidu +支队zhidui +至多zhiduo +知法zhifa +执法zhifa +制服zhifu +支付zhifu +职工zhigong +只顾zhigu +只管zhiguan +直观zhiguan +治国zhiguo +只好zhihao +之后zhihou +指挥zhihui +智慧zhihui +知己zhiji +指甲zhijia +之间zhijian +只见zhijian +指教zhijiao +直接zhijie +枝节zhijie +至今zhijin +直经zhijing +直径zhijing +止境zhijing +致敬zhijing +知觉zhijue +治理zhili +致力zhili +智力zhili +质量zhiliang +治疗zhiliao +指令zhiling +直流zhiliu +支流zhiliu +殖民zhimin +致命zhiming +指明zhiming +知名zhiming +智谋zhimou +指南zhinan +智囊zhinang +之内zhinei +只能zhineng +职能zhineng +智能zhineng +只怕zhipa +指派zhipai +支配zhipei +支票zhipiao +制品zhipin +志气zhiqi +之前zhiqian +支前zhiqian +值勤zhiqin +执勤zhiqin +知情zhiqing +知青zhiqing +智取zhiqu +志趣zhiqu +知趣zhiqu +职权zhiquan +值日zhiri +治丧zhisang +之上zhishang +直上zhishang +至上zhishang +至少zhishao +制胜zhisheng +之声zhisheng +只是zhishi +指使zhishi +支使zhishi +致使zhishi +知事zhishi +指示zhishi +知识zhishi +指数zhishu +支书zhishu +直属zhishu +植树zhishu +直爽zhishuang +治水zhishui +直说zhishuo +致死zhisi +之外zhiwai +指望zhiwang +职位zhiwei +质问zhiwen +植物zhiwu +职务zhiwu +窒息zhixi +之下zhixia +直线zhixian +指向zhixiang +志向zhixiang +知心zhixin +执行zhixing +只许zhixu +秩序zhixu +直言zhiyan +只要zhiyao +职业zhiye +致意zhiyi +旨意zhiyi +质疑zhiyi +指引zhiyin +知音zhiyin +只有zhiyou +至于zhiyu +置于zhiyu +智育zhiyu +职员zhiyuan +支援zhiyuan +志愿zhiyuan +制约zhiyue +制造zhizao +指责zhize +职责zhize +纸张zhizhang +职掌zhizhang +执照zhizhao +指正zhizheng +执政zhizheng +制止zhizhi +直至zhizhi +之中zhizhong +支助zhizhu +支柱zhizhu +知足zhizu +制作zhizuo +走后门zhm +中华民国zhmg +中华民族zhmz +中zhong +种zhong +重zhong +众zhong +钟zhong +终zhong +忠zhong +肿zhong +仲zhong +盅zhong +衷zhong +冢zhong +忪*zhong +锺zhong +螽zhong +舯zhong +踵zhong +钟爱zhongai +重办zhongban +重兵zhongbing +中部zhongbu +仲裁zhongcai +中层zhongceng +衷肠zhongchang +忠诚zhongcheng +重大zhongda +重担zhongdan +中等zhongdeng +种地zhongdi +重地zhongdi +重点zhongdian +终点zhongdian +中东zhongdong +中断zhongduan +终端zhongduan +中队zhongdui +众多zhongduo +重犯zhongfan +忠告zhonggao +中共zhonggong +中国zhongguo +忠厚zhonghou +中华zhonghua +中级zhongji +终极zhongji +重价zhongjia +中间zhongjian +中坚zhongjian +中奖zhongjiang +终结zhongjie +终究zhongjiu +终久zhongjiu +终局zhongju +中肯zhongken +种类zhonglei +中立zhongli +重量zhongliang +终了zhongliao +中流zhongliu +肿瘤zhongliu +中美zhongmei +众目zhongmu +中年zhongnian +终年zhongnian +中秋zhongqiu +重任zhongren +中日zhongri +终日zhongri +中伤zhongshang +重赏zhongshang +终身zhongshen +终生zhongsheng +重视zhongshi +忠实zhongshi +中枢zhongshu +众说zhongshuo +中苏zhongsu +终天zhongtian +中途zhongtu +重托zhongtuo +中外zhongwai +重围zhongwei +中文zhongwen +中午zhongwu +中西zhongxi +中心zhongxin +忠心zhongxin +衷心zhongxin +中性zhongxing +中学zhongxue +中旬zhongxun +忠言zhongyan +中央zhongyang +中药zhongyao +重要zhongyao +中医zhongyi +重用zhongyong +中庸zhongyong +中游zhongyou +终于zhongyu +忠于zhongyu +忠贞zhongzhen +中止zhongzhi +种植zhongzhi +终止zhongzhi +种种zhongzhong +中专zhongzhuan +种族zhongzu +轴zhou +周zhou +洲zhou +州zhou +皱zhou +骤zhou +舟zhou +诌zhou +粥zhou +肘zhou +帚zhou +咒zhou +宙zhou +昼zhou +荮zhou +啁zhou +妯zhou +纣zhou +绉zhou +胄zhou +碡zhou +籀zhou +繇*zhou +酎zhou +周到zhoudao +咒骂zhouma +周密zhoumi +周末zhoumo +周期zhouqi +周全zhouquan +周围zhouwei +周旋zhouxuan +昼夜zhouye +周折zhouzhe +周知zhouzhi +周转zhouzhuan +总后勤部zhqb +中华人民共和国zhrg +主zhu +注zhu +著zhu +住zhu +助zhu +猪zhu +铸zhu +属*zhu +株zhu +筑zhu +柱zhu +术*zhu +驻zhu +逐zhu +祝zhu +竹zhu +贮zhu +珠zhu +朱zhu +诸zhu +蛛zhu +诛zhu +烛zhu +煮zhu +拄zhu +瞩zhu +嘱zhu +蛀zhu +伫zhu +侏zhu +邾zhu +茱zhu +洙zhu +渚zhu +潴zhu +杼zhu +槠zhu +橥zhu +炷zhu +铢zhu +疰zhu +瘃zhu +褚*zhu +竺zhu +箸zhu +舳zhu +翥zhu +躅zhu +麈zhu +抓zhua +挝*zhua +抓好zhuahao +转*zhuai +曳*zhuai +拽zhuai +抓紧zhuajin +转zhuan +专zhuan +传*zhuan +砖zhuan +撰zhuan +赚zhuan +篆zhuan +啭zhuan +馔zhuan +沌*zhuan +颛zhuan +转变zhuanbian +转播zhuanbo +专长zhuanchang +专程zhuancheng +转达zhuanda +转发zhuanfa +装zhuang +状zhuang +壮zhuang +庄zhuang +撞zhuang +幢*zhuang +桩zhuang +妆zhuang +僮zhuang +奘*zhuang +转告zhuangao +装扮zhuangban +装备zhuangbei +壮大zhuangda +装订zhuangding +壮观zhuangguan +装甲zhuangjia +庄稼zhuangjia +庄嫁zhuangjia +壮举zhuangju +状况zhuangkuang +壮阔zhuangkuo +壮丽zhuangli +壮烈zhuanglie +装配zhuangpei +装饰zhuangshi +状态zhuangtai +装卸zhuangxie +庄严zhuangyan +庄园zhuangyuan +装运zhuangyun +装置zhuangzhi +壮志zhuangzhi +庄重zhuangzhong +转化zhuanhua +转换zhuanhuan +转给zhuanji +专家zhuanjia +专科zhuanke +专利zhuanli +专门zhuanmen +转让zhuanrang +专题zhuanti +转向zhuanxiang +专心zhuanxin +转眼zhuanyan +专业zhuanye +转移zhuanyi +专员zhuanyuan +转载zhuanzai +转折zhuanzhe +转正zhuanzheng +专政zhuanzheng +专制zhuanzhi +专职zhuanzhi +专注zhuanzhu +专著zhuanzhu +主办zhuban +逐步zhubu +贮藏zhucang +注册zhuce +助长zhuchang +主持zhuchi +主次zhuci +主导zhudao +注定zhuding +主动zhudong +主队zhudui +主犯zhufan +住房zhufang +祝福zhufu +嘱咐zhufu +逐个zhuge +主攻zhugong +助工zhugong +主管zhuguan +主观zhuguan +追zhui +锥zhui +椎zhui +赘zhui +坠zhui +缀zhui +惴zhui +骓zhui +缒zhui +追捕zhuibu +追查zhuicha +追悼zhuidao +追赶zhuigan +坠毁zhuihui +追加zhuijia +追究zhuijiu +追求zhuiqiu +追认zhuiren +追溯zhuisu +追随zhuisui +追问zhuiwen +追逐zhuizhu +追踪zhuizong +主机zhuji +主见zhujian +逐渐zhujian +主将zhujiang +主讲zhujiang +主教zhujiao +主角zhujiao +注解zhujie +祝酒zhujiu +主力zhuli +助理zhuli +株连zhulian +主粮zhuliang +主流zhuliu +驻留zhuliu +著名zhuming +主谋zhumou +注目zhumu +瞩目zhumu +准zhun +屯*zhun +谆zhun +肫zhun +窀zhun +准备zhunbei +逐年zhunian +准确zhunque +准绳zhunsheng +准时zhunshi +准许zhunxu +准则zhunze +着*zhuo +著*zhuo +捉zhuo +桌zhuo +缴*zhuo +拙zhuo +卓zhuo +琢zhuo +茁zhuo +酌zhuo +啄zhuo +灼zhuo +浊zhuo +倬zhuo +诼zhuo +擢zhuo +浞zhuo +涿zhuo +濯zhuo +棹*zhuo +焯zhuo +禚zhuo +斫zhuo +镯zhuo +拙劣zhuolie +琢磨zhuomo +捉弄zhuonong +酌情zhuoqing +卓越zhuoyue +茁壮zhuozhuang +主权zhuquan +主人zhuren +主任zhuren +诸如zhuru +注色zhuse +注视zhushi +柱石zhushi +注释zhushi +助手zhushou +主送zhusong +住宿zhusu +珠算zhusuan +主题zhuti +主体zhuti +逐条zhutiao +嘱托zhutuo +诸位zhuwei +主席zhuxi +注销zhuxiao +主要zhuyao +逐一zhuyi +主义zhuyi +主意zhuyi +注意zhuyi +祝愿zhuyuan +逐月zhuyue +主宰zhuzai +铸造zhuzao +驻扎zhuzha +住宅zhuzhai +主张zhuzhang +住址zhuzhi +注重zhuzhong +著作zhuzuo +子zi +自zi +资zi +字zi +紫zi +仔zi +籽zi +姿zi +吱*zi +兹zi +咨zi +滋zi +淄zi +孜zi +滓zi +渍zi +谘zi +茈*zi +呲*zi +嵫zi +姊zi +孳zi +缁zi +梓zi +辎zi +赀zi +恣zi +眦zi +锱zi +秭zi +耔zi +笫zi +粢zi +趑zi +觜zi +訾zi +龇zi +鲻zi +髭zi +自爱ziai +自白zibai +自卑zibei +资本ziben +资产zichan +滋长zichang +自称zicheng +自传zichuan +自从zicong +子弟zidi +字典zidian +自动zidong +自发zifa +自费zifei +自封zifeng +自负zifu +字符zifu +资格zige +字根zigen +自豪zihao +自给ziji +自己ziji +字迹ziji +字节zijie +资金zijin +自救zijiu +自居ziju +自觉zijue +字库ziku +自夸zikua +自理zili +资历zili +资料ziliao +自满ziman +自勉zimian +字母zimu +字幕zimu +子女zinu +自强ziqiang +自然ziran +滋润zirun +自杀zisha +自身zishen +姿势zishi +自述zishu +自私zisi +姿态zitai +字体ziti +字帖zitie +自卫ziwei +滋味ziwei +自问ziwen +自我ziwo +仔细zixi +自信zixin +自修zixiu +自叙zixu +自选zixuan +自学zixue +咨询zixun +滋养ziyang +自由ziyou +自愿ziyuan +资源ziyuan +自找zizhao +自治zizhi +自重zizhong +资助zizhu +自尊zizun +直截了当zjld +浙江省zjs +这就是说zjss +中纪委zjw +再接再厉zjzl +中联部zlb +专利法zlf +质量管理zlgl +自力更生zlgs +展览会zlh +智力开发zlkf +专利权zlq +知名人士zmrs +这么些zmx +这么样zmy +怎么样zmy +总zong +纵zong +宗zong +综zong +棕zong +鬃zong +踪zong +偬zong +枞zong +腙zong +粽zong +总部zongbu +总裁zongcai +总参zongcan +总队zongdui +总额zonge +总纲zonggang +总共zonggong +纵贯zongguan +总和zonghe +综合zonghe +纵横zongheng +总后zonghou +总计zongji +踪迹zongji +宗教zongjiao +总结zongjie +总局zongju +总括zongkuo +总理zongli +总论zonglun +宗派zongpai +纵情zongqing +纵深zongshen +总是zongshi +纵使zongshi +总数zongshu +总算zongsuan +总体zongti +总统zongtong +总务zongwu +踪影zongying +总帐zongzhang +总政zongzheng +总之zongzhi +宗旨zongzhi +走zou +邹zou +奏zou +揍zou +诹zou +陬zou +鄹zou +驺zou +鲰zou +走访zoufang +邹虹zouhong +走私zousi +奏效zouxiao +酌情处理zqcl +中青年zqn +朝气蓬勃zqpb +准确无误zqww +正确性zqx +诸如此类zrcl +责任感zrg +自然界zrj +主人翁zrw +责任心zrx +责任制zrz +再生产zsc +自上而下zsex +知识分子zsfz +这时候zsh +知识化zsh +株式会社zshs +总书记zsj +装饰品zsp +综上所述zsss +之所以zsy +自始至终zszz +众所周知zszz +座谈会zth +组zu +族zu +足zu +阻zu +祖zu +租zu +卒zu +诅zu +俎zu +菹zu +镞zu +阻碍zuai +钻zuan +赚*zuan +纂zuan +攥zuan +缵zuan +躜zuan +钻研zuanyan +组成zucheng +阻挡zudang +组阁zuge +足够zugou +祖国zuguo +组合zuhe +最zui +罪zui +嘴zui +堆*zui +咀*zui +醉zui +蕞zui +最初zuichu +最大zuida +最低zuidi +罪恶zuie +罪犯zuifan +最高zuigao +罪过zuiguo +最好zuihao +最后zuihou +最坏zuihuai +最佳zuijia +最近zuijin +嘴脸zuilian +罪名zuiming +罪孽zuinie +罪人zuiren +最先zuixian +最小zuixiao +最新zuixin +醉心zuixin +罪行zuixing +罪责zuize +罪证zuizheng +最终zuizhong +罪状zuizhuang +阻击zuji +租界zujie +租借zujie +阻拦zulan +阻力zuli +租赁zulin +尊zun +遵zun +撙zun +樽zun +鳟zun +阻挠zunao +遵从zuncong +尊贵zungui +尊敬zunjing +遵守zunshou +遵循zunxun +尊严zunyan +遵照zunzhao +尊重zunzhong +作zuo +做zuo +左zuo +座zuo +坐zuo +昨zuo +撮*zuo +凿*zuo +搓*zuo +琢*zuo +佐zuo +柞zuo +阼zuo +唑zuo +嘬zuo +怍zuo +胙zuo +祚zuo +笮*zuo +作案zuoan +作弊zuobi +左边zuobian +坐标zuobiao +做到zuodao +作法zuofa +做法zuofa +作废zuofei +作风zuofeng +做工zuogong +作怪zuoguai +做好zuohao +作家zuojia +作客zuoke +作乐zuole +作乱zuoluan +坐落zuoluo +左派zuopai +作品zuopin +左倾zuoqing +做人zuoren +昨日zuori +做事zuoshi +坐视zuoshi +座谈zuotan +昨天zuotian +昨晚zuowan +作为zuowei +座位zuowei +坐位zuowei +作文zuowen +作物zuowu +作业zuoye +昨夜zuoye +作用zuoyong +左右zuoyou +作战zuozhan +作者zuozhe +作证zuozheng +作主zuozhu +做主zuozhu +做作zuozuo +足球zuqiu +阻塞zuse +祖师zushi +祖先zuxian +组长zuzhang +组织zuzhi +阻止zuzhi +祖宗zuzong +中外合资zwhz +责无旁贷zwpd +中宣部zxb +自行车zxc +自下而上zxes +忠心耿耿zxgg +展销会zxh +照相机zxj +争先恐后zxkh +中学生zxs +主席团zxt +中小学zxx +自信心zxx +中央办公厅zybt +着眼点zyd +专业对口zydk +中央电视台zydt +中央各部委zygw +专业化zyh +专业户zyh +中央军委zyjw +座右铭zym +中央全会zyqh +中央人民广播电台zyrt +主要人员zyry +专业人员zyry +中央书记处zysc +中央委员会zywh +中央委员zywy +重要性zyx +主要原因zyyy +中央政治局zyzj +专业知识zyzs +中组部zzb +组织部zzb +政治部zzb +政治处zzc +转折点zzd +置之度外zzdw +政治局zzj +自治区zzq +蒸蒸日上zzrs +组织上zzs +郑州市zzs +组织性zzx +自尊心zzx +赵紫阳zzy +总政治部zzzb +喷码pm +优喷yp +科技kj +比洋by +公司gs +威诺巴赫wnbh +有限公司yxgz +股份公司gfgs +企业qy +标准bz +喷码机pmj +电线dx +电缆dl +电线电缆dxdl +电力电缆dldl +绝缘jy +绝缘层jyc +导体dt +导线dx +电力dl +通信tx +控制电缆kzdl +补偿电缆bcdl +屏蔽电缆pbdl +高温电缆gwdl +计算机电缆jsjdl +信号电缆xhdl +同轴电缆tzdl +耐火电缆nhdl +船用电缆cydl +铝合金电缆lhjdl +单股dg +多股dg +连接lj +电路dl +电器dq +型号xh +铜t +铝l +铅包qb +铝包qb +聚氯乙烯jlyx +电磁线dcx +北京市bj +东城区dcq +西城区xcq +崇文区cwq +宣武区xwq +朝阳区zyq +海淀区hdq +丰台区ftq +房山区fsq +通州区tzq +顺义区syq +昌平区cpq +大兴区txq +怀柔区hrq +平谷区pgq +门头沟区mtgq +石景山区sjsq +天津市tjs +和平区hpq +河东区hdq +河西区hxq +南开区nkq +河北区hbq +红桥区hqq +塘沽区tgq +汉沽区hgq +大港区tgq +东丽区dlq +西青区xqq +北辰区bcq +津南区jnq +武清区wqq +宝坻区bdq +河北省hbs +辛集市xjs +藁城市gcs +晋州市jzs +新乐市xls +鹿泉市lqs +唐山市tss +遵化市zhs +安市as +邯郸市hds +武安市was +邢台市xts +南宫市ngs +沙河市shs +保定市bds +涿州市zzs +定州市dzs +安国市ags +承德市cds +沧州市czs +泊头市bts +任丘市rqs +黄骅市hhs +河间市hjs +廊坊市lfs +霸州市bzs +三河市shs +衡水市hss +冀州市jzs +深州市szs +石家庄市sjzs +张家口市zjks +高碑店市gbds +秦皇岛市qhds +山西省sxs +太原市tys +古交市gjs +大同市dts +阳泉市yqs +长治市czs +潞城市lcs +晋城市jcs +高平市gps +朔州市szs +晋中市jzs +介休市jxs +运城市ycs +河津市hjs +永济市sjs +忻州市xzs +原平市yps +临汾市lfs +侯马市hms +霍州市hzs +吕梁市lls +孝义市xys +汾阳市fys +内蒙古自治区nmg +包头市bts +乌海市whs +赤峰市cfs +通辽市tls +根河市ghs +丰镇市fzs +辽宁省LNS +沈阳市sys +新民市xms +大连市dls +庄河市zhs +鞍山市ass +海城市hcs +抚顺市fss +本溪市bxs +丹东市dds +东港市dgs +凤城市fcs +锦州市jzs +凌海市lhs +北宁市bns +营口市yks +盖州市gzs +阜新市fxs +辽阳市lys +灯塔市dts +盘锦市pjs +铁岭市tls +开原市kys +朝阳市zys +凌源市lys +北票市bps +兴城市xcs +大石桥市dsqs +瓦房店市wfds +普兰店市plds +调兵山市dbss +葫芦岛市hlds +吉林省jls +长春市ccs +九台市jts +榆树市yss +德惠市dhs +吉林市jls +舒兰市sls +桦甸市hds +蛟河市jhs +磐石市pss +四平市sps +双辽市sls +辽源市lys +通化市ths +集安市jas +白山市bss +临江市ljs +松原市sys +白城市bcs +大安市das +洮南市tns +延吉市yjs +图们市tms +敦化市ghs +龙井市ljs +珲春市hcs +和龙市hls +公主岭市gzls +梅河口市mhks +黑龙江省hljs +阿城市acs +尚志市szs +双城市scs +五常市wcs +讷河市nhs +鹤岗市hgs +鸡西市jxs +密山市mss +虎林市hls +大庆市dqs +伊春市ycs +铁力市tls +宁安市nas +海林市hls +穆棱市mls +同江市tjs +富锦市fjs +黑河市hhs +北安市bas +绥化市shs +安达市ads +肇东市zds +海伦市hls +七台河市qths +双鸭山市syss +牡丹江市mdjs +佳木斯市jmss +绥芬河市sfhs +哈尔滨市hebs +齐齐哈尔市qqhes +五大连池市wdlcs +上海市shs +黄浦区hpq +卢湾区lwq +徐汇区xhq +长宁区cnq +静安区jaq +普陀区ptq +闸北区zbq +虹口区hkq +杨浦区ypq +宝山区bsq +闵行区mxq +嘉定区jdq +松江区sjq +金山区jsq +青浦区qpq +南汇区nhq +奉贤区fxq +崇明县浦东新区cmxpdxq +江苏省jss +南京市njs +无锡市wxs +江阴市jys +宜兴市yxs +徐州市xzs +邳州市pzs +新沂市xys +常州市czs +金坛市jts +溧阳市lys +苏州市szs +常熟市css +太仓市dcs +昆山市hss +吴江市wjs +南通市nns +如皋市rgs +通州市tzs +海门市hms +启东市qds +淮安市has +盐城市ycs +东台市dts +大丰市dfs +扬州市yzs +高邮市gys +江都市jds +仪征市yzs +镇江市zjs +丹阳市dys +扬中市yzs +句容市jrs +泰州市dzs +泰兴市dxs +姜堰市jys +靖江市jjs +兴化市xhs +宿迁市sqs +连云港市lygs +张家港市zjgs +浙江省zjs +杭州市hzs +建德市jds +富阳市fys +临安市las +宁波市nbx +余姚市yys +慈溪市cxs +奉化市fhs +温州市wzs +瑞安市ras +乐清市lqs +嘉兴市jxs +海宁市hns +平湖市phs +桐乡市txs +湖州市hzs +绍兴市sxs +诸暨市zjs +上虞市sys +嵊州市szs +金华市jhs +兰溪市lxs +义乌市yws +东阳市dys +永康市yks +衢州市qzs +江山市jss +舟山市zss +台州市tzs +临海市lhs +丽水市lss +龙泉市lqs +安徽省ahs +合肥市hfs +芜湖市whs +蚌埠市bbs +淮南市hns +淮北市hbs +铜陵市tls +安庆市aqs +桐城市tcs +黄山市hss +滁州市czs +天长市dcs +明光市mgs +阜阳市fys +界首市jss +宿州市szs +巢湖市chs +六安市las +亳州市hzs +池州市czs +宣城市ycs +宁国市ngs +马鞍山市mass +福建省fjs +福州市fjs +福清市fqs +长乐市cls +厦门市xms +莆田市pts +三明市sms +永安市yas +泉州市qzs +石狮市sss +晋江市jjs +南安市nas +漳州市zzs +龙海市lhs +南平市nps +建瓯市jos +邵武市sws +建阳市jys +龙岩市lys +漳平市zps +宁德市nds +福安市fas +福鼎市fds +武夷山市wyss +江西省jxs +南昌市ncs +乐平市lps +萍乡市pxs +九江市jjs +瑞昌市rcs +新余市xys +鹰潭市yts +贵溪市gxs +赣州市gzs +瑞金市rjs +南康市nks +吉安市jas +宜春市ycs +丰城市fcs +樟树市zss +高安市gas +抚州市fzs +上饶市srs +德兴市dxs +井冈山市jgss +景德镇市jdzs +山东省sds +济南市jns +章丘市zqs +青岛市qds +胶南市jns +胶州市jzs +平度市pds +莱西市lxs +即墨市jms +淄博市zbs +枣庄市zzs +滕州市tzs +烟台市yts +龙口市lks +莱阳市lys +莱州市lzs +招远市zys +蓬莱市pls +栖霞市qxs +海阳市hys +潍坊市wfs +青州市qzs +诸城市zcs +寿光市sgs +安丘市aqs +高密市gms +昌邑市cys +济宁市jns +曲阜市qfs +兖州市yzs +邹城市zcs +泰安市tas +新泰市xts +肥城市fcs +威海市whs +乳山市rss +文登市wds +荣成市rcs +日照市rzs +莱芜市lws +临沂市lys +德州市dzs +乐陵市lls +禹城市ycs +聊城市lcs +临清市lqs +滨州市bzs +菏泽市hzs +河南省hns +郑州市zzs +巩义市gys +新郑市xzs +新密市xms +登封市dfs +荥阳市xys +开封市kfs +洛阳市lys +偃师市yss +汝州市rzs +舞钢市wgs +安阳市ays +林州市lzs +新乡市xxs +卫辉市whs +辉县市hxs +焦作市jzs +沁阳市qys +孟州市mzs +濮阳市pys +许昌市xcs +禹州市yzs +长葛市cgs +漯河市lhs +义马市yms +灵宝市lbs +南阳市nys +邓州市dzs +商丘市sqs +永城市ycs +信阳市xys +周口市zks +项城市dcs +济源市jys +三门峡市smxs +平顶山市pdss +驻马店市zmds +湖北省hbs +武汉市whs +黄石市hss +大冶市dys +十堰市sys +荆州市jzs +洪湖市hhs +石首市sss +松滋市szs +宜昌市ycs +宜都市yds +当阳市dys +枝江市jjs +襄樊市xfs +枣阳市zys +宜城市ycs +鄂州市ezs +荆门市jms +钟祥市zxs +孝感市xgs +应城市ycs +安陆市als +汉川市hcs +黄冈市hgs +麻城市mcs +武穴市wxs +咸宁市xns +赤壁市cbs +随州市szs +广水市gss +仙桃市xts +天门市tms +潜江市qjs +恩施市ess +利川市lcs +丹江口市djks +老河口市lhks +神农架林区snjlq +湖南省hns +长沙市css +浏阳市lys +株洲市zzs +醴陵市lls +湘潭市xts +湘乡市xxs +韶山市sss +衡阳市hys +耒阳市lys +常宁市cns +邵阳市sys +武冈市wgs +岳阳市yys +临湘市lxs +汨罗市mls +常德市cds +津市市jss +益阳市yys +沅江市yjs +郴州市czs +资兴市zxs +永州市yzs +怀化市hhs +洪江市hjs +娄底市lds +涟源市lys +吉首市jss +冷水江市lsjs +张家界市zjjs +广东省gds +广州市gzs +从化市chs +增城市zcs +深圳市szs +珠海市zhs +汕头市sts +韶关市sgs +乐昌市lcs +南雄市nxs +佛山市fss +江门市jms +台山市tss +开平市kps +鹤山市hss +恩平市eps +湛江市zjs +廉江市ljs +雷州市lzs +吴川市wcs +茂名市mms +西昌市xcs +峨眉山市emss +都江堰市djys +攀枝花市pzhs +贵州省gzs +贵阳市gys +清镇市qzs +遵义市zys +赤水市css +仁怀市rhs +安顺市ass +毕节市bjs +兴义市xys +凯里市kls +都匀市dys +福泉市fqs +六盘水市lpss +六枝特区lztq +万山特区wstq +云南省yns +昆明市kms +安宁市ans +曲靖市qjs +宣威市xws +玉溪市yxs +保山市bss +昭通市zts +丽江市ljs +思茅市sms +临沧市lqs +个旧市gjs +开远市kys +景洪市jhs +楚雄市cxs +大理市dls +潞西市lxs +瑞丽市rls +西藏自治区xzzzq +拉萨市lss +陕西省sxs +西安市xas +铜川市tcs +宝鸡市bjs +咸阳市xys +渭南市wns +韩城市hcs +华阴市hys +延安市yas +汉中市azs +榆林市yls +安康市aks +商洛市sls +甘肃省gss +兰州市lzs +金昌市jcs +白银市bys +天水市tss +武威市wws +张掖市zys +平凉市pls +酒泉市jqs +玉门市yms +敦煌市dhs +庆阳市qys +定西市dxs +陇南市lns +临夏市lxs +合作市hzs +嘉峪关市jygs +青海省qhs +西宁市xns +德令哈市dlhs +格尔木市gems +宁夏回族自治区nxhzzzq +银川市ycs +灵武市lws +吴忠市wzs +固原市gys +中卫市zws +石嘴山市szss +青铜峡市qtxs +新疆维吾尔自治区xjwwezzq +喀什市kss +昌吉市cjs +阜康市fks +米泉市mqs +博乐市bls +伊宁市yns +奎屯市kts +塔城市tcs +乌苏市wss +石河子市shzs +阿拉尔市ales +五家渠市wjqs +吐鲁番市tlfs +阿克苏市akss +阿图什市atss +库尔勒市kels +阿勒泰市alts +乌鲁木齐市wlmqs +克拉玛依市klmys +图木舒克市tmsks +香港特别行政区 +中西区zxq +东区dq +观塘区gtq +南区nq +湾仔区wzq +离岛区ldq +葵青区kqq +北区bq +西贡区xgq +沙田区stq +屯门区tmq +大埔区dpq +荃湾区qwq +元朗区ylq +九龙城区jtcq +油尖旺区yjwq +深水埗区ssbq +黄大仙区hdxq +台湾省tws +台北市tbs +高雄市gxs +基隆市jls +台中市tzs +台南市tns +新竹市xzs +嘉义市jys +板桥市bqs +宜兰市yls +竹北市zbs +桃园市tys +苗栗市mls +丰原市fys +彰化市zhs +南投市nts +太保市tbs +斗六市dls +新营市xys +凤山市fss +屏东市pds +台东市tds +花莲市hls +马公市mgs diff --git a/ZkEdit.cpp b/ZkEdit.cpp new file mode 100644 index 0000000..2d1ff38 --- /dev/null +++ b/ZkEdit.cpp @@ -0,0 +1,265 @@ +#include "ZkEdit.h" +#include "ui_zkedit.h" +#include "SysPara.h" +#include +#include + +ZkEdit::ZkEdit(QWidget *parent) : + QWidget(parent), + ui(new Ui::ZkEdit) +{ + ui->setupUi(this); + fileDialog = 0; + openedFileName = ""; + newFileAppending = false; + connect(ui->widgetPic,SIGNAL(picWidgetModify(int ,int )),this,SLOT(enableSaveButton(int ,int ))); + connect(ui->checkBoxPicExpand,SIGNAL(clicked(bool)),this,SLOT(oncheckboxExpandClicked(bool))); + connect(ui->checkBoxTrimPic,SIGNAL(clicked(bool)),this,SLOT(oncheckboxTrimPicClicked(bool))); + ui->pushButtonSave->setEnabled(false); + forcePicWidgetSize = false; +#ifdef MYSAVEFILEDLG + dialogSaveFile =new DialogSaveFile(0); +#endif + +} + +ZkEdit::~ZkEdit() +{ + delete ui; +#ifdef MYSAVEFILEDLG + if(dialogSaveFile) delete dialogSaveFile; +#endif + if(fileDialog) + delete fileDialog; + +} + +void ZkEdit::oncheckboxExpandClicked(bool) +{ + ui->checkBoxTrimPic->setCheckState(Qt::Unchecked); +} + +void ZkEdit::oncheckboxTrimPicClicked(bool) +{ + ui->checkBoxPicExpand->setCheckState(Qt::Unchecked); +} + +void ZkEdit::checkNewFileAppending(){ + if(newFileAppending){ + ui->widgetPic->initWidget(ui->spinBoxWidthPoint->value(),ui->spinBoxHeightPoint->value()); + openedFileName = ""; + } + newFileAppending = false; +} + +void ZkEdit::onSave_File_reject(){ + checkNewFileAppending(); +} + +bool ZkEdit::maybeSave(){ + if(!ui->widgetPic->isModified()) + return true; + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("图片已经改变,是否保存?")); + QPushButton *saveButton = msgBox.addButton(tr("保存"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("放弃保存"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + + msgBox.exec(); + + if (msgBox.clickedButton() == saveButton) { + newFileAppending = true; + on_pushButtonSave_clicked(); + return false; + } else if (msgBox.clickedButton() == cancleSaveButton) { + return true; + } + else + return false; + + return true; +} + +void ZkEdit::on_pushButtonNew_pressed(){ + if(maybeSave()){ + ui->widgetPic->initWidget(ui->spinBoxWidthPoint->value(),ui->spinBoxHeightPoint->value()); + openedFileName = ""; + } +} + +void ZkEdit::enableSaveButton(int w,int h){ + ui->pushButtonSave->setEnabled(true); + ui->spinBoxHeightPoint->setValue(h); + ui->spinBoxWidthPoint->setValue(w); +} + +void ZkEdit::on_pushButtonEnlarge_pressed() +{ + ui->widgetPic->enlargeDisplay(); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); +} + +void ZkEdit::on_pushButtonReduce_pressed() +{ + ui->widgetPic->reduceDisplay(); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); +} + +void ZkEdit::on_pushButtonUp_pressed() +{ + //ui->widgetPic->currPositionMove(0,-1); + ui->widgetPic->currPositionMove(0,-1,0,ui->checkBoxTrimPic->isChecked(),ui->checkBoxPicExpand->isChecked()); +} + +void ZkEdit::on_pushButtonLeft_pressed() +{ + //ui->widgetPic->currPositionMove(-1,0); + ui->widgetPic->currPositionMove(-1,0,0,ui->checkBoxTrimPic->isChecked(),ui->checkBoxPicExpand->isChecked()); +} + +void ZkEdit::on_pushButtonEnsure_pressed() +{ + ui->widgetPic->ensureCurrPos(); +} + +void ZkEdit::on_pushButtonRight_pressed() +{ + //ui->widgetPic->currPositionMove(1,0); + ui->widgetPic->currPositionMove(1,0,0,ui->checkBoxTrimPic->isChecked(),ui->checkBoxPicExpand->isChecked()); +} + +void ZkEdit::on_pushButtonDown_pressed() +{ + //ui->widgetPic->currPositionMove(0,1); + ui->widgetPic->currPositionMove(0,1,0,ui->checkBoxTrimPic->isChecked(),ui->checkBoxPicExpand->isChecked()); +} + +void ZkEdit::on_pushButtonSaveAs_clicked() +{ +#ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->setTitleTxt(tr("图片另存为...")); + dialogSaveFile->refreshListView(2); + dialogSaveFile->setEnterFileName(""); + dialogSaveFile->show(); +#else + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + fileDialog->showFileDialog(tr("另存为"),QString(DOC_ROOT_DIR),QString("Picture files (*.jpg )")); +#endif + +} +void ZkEdit::onSaveASFile(QString fileName,bool Flag){// use for dialogSaveFile class + // filename= fileName ; + if( !fileName.endsWith(".jpg",Qt::CaseInsensitive) ) + fileName = QFileInfo(fileName).baseName()+ ".jpg"; + + ui->widgetPic->saveImage(fileName); + ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(fileName); + + checkNewFileAppending(); + +} + +void ZkEdit::onSaveAS_FIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + QString fileName = files[i]; + if( // !fileName.endsWith(".gif",Qt::CaseInsensitive) + //&& !fileName.endsWith(".jpeg",Qt::CaseInsensitive) + // && + !fileName.endsWith(".jpg",Qt::CaseInsensitive) + //&& !fileName.endsWith(".png",Qt::CaseInsensitive) + //&& !fileName.endsWith(".bmp",Qt::CaseInsensitive) + ) + fileName += ".jpg"; + + ui->widgetPic->saveImage(fileName); + ui->pushButtonSave->setEnabled(false); + openedFileName = fileName; + ui->labelFileName->setText(fileName); + } + checkNewFileAppending(); +} + +void ZkEdit::on_pushButtonOpen_clicked() +{ + forcePicWidgetSize = false; + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onOpenFIle_select())); + fileDialog->showFileDialog(tr("打开文件"),QString(DOC_ROOT_DIR), + QString("Picture files ( *.jpeg *.bmp *.gif *.png *jpg)")); +} + + +void ZkEdit::onOpenFIle_select(){ + QStringList files = fileDialog->selectedFiles(); + for(int i = 0;i < files.size(); i++){ + QString fileName = files.value(i); + ui->widgetPic->loadImage(fileName,forcePicWidgetSize); + openedFileName = fileName; + ui->labelFileName->setText(fileName); + ui->labelScaleLeval->setText(tr("放大倍数:%1").arg(ui->widgetPic->getScaleValue())); + ui->spinBoxHeightPoint->setValue(ui->widgetPic->getHeight()); + ui->spinBoxWidthPoint->setValue(ui->widgetPic->getWidth()); + } +} + +void ZkEdit::on_pushButtonSave_clicked() +{ + if(!openedFileName.isEmpty()){ + ui->widgetPic->saveImage(openedFileName); + ui->pushButtonSave->setEnabled(false); + } + else { + #ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->setTitleTxt(tr("图片保存为...")); + dialogSaveFile->refreshListView(2); + dialogSaveFile->setEnterFileName(""); + dialogSaveFile->show(); + #else + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(rejected()),this,SLOT(onSave_File_reject())); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onSaveAS_FIle_select())); + fileDialog->showFileDialog(tr("保存"),QString(DOC_ROOT_DIR),QString("Picture files ( *.jpg )")); + #endif + } +} + +void ZkEdit::on_pushButtonImport_clicked() +{ + forcePicWidgetSize = true; + if(fileDialog) + delete fileDialog; + fileDialog = new MyFileDialog(0); + disconnect(fileDialog,SIGNAL(accepted()),0,0); + connect(fileDialog,SIGNAL(accepted()),this,SLOT(onOpenFIle_select())); + fileDialog->showFileDialog(tr("导入文件"),QString(DOC_ROOT_DIR),QString("Picture files (*.png *.jpeg *.jpg *.gif *.bmp)")); +} + +void ZkEdit::keyPressEvent(QKeyEvent *e) +{ + switch(e->key()) + { + case Qt::Key_Return:on_pushButtonEnsure_pressed();break; + case Qt::Key_Up: on_pushButtonUp_pressed();break; + case Qt::Key_Left: on_pushButtonLeft_pressed();break; + case Qt::Key_Right:on_pushButtonRight_pressed();break; + case Qt::Key_Down:on_pushButtonDown_pressed();break; + } +} + diff --git a/ZkEdit.h b/ZkEdit.h new file mode 100644 index 0000000..3f683f9 --- /dev/null +++ b/ZkEdit.h @@ -0,0 +1,73 @@ +#ifndef ZKEDIT_H +#define ZKEDIT_H + +#include +#include +#include +#include +#include "MyFileDialog.h" +#include "DialogSaveFile.h" +#include "myinclude.h" +namespace Ui { +class ZkEdit; +} + +#define MAX_PIC_HEIGHT 40 +#define MAX_PIC_WIDTH 100 +class ZkEdit : public QWidget +{ + Q_OBJECT + +public: + explicit ZkEdit(QWidget *parent = 0); + ~ZkEdit(); + +protected slots: + void onSaveASFile(QString fileName, bool Flag); +private slots: + void on_pushButtonNew_pressed(); + + void on_pushButtonEnlarge_pressed(); + + void on_pushButtonReduce_pressed(); + + void on_pushButtonUp_pressed(); + + void on_pushButtonLeft_pressed(); + + void on_pushButtonEnsure_pressed(); + + void on_pushButtonRight_pressed(); + + void on_pushButtonDown_pressed(); + + void on_pushButtonSaveAs_clicked(); + void onSaveAS_FIle_select(); + void onSave_File_reject(); + void on_pushButtonOpen_clicked(); + void onOpenFIle_select(); + void on_pushButtonSave_clicked(); + + void enableSaveButton(int w,int h); + + void on_pushButtonImport_clicked(); + void oncheckboxExpandClicked(bool); + void oncheckboxTrimPicClicked(bool); + +private: + Ui::ZkEdit *ui; + MyFileDialog *fileDialog; + QString openedFileName; + bool newFileAppending; + void checkNewFileAppending(); + bool maybeSave(); + bool forcePicWidgetSize; + void keyPressEvent(QKeyEvent *e); +#ifdef MYSAVEFILEDLG + DialogSaveFile *dialogSaveFile; +#endif +}; + +#endif +// ZKEDIT_H + diff --git a/arm_build b/arm_build new file mode 100644 index 0000000..9d508be --- /dev/null +++ b/arm_build @@ -0,0 +1,3 @@ +/usr/local/Trolltech/QtEmbedded-4.6.3-arm/bin/qmake -project +#echo "TRANSLATIONS = chinese.ts english.ts" >> QtUI.pro +/usr/local/Trolltech/QtEmbedded-4.6.3-arm/bin/qmake diff --git a/buge_record.lnk b/buge_record.lnk new file mode 100644 index 0000000..f98bf59 Binary files /dev/null and b/buge_record.lnk differ diff --git a/buge_record.txt b/buge_record.txt new file mode 100644 index 0000000..a80461c --- /dev/null +++ b/buge_record.txt @@ -0,0 +1,228 @@ + +2017.9.16:为兼容am335x,添加新的pwm控制方式 + +2017.8.30:调整FPGA通信异常判别阀值,减少误判提示 + +备忘内容:主板的型号与软件版本 +`define JETV3 // EP4F15 V3板子 +`define JETV32 // EP3C10 V4板子 +`define JETV23 // V23板子 EP3C25 + +2017.8.29:显示字库文件检验码,字库可导出U盘。(完成) + +2017.8.27 支持多段长度顺序打印 + 设置 数组 保存: 计数器1起始值,结束值,重复次数 + 还在考虑设计方案。 +2017.8.26 支持145KHz晶振 + 版本日期: 2017.8.26 23:25 + +2017.8.26 增加自动清洗功能分3个步骤 + 版本日期: 2017.8.25 20:10(左右) +2017.8.21 解决清洗会关供墨阀问题 + 版本日期: 2017.8.21 15:36 + + +2017.8.19 测试内容:卷间隔打印 +1. ARM文件更新为:QtUI (2017-8-18 21:37:08) +2. FPGA有两个版本,分别测试一下,看哪个版本能用 + 测试1:刷FPGA文件 cheap_Jet3V2(0726-1).pof (No52) + 测试2:刷FPGA文件 cheap_Jet3V2(A87T-3).pof (No53) + +2017.7.18 +1. FPGA与QtUI都要更新 +2. QtUI可通过U盘升级 +3. FPGA文件(A87T.pof)请通过FPGA的下载线更新 + +A87T.pof 测试结果 位置不固定,但长度正确 + +A87T-1.pof 等测试 + +20160729: 发现打开历史记录会死机问题,原因待查。但执行删除历史记录后,可避免再次死机。 +20160723: 增加电眼复位功能。 与电眼清零不同,复位时,计数不清零,而是等于预设的当前值。 +20160718: 参考日立方案,优化打印效果 +20160715: 增加了 0/00 字符 +20160717: 修改了12点阵纯变量时的点阵数 +20160630: 修正粘度测量时间错误问题 + +20151218 增加开机次数和开机时间显示功能 +20151210 修正点阵方式下变量数大于8时,出现死机现象 +20151210 修正文本方式垂直点阵数不正确问题。单行可以了,多行则还会出现多余空行。 +20151206 粘度低报警问题 +20151204 开机默认打开:高压故障关回收槽功能 +20151204 主界面增加逆清洗按钮 +20151204 进一步细分晶振搜索电压步进值 + + +20151127 修正二维码图案的下一行显示不全问题 +20151121 高压故障自动关闭回收槽 +20151119 增加打开文件,自动自动清零选项 +20151110 增加外部电眼自动清零且计数器2加1 +20151109 新增计数1和计数器2单独立即清零 版本号 No42 +20151017 二维码变量任意位置显示问题 +20151015 二维码变量可显示 +20151012 增加DataMatrix二维码功能 + +20151001 by20150127 +20150210 关闭主界面温度报警显示; 最新字库为20150210字库 +20150209 新增:温度、直径等部分特殊字符(需要升级字库) +20150207 修改界面显示:墨水泄漏改为墨水缸满 +20150207 开机时,喷头温度延时30分钟报警 +20150127 新增同步方式下,电眼立即清零功能(ARM与FPGA一起更新No.28) +20150124 修正原有“变量周”计算错误 +20150119 修正产品脉冲输出延时问题 +20150118 修正双计数器出现不同步问题 +20150114 修正超慢打印时,喷印延时数据溢出错误 +20150111 修改管材,电缆的时间方式喷印间隔(取值6~9999999ms),与旧版本不完全兼容。 +20150109 测试二维码喷印 +20141211 点阵方式9X6字库改为9X7 +20141211 修正插入某些图案出现多余点问题 +20141208 开发新版电脑编字软件 +20141127 完善了喷嘴逆清洗功能 +20141116 测试了AB双相同步器功能(未应用) +20141110 测试了自动开机循环功能(未应用) +20141106 增加了压力调整和高压重置的限制 +20141101 修正毫米脉冲数大时速度显示问题 +20141029 调整部分默认参数 +20141023 修正英文版本翻译不全 +20141017 FPGA修正同步方式利用电眼信号触发清0问题 +20141009 修正超速对话框与参数保存对话框冲突问题 +20141008 + 1. 修正上一版本中存在的图形方式下,输入变量没有变绿底问题。打印时计数器显示正常。 + 2. 注意测试的内容:系统参数是否还会出现丢失现象 +20140915 + * 修正了不同字体混编时,通过回车符上移光标问题。 +20140909 + * 机箱温度显示 +20140830 + * 修正点击权限按钮时出现信息显示行数错误问题 +20140731 + * 限制电眼误触发; 时间触发的行末到行首问题已修正. +201400707 + * 解决下位灯影响粘度泵工作问题 + +20140628 + * 修正shift键影响中文输入问题 + * 计数器立即清零 + * 不同步走米功能修正:选择时不同步走米时,不受故障和停止键影响; 不选择时,由打印和停止键控制计米器 + +20140620 + * 最大可编辑信息长度为3100列 + * 墨水或溶剂空超过3小时,自动关机 + * 1/8电压调整 + * 整列电压调整 +20140620 + * 修正点阵模式部分中文符号不能输入问题 + * 修正回收故障动作不正常问题 +20140609 + * 部分中文加粗显示 +20140608 + * 部分变量加粗显示 +20140606 + * 部分字符加粗显示 +20140528 + * 新增不打印走米选择项 +20140527 + * 修正一处同步打印触发错误(FPGA) +20140526 + * 增加立即清零按钮,不需等待上一米打印完成,也可以直接打印新行。 --测试中,未完成。 + * ARM与FPGA均需要升级. +20140523 + * 修正回收故障恢复异常 +20140523 + * 修正文件不能删除问题(A3.05) +20140506 + * 更换3.14字库 +2014/5/5 + *修正默认参数异常问题 +2014/4/28 + *修正泄压阀由FPGA控制控制时,不动作问题.(仅需FPGA) + *计数器清0测试完成。 + +2014/4/26 + * 解决计数复位不正确;泄压阀由FPGA控制(需改变电阻连接) + +20140423 + * 修正V4板泄压阀工作异常,由FPGA处理; 修正计数器复位异常(0有时不打印情况); FPGA 需要升级 +20140418 + * 修正V4板主泵状态异常。 +20140417 + * 修正预览出现显示不全问题.修正暂停按钮英文拼写错误。 +20140415 + * 修正英文版翻译不全问题. +20140411 + * 修正喷嘴逆清洗存在的黑屏问题; 修正V4版回收故障显示错误(FPGA需要升级) +20140410 + * 优化系统界面字体,新增英文版本,要升级字库。 +20140407 + * 实现:点阵模式下变量可加粗 +20140328 + * 点距微调加到独立参数设置;解决删除图片存在的问题 +20140327 + * 更新版本号为A304:增加独立参数设置 +20140326 + *修正图案上下倒置问题。 +20140319 + *增加超速不打印设置选项。 +20140318 + *更正字库编辑不能正常切换问题。 +20140317 + *更正不打印走米提示信息。 +20140316 + *修正不打印走米暂停逻辑。 + +20140315 + * 修正高压包最大容差为50 + * 新增同步方式下,不打印走米(测试) +20140314 + * 修正交替打印字宽问题 + * 修正平字方编码错误 +20140312 + * 修正交替打印字高减半问题 + * 修正电机动作方式,改脉冲式 + * A3.03/Fx.1.3 No.7 +20140311 + * 完善键盘部分字符不能显示问题 + * 完善编辑状态下的键盘操作 + * 修正电机动作方式 + * 修正自然计数米界面显示 + +20140310 + * 修正变量(计数器)放置在信息最末尾时,出现保存后不能编辑的问题 + * 修正交替打印时,光栅高度显示值不正确问题 + * 修正交替打印与显示不一致问题 + * 版本标识:A3.03/Fx.1.3 No.6 +20140309 + ** 注意A3.03必须与Fx.1.3配套使用 ** + * 交替打印功能移到FPGA实现,ARM软件也作相应修改 + * 交替打印信息按正常方式编辑,变量使用无特殊要求! + * 新增版本信息记录界面 + * 修正文本-点阵界面切换存在的问题 + * 修正点阵界面下开机不能自动加载文件的问题 + * 修正字库编辑功能无法开启 + * 修正字库倒置问题 + * 完善了插入图案功能,点阵编辑界面也支持JPG、BMP等图片格式 +20140308 + * 版本号改为A3.03,识别码变更 + * 修正变量显示位置不正确问题 +20140307 + * 解决文本编辑方式平方不正常问题 +20140306 + * 两种编辑方式切换改为人工切换,在[系统设置]中进行设置 +20140305 + * 打印不完报警 +20140304 + * 修改完善12点阵和16点阵的文本字库 +20140301 + * 整合两种编辑方式(点阵方式与文件方式) +20140228 + * 修改完善英文点阵字库 +20140226 + * 解决晶振电压调整出现的问题 +20140221 + * 文本方式编字,增加了以下主要功能: + * FPGA控制主墨泵 + * FPGA控制电机 + * 回收故障关墨线 + * 交替打印 + * 自然数计米 + * 开喷头盖,相位故障仍能走米 diff --git a/buge_record1.txt b/buge_record1.txt new file mode 100644 index 0000000..bb0186f --- /dev/null +++ b/buge_record1.txt @@ -0,0 +1,175 @@ + + +20151127 修正二维码图案的下一行显示不全问题 +20151121 高压故障自动关闭回收槽 +20151119 增加打开文件,自动自动清零选项 +20151110 增加外部电眼自动清零且计数器2加1 +20151109 新增计数1和计数器2单独立即清零 版本号 No42 +20151017 二维码变量任意位置显示问题 +20151015 二维码变量可显示 +20151012 增加DataMatrix二维码功能 + +20151001 by20150127 +20150210 关闭主界面温度报警显示; 最新字库为20150210字库 +20150209 新增:温度、直径等部分特殊字符(需要升级字库) +20150207 修改界面显示:墨水泄漏改为墨水缸满 +20150207 开机时,喷头温度延时30分钟报警 +20150127 新增同步方式下,电眼立即清零功能(ARM与FPGA一起更新No.28) +20150124 修正原有“变量周”计算错误 +20150119 修正产品脉冲输出延时问题 +20150118 修正双计数器出现不同步问题 +20150114 修正超慢打印时,喷印延时数据溢出错误 +20150111 修改管材,电缆的时间方式喷印间隔(取值6~9999999ms),与旧版本不完全兼容。 +20150109 测试二维码喷印 +20141211 点阵方式9X6字库改为9X7 +20141211 修正插入某些图案出现多余点问题 +20141208 开发新版电脑编字软件 +20141127 完善了喷嘴逆清洗功能 +20141116 测试了AB双相同步器功能(未应用) +20141110 测试了自动开机循环功能(未应用) +20141106 增加了压力调整和高压重置的限制 +20141101 修正毫米脉冲数大时速度显示问题 +20141029 调整部分默认参数 +20141023 修正英文版本翻译不全 +20141017 FPGA修正同步方式利用电眼信号触发清0问题 +20141009 修正超速对话框与参数保存对话框冲突问题 +20141008 + 1. 修正上一版本中存在的图形方式下,输入变量没有变绿底问题。打印时计数器显示正常。 + 2. 注意测试的内容:系统参数是否还会出现丢失现象 +20140915 + * 修正了不同字体混编时,通过回车符上移光标问题。 +20140909 + * 机箱温度显示 +20140830 + * 修正点击权限按钮时出现信息显示行数错误问题 +20140731 + * 限制电眼误触发; 时间触发的行末到行首问题已修正. +201400707 + * 解决下位灯影响粘度泵工作问题 + +20140628 + * 修正shift键影响中文输入问题 + * 计数器立即清零 + * 不同步走米功能修正:选择时不同步走米时,不受故障和停止键影响; 不选择时,由打印和停止键控制计米器 + +20140620 + * 最大可编辑信息长度为3100列 + * 墨水或溶剂空超过3小时,自动关机 + * 1/8电压调整 + * 整列电压调整 +20140620 + * 修正点阵模式部分中文符号不能输入问题 + * 修正回收故障动作不正常问题 +20140609 + * 部分中文加粗显示 +20140608 + * 部分变量加粗显示 +20140606 + * 部分字符加粗显示 +20140528 + * 新增不打印走米选择项 +20140527 + * 修正一处同步打印触发错误(FPGA) +20140526 + * 增加立即清零按钮,不需等待上一米打印完成,也可以直接打印新行。 --测试中,未完成。 + * ARM与FPGA均需要升级. +20140523 + * 修正回收故障恢复异常 +20140523 + * 修正文件不能删除问题(A3.05) +20140506 + * 更换3.14字库 +2014/5/5 + *修正默认参数异常问题 +2014/4/28 + *修正泄压阀由FPGA控制控制时,不动作问题.(仅需FPGA) + *计数器清0测试完成。 + +2014/4/26 + * 解决计数复位不正确;泄压阀由FPGA控制(需改变电阻连接) + +20140423 + * 修正V4板泄压阀工作异常,由FPGA处理; 修正计数器复位异常(0有时不打印情况); FPGA 需要升级 +20140418 + * 修正V4板主泵状态异常。 +20140417 + * 修正预览出现显示不全问题.修正暂停按钮英文拼写错误。 +20140415 + * 修正英文版翻译不全问题. +20140411 + * 修正喷嘴逆清洗存在的黑屏问题; 修正V4版回收故障显示错误(FPGA需要升级) +20140410 + * 优化系统界面字体,新增英文版本,要升级字库。 +20140407 + * 实现:点阵模式下变量可加粗 +20140328 + * 点距微调加到独立参数设置;解决删除图片存在的问题 +20140327 + * 更新版本号为A304:增加独立参数设置 +20140326 + *修正图案上下倒置问题。 +20140319 + *增加超速不打印设置选项。 +20140318 + *更正字库编辑不能正常切换问题。 +20140317 + *更正不打印走米提示信息。 +20140316 + *修正不打印走米暂停逻辑。 + +20140315 + * 修正高压包最大容差为50 + * 新增同步方式下,不打印走米(测试) +20140314 + * 修正交替打印字宽问题 + * 修正平字方编码错误 +20140312 + * 修正交替打印字高减半问题 + * 修正电机动作方式,改脉冲式 + * A3.03/Fx.1.3 No.7 +20140311 + * 完善键盘部分字符不能显示问题 + * 完善编辑状态下的键盘操作 + * 修正电机动作方式 + * 修正自然计数米界面显示 + +20140310 + * 修正变量(计数器)放置在信息最末尾时,出现保存后不能编辑的问题 + * 修正交替打印时,光栅高度显示值不正确问题 + * 修正交替打印与显示不一致问题 + * 版本标识:A3.03/Fx.1.3 No.6 +20140309 + ** 注意A3.03必须与Fx.1.3配套使用 ** + * 交替打印功能移到FPGA实现,ARM软件也作相应修改 + * 交替打印信息按正常方式编辑,变量使用无特殊要求! + * 新增版本信息记录界面 + * 修正文本-点阵界面切换存在的问题 + * 修正点阵界面下开机不能自动加载文件的问题 + * 修正字库编辑功能无法开启 + * 修正字库倒置问题 + * 完善了插入图案功能,点阵编辑界面也支持JPG、BMP等图片格式 +20140308 + * 版本号改为A3.03,识别码变更 + * 修正变量显示位置不正确问题 +20140307 + * 解决文本编辑方式平方不正常问题 +20140306 + * 两种编辑方式切换改为人工切换,在[系统设置]中进行设置 +20140305 + * 打印不完报警 +20140304 + * 修改完善12点阵和16点阵的文本字库 +20140301 + * 整合两种编辑方式(点阵方式与文件方式) +20140228 + * 修改完善英文点阵字库 +20140226 + * 解决晶振电压调整出现的问题 +20140221 + * 文本方式编字,增加了以下主要功能: + * FPGA控制主墨泵 + * FPGA控制电机 + * 回收故障关墨线 + * 交替打印 + * 自然数计米 + * 开喷头盖,相位故障仍能走米 diff --git a/calibrate b/calibrate new file mode 100644 index 0000000..d01c0e5 Binary files /dev/null and b/calibrate differ diff --git a/chinese.qm b/chinese.qm new file mode 100644 index 0000000..1513073 Binary files /dev/null and b/chinese.qm differ diff --git a/chinese.ts b/chinese.ts new file mode 100644 index 0000000..96711a9 --- /dev/null +++ b/chinese.ts @@ -0,0 +1,7475 @@ + + + +UTF-8 + + DevOp + + + + + + + + 警告 + + + + + 字高超出范围 + + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + + + + + + 错误 + + + + + 在同步计米的情况下无打印串或显示区域为零 + + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + + + + + 输入密码 + 提升授权 + + + + + DialogCycleprint + + + Dialog + + + + + 1循环范围:0- + + + + + 1循环次数: + + + + + 2循环范围:0- + + + + + 2循环次数: + + + + + 3循环范围:0- + + + + + 3循环次数: + + + + + 6循环次数: + + + + + 6循环范围:0- + + + + + 5循环范围:0- + + + + + 5循环次数: + + + + + 4循环范围:0- + + + + + 4循环次数: + + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + + + + + U盘文件 + + + + + 删除文件 + + + + + 删除全部 + + + + + 从U盘导入 + + + + + 导出到U盘 + + + + + 插入 + + + + + 打开文件 + + + + + 上一个 + + + + + 下一个 + + + + + 退出 + + + + + 文件操作 + + + + + + + 警告 + + + + + 是否确认删除当前文件? + + + + + 是否确认删除所有文件? + + + + + + + + 提示 + + + + + 是否确认从U盘导入所有文件? + + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + + + + + 成功从U盘导入? + + + + + 是否确认将所有文件导出到U盘? + + + + + 成功导出到U盘? + + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + + + + + 24点(中/英) + + + + + 7点(左横) + + + + + 7点(右横) + + + + + 9点(左横) + + + + + 9点(右横) + + + + + 7点(孟加拉) + + + + + 32点 + + + + + 7点(rf7) + 7点(数字) + + + + + 21点(rf21) + + + + + 12点(新罗马) + + + + + 123456890ABCDEFGWXYZ + + + + + - + + + + + 查字库标识 + + + + + 16点(中/英) + + + + + 5点(英) + + + + + 12点(中/英) + + + + + 7点(英) + + + + + 选择字体大小 + + + + + DialogInputTxt + + + Dialog + + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + + + + + 日 + + + + + 秒 + + + + + 分 + + + + + 月 + + + + + 周 + + + + + 时 + + + + + 年 + + + + + DataMatrix + + + + + QRCode + + + + + BarCode128 + + + + + 计数器1 + + + + + 计数器2 + + + + + 随机码1 + + + + + 有效日期 + + + + + 生产日期 + + + + + Class + + + + + 计数器3 + + + + + 数字个数 + + + + + 9个 + + + + + 11个 + + + + + 10个 + + + + + 3个 + + + + + 6个 + + + + + 12个 + + + + + 13个 + + + + + 14个 + + + + + 15个 + + + + + 5个 + + + + + 8个 + + + + + 2个 + + + + + 7个 + + + + + 4个 + + + + + 1个 + + + + + 变量插入 + + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + + + + + + 1个像素 + + + + + + 2个像素 + + + + + + 3个像素 + + + + + 4个像素 + + + + + 5个像素 + + + + + 6个像素 + + + + + 7个像素 + + + + + 行间距: + + + + + 字符间距: + + + + + 选择行间距和字符间距 + + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + + + + + 列中: + + + + + 列尾: + + + + + 重置 + + + + + 测试 + + + + + DialogSaveFile + + + Dialog + + + + + 本地文件 + + + + + U盘文件 + + + + + 预览文件内容: + + + + + 上一个 + + + + + 下一个 + + + + + 请输入文件名: + + + + + 取消 + + + + + + 保存 + + + + + 警告 + + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + + + + + DialogShowCounter + + + Dialog + + + + + 米标显示: + + + + + 目前循环范围: + + + + + + + 米 + + + + + 剩余米数: + + + + + 循环次数: + + + + + 立即重新计米 + + + + + 起始: + + + + + 结束: + + + + + Dialoginputpasswd + + + Dialog + + + + + 修改密码: + + + + + Dialogmodifypasswd + + + Dialog + + + + + 修改密码: + + + + + 密码授权 + + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + + + + + 开始时间 + + + + + 结束时间 + + + + + SuperNodeIP: + + + + + edgeIP: + + + + + + + + + + . + + + + + 喷码机恢复工作! + + + + + Mac:%1维护时间剩余 + 维护时间剩余 + + + + + 小时,喷码机将停止工作.请与供应商联系! + + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + + + + + + 当前日期: + + + + + + 正确? + + + + + DlgMutiLanguage + + + 界面语言设置 + + + + + 中文 + + + + + 英语 + + + + + 土耳其语 + + + + + 西班牙语 + + + + + 泰语 + + + + + (注意: 选择切换显示语言, 重启后才能生效) + + + + + DlgMyWarring + + + 警告 + + + + + 确定 + + + + + TextLabel + + + + + DlgSelectInputLanguage + + + Dialog + + + + + 汉语(Chinese) + + + + + 英语(English) + + + + + 越南语(Vietnam) + + + + + DlgShowMsg + + + 警告 + + + + + 确定 + + + + + DlgVarLength + + + 变长喷印参数 + + + + + 头部长度(m) + + + + + 尾部长度(m) + + + + + + 调整长度(mm) + + + + + 总长(m) + + + + + 确定 + + + + + 可变长度允许 + + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + + + + + + + 信息编辑 + + + + + 图案编辑 + + + + + 打印设置 + + + + + 触发设置 + + + + + + 系统设置 + + + + + + 系统管理 + + + + + + 其他信息 + + + + + + 日志信息 + + + + + + 网络管理 + + + + + 电压调整 + + + + + Save + + + + + 不连续电压 + + + + + + vol0 + + + + + + vol1 + + + + + + vol2 + + + + + + vol3 + + + + + + vol4 + + + + + + vol5 + + + + + + vol6 + + + + + + vol7 + + + + + + vol8 + + + + + + vol9 + + + + + + vol10 + + + + + + vol11 + + + + + + vol12 + + + + + + vol13 + + + + + + vol14 + + + + + + vol15 + + + + + + vol16 + + + + + + vol17 + + + + + + vol18 + + + + + + vol19 + + + + + + vol20 + + + + + + vol21 + + + + + + vol22 + + + + + + vol23 + + + + + + vol24 + + + + + + vol25 + + + + + + vol26 + + + + + + vol27 + + + + + + vol28 + + + + + + vol29 + + + + + + vol30 + + + + + + vol31 + + + + + + vol32 + + + + + + vol33 + + + + + + vol34 + + + + + + vol35 + + + + + + vol36 + + + + + + vol37 + + + + + + vol38 + + + + + + vol39 + + + + + 连续电压 + + + + + 满列电压 + + + + + fvol0 + + + + + fvol1 + + + + + fvol2 + + + + + fvol3 + + + + + fvol4 + + + + + fvol5 + + + + + fvol6 + + + + + fvol7 + + + + + fvol8 + + + + + fvol9 + + + + + fvol10 + + + + + fvol11 + + + + + fvol12 + + + + + fvol13 + + + + + fvol14 + + + + + fvol15 + + + + + fvol16 + + + + + fvol17 + + + + + fvol18 + + + + + fvol19 + + + + + fvol20 + + + + + fvol21 + + + + + fvol22 + + + + + fvol23 + + + + + fvol24 + + + + + fvol25 + + + + + fvol26 + + + + + fvol27 + + + + + fvol28 + + + + + fvol29 + + + + + fvol30 + + + + + fvol31 + + + + + fvol32 + + + + + fvol33 + + + + + fvol34 + + + + + fvol35 + + + + + fvol36 + + + + + fvol37 + + + + + fvol38 + + + + + fvol39 + + + + + 其他调整 + + + + + 整体缩放(%) : + + + + + WriteByte + + + + + ReadByte + + + + + + + Address: + + + + + + Value: + + + + + WriteWord + + + + + ReadWord + + + + + ReadDword + + + + + WriteDword + + + + + ValueH: + + + + + ValueL: + + + + + 定时开机循环完成,准备关机 + + + + + 准备关机 + + + + + 与FPGA失去通信!!! + + + + + 与FPGA通信恢复正常 + + + + + 开始自检,请等待60秒............... + + + + + 开始自检,请等待%1秒............... + + + + + + 自检完成!!! + + + + + + 墨水或溶剂空,准备关机 + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + + + + + 喷印速度过快!无法喷印完全!!! + + + + + 压力波动超过设定的5个值. + + + + + 停止打印,自动关闭高压. + + + + + 压力异常:上次压力值%1,当前压力值%2 + + + + + 高压异常:上次电流值%1,当前电流值%2 + + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + + + + + + 错误!!!!!!!!!!!主墨泵故障 + + + + + + 主墨泵故障!!! + + + + + 错误!!!!!!!!!!!压缩机故障 + + + + + 压缩机故障!!! + + + + + + 错误!粘度计下位灯故障. + + + + + + 错误!粘度计故障:检测不到上位灯. + + + + + 粘度检测异常,粘度值太大!!! + + + + + 提示 + + + + + 是否接收新的信息! + + + + + + 错误!!!!!!!!!!!粘度偏大故障 + + + + + 定时开机 + + + + + + 压力泄漏或压力传感器故障! + + + + + 运行中压力泄漏,停齿轮泵! + + + + + + 测试时间结束,准备关机 + + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + + + + + 混合阀打开1: + + + + + + 警告!!!!!!!!!!!粘度值偏低 + + + + + 混合阀打开2: + + + + + + + 电机故障 + + + + + 电机故障!!! + + + + + + 回收槽到头 + + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + + + + + 下一页 + + + + + ` + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 0 + + + + + - + + + + + = + + + + + 退格 + + + + + + 英文 + + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + [ + + + + + ] + + + + + \ + + + + + + 大写 + + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + Shift + + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + , + + + + + . + + + + + / + + + + + 上 + + + + + 特殊字 + + + + + 隐藏 + + + + + Ctrl + + + + + 删除 + + + + + 行首 + + + + + 行尾 + + + + + 左 + + + + + 下 + + + + + 右 + + + + + + 错误 + + + + + hanziDisplayLabels缺少初始化 + + + + + warning + + + + + myInputMethod is null + + + + + + 找不到输入法初始化文件 + + + + + 小写 + + + + + Tiếng Việt + + + + + Russian + + + + + Japanese + + + + + 全选 + + + + + 复制 + + + + + 粘贴 + + + + + 剪切 + + + + + 后退 + + + + + InsertSpaceNumDialog + + + 插入空格数 + + + + + 空格个数: + + + + + LogInfo + + + Form + + + + + 当前状态 + + + + + 清空当前状态 + + + + + 历史状态 + + + + + 删除历史文件 + + + + + 打开历史文件 + + + + + TextLabel + + + + + 导出日志到U盘 + + + + + 版本信息 + + + + + 请先打开历史状态文件! + + + + + + + 警告 + + + + + + + 无法打开文件 + + + + + + + + 提示 + + + + + 是否确认将所有日志文件导出到U盘? + + + + + 成功导出到U盘? + + + + + 选择历史记录文件 + + + + + 是否确认将历史日志文件全部清除? + + + + + 是否确认将当前日志全部清除? + + + + + MainWindow + + + InkJet + + + + + 编辑 + + + + + 打开文件 + + + + + 二维码 + + + + + 条形码 + + + + + 缩小 + + + + + 放大 + + + + + 获取数据 + + + + + 交替打印文件名 + + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + + + + + 当前时间 + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨线开关 + + + + + 喷头盖开 + + + + + 墨水缸满 + + + + + 墨水液位 + + + + + 溶剂液位 + + + + + 回收故障 + + + + + 粘度故障 + + + + + 相位故障 + + + + + 高压故障 + + + + + 故障恢复 + + + + + 立即重新计米 + + + + + 产品计数 + + + + + 产品总计数 + + + + + 关机 + + + + + 2014-08-23 + + + + + 高压包 + + + + + 粘度 + + + + + 压力 + + + + + + 隔膜位置 + + + + + + + + 开 + + + + + + + + 关 + + + + + + 暂停打印 +停止高压 + + + + + 紧急停机 + + + + + 泵启动 + + + + + 喷嘴逆清洗 + + + + + + 机箱: + + + + + + + 正在喷印............... + + + + + 喷头盖开, 喷印无法正常进行!!! + + + + + + 墨水缸满报警 + + + + + + 墨水液位报警 + + + + + + 溶剂液位报警 + + + + + + 高压故障,暂停打印 + + + + + + 高压故障,暂停打印. + + + + + 高压故障,关回收槽 + + + + + 高压故障,关回收槽和墨线 + + + + + + + + + 回收故障,关闭回收槽,关墨线 + + + + + 回收故障. + + + + + 回收异常,墨线可能偏离.(%1) + + + + + 维护时间已到,喷码机停止工作! + + + + + 相位故障:飞行时间错误! + + + + + 相位故障:相位检测错误! + + + + + + + 相位故障,准备关机 + + + + + + + 相位故障,暂停打印 + + + + + 相位故障,屏蔽DAC输出 + + + + + + 相位故障,屏蔽充电 + + + + + 齿轮泵转速 + + + + + 交替打印 + + + + + 电眼交替 + + + + + 列延时:%1点 + + + + + + + + + + + + + + + + 警告 + + + + + 无法打开文件 + + + + + 打开文件: + + + + + + + 提示 + + + + + 文件未保存,是否先保存文件! + + + + + + + + 变量数大于8个,某些变量将不起作用!!! + + + + + 喷印间隔过短,应高于%1! + + + + + 继续打印 +保持高压 + + + + + 正在排气 ............... + + + + + 泵停止 + + + + + + 最多支持的列数目为:%1请减小信息长度. + + + + + 同步目标每列有%1.%2个同步脉冲 + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + + + + + + 获取DM码内容: + + + + + + 获取DM码内容跟上次相同 + + + + + 高压故障:两高压偏转板间的电压检测异常 + + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + + + + + 3.高压线路漏电,请更换高压线路; + + + + + 4.高压底座漏电,请更换高压底座。 + + + + + 墨水过多:墨水溢出 + + + + + 1. 请停止添加墨水; + + + + + 2. 请排出多余墨水。 + + + + + 墨水液位:墨水即将耗尽 + + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + + + + + 回收故障:未检测到有墨水回收 + + + + + 1. 墨水未射入回收管,请修正墨线方向; + + + + + 2. 墨水粘度太低,请更换新墨水; + + + + + 3. 回收管堵塞,请清通或者更换回收管; + + + + + 4. 回收泵故障,请清洗或者更换回收泵; + + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + + + + + 溶剂液位:溶剂即将耗尽 + + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + + + + + + 粘度故障报警 + + + + + 粘度故障:墨水粘度无法自动调整 + + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + + + + + 粘度计异常: + + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + + + + + 相位故障报警 + + + + + 相位故障:相位信号检测异常 + + + + + 1. 墨水分裂不正常,请调整墨水分裂; + + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + + + + + 3. 放大板功能性异常,请更换放大板; + + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + + + + + 6. 墨水质量异常,请更换新墨水。 + + + + + 回收槽开关检测完成! + + + + + warning,界面上有变量未显示完全 + + + + + + + + [ %1行 x %2列 ] + + + + + + + + + 错误 + + + + + 喷头盖未关,请先关喷头盖! + + + + + 墨线未开,请先开墨线开关! + + + + + 正在加高压... + + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + + + + + + + 开始打印 + + + + + 回收槽未到底!!!!!! + + + + + + 暂停喷印............... + + + + + + 请减少信息中的变量(或计数器)数量. + + + + + 停止打印 + + + + + + 随机码文本将展出到U盘,请插入U盘 + + + + + 暂停打印 + + + + + 继续打印 + + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + + + + + + 停止 + + + + + %1.%2[%3.%4]米/分 + + + + + 停止打开 + + + + + 正在打开回收槽... + + + + + + 警告!回收槽开关时间未设置! + + + + + 停止关闭 + + + + + 正在关闭回收槽... + + + + + 准备关机...... + + + + + 回收槽未关,是否关闭回收槽后关机! + + + + + 是否确认关机? + + + + + 是否初始化产品计数? + + + + + 是否清除总产品计数? + + + + + 是否立即重新计米? + + + + + 警告:‘-’和空格的宽度不一样 + + + + + 条形码信息编辑 + + + + + + 二维码信息编辑 + + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + + + + + 0x0000 + + + + + 0xb100 + + + + + 0xb200 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + + + + + 写空间 + + + + + 进制转换 + + + + + + 编辑 + + + + + 上一页 + + + + + 下一页 + + + + + 完成 + + + + + ModbusSerial + + + 接收到开始打印命令 + + + + + 接收到暂停打印命令 + + + + + 接收到停止打印命令 + + + + + 接收到DM码数据命令 + + + + + MyFileDialog + + + 确定 + + + + + NetworkManager + + + Form + + + + + 手动设定 + + + + + + IP: + + + + + Mask: + + + + + GW: + + + + + 取消 + + + + + 有线LAN + + + + + WiFi: + + + + + SSID: + + + + + Status: + + + + + 连接 + + + + + auth: + + + + + Encryption: + + + + + Plaintext (open / no authentication) + + + + + 主获取数据按钮 + + + + + 断开 + + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + 设备码: + + + + + 服务IP: + + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + 8754 + + + + + 服务端口: + + + + + PSK: + + + + + Password: + + + + + 扫描 + + + + + 清除 + + + + + 获取数据 + + + + + Network: + + + + + 添加网络 + + + + + 测试 + + + + + 应用配置 + + + + + 去掉数字码 + + + + + 去掉QR码 + + + + + ScanSSID + + + + + 1 + + + + + 47.111.170.144 + + + + + wpa_supplicant service is not running. +Do you want to start it? + + + + + Disconnected + + + + + Inactive + + + + + Scanning + + + + + Authenticating + + + + + Associating + + + + + Associated + + + + + 4-Way Handshake + + + + + Group Handshake + + + + + Completed + + + + + Unknown + + + + + Could not get status from wpa_supplicant + + + + + Select any network + + + + + WPS AP in active PBC mode found + + + + + Press the PBC button on the screen to start registration + + + + + WPS AP with recently selected registrar + + + + + WPS AP detected + + + + + PBC mode overlap detected + + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + + + + + Network configuration received + + + + + Registration started + + + + + Registrar does not yet know PIN + + + + + Registration failed + + + + + Registration succeeded + + + + + WPA Pre-Shared Key Error + + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + + Network ID Error + + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + + + + + Failed to add network to wpa_supplicant +configuration. + + + + + Failed to enable network in wpa_supplicant +configuration. + + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + + + + + Yes + + + + + No + + + + + Failed to remove network from wpa_supplicant +configuration. + + + + + 是否去获取数据! + + + + + 获取数据中... + + + + + + 上报数据中... + + + + + + + + 提示 + + + + + + IP设置错误! + + + + + 应用成功 + + + + + OtherInfo + + + Form + + + + + 相位位置: + + + + + + 锁定相位 + + + + + DetectDelay + + + + + detect_num + + + + + FullTimeEn + + + + + 相位偏移: + + + + + 相检: + + + + + DetectVol + + + + + HighLowRatio + + + + + 充电占空比100% + + + + + 相位检测电压: + 相位检测电压 + + + + + 检测点数量: + + + + + 检测延迟 : + 检测墨点数量: + + + + + 飞行时间: + + + + + 频闪灯周期: + + + + + 应用当前配置 + + + + + 提示 + + + + + 应用成功 + + + + + 点 + + + + + 解锁相位 + + + + + PicEdit + + + Form + + + + + 开启软键盘 + + + + + 插入变量 + + + + + + 保存/打印 + + + + + 缩小 + + + + + 放大 + + + + + 5点阵 + + + + + 7点阵 + + + + + 9点阵 + + + + + 12点阵宋体 + + + + + 16点阵宋体 + + + + + 16点阵黑体 + + + + + 24点阵宋体 + + + + + 24点阵黑体 + + + + + 列高 + + + + + 无加粗 + + + + + 加粗1倍 + + + + + 加粗2倍 + + + + + 光栅[X:Y] + + + + + 放大比例 + + + + + 插入模式 + + + + + 文件名 + + + + + CURR[X,Y] + + + + + 新建信息 + + + + + 打开文件 + + + + + 字符间距 + + + + + 插入/修改 + + + + + 删除字符 + + + + + 插入图片 + + + + + 保存为 + + + + + + + 字库编辑 + + + + + 网格 + + + + + 粗体 + + + + + 显示控制符 + + + + + 行首 + + + + + 行尾 + + + + + 字符光标 + + + + + 像素光标 + + + + + 编辑现有的多字体 + + + + + 点击光栅可打开键盘,点击空白处关闭 + + + + + + + + + + + + 放大倍数:%1 + + + + + + 插入模式 + + + + + + 修改模式 + + + + + 编辑现有的多字体文件 +请使用修改模式!!! + 编辑现有的多字体文件 +请使用修改模式!!! + + + + + + + 保存 + + + + + 点击光栅可打开键盘,点击空白处关闭 + + + + + 信息编辑 + + + + + 字库保存 + + + + + + 返回信息编辑 + + + + + 请选择字体,打开键盘并输入要编辑的字符 + + + + + + + 提示 + + + + + 图片已经改变,是否保存? + + + + + 放弃保存 + + + + + 文件另存为... + + + + + 另存为 + + + + + + + + + + 文件名: + + + + + 文件名:) + + + + + 文件保存为... + + + + + 本条信息的变量超过规定数量! + + + + + 是否立即喷印当前的文件? + + + + + 是 + + + + + 否 + + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + + + + + 选择[字体]可改变光标大小. + + + + + 选择[绘图]方式,可以绘制任意图形 + + + + + 光标不匹配时,不能输入或删除. + + + + + 点击空白处可关闭键盘. + + + + + 通过[字库编辑]功能,用户可以自定义新字符 + + + + + 选择[文本模式]可切换到主界面编辑方式. + + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + + + + + 使用[字库编辑]功能,用户可自己修改字形 + + + + + PicWidget + + + Please input a char. + + + + + 请输入要编辑的字符 + + + + + 编辑字符:%1 + + + + + [%1行,%2列] + + + + + 光标[%1,%2] + + + + + + + + + + + + + + 警告 + + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + + + + + + + 请新创建建图片 + + + + + + + 文件:%1 无法打开 + + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintNet + + + 获取二维码内容: + + + + + 获取数字码: + + + + + PrintSetting + + + Form + + + + + 常用设置 + + + + + 字体加粗: + + + + + + 快速 + + + + + + + 标准 + + + + + + + 慢速1 + + + + + + + 慢速2 + + + + + + 慢速3 + + + + + + 慢速4 + + + + + + 慢速5 + + + + + + 慢速6 + + + + + + 慢速7 + + + + + + 慢速8 + + + + + + 慢速9 + + + + + 首行电压(%): + + + + + 打印模式: + + + + + 字高设置(%): + + + + + 字体宽度: + + + + + 行末电压(%): + + + + + 信息左右颠倒 + + + + + 相位故障关机 + + + + + 信息上下颠倒 + + + + + 故障停止走米 + + + + + 相位故障不打印 + + + + + 回收故障处理 + + + + + 自然数计米 + + + + + 超速暂停打印 + + + + + TextLabel + + + + + 不打印走米 + + + + + 电眼误触禁止 + + + + + 字形优化 + + + + + date time + + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + + ddhhmm + + + + + 有效期(天): + + + + + + 高级设置 + + + + + + 交替扫描隔点(默认为1): + + + + + 行末调整点模式: + + + + + 点距调整值(默认为0): + + + + + + 扫描颠倒 + + + + + 点距调整电压位置: + + + + + 行末调整点数(默认为0): + + + + + 去除冗点模式(默认懒惰): + + + + + 懒惰模式 + + + + + 贪婪模式 + + + + + 均衡模式 + + + + + + 冗点比例(默认为0%): + + + + + 行末点微调(‰): + + + + + 修改授权 + + + + + 省点 + + + + + dd MM yy + + + + + + 调整电压 + + + + + 使用推荐设置 + + + + + 行业: + + + + + 快 + + + + + 电线电缆 + + + + + 制药/食品/电子 + + + + + 建筑管材 + + + + + 其他 + + + + + 速度: + + + + + + 锁定脉冲计数 + + + + + 每条信息只打印一次 + + + + + 非字宽 + + + + + 使用齿轮泵 + + + + + 高压阈值: + + + + + 不检测喷头盖 + + + + + 打印时绿灯常亮 + + + + + 复位发送打印数据 + + + + + 计数器设置 + + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + + + + + 计数器3 + + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + + + + + 交替打印设置 + + + + + 起始位置: + + + + + 距离尾部(mm): + + + + + 特殊条件计数 + + + + + 首尾交替 + + + + + 打印电压缩放 + + + + + 整体缩放(%) : + + + + + 交替间隔: + + + + + 重复次数: + + + + + 米标显示 + + + + + 上移 + + + + + 下移 + + + + + 其它设置 + + + + + 特殊变量结束值: + + + + + 特殊变量起始值: + + + + + 打印 + + + + + 更换信息文件时执行的动作: + + + + + 产品计数器自动清0 + + + + + 总产品计数器自动清0 + + + + + 显示屏显示: + + + + + 分段计米 + + + + + 插 入 + + + + + 添 加 + + + + + 全部删除 + + + + + 删 除 + + + + + 高压故障关回收槽 + + + + + 计数器1设置 + + + + + + + + 起始值: + + + + + + + + 结束值: + + + + + + + + 增量值: + + + + + + + 重设值 + + + + + + + 重复数: + + + + + + + 当前值: + + + + + + + 清零 + + + + + 无交替 + + + + + 普通交替 + + + + + 电眼触发交替 + + + + + 导出随机码文本 + + + + + 无 + + + + + 外接显示屏: + + + + + 复位到起始值 + + + + + 小屏 + + + + + 大屏 + + + + + 总产品计数值 + + + + + + 计数器1 + + + + + + 计数器2 + + + + + 可变长度 + + + + + 计数器2设置 + + + + + 计数器3设置 + + + + + 跳米设置 + + + + + 跳米数: + + + + + 跳米打印 + + + + + + + 输入密码 + 提升权限 + + + + + 墨线时间 + + + + + 墨线时间: + + + + + + + 0 + + + + + 开机次数: + + + + + 应用当前配置 + + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + + + + + 要求:(重复次数+起始位置)<交替间隔 + + + + + + + + + 提示 + + + + + 应用成功 + + + + + 系统维护设置成功! + + + + + 喷码机维护设置成功! + + + + + + + 错误 + + + + + 授权码: + + + + + 错误 + + + + + 不存在 + + + + + + + 输入密码 + 提升授权 + + + + + 密码: + + + + + 取消授权 + + + + + + + + + + + 警告 + + + + + 是否确认使用推荐设置? + + + + + 随机码文件为空,不需要导出 + + + + + 随机码文本将展出到U盘,请插入U盘 + + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + + + + + 1 + + + + + 正在打印第%1组设置,不可删除 + + + + + 是否确认删除第%1组设置? + + + + + 是否确认删除全部设置? + + + + + 字体宽度不能为0 + + + + + 是否立即重新计米? + + + + + 解锁脉冲计数 + + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + + + + + 根据喷印 + + + + + 根据脉冲数 + + + + + 根据同步器参数 + + + + + 实际皮带速度(毫米/秒): + + + + + 实际喷印间隔长度(毫米): + + + + + 长度(毫米): + + + + + 同步脉冲数 + + + + + 同步器直径(毫米): + + + + + 脉冲数/转: + + + + + 脉冲数修正 + + + + + + + + 错误 + + + + + 速度不应该为0 + + + + + 实际同步长度不应该为0 + + + + + 长度不应该为0 + + + + + 直径不应该为0 + + + + + QBarCode + + + Dialog + + + + + 条形码类型 + + + + + 条形码高度 + + + + + 条码宽度 + + + + + 显示缩放 + + + + + 墨水类型 + + + + + 1点 + + + + + 2点 + + + + + 3点 + + + + + 4点 + + + + + + 5点 + + + + + 6点 + + + + + 文本1 + + + + + 文本3 + + + + + 计数器2 + + + + + 文本2 + + + + + 计数器1 + + + + + 增加数字行 + + + + + 日期 + + + + + 时间 + + + + + 黑墨 + + + + + 白墨 + + + + + 预览 + + + + + 返回 + + + + + 插入文档 + + + + + 条码保存 + + + + + FileName + + + + + 文件未保存 + + + + + CODE_128 + BARCODE_93 + + + + + CODE_93 + + + + + 7点 + + + + + 9点 + + + + + 12点 + + + + + 16点 + + + + + 24点 + + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + + + + + QObject + + + + 手动设定 + + + + + 应用 + + + + + 起始值 + + + + + 结束值 + + + + + 循环值 + + + + + SceneEditOption + + + Form + + + + + 预览 + + + + + 新建 + + + + + 打开 + + + + + + 保存 + + + + + 另存为 + + + + + 新增图元 + + + + + 编辑图元 + + + + + 删除图元 + + + + + 放大 + + + + + 缩小 + + + + + 提示 + + + + + 文档已经改变,是否保存? + + + + + 放弃保存 + + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + + + + + 齿轮泵开 + + + + + 齿轮泵关 + + + + + 回收槽开 + + + + + + + + + + + + + + 停止 + + + + + 回收槽关 + + + + + 回收泵 + + + + + + 压缩机 + + + + + 主墨泵 + + + + + 泄压阀 + + + + + 循环阀 + + + + + 墨水阀 + + + + + 粘度泵 + + + + + 混合阀 + + + + + 时间设置 + + + + + 系统升级 + + + + + 排气 + + + + + 导出配置到U盘 + + + + + 自动清洗 + + + + + 电机测试 + + + + + 更新字库 + + + + + 导出字库 + + + + + 从U盘导入配置 + + + + + 屏幕校正 + + + + + 更新软件 + + + + + 出厂设置 + + + + + + + Cancel + + + + + (1/2) Cleaning, please wait... + + + + + + + + + + + + + + + + + + + + + 开 + + + + + + + + + + + + + + + + + + + + + + 关 + + + + + + + + + + + + + + + + + + + 警告 + + + + + + + + 请先移开喷头盖! + + + + + 是否确认进入手动模式? + + + + + 请先确认已经关闭回收槽,确认进入自动模式? + + + + + + 手动 + + + + + + + 自动 + + + + + + + + + + + + 启动 + + + + + Application + + + + + 是否确认更新字库? + + + + + + + + + + + + + + + + + + 提示 + + + + + 更新字库成功,重启后生效! + + + + + 恢复出厂设置成功,请重新关机上电 + + + + + 校准触摸屏 + + + + + 是否确认开始校准程序?请小心进行校准! + + + + + 无法生成脚本 + + + + + + + + 密码不正确! + + + + + 是否确认更新软件? + + + + + 更新失败! + + + + + 软件更新成功,重启后生效! + + + + + + + + + 错误 + + + + + 没找到对应字库,更新失败! + + + + + 找不到更新软件! + + + + + 是否确认更新系统? + + + + + 系统更新成功,重启后生效! + + + + + 文件不存在! + + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + + + + + 停止清洗 + + + + + 压力 + + + + + autoclean cancel or status: + + + + + (2/3) Cleaning + + + + + (3/3) Cleaning + + + + + 混合阀打开3: + 混合阀打开3. + + + + + 是否确认导出配置到U盘? + + + + + 检测不到U盘 + + + + + 成功导出配置到U盘 + + + + + 是否确认从U盘导入配置? + + + + + 配置文件/udisk/sysPara.bin不存在! + + + + + 从U盘成功导入配置,重启后生效! + + + + + autoclean start + + + + + 是否确认启动自动清洗? + + + + + 是否确认墨水排除,加入清洗剂? + + + + + (1/3) Cleaning + + + + + 是否确认导出字库到U盘? + + + + + U盘不可识别! + + + + + 字库导出完成! + + + + + 是否开始电机测试? + + + + + 正在排气,是否停止? + + + + + SystemSetting + + + Form + + + + + 晶振电压(%): + + + + + 压力: + + + + + 高压包容差: + + + + + 粘度: + + + + + 回收泵力度(%): + + + + + 喷头温度: + + + + + 晶振频率: + + + + + 64K + + + + + 76K + + + + + 96K + + + + + 128K + + + + + 新晶振 + + + + + 场景模式 + + + + + 粘度泵动作间隔(秒): + + + + + 墨水温度: + + + + + °C + + + + + 0 + + + + + 0.6 + + + + + 1.0 + + + + + 1.6 + + + + + 2.0 + + + + + 频率修正: + + + + + 粘度校正(%): + + + + + Hz + + + + + 回收槽开关时间: + + + + + 电机电流: + + + + + 隔膜位置: + + + + + 信息编辑模式: + + + + + 文本模式 + + + + + 点阵模式 + + + + + 隔膜位置偏移: + + + + + 5 + + + + + 风扇开启温度: + + + + + 脉冲计数器: + + + + + 10 + + + + + 15 + + + + + 20 + + + + + 25 + + + + + 30 + + + + + 40 + + + + + 45 + + + + + 50 + + + + + 55 + + + + + 60 + + + + + 重置高压 + + + + + 界面语言设置 + + + + + 喷嘴逆清洗 + + + + + 搜索最佳晶振频率 + + + + + 搜索最佳晶振电压 + + + + + 应用当前配置 + + + + + + + + + + + + + 错误 + + + + + 实际频率不能为%1 + + + + + + 提示 + + + + + 应用成功 + + + + + 自动清洗时间约为一分钟,然后自动停止 + + + + + 开始清洗 + + + + + 停止清洗 + + + + + 正在喷嘴逆清洗...... + + + + + 清洗完成 + + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + + + + + + + Application + + + + + 是否更新高压包电流数据? + + + + + + + 喷头盖未关,请先关喷头盖! + + + + + + 墨线开关未开,请先打开墨线开关! + + + + + + 回收槽未全部打开! + + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + + + + + 搜索的起始频率%1 HZ超出范围? + + + + + 高压设置完成 + + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + + + + + 最佳晶振频率完成 + + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + + + + + + 最佳晶振电压完成 + + + + + Tiếng Việt(Vietnamese interface) + + + + + Chinese interface(中文界面) + + + + + English interface(英文界面) + + + + + TextEditOption + + + Form + + + + + 预览 + + + + + 新建 + + + + + + + 保存 + + + + + + 另存为 + + + + + 文件 + + + + + 插变量 + + + + + 间距 + + + + + 字体 + + + + + wenquanyi + + + + + 12 + + + + + 点 + + + + + 粗体 + + + + + + + + + + 警告 + + + + + + + + 无法打开文件 + + + + + + Application + + + + + + 是否确认将文件内容追加到打开的文件? + + + + + 插入图片 + + + + + 插入文本 + + + + + 错误 + + + + + TextEditOption 构造函数参数textEdit 不应当为空 + + + + + 打开文件 + + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + + + + + 提醒 + + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + + + + + 无法保存文件 + + + + + 保存... + + + + + 提示 + + + + + 文档已经改变,是否保存? + + + + + 放弃保存 + + + + + 二维码变量设置 + + + + + 完成 + + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + + + + + 分: + + + + + 月: + + + + + 日: + + + + + 时: + + + + + 年: + + + + + 设置时间 + + + + + TriggerCtrl + + + Form + + + + + 触发模式 + + + + + 光电电平触发 + + + + + 光电边沿触发 + + + + + 同步器触发 + + + + + 延时触发 + + + + + 脉冲数/毫米 + + + + + 喷印间隔(毫米) + + + + + 脉冲信号值: + + + + + 同步喷印模式 + + + + + 按字符宽度 + + + + + 按喷印比例 + + + + + 字符宽度: + + + + + 重复次数 + + + + + + + + + 重复间隔(毫秒) + + + + + + + + 触发延时(毫秒) + + + + + 间隔模式: + + + + + 行末<->行首 + + + + + 行首<->行首 + + + + + 产生脉冲所需计数: + + + + + + + + 延时(毫秒): + + + + + 同步打印 + + + + + 同步器清零 + + + + + 脉冲数修正 + + + + + 脉冲输出使能 + + + + + 允许电眼复位 + + + + + 允许电眼立即复位 + + + + + 电眼清零 + + + + + 镜像交替间隔 + + + + + 镜象交替类型 + + + + + 自动垂直翻转 + + + + + 禁止电眼清零 + + + + + + 封锁时间(毫秒) + + + + + 无镜像打印 + + + + + 自动水平翻转 + + + + + 中心对称旋转 + + + + + 同步器正反转打印 + + + + + 同步器只正转打印 + + + + + 同步器只反转打印 + + + + + 20131228-1 + + + + + 应用当前配置 + + + + + 独立参数 + + + + + + + + 触发延时(毫米) + + + + + + + 重复间隔(毫米) + + + + + + 封锁间隔(毫米) + + + + + + + + 延时(毫米): + + + + + 字符宽度 + + + + + 喷印比例(%) + + + + + 提示 + + + + + 应用成功 + + + + + 封锁间隔(毫秒) + + + + + ZkEdit + + + Form + + + + + 编辑图案 + + + + + 缩小 + + + + + 放大 + + + + + 宽度 + + + + + 新建 + + + + + 高度 + + + + + + + 保存 + + + + + 保存为 + + + + + 打开 + + + + + 导入 + + + + + A + + + + + 图像扩张 + + + + + 图像裁剪 + + + + + 提示 + + + + + 图片已经改变,是否保存? + + + + + 放弃保存 + + + + + + + 放大倍数:%1 + + + + + 图片另存为... + + + + + 另存为 + + + + + 打开文件 + + + + + 图片保存为... + + + + + 导入文件 + + + + + dlgDrawInit + + + 图案参数设置 + + + + + 图案宽度(像素) + + + + + 图案高度(像素) + + + + + 确定 + + + + + dlgQrCode + + + Dialog + + + + + + TextLabel + + + + + 正相打印 + + + + + 反相打印 + + + + + 条形码 + + + + + 默认 + + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + + + + + 自动插入时间 + + + + + DataMatrix + + + + + QRCode + + + + + 自动刷新 + + + + + 信息前缀 + + + + + 变量(初值) + + + + + 信息后缀 + + + + + 变量增量 + + + + + 插入文档 + + + + + 计数器(变量) + + + + + 预览 + + + + + 保存 + + + + + 返回 + + + + + 警告 + + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + + + + + [%1 X %2] + + + + + logo_Form + + + Form + + + + + zkWidget + + + + 警告 + + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + + + + + 请新创建建图片 + + + + diff --git a/clear_svn.bat b/clear_svn.bat new file mode 100644 index 0000000..e745021 --- /dev/null +++ b/clear_svn.bat @@ -0,0 +1,3 @@ +.svn\sqlite3 .svn\wc.db; +select * from work_queue; +delete from work_queue; \ No newline at end of file diff --git a/conf/VoltDataStd21.bin b/conf/VoltDataStd21.bin new file mode 100644 index 0000000..20ddb03 Binary files /dev/null and b/conf/VoltDataStd21.bin differ diff --git a/conf/VoltDataStd25.bin b/conf/VoltDataStd25.bin new file mode 100644 index 0000000..039ec45 Binary files /dev/null and b/conf/VoltDataStd25.bin differ diff --git a/conf/VoltDataStd32.bin b/conf/VoltDataStd32.bin new file mode 100644 index 0000000..25cb542 Binary files /dev/null and b/conf/VoltDataStd32.bin differ diff --git a/conf/VoltParaHi.bin b/conf/VoltParaHi.bin new file mode 100644 index 0000000..01deb6e Binary files /dev/null and b/conf/VoltParaHi.bin differ diff --git a/conf/VoltePara_No73.bin b/conf/VoltePara_No73.bin new file mode 100644 index 0000000..392073f Binary files /dev/null and b/conf/VoltePara_No73.bin differ diff --git a/conf/config.ini b/conf/config.ini new file mode 100644 index 0000000..3990061 --- /dev/null +++ b/conf/config.ini @@ -0,0 +1,10 @@ +[logging] +fileName=/home/plg/loginfo/log.txt +minLevel=DEBUG +bufferSize=0 +maxSize=200000 +maxBackups=100 +;timestampFormat=dd.MM.yyyy hh:mm:ss.zzz +timestampFormat=yyyy-MM-dd hh:mm:ss.zzz +msgFormat={timestamp} {typeNr} {type} {msg} +;msgFormat={timestamp} {typeNr} {type} {thread} {msg} diff --git a/dacdisplayandedit.ui b/dacdisplayandedit.ui new file mode 100644 index 0000000..2d64f38 --- /dev/null +++ b/dacdisplayandedit.ui @@ -0,0 +1,272 @@ + + + DacDisplayAndEdit + + + + 0 + 0 + 600 + 143 + + + + Qt::StrongFocus + + + Form + + + + + 10 + 0 + 471 + 111 + + + + + 6 + + + + + 0 + + + 1 + + + + + + 40 + 0 + + + + 10 + + + Qt::AlignCenter + + + + + + + 07 + + + Qt::AlignCenter + + + + + + + 02 + + + Qt::AlignCenter + + + + + + + + 40 + 0 + + + + 20 + + + Qt::AlignCenter + + + + + + + 06 + + + Qt::AlignCenter + + + + + + + 09 + + + Qt::AlignCenter + + + + + + + 03 + + + Qt::AlignCenter + + + + + + + 01 + + + Qt::AlignCenter + + + + + + + 04 + + + Qt::AlignCenter + + + + + + + 05 + + + Qt::AlignCenter + + + + + + + 00 + + + Qt::AlignCenter + + + + + + + 08 + + + Qt::AlignCenter + + + + + + + + 40 + 0 + + + + 30 + + + Qt::AlignCenter + + + + + + + + 40 + 0 + + + + 00 + + + Qt::AlignCenter + + + + + + + 墨点 + + + Qt::AlignCenter + + + + + + + + + + + 10 + 110 + 571 + 20 + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + + + + + + 490 + 20 + 91 + 91 + + + + + + + + 0 + 40 + + + + 默认值 + + + + + + + + 0 + 40 + + + + 编辑 + + + + + + + + + diff --git a/dialogauthorization.ui b/dialogauthorization.ui new file mode 100644 index 0000000..78e6bf1 --- /dev/null +++ b/dialogauthorization.ui @@ -0,0 +1,93 @@ + + + DialogAuthorization + + + + 0 + 0 + 445 + 123 + + + + Qt::StrongFocus + + + Dialog + + + + + 210 + 80 + 221 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 20 + 421 + 51 + + + + + + + 授权密码: + + + + + + + + + + + + + buttonBox + accepted() + DialogAuthorization + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogAuthorization + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialogcycleprint.cpp b/dialogcycleprint.cpp new file mode 100644 index 0000000..8628feb --- /dev/null +++ b/dialogcycleprint.cpp @@ -0,0 +1,163 @@ +#include "dialogcycleprint.h" +#include "ui_dialogcycleprint.h" +#include + +DialogCycleprint::DialogCycleprint(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogCycleprint) +{ + ui->setupUi(this); +} + +DialogCycleprint::~DialogCycleprint() +{ + delete ui; +} + + +void DialogCycleprint::getSpinboxValue(CycleprintArg &t_arg) +{ + t_arg.area_end1 = ui->spinBoxarea1->value(); + t_arg.area_end2 = ui->spinBoxarea2->value(); + t_arg.area_end3 = ui->spinBoxarea3->value(); + t_arg.area_end4 = ui->spinBoxarea4->value(); + t_arg.area_end5 = ui->spinBoxarea5->value(); + t_arg.area_end6 = ui->spinBoxarea6->value(); + + t_arg.cycle_time1 = ui->spinBoxcycletime1->value(); + t_arg.cycle_time2 = ui->spinBoxcycletime2->value(); + t_arg.cycle_time3 = ui->spinBoxcycletime3->value(); + t_arg.cycle_time4 = ui->spinBoxcycletime4->value(); + t_arg.cycle_time5 = ui->spinBoxcycletime5->value(); + t_arg.cycle_time6 = ui->spinBoxcycletime6->value(); +} + +void DialogCycleprint::SetSpinboxValue(CycleprintArg &t_arg) +{ + ui->spinBoxarea1->setValue(t_arg.area_end1); + ui->spinBoxarea2->setValue(t_arg.area_end2); + ui->spinBoxarea3->setValue(t_arg.area_end3); + ui->spinBoxarea4->setValue(t_arg.area_end4); + ui->spinBoxarea5->setValue(t_arg.area_end5); + ui->spinBoxarea6->setValue(t_arg.area_end6); + + ui->spinBoxcycletime1->setValue(t_arg.cycle_time1); + ui->spinBoxcycletime2->setValue(t_arg.cycle_time2); + ui->spinBoxcycletime3->setValue(t_arg.cycle_time3); + ui->spinBoxcycletime4->setValue(t_arg.cycle_time4); + ui->spinBoxcycletime5->setValue(t_arg.cycle_time5); + ui->spinBoxcycletime6->setValue(t_arg.cycle_time6); + +} + +void DialogCycleprint::update_save() +{ + save_arg.area_end3 = ui->spinBoxarea3->value(); + save_arg.cycle_time3 = ui->spinBoxcycletime3->value(); + save_arg.area_end4 = ui->spinBoxarea4->value(); + save_arg.cycle_time4 = ui->spinBoxcycletime4->value(); + save_arg.area_end5 = ui->spinBoxarea5->value(); + save_arg.cycle_time5 = ui->spinBoxcycletime5->value(); + save_arg.area_end6 = ui->spinBoxarea6->value(); + save_arg.cycle_time6 = ui->spinBoxcycletime6->value(); + +} + +void DialogCycleprint::set_spinBox_value(int area, int cycletime, int which_box) +{ + switch (which_box) { + + case 6: + ui->spinBoxarea6->setValue(ui->spinBoxarea5->value()); + ui->spinBoxcycletime6->setValue(ui->spinBoxcycletime5->value()); + case 5: + ui->spinBoxarea5->setValue(ui->spinBoxarea4->value()); + ui->spinBoxcycletime5->setValue(ui->spinBoxcycletime4->value()); + case 4: + ui->spinBoxarea4->setValue(ui->spinBoxarea3->value()); + ui->spinBoxcycletime4->setValue(ui->spinBoxcycletime3->value()); + case 3: + ui->spinBoxarea3->setValue(ui->spinBoxarea2->value()); + ui->spinBoxcycletime3->setValue(ui->spinBoxcycletime2->value()); + break; + default: + break; + } + ui->spinBoxarea2->setValue(area); + ui->spinBoxcycletime2->setValue(cycletime); +} + +void DialogCycleprint::on_spinBoxarea3_editingFinished() +{ + if(ui->spinBoxarea3->value() != save_arg.area_end3) + { + set_spinBox_value(ui->spinBoxarea3->value(), ui->spinBoxcycletime3->value(), 3); + update_save(); + } +} +void DialogCycleprint::on_spinBoxcycletime3_editingFinished() +{ + if(ui->spinBoxcycletime3->value() != save_arg.cycle_time3) + { + set_spinBox_value(ui->spinBoxarea3->value(), ui->spinBoxcycletime3->value(), 3); + update_save(); + } +} + +void DialogCycleprint::on_spinBoxarea4_editingFinished() +{ + if(ui->spinBoxarea4->value() != save_arg.area_end4) + { + set_spinBox_value(ui->spinBoxarea4->value(), ui->spinBoxcycletime4->value(), 4); + update_save(); + } +} +void DialogCycleprint::on_spinBoxcycletime4_editingFinished() +{ + if(ui->spinBoxcycletime4->value() != save_arg.cycle_time4) + { + set_spinBox_value(ui->spinBoxarea4->value(), ui->spinBoxcycletime4->value(), 4); + update_save(); + } +} + + +void DialogCycleprint::on_spinBoxarea5_editingFinished() +{ + if(ui->spinBoxarea5->value() != save_arg.area_end5) + { + set_spinBox_value(ui->spinBoxarea5->value(), ui->spinBoxcycletime5->value(), 5); + update_save(); + } +} +void DialogCycleprint::on_spinBoxcycletime5_editingFinished() +{ + if(ui->spinBoxcycletime5->value() != save_arg.cycle_time5) + { + set_spinBox_value(ui->spinBoxarea5->value(), ui->spinBoxcycletime5->value(), 5); + update_save(); + } +} + + +void DialogCycleprint::on_spinBoxarea6_editingFinished() +{ + if(ui->spinBoxarea6->value() != save_arg.area_end6) + { + set_spinBox_value(ui->spinBoxarea6->value(), ui->spinBoxcycletime6->value(), 6); + update_save(); + } +} +void DialogCycleprint::on_spinBoxcycletime6_editingFinished() +{ + if(ui->spinBoxcycletime6->value() != save_arg.cycle_time6) + { + set_spinBox_value(ui->spinBoxarea6->value(), ui->spinBoxcycletime6->value(), 6); + update_save(); + } +} + + + + + diff --git a/dialogcycleprint.h b/dialogcycleprint.h new file mode 100644 index 0000000..ba94cfc --- /dev/null +++ b/dialogcycleprint.h @@ -0,0 +1,64 @@ +#ifndef DIALOGCYCLEPRINT_H +#define DIALOGCYCLEPRINT_H + +#include + +typedef struct { + int area_end1; + int area_end2; + int area_end3; + int area_end4; + int area_end5; + int area_end6; + + int cycle_time1; + int cycle_time2; + int cycle_time3; + int cycle_time4; + int cycle_time5; + int cycle_time6; + +}CycleprintArg; + + +namespace Ui { +class DialogCycleprint; +} + +class DialogCycleprint : public QDialog +{ + Q_OBJECT + +public: + explicit DialogCycleprint(QWidget *parent = 0); + + void getSpinboxValue(CycleprintArg &t_arg); + void SetSpinboxValue(CycleprintArg &t_arg); + void update_save(); + + ~DialogCycleprint(); + +private slots: + + void on_spinBoxarea3_editingFinished(); + void on_spinBoxcycletime3_editingFinished(); + + void on_spinBoxarea4_editingFinished(); + void on_spinBoxcycletime4_editingFinished(); + + void on_spinBoxarea5_editingFinished(); + void on_spinBoxcycletime5_editingFinished(); + + void on_spinBoxarea6_editingFinished(); + void on_spinBoxcycletime6_editingFinished(); + +private: + + void set_spinBox_value(int area, int cycletime, int which_box); + + CycleprintArg save_arg; + + Ui::DialogCycleprint *ui; +}; + +#endif // DIALOGCYCLEPRINT_H diff --git a/dialogcycleprint.ui b/dialogcycleprint.ui new file mode 100644 index 0000000..27700b4 --- /dev/null +++ b/dialogcycleprint.ui @@ -0,0 +1,416 @@ + + + DialogCycleprint + + + + 0 + 0 + 459 + 237 + + + + Dialog + + + + + 100 + 190 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 90 + 10 + 48 + 31 + + + + 999 + + + 80 + + + + + + 10 + 20 + 71 + 16 + + + + 1循环范围:0- + + + + + + 10 + 50 + 71 + 16 + + + + 1循环次数: + + + + + + 90 + 50 + 48 + 31 + + + + 999 + + + 3 + + + + + + 240 + 50 + 48 + 31 + + + + 999 + + + 3 + + + + + + 240 + 10 + 48 + 31 + + + + 999 + + + 80 + + + + + + 160 + 20 + 71 + 16 + + + + 2循环范围:0- + + + + + + 160 + 50 + 71 + 16 + + + + 2循环次数: + + + + + + 390 + 10 + 48 + 31 + + + + 999 + + + 80 + + + + + + 390 + 50 + 48 + 31 + + + + 999 + + + 3 + + + + + + 310 + 20 + 71 + 16 + + + + 3循环范围:0- + + + + + + 310 + 50 + 71 + 16 + + + + 3循环次数: + + + + + + 240 + 100 + 48 + 31 + + + + 999 + + + 80 + + + + + + 310 + 140 + 71 + 16 + + + + 6循环次数: + + + + + + 240 + 140 + 48 + 31 + + + + 999 + + + 3 + + + + + + 390 + 140 + 48 + 31 + + + + 999 + + + 3 + + + + + + 390 + 100 + 48 + 31 + + + + 999 + + + 80 + + + + + + 310 + 110 + 71 + 16 + + + + 6循环范围:0- + + + + + + 90 + 140 + 48 + 31 + + + + 999 + + + 3 + + + + + + 160 + 110 + 71 + 16 + + + + 5循环范围:0- + + + + + + 160 + 140 + 71 + 16 + + + + 5循环次数: + + + + + + 90 + 100 + 48 + 31 + + + + 999 + + + 80 + + + + + + 10 + 110 + 71 + 16 + + + + 4循环范围:0- + + + + + + 10 + 140 + 71 + 16 + + + + 4循环次数: + + + + + + + buttonBox + accepted() + DialogCycleprint + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogCycleprint + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialogfileoperation.ui b/dialogfileoperation.ui new file mode 100644 index 0000000..ee10606 --- /dev/null +++ b/dialogfileoperation.ui @@ -0,0 +1,290 @@ + + + DialogFileOperation + + + + 0 + 0 + 557 + 214 + + + + Qt::StrongFocus + + + Dialog + + + + + 10 + 10 + 541 + 198 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + Qt::LeftToRight + + + 本地文件 + + + + :/icon/localdisk.png:/icon/localdisk.png + + + true + + + + + + + Qt::LeftToRight + + + U盘文件 + + + + :/icon/udisk.png:/icon/udisk.png + + + + + + + + + 2 + + + + + 删除文件 + + + + :/icon/keydelete.png:/icon/keydelete.png + + + + + + + true + + + 删除全部 + + + + :/icon/filedelete.png:/icon/filedelete.png + + + + + + + 从U盘导入 + + + + :/icon/import.png:/icon/import.png + + + + + + + 导出到U盘 + + + + :/icon/export.png:/icon/export.png + + + + + + + + + true + + + false + + + + + + + 0 + + + + + + 90 + 16777215 + + + + 插入 + + + + :/icon/insert.png:/icon/insert.png + + + + + + + + 90 + 16777215 + + + + 打开文件 + + + + :/icon/fileoperation.png:/icon/fileoperation.png + + + + + + + + 90 + 16777215 + + + + 上一个 + + + + :/icon/lastpage.png:/icon/lastpage.png + + + + + + + + 90 + 16777215 + + + + 下一个 + + + + :/icon/nextpage.png:/icon/nextpage.png + + + + + + + + 90 + 16777215 + + + + 退出 + + + + :/icon/exit.png:/icon/exit.png + + + + + + + + + + + + + + + + + diff --git a/dialogfontsize.ui b/dialogfontsize.ui new file mode 100644 index 0000000..611b943 --- /dev/null +++ b/dialogfontsize.ui @@ -0,0 +1,251 @@ + + + DialogFontSize + + + + 0 + 0 + 428 + 309 + + + + Qt::StrongFocus + + + Dialog + + + + + 110 + 260 + 291 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 17 + 10 + 401 + 185 + + + + + 12 + + + + + 9点(左横) + + + + + + + 16点(中/英) + + + + + + + 7点(左横) + + + + + + + 7点(英) + + + + + + + 5点(英) + + + + + + + 9点(右横) + + + + + + + 12点(中/英) + + + + + + + 9点(英) + + + true + + + + + + + 7点(右横) + + + + + + + 24点(中/英) + + + + + + + true + + + + 0 + 0 + + + + 7点(孟加拉) + + + + + + + 32点 + + + + + + + 7点(rf7) + + + + + + + 21点(rf21) + + + + + + + 12点(新罗马) + + + + + + + + true + + + + 40 + 210 + 321 + 31 + + + + 123456890ABCDEFGWXYZ + + + Qt::AlignCenter + + + true + + + + + + 70 + 250 + 311 + 20 + + + + - + + + + + + 30 + 270 + 89 + 25 + + + + 查字库标识 + + + + + + + buttonBox + accepted() + DialogFontSize + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogFontSize + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialoginputpasswd.ui b/dialoginputpasswd.ui new file mode 100644 index 0000000..8fc2e98 --- /dev/null +++ b/dialoginputpasswd.ui @@ -0,0 +1,91 @@ + + + Dialoginputpasswd + + + + 0 + 0 + 384 + 112 + + + + Dialog + + + + + 30 + 70 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 20 + 20 + 62 + 49 + + + + 修改密码: + + + + + + 90 + 30 + 241 + 27 + + + + + + + + buttonBox + accepted() + Dialoginputpasswd + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialoginputpasswd + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialoginsertvari.ui b/dialoginsertvari.ui new file mode 100644 index 0000000..b4f5089 --- /dev/null +++ b/dialoginsertvari.ui @@ -0,0 +1,598 @@ + + + DialogInsertVari + + + + 0 + 0 + 516 + 395 + + + + Qt::StrongFocus + + + Dialog + + + + 6 + + + + + + 0 + 0 + + + + 变量类型 + + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + + 0 + 30 + + + + 生产日期 + + + + + + + + 0 + 30 + + + + 年 + + + + + + + + 0 + 30 + + + + 计数器1 + + + true + + + + + + + + 0 + 28 + + + + 计数器2 + + + + + + + + 0 + 30 + + + + 时 + + + + + + + + 0 + 28 + + + + 周 + + + + + + + + 0 + 28 + + + + 随机码1 + + + + + + + + 0 + 28 + + + + 月 + + + + + + + + 0 + 28 + + + + DataMatrix + + + + + + + + 0 + 28 + + + + QRCode + + + + + + + + 0 + 28 + + + + 有效日期 + + + + + + + + 0 + 28 + + + + Class + + + + + + + + 0 + 28 + + + + 秒 + + + + + + + + 0 + 28 + + + + 日 + + + + + + + + 0 + 28 + + + + 分 + + + + + + + + 0 + 28 + + + + BarCode128 + + + + + + + + 0 + 30 + + + + 计数器3 + + + + + + + + + + + + + 0 + 0 + + + + 数字个数 + + + + 0 + + + 9 + + + 0 + + + + + 0 + + + 0 + + + + + + 0 + 30 + + + + 9个 + + + + + + + + 0 + 30 + + + + 11个 + + + + + + + + 0 + 30 + + + + 10个 + + + + + + + + 0 + 30 + + + + 2个 + + + + + + + + 0 + 30 + + + + 1个 + + + + + + + + 0 + 30 + + + + 3个 + + + + + + + + 0 + 30 + + + + 4个 + + + true + + + + + + + + 0 + 30 + + + + 5个 + + + + + + + + 0 + 30 + + + + 6个 + + + + + + + + 0 + 30 + + + + 7个 + + + + + + + + 0 + 30 + + + + 8个 + + + + + + + + 0 + 30 + + + + 12个 + + + + + + + + 0 + 30 + + + + 13个 + + + + + + + + 0 + 30 + + + + 14个 + + + + + + + + 0 + 30 + + + + 15个 + + + + + + + + + + :/80/image/expiryDate8.bmp + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + + buttonBox + accepted() + DialogInsertVari + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogInsertVari + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialoglinespace.ui b/dialoglinespace.ui new file mode 100644 index 0000000..4ab1c07 --- /dev/null +++ b/dialoglinespace.ui @@ -0,0 +1,208 @@ + + + DialogLineSpace + + + + 0 + 0 + 384 + 277 + + + + Dialog + + + + + 150 + 240 + 221 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 30 + 361 + 121 + + + + + + + 0个像素 + + + + + + + 1个像素 + + + + + + + 2个像素 + + + + + + + 3个像素 + + + + + + + 4个像素 + + + true + + + + + + + 5个像素 + + + + + + + 6个像素 + + + + + + + 7个像素 + + + + + + + + + 10 + 10 + 81 + 17 + + + + 行间距: + + + + + + 10 + 160 + 91 + 17 + + + + 字符间距: + + + + + + 10 + 180 + 361 + 61 + + + + + + + 3个像素 + + + + + + + 2个像素 + + + + + + + 0个像素 + + + true + + + + + + + 1个像素 + + + + + + + + + + buttonBox + accepted() + DialogLineSpace + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogLineSpace + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialogmodifypasswd.cpp b/dialogmodifypasswd.cpp new file mode 100644 index 0000000..4a1c18b --- /dev/null +++ b/dialogmodifypasswd.cpp @@ -0,0 +1,26 @@ +#include "dialogmodifypasswd.h" +#include "ui_dialogmodifypasswd.h" + +Dialogmodifypasswd::Dialogmodifypasswd(QWidget *parent) : + QDialog(parent), + ui(new Ui::Dialogmodifypasswd) +{ + ui->setupUi(this); + this->setWindowTitle(tr("密码授权")); + this->setFixedSize(this->geometry().width(),this->geometry().height()); + ui->lineEdit->setEchoMode(QLineEdit::Password); // 密码不回显 +} + +Dialogmodifypasswd::~Dialogmodifypasswd() +{ + delete ui; +} + +QString Dialogmodifypasswd::getModPasswd(){ + return ui->lineEdit->text(); +} + +void Dialogmodifypasswd::clearAuth(){ + ui->lineEdit->setText(tr("")); + +} diff --git a/dialogmodifypasswd.h b/dialogmodifypasswd.h new file mode 100644 index 0000000..8621471 --- /dev/null +++ b/dialogmodifypasswd.h @@ -0,0 +1,25 @@ +#ifndef DIALOGMODIFYPASSWD_H +#define DIALOGMODIFYPASSWD_H + +#include + +namespace Ui { +class Dialogmodifypasswd; +} + +class Dialogmodifypasswd : public QDialog +{ + Q_OBJECT + +public: + + explicit Dialogmodifypasswd(QWidget *parent = 0); + ~Dialogmodifypasswd(); + + QString getModPasswd(); + void clearAuth(); +private: + Ui::Dialogmodifypasswd *ui; +}; + +#endif // DIALOGMODIFYPASSWD_H diff --git a/dialogmodifypasswd.ui b/dialogmodifypasswd.ui new file mode 100644 index 0000000..a794616 --- /dev/null +++ b/dialogmodifypasswd.ui @@ -0,0 +1,91 @@ + + + Dialogmodifypasswd + + + + 0 + 0 + 426 + 102 + + + + Dialog + + + + + 50 + 60 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 20 + 10 + 62 + 49 + + + + 修改密码: + + + + + + 90 + 20 + 281 + 27 + + + + + + + + buttonBox + accepted() + Dialogmodifypasswd + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialogmodifypasswd + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dialogpointdistanceadjust.ui b/dialogpointdistanceadjust.ui new file mode 100644 index 0000000..0999316 --- /dev/null +++ b/dialogpointdistanceadjust.ui @@ -0,0 +1,304 @@ + + + DialogPointDistanceAdjust + + + + 0 + 0 + 555 + 194 + + + + Qt::StrongFocus + + + Dialog + + + + + 320 + 150 + 221 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 541 + 141 + + + + + 3 + + + 3 + + + + + + + 列首: + + + + + + + -99 + + + 3 + + + Qt::Horizontal + + + + + + + -99 + + + + + + + + + + + 列中: + + + + + + + -99 + + + 3 + + + Qt::Horizontal + + + + + + + -99 + + + + + + + + + + + 列尾: + + + + + + + -99 + + + 3 + + + Qt::Horizontal + + + + + + + -99 + + + + + + + + + + + 160 + 160 + 98 + 27 + + + + 重置 + + + + + + 30 + 160 + 98 + 27 + + + + 测试 + + + + + + + buttonBox + accepted() + DialogPointDistanceAdjust + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogPointDistanceAdjust + reject() + + + 316 + 260 + + + 286 + 274 + + + + + horizontalSliderLineHeadValue + valueChanged(int) + spinBoxLineHeadValue + setValue(int) + + + 266 + 33 + + + 518 + 33 + + + + + horizontalSliderLineCenterValue + valueChanged(int) + spinBoxLineCenterValue + setValue(int) + + + 266 + 80 + + + 518 + 80 + + + + + horizontalSliderLineEndValue + valueChanged(int) + spinBoxLineEndValue + setValue(int) + + + 266 + 127 + + + 518 + 127 + + + + + spinBoxLineHeadValue + valueChanged(int) + horizontalSliderLineHeadValue + setValue(int) + + + 518 + 33 + + + 266 + 33 + + + + + spinBoxLineCenterValue + valueChanged(int) + horizontalSliderLineCenterValue + setValue(int) + + + 518 + 80 + + + 266 + 80 + + + + + spinBoxLineEndValue + valueChanged(int) + horizontalSliderLineEndValue + setValue(int) + + + 518 + 127 + + + 266 + 127 + + + + + diff --git a/dialogsavefile.ui b/dialogsavefile.ui new file mode 100644 index 0000000..9d3214e --- /dev/null +++ b/dialogsavefile.ui @@ -0,0 +1,247 @@ + + + DialogSaveFile + + + Qt::WindowModal + + + + 0 + 0 + 640 + 460 + + + + Qt::NoFocus + + + Dialog + + + Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhPreferNumbers + + + + + + 0 + + + + + 0 + + + + + + 100 + 16777215 + + + + Qt::LeftToRight + + + 本地文件 + + + + :/icon/localdisk.png:/icon/localdisk.png + + + true + + + + + + + + 120 + 16777215 + + + + Qt::LeftToRight + + + U盘文件 + + + + :/icon/udisk.png:/icon/udisk.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + + + + + 6 + + + 0 + + + + + 预览文件内容: + + + + + + + + 90 + 16777215 + + + + 上一个 + + + + :/icon/lastpage.png:/icon/lastpage.png + + + + + + + + 90 + 16777215 + + + + 下一个 + + + + :/icon/nextpage.png:/icon/nextpage.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + true + + + + 16777215 + 60 + + + + false + + + + + + + + + 请输入文件名: + + + + + + + + 0 + 30 + + + + + + + + + 90 + 16777215 + + + + 取消 + + + + :/icon/exit.png:/icon/exit.png + + + + + + + + 90 + 16777215 + + + + 保存 + + + + :/icon/filesave.png:/icon/filesave.png + + + + + + + + + + + + + + diff --git a/dialogshowcounter.cpp b/dialogshowcounter.cpp new file mode 100644 index 0000000..f849f31 --- /dev/null +++ b/dialogshowcounter.cpp @@ -0,0 +1,165 @@ +#include "dialogshowcounter.h" +#include "ui_dialogshowcounter.h" +#include + +DialogShowCounter::DialogShowCounter(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogShowCounter) +{ + ui->setupUi(this); + + cycle_flag = true; + cycleTimecount = 0; + savecnt1CurrValue = 0; + + dialogcycleprint = new DialogCycleprint(parent); + connect(dialogcycleprint,SIGNAL(accepted()),this,SLOT(ondialogcycleprintAccepted())); +// ui->CycleprintpushButton->hide(); + setWindowFlags(Qt::FramelessWindowHint); +} + +DialogShowCounter::~DialogShowCounter() +{ + delete ui; +} + +void DialogShowCounter::init_arg() +{ + dialogcycleprint->getSpinboxValue(cycleprintarg); + + dialogcycleprint->SetSpinboxValue(cycleprintarg); + +// qDebug()<<"[init_arg]cycleprintarg.area_end1="<SetSpinboxValue(cycleprintarg); + + +// emit set_count_endvalue(cycleprintarg.cycle_time1, cycleprintarg.area_end1); + } +#endif + + // 当前米标 +// QString temp_str = QString::number(metre); + ui->lcdNumber->display(currCnt1Value); + + // 结束值 +// temp_str = QString::number(cn1EndValue); + ui->lcdCycleEndNumber->display(cn1EndValue); + + // 起始值 +// temp_str = QString::number(cn1StartValue); + ui->lcdCycleStartNumber->display(cn1StartValue); + + // 循环 +//// cycleTimecount = cycle_count; +// temp_str = QString::number(cycleTimecount); + ui->lcdCycleTimeNumber->display(currGroupLoop + 1); + + // 剩余米数 +// lcd_number = cn1EndValue - metre; +// temp_str = QString::number(lcd_number); + int remainValue = cn1EndValue - currCnt1Value; + ui->lcdLessNumber->display(remainValue); + +} + +void DialogShowCounter::setLCDframe() +{ + ui->lcdNumber->setDigitCount(4); + ui->lcdNumber->setMode(QLCDNumber::Dec); + ui->lcdNumber->setSegmentStyle(QLCDNumber::Flat); + QPalette lcdpat = ui->lcdNumber->palette(); + lcdpat.setColor(QPalette::Normal, QPalette::WindowText, Qt::red); + ui->lcdNumber->setPalette(lcdpat); + + ui->lcdCycleEndNumber->setDigitCount(4); + ui->lcdCycleEndNumber->setMode(QLCDNumber::Dec); + ui->lcdCycleEndNumber->setSegmentStyle(QLCDNumber::Flat); + lcdpat = ui->lcdCycleEndNumber->palette(); + lcdpat.setColor(QPalette::Normal, QPalette::WindowText, Qt::red); + ui->lcdCycleEndNumber->setPalette(lcdpat); + + ui->lcdCycleStartNumber->setDigitCount(4); + ui->lcdCycleStartNumber->setMode(QLCDNumber::Dec); + ui->lcdCycleStartNumber->setSegmentStyle(QLCDNumber::Flat); + lcdpat = ui->lcdCycleStartNumber->palette(); + lcdpat.setColor(QPalette::Normal, QPalette::WindowText, Qt::red); + ui->lcdCycleStartNumber->setPalette(lcdpat); + + ui->lcdCycleTimeNumber->setDigitCount(4); + ui->lcdCycleTimeNumber->setMode(QLCDNumber::Dec); + ui->lcdCycleTimeNumber->setSegmentStyle(QLCDNumber::Flat); + lcdpat = ui->lcdCycleTimeNumber->palette(); + lcdpat.setColor(QPalette::Normal, QPalette::WindowText, Qt::red); + ui->lcdCycleTimeNumber->setPalette(lcdpat); + + ui->lcdLessNumber->setDigitCount(4); + ui->lcdLessNumber->setMode(QLCDNumber::Dec); + ui->lcdLessNumber->setSegmentStyle(QLCDNumber::Flat); + lcdpat = ui->lcdLessNumber->palette(); + lcdpat.setColor(QPalette::Normal, QPalette::WindowText, Qt::red); + ui->lcdLessNumber->setPalette(lcdpat); + +} + +int DialogShowCounter::getResetMetreState(int &area_end) +{ + int t_reset; + t_reset = reset_meter; + reset_meter = false; + + //qDebug()<<"cycleprintarg.area_end1="<getSpinboxValue(cycleprintarg); +} + +void DialogShowCounter::on_CycleprintpushButton_clicked() +{ + dialogcycleprint->show(); +} diff --git a/dialogshowcounter.h b/dialogshowcounter.h new file mode 100644 index 0000000..35a706c --- /dev/null +++ b/dialogshowcounter.h @@ -0,0 +1,53 @@ +#ifndef DIALOGSHOWCOUNTER_H +#define DIALOGSHOWCOUNTER_H + +#include +#include +#include +#include "ParaSettingUI.h" + +#include "dialogcycleprint.h" + +namespace Ui { +class DialogShowCounter; +} + +class DialogShowCounter : public QDialog +{ + Q_OBJECT + +public: + void setLCDframe(void); + void refreshdate(int currCnt1Value, int cn1StartValue, int cn1EndValue,int currGroupIndex, int currGroupLoop/*当前循环次数*/); + int getResetMetreState(int &area_end); + void init_arg(); + + explicit DialogShowCounter(QWidget *parent = 0); + + DialogCycleprint *dialogcycleprint; + + CycleprintArg cycleprintarg; + + ~DialogShowCounter(); + +Q_SIGNALS: + void set_count_endvalue(int cycle_time,int area_end); + +private slots: + void on_pushButton_clicked(); + + void on_CycleprintpushButton_clicked(); + void ondialogcycleprintAccepted(); + +private: + Ui::DialogShowCounter *ui; + int lcd_number; + int reset_meter; + int cycleTimecount; + int savecnt1CurrValue; + int cycle_flag; +// QTimer *refresh_timer; + +}; + +#endif // DIALOGSHOWCOUNTER_H diff --git a/dialogshowcounter.ui b/dialogshowcounter.ui new file mode 100644 index 0000000..dfdff2c --- /dev/null +++ b/dialogshowcounter.ui @@ -0,0 +1,279 @@ + + + DialogShowCounter + + + + 0 + 0 + 640 + 480 + + + + Dialog + + + + + 290 + 440 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 160 + 20 + 471 + 411 + + + + 4 + + + + + + 170 + 0 + 61 + 21 + + + + 米标显示: + + + + + + 10 + 10 + 91 + 16 + + + + 目前循环范围: + + + + + + 40 + 30 + 101 + 61 + + + + 4 + + + + + + 140 + 70 + 16 + 16 + + + + 米 + + + + + + 10 + 190 + 91 + 16 + + + + 剩余米数: + + + + + + 140 + 300 + 16 + 16 + + + + 米 + + + + + + 0 + 210 + 141 + 111 + + + + 4 + + + + + + 0 + 340 + 141 + 91 + + + + 4 + + + + + + 0 + 320 + 91 + 16 + + + + 循环次数: + + + + + + 20 + 440 + 91 + 23 + + + + 立即重新计米 + + + + + + 140 + 150 + 16 + 16 + + + + 米 + + + + + + 40 + 110 + 101 + 61 + + + + 4 + + + + + + 10 + 70 + 31 + 16 + + + + 起始: + + + + + + 10 + 150 + 31 + 16 + + + + 结束: + + + lcdNumber + buttonBox + label + label_2 + lcdCycleStartNumber + label_3 + label_4 + label_5 + lcdLessNumber + lcdCycleTimeNumber + label_6 + pushButton + label_7 + lcdCycleEndNumber + label_8 + label_9 + + + + + buttonBox + accepted() + DialogShowCounter + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogShowCounter + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/digitalinput.ui b/digitalinput.ui new file mode 100644 index 0000000..79a8fc9 --- /dev/null +++ b/digitalinput.ui @@ -0,0 +1,420 @@ + + + DigitalInput + + + + 0 + 0 + 203 + 213 + + + + + + + + + 255 + 255 + 255 + + + + + + + 202 + 201 + 201 + + + + + + + + + 255 + 255 + 255 + + + + + + + 202 + 201 + 201 + + + + + + + + + 202 + 201 + 201 + + + + + + + 202 + 201 + 201 + + + + + + + + Form + + + + + 0 + 0 + 201 + 211 + + + + + 3 + + + 3 + + + + + 0 + + + 1 + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 9 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 3 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 8 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + - + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 退格 + + + + :/icon/keyleft.png:/icon/keyleft.png + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 1 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 4 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 0 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 5 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 7 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 2 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 6 + + + + + + + + + 0 + + + 0 + + + + + + 50 + 75 + + + + + 50 + 75 + + + + + + + + :/icon/keyup.png:/icon/keyup.png + + + + + + + + 50 + 75 + + + + + 50 + 75 + + + + + + + + :/icon/keydown.png:/icon/keydown.png + + + + + + + + 50 + 60 + + + + + 50 + 60 + + + + 全选 + + + + + + + + + + + + + diff --git a/dlgQrCode.cpp b/dlgQrCode.cpp new file mode 100644 index 0000000..7207d21 --- /dev/null +++ b/dlgQrCode.cpp @@ -0,0 +1,606 @@ +#include "dlgQrCode.h" +#include "ui_dlgQrCode.h" + + +#include +#include +#include +#include + +#include +#include +#include "SysPara.h" +#include "InkJetPrinter.h" + +#define AUTOREF true + + +#include "Matrix/dm200.h" + +#define MDTFLAG 0xff00FF10 +#define QRFLAG 0xff00FF20 +#define BARFLAG 0xff00FF30 + +char DataMatrixdDraw(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize); + char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize); + void Draw_MatrixToImg(unsigned char *buffer,QImage *pImg); + + extern InkJetPrinter *pInkJectPrinter; + //void MatrixEnCode(unsigned char *intext,int Size); + + static int casesensitive = 1; + static int eightbit = 0; + static int kanji = 0; + static int version = 0; + +static int margin = 1; + +static QRecLevel level = QR_ECLEVEL_L; + + +static int AutoCount=0; +static QImage img1; +static int InkColor=0; + + +dlgQrCode::dlgQrCode(QWidget *parent) : + QDialog(parent), + ui(new Ui::dlgQrCode) +{ + ui->setupUi(this); + qrOption = new qrOption_t; + //ui->labQRImage->setText(""); + ui->labName->setText(""); + ui->labRECT->setText(""); + bcWidth=bcHeight=0; + counter =0; + scene = new QGraphicsScene; + connect(ui->lineEditIn,SIGNAL(editingFinished()),this,SLOT(onTextChanged())); + connect(ui->checkBoxAuto,SIGNAL(clicked(bool)),this,SLOT(onQRCodeAuto(bool))); + // img1 =0; + + connect(ui->comboBoxType, SIGNAL(currentIndexChanged(int)),this, SLOT(onComboBoxType(int))); +} + +dlgQrCode::~dlgQrCode() +{ + delete ui; + if(scene) + { + delete scene; + } +} + +enum { + O_HELP, + O_OUTPUT, + O_SIZE, + O_VERSION, + O_LEVEL, + O_MARGIN, + O_KANJI, + O_CASE, + O_8BIT, +}; + +static const struct option options[] = { + {"h", no_argument , NULL, O_HELP}, + {"o", required_argument, NULL, O_OUTPUT}, + {"l", required_argument, NULL, O_LEVEL}, + {"s", required_argument, NULL, O_SIZE}, + {"v", required_argument, NULL, O_VERSION}, + {"m", required_argument, NULL, O_MARGIN}, + {"k", no_argument , NULL, O_KANJI}, + {"c", no_argument , NULL, O_CASE}, + {"8", no_argument , NULL, O_8BIT}, + {NULL, 0, NULL, 0} +}; + +static QRcode *encode(const char *intext) +{ + QRencodeMode hint; + QRcode *code; + + if(kanji) { + hint = QR_MODE_KANJI; + } else { + hint = QR_MODE_8; + } + + if(eightbit) { + code = QRcode_encodeString8bit(intext, version, QR_ECLEVEL_L); + } else { + code = QRcode_encodeString(intext, version, QR_ECLEVEL_L, hint, casesensitive); + } + + return code; +} + +static void qrencode(const char *intext,int Size) +{ + QRcode *qrcode; + //png_structp png_ptr; + //png_infop info_ptr; + unsigned char *row, *p, *q; + int x, y, xx, yy, bit; + int realwidth; + + qrcode = encode(intext); + if(qrcode == NULL) { + fprintf(stderr, "Failed to encode the input data.\n"); + exit(1); + } + + realwidth = (qrcode->width + margin * 2) * Size; + + row = (unsigned char *)malloc(realwidth); + // top margin + memset(row, 0x0, realwidth ); + QImage QRImage(realwidth, InkColor?realwidth:qrcode->width*Size ,QImage::Format_ARGB32 ); + QImage *img; + img = &QRImage; + if( AutoCount ) { + InkColor =0; + img->fill(0xff00ff00); // 0xff00ff01(DMT) 0xff00ff02(QR) 0xff00ff03(BAR) + } + else + img->fill(InkColor?0xff000000:0x00ffffff); + /* data */ + p = qrcode->data; + int ypos=InkColor?margin:0;//margin * Size; + int xpos=0; + + for(y=0; ywidth; y++) { + bit = 7; + bit = 7 - (margin * Size % 8); + xpos=margin * Size; + for(x=0; xwidth; x++) { + for(xx=0; xxsetPixel(xpos,ypos+yy,InkColor? 0x00ffffff:0xff000000); + img->setPixel(xpos,ypos+yy,InkColor? 0x00ffffff:0xff000000); + } + } + xpos++; + + } + p++; + bit--; + if(bit < 0) { + //q++; + bit = 7; + } + } + ypos+=Size; + } + img1 = img->copy(img->rect()); + if(AutoCount) img1.setPixel(0,ypos-1,QRFLAG); + free(row); + QRcode_free(qrcode); +} + + void dlgQrCode::MatrixEnCode(unsigned char *intext,int Size) +{ + U16 sColumns, sRows; + U08 *Grid; + sColumns = sRows = 0; + Grid = 0; + short sizeType = ui->comboBox_DMType->currentIndex(); + Grid = iec16022ecc200((short*)&sColumns, (short*)&sRows, intext, &sizeType); + if(sizeType == -1) + { + QMessageBox::warning(0,tr("警告"),tr("输入内容超出选择DM码尺寸大小,请选择更大的尺寸!")); + return; + } + DataMatrixdDrawImg(Grid,sRows,sColumns,Size); +} + +void dlgQrCode::on_pushBtnClose_pressed(){ + + flagInsert = ui->checkBox->checkState()?1:0; + AutoCount=(ui->checkBoxAutoCount->checkState())?1:0; + ui->checkBox->setChecked(0); + barCodeFlag = ui->barCodeCheckBox->checkState()?1:0; + + emit onQRCodeCloseNow(); + this->close(); +} + + char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize) +{ + int Size=MSize; + int w = cColumns*Size; + int h = cRows*Size; + //qDebug()<fill( AutoCount?0xff00ff00:0x00ffffff); + /* data */ + int margin=0; + U08 *p = OutBuff; + int ypos=0;//margin * Size; + int xpos=0; + int x,y,xx,yy,bit; + for(y=0; ysetPixel(xpos,h-1-(ypos+yy),AutoCount?0xff000000:0xff000000); + } + } + xpos++; + } + p++; + bit--; + if(bit < 0) { + //q++; + bit = 7; + } + } + // xpos++; + for(xx=0; xxsetPixel(xpos,h-1-(ypos+yy),0x00ffffff); + } + xpos++; + } + + ypos+=Size; + + } + //img->save("Myqr.bmp"); + img1 = img->copy(img->rect()); + if(AutoCount) img1.setPixel(0,ypos-1,MDTFLAG); // 设置定位标志 + return 0; +} +void dlgQrCode::on_pushBtnPreView_pressed(){ + QString in; + InkColor = ui->comboBoxInkColor->currentIndex()?1:0; + AutoCount=(ui->checkBoxAutoCount->checkState())?1:0; + + QString s1=ui->lineEditCNT->text(); + QString s2; + int len = s1.length(); + + + if(ui->checkBoxAutoCount->checkState()) { + + in = ui->lineEditIn->text() + ui->lineEditCNT->text() +ui->lineEditIn2->text();// "%04d" + + } + else in = ui->lineEditIn->text()+ui->lineEditIn2->text(); + if(flagCount==0) in=ui->lineEditIn->text(); + + ui->lineEdit->setText(in); + + if(in.isEmpty()) + { +// qDebug()<<"QRcode string isEmpty"; + return; + }QByteArray inUtf8 = in.toUtf8(); + char *intext =""; + intext = (char *)malloc(inUtf8.length()*2);//intext = (char *)malloc(in.length()*2); + memset(intext,0,sizeof(intext)); + memcpy(intext,inUtf8.data(),2*inUtf8.length());//memcpy(intext,in.toLocal8Bit().data(),2*in.length()); + + if(ui->comboBoxType->currentIndex()){ qrencode(intext,1); } + else { MatrixEnCode((unsigned char *)intext,1); } + + //if(pInkJectPrinter->modbus->modbus_up_QRCODE == 0) + { + ShowQRCode(&img1); + } + bcWidth = img1.width(); + bcHeight = img1.height(); + ui->labRECT->setText(tr("[%1 X %2]").arg(img1.width()).arg(img1.height())); + if(!ui->checkBoxAutoCount->isChecked()) + { + ui->pushBtnSave->setEnabled(true); + } + else + { + ui->pushBtnSave->setEnabled(false); + } +} + +void dlgQrCode::onTextChanged(){ + //qDebug()<<"onTextChanged:"; + if(AutoRefresh){ + emit on_pushBtnPreView_pressed(); + } +} + +void dlgQrCode::ShowQRCode(QImage *img) +{ + //scene = new QGraphicsScene; 一直new不释放会让内存耗尽 + scene->clear(); + int scale = 4; + int bcWidth= img->width(); + int bcHeight = img->height(); + scene->setSceneRect( 0,0,bcWidth*(scale),bcHeight*(scale)); + scene->setItemIndexMethod(QGraphicsScene::NoIndex); + QPixmap pixmap(QPixmap::fromImage(*img)); + pixmap = pixmap.scaledToHeight(bcHeight*(scale)); + //pixmap = pixmap.scaledToWidth(scale*bcWidth); + item = scene->addPixmap(pixmap); + /***************设置view的场景*****************************/ + ui->BarCodeView->setScene(scene); + ui->BarCodeView->setRenderHint(QPainter::Antialiasing); + ui->BarCodeView->setCacheMode(QGraphicsView::CacheBackground); + ui->BarCodeView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + ui->BarCodeView->setDragMode(QGraphicsView::ScrollHandDrag); + //ui->graphicsView->resize(400,300); + ui->BarCodeView->setScene(scene);//设置view的场景 +} + + +void dlgQrCode::on_pushBtnSave_pressed(){ + //if(img1.width()<10) + // on_pushBtnPreView_pressed(); + + QString s1 = ui->lineEditIn->text(); + QString s2=""; + int len =s1.length()<10?s1.length():10; + for(int i=1;i='0' && c<='9') || (c>='A' && c<='Z') || (c>='a' && c<='z') ) + s2+= QString(c); + } + + s2 = (ui->comboBoxType->currentIndex()?"QR_":"DMT_")+s2.left(10)+".bmp"; + if(AutoCount) s2 = (ui->comboBoxType->currentIndex()?"QRV":"DMTV")+ QString().sprintf("%02d",img1.height())+".bmp"; + ui->labName->setText(s2); + + if(pInkJectPrinter->modbus->modbus_up_QRCODE == 1) + { +// qDebug()<<"save modbusQR"; + s2 = "modbusQR.bmp"; + this->pictureName=DOC_ROOT_DIR+s2; + img1.save(pictureName); + pInkJectPrinter->modbus->modbus_up_QRCODE = 0; + }else + { + this->pictureName=DOC_ROOT_DIR+s2; + //如果是自动计数不作保存 + if(AutoCount) + { + return; + } + img1.save(pictureName); + } + +} +QString dlgQrCode::getCounterText( int counter,int QRCntNum){ + QString s1=""; + //counter = qrOption->counter; + char mFormat[20]; + memset(mFormat,0,20); + if(QRCntNum>0) {snprintf(mFormat,20,"%%%02dd",QRCntNum); + if(QRCntNum==1) s1 = QString().sprintf(mFormat,counter%10); + else if(QRCntNum==2) s1 = QString().sprintf(mFormat,counter%100); + else if(QRCntNum==3) s1 = QString().sprintf(mFormat,counter%1000); + else if(QRCntNum==4) s1 = QString().sprintf(mFormat,counter%10000); + else if(QRCntNum==5) s1 = QString().sprintf(mFormat,counter%100000); + else if(QRCntNum==6) s1 = QString().sprintf(mFormat,counter%1000000); + else if(QRCntNum==7) s1 = QString().sprintf(mFormat,counter%10000000); + else if(QRCntNum==8) s1 = QString().sprintf(mFormat,counter%100000000); + else if(QRCntNum==9) s1 = QString().sprintf(mFormat,counter%1000000000); + else if(QRCntNum>=10) s1= QString().sprintf(mFormat,counter%10000000000); + //else s1 = QString().sprintf(mFormat,counter); + } + return s1; +} + +void dlgQrCode::SetOption(qrOption_t *qrOption){ + //memcpy( qrOption,qrOption0,sizeof(qrOption)); + QString s1=qrOption->text2; + ui->checkBoxAuto->setChecked(qrOption->AutoRefresh); + ui->checkBox->setChecked(0); + ui->lineEditIn2->setText(s1);//后缀 + ui->lineEditVarInc->setText(QString("%1").arg(qrOption->CntInc)); + //qDebug()<CntInc; + s1=getCounterText(qrOption->counter,qrOption->cntNum); + ui->lineEditCNT->setText(s1);//变量 + s1=qrOption->text; + ui->lineEditIn->setText(s1);//前缀 + ui->comboBoxInkColor->setCurrentIndex(qrOption->InkColor); + ui->checkBoxAutoCount->setChecked(qrOption->AutoCount);//z//计数器变量 + ui->checkBox->setChecked(flagInsert); + ui->barCodeCheckBox->setChecked(qrOption->barCodeFlag); + ui->comboBoxType->setCurrentIndex(qrOption->type); + QRCntNum = qrOption->cntNum; + if(qrOption->AutoCount) { + counter = qrOption->counter; + s1 = ui->lineEditIn->text()+ui->lineEditCNT->text()+ui->lineEditIn2->text(); + } + else s1 = ui->lineEditIn->text()+ui->lineEditIn2->text(); + + ui->lineEdit->setText(s1); + + if(s1.length()>10) s1 = "QR_"+s1.left(10)+".bmp"; + if(AutoCount) s1 = (ui->comboBoxType->currentIndex()?"QRV":"DMTV")+ QString().sprintf("%02d",img1.height())+".bmp"; + this->pictureName=DOC_ROOT_DIR+s1; + if(!qrOption->AutoRefresh) emit on_pushBtnPreView_pressed(); + //AutoRefresh = AUTOREF; + ui->pushBtnSave->setEnabled(false); + if(sysPara) + { + sysPara->para.isCheckInsertTime ? ui->checkBoxInsertTime->setChecked(true) : ui->checkBoxInsertTime->setChecked(false); + } +} + +void dlgQrCode::GetOption(qrOption_t *qrOption0){ + //qrOption = qrOption0; + if(qrOption0){ + qrOption0->width = img1.width(); + qrOption0->height = img1.height(); + //qrOption0->level = level; // ui->qrLevel->currentIndex()+1; + qrOption0->InkColor = ui->comboBoxInkColor->currentIndex()?1:0; + qrOption0->AutoRefresh = AutoRefresh; + qrOption0->type = ui->comboBoxType->currentIndex(); + qrOption0->AutoCount=(ui->checkBoxAutoCount->checkState())?1:0; + snprintf(qrOption0->text,sizeof(qrOption0->text),"%s",ui->lineEditIn->text().toAscii().constData()); + snprintf(qrOption0->text2,sizeof(qrOption0->text2),"%s",ui->lineEditIn2->text().toAscii().constData()); + snprintf(qrOption0->textCnt,sizeof(qrOption0->textCnt),"%s",ui->lineEditCNT->text().toAscii().constData()); + qrOption0->cntNum =ui->lineEditCNT->text().length(); + //qDebug()<<"GetOption cntNum"<cntNum; + //bool ok; + qrOption0->counter = ui->lineEditCNT->text().toInt(0,10); + qrOption0->CntInc = ui->lineEditVarInc->text().toInt(0,10); + //qrOption->CntInc =11; + //qDebug()<<"TTTT"<CntInc)<<(qrOption0->counter)<<(qrOption0->cntNum); + ui->pushBtnSave->setEnabled(false); + if(sysPara) + { + sysPara->para.isCheckInsertTime = ui->checkBoxInsertTime->isChecked() ? true : false; + } + } +} + +int dlgQrCode::getDat(SysPara* sysPara,int varNum){ + + //TextToQRImg((QRvars_t *)&sysPara->print.QRvars[varNum]); + + int w= img1.width(); + int h= img1.height(); + if(varNum>1)varNum=0; + int wStart=sysPara->print.QRvars[varNum].startColPos; + int hStart= sysPara->print.QRvars[varNum].startRowPos; + //if(hStart)hStart-=1; + //qDebug()<<"wStart"<status.printDat; + for(int i = 0 ; i < w; i++) + { + unsigned char c=0,c1=0; + int j=0; + hStart= sysPara->print.QRvars[varNum].startRowPos; + c=sysPara->status.printDat[(wStart)*5+(hStart)/8]; + for( j = 0; j < h; j++) + { + QRgb rgb = img1.pixel(i,j); + if((rgb == 0xff000000)) c |= (1 << (hStart%8)); + else c &= ~(1 << (hStart%8)); + if(hStart%8==7) { + sysPara->status.printDat[(wStart)*5+(hStart)/8]=c; + c=sysPara->status.printDat[(wStart)*5+(hStart+1)/8]; + } + hStart++; + } + sysPara->status.printDat[(wStart)*5+(hStart)/8]=c; + wStart++; + if(sysPara->status.addSpace ) wStart++; //&& sysPara->print.QRvars[varNum].type==0 + } + return w; +} + + +#include "QDateTime" +void dlgQrCode::extSetText(QString text, bool flag) +{ + if(flag) + { + ui->comboBoxType->setCurrentIndex(1); + } + else{ + ui->comboBoxType->setCurrentIndex(0); + } + ui->lineEditIn->setText(text); + ui->lineEditIn2->setText(""); + ui->lineEditCNT->setText(""); + + pInkJectPrinter->modbus->modbus_up_QRCODE =1; + + emit on_pushBtnPreView_pressed(); + emit on_pushBtnSave_pressed(); +} + +QString dlgQrCode::TextToQRImg(qrOption_t *qrVar){ + QString in,s1,s2,s3; + + //snprintf(qrVar->text,sizeof(qrVar->text),"%s",ui->lineEditIn->text().toAscii().constData()); + s1 = qrVar->text;//ui->lineEditIn->text(); + s2 = qrVar->text2; + s3 = getCounterText(qrVar->counter,qrVar->cntNum) ; + QRCntNum = qrVar->cntNum; + in = s1+s2; + + if(QRCntNum>0) { + in =s1+s3+s2; + } + + + // if(qrVar->TimeEn) + // in += " "+ QDateTime::currentDateTime().toString(tr("yy-MM-dd HH:mm:SS")); + counter = qrVar->counter; + if(in.isEmpty())in = ""; +#ifdef MYARMTEST + //qDebug()<<"txtToImg:"<type){ qrencode(intext,1); } + else { MatrixEnCode((unsigned char *)intext,1); } + //ShowQRCode(&img1); + free(intext); + qrVar->width = img1.width(); + qrVar->height = img1.height(); + //qrVar->startRowPos = qrVar->endRowPos-qrVar->height; + bcWidth = img1.width(); + bcHeight = img1.height(); + return in;// 返回文件名 +} + +void dlgQrCode::onQRCodeAuto(bool En){ + AutoRefresh = En; + //ui->pushBtnPreView->setEnabled(!En); +} + +void dlgQrCode::onComboBoxType(int type) +{ + if(type == 0) + { + ui->comboBox_DMType->setEnabled(true); + } + else + { + ui->comboBox_DMType->setEnabled(false); + } +} + +void dlgQrCode::setCntCheckBoxHide(bool hideEn){ + if(hideEn){ + ui->checkBoxAutoCount->setChecked(0); + ui->checkBoxAutoCount->hide(); + flagCount = 0; + ui->lineEditCNT->hide(); + ui->labelVarInc->hide(); + ui->lineEditVarInc->hide(); + ui->lineEditIn2->hide(); + ui->label_4->hide(); + ui->label_3->hide(); + } + else { + ui->checkBoxAutoCount->show(); + ui->lineEditCNT->show(); + ui->labelVarInc->show(); + ui->lineEditIn2->show(); + ui->label_4->show(); + ui->lineEditVarInc->show(); + ui->label_3->show(); + flagCount =1; + } +} + +void dlgQrCode::setSysPara(SysPara * sysPara) +{ + this->sysPara = sysPara; +} diff --git a/dlgQrCode.h b/dlgQrCode.h new file mode 100644 index 0000000..a3d8f9d --- /dev/null +++ b/dlgQrCode.h @@ -0,0 +1,64 @@ +#ifndef DLGQRCODE_H +#define DLGQRCODE_H + +#include +#include "QtQREnCode/qrencode.h" +#include "QGraphicsScene" +#include "QGraphicsPixmapItem" +#include "SysPara.h" + +namespace Ui { + class dlgQrCode; +} + +class dlgQrCode : public QDialog +{ + Q_OBJECT + +public: + explicit dlgQrCode(QWidget *parent = 0); + ~dlgQrCode(); + //dlgQrCode(qrOption_t *qrOption); + + int bcWidth,bcHeight; + unsigned char flagInsert:1; + unsigned char flagCount:1; + unsigned char AutoCount11:1; + unsigned char barCodeFlag:1; //明码标志 + unsigned char NNNCC:5; + QString pictureName; + int QRCntNum; + void SetOption(qrOption_t *qrOption); + void GetOption(qrOption_t *qrOption); + void extSetText(QString text, bool flag = false); + QString TextToQRImg(qrOption_t *qrVar); + int getDat(SysPara * sysPara,int varNum); + unsigned long counter; + + void setCntCheckBoxHide(bool hideEn); + QString getCounterText( int counter,int QRCntNum); + void MatrixEnCode(unsigned char *intext,int Size); + void setSysPara(SysPara * sysPara); + +public slots: + void onTextChanged(); +signals: + void onQRCodeCloseNow(); + +private slots: + void onQRCodeAuto(bool); + void on_pushBtnPreView_pressed(); + void on_pushBtnClose_pressed(); + void on_pushBtnSave_pressed(); + void onComboBoxType(int); +private: + void ShowQRCode(QImage *img); + QGraphicsScene *scene;//声明scene + QGraphicsPixmapItem *item;//声明item + qrOption_t *qrOption; + bool AutoRefresh; + Ui::dlgQrCode *ui; + SysPara * sysPara; +}; + +#endif // DLGQRCODE_H diff --git a/dlgQrCode.ui b/dlgQrCode.ui new file mode 100644 index 0000000..2dc2957 --- /dev/null +++ b/dlgQrCode.ui @@ -0,0 +1,353 @@ + + + dlgQrCode + + + + 0 + 0 + 560 + 300 + + + + Qt::StrongFocus + + + Qt::NoContextMenu + + + Dialog + + + + :/icon/bypm.png:/icon/bypm.png + + + false + + + + + + + + + + + 120 + 0 + + + + 返回 + + + + + + + + DataMatrix + + + + + QRCode + + + + + + + + 保存 + + + + + + + 预览 + + + + + + + + 正相打印 + + + + + 反相打印 + + + + + + + + + + + 120 + 16777215 + + + + 变量增量 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 16777215 + + + + Qt::ImhDigitsOnly + + + 4 + + + + + + + + + + + + + + + 信息前缀 + + + + + + + + + + 80 + 16777215 + + + + Qt::ImhDigitsOnly + + + 10 + + + + + + + 变量(初值) + + + + + + + 80 + + + + + + + 100 + + + + + + + + + 信息后缀 + + + + + + + + + + + + + TextLabel + + + + + + + 计数器(变量) + + + + + + + 自动刷新 + + + + + + + 插入文档 + + + + + + + + 120 + 0 + + + + + 160 + 16777215 + + + + TextLabel + + + + + + + + + false + + + 200 + + + true + + + + + + + + 16777215 + 600 + + + + + + + + + 0 + 0 + + + + 条形码 + + + + + + + + 0 + 0 + + + + + 默认 + + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + + + + DM码尺寸: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 自动插入时间 + + + + + + + + + + + + diff --git a/dlgdrawinit.cpp b/dlgdrawinit.cpp new file mode 100644 index 0000000..c9bef93 --- /dev/null +++ b/dlgdrawinit.cpp @@ -0,0 +1,37 @@ +#include "dlgdrawinit.h" +#include "ui_dlgdrawinit.h" +#include "MyInputMethod.h" +dlgDrawInit::dlgDrawInit(QWidget *parent) : + QDialog(parent), + ui(new Ui::dlgDrawInit) +{ + ui->setupUi(this); +} + +dlgDrawInit::~dlgDrawInit() +{ + delete ui; +} + +int dlgDrawInit::getWidth(){ + return ui->spinBoxWidth->value(); +} + +int dlgDrawInit::getHeight(){ + return ui->spinBoxHeight->value(); +} + +int dlgDrawInit::setWidth(int w){ + ui->spinBoxWidth->setValue(w); + return w; +} +int dlgDrawInit::setHeight(int h){ + ui->spinBoxHeight->setValue(h); + return h; +} +void dlgDrawInit::on_pushButtonOK_pressed() +{ + +emit dlgDrawOK(); + +} diff --git a/dlgdrawinit.h b/dlgdrawinit.h new file mode 100644 index 0000000..90fa7c8 --- /dev/null +++ b/dlgdrawinit.h @@ -0,0 +1,31 @@ +#ifndef DLGDRAWINIT_H +#define DLGDRAWINIT_H +#include +#include +#include "MyInputMethod.h" + +namespace Ui { + class dlgDrawInit; +} + +class dlgDrawInit : public QDialog +{ + Q_OBJECT + +public: + explicit dlgDrawInit(QWidget *parent = 0); + ~dlgDrawInit(); + + int getWidth(); + int getHeight(); + int setWidth(int w); + int setHeight(int h); +public slots: + void on_pushButtonOK_pressed(); +Q_SIGNALS: + void dlgDrawOK(); +private: + Ui::dlgDrawInit *ui; +}; + +#endif // DLGDRAWINIT_H diff --git a/dlgdrawinit.ui b/dlgdrawinit.ui new file mode 100644 index 0000000..b194894 --- /dev/null +++ b/dlgdrawinit.ui @@ -0,0 +1,73 @@ + + + dlgDrawInit + + + + 0 + 0 + 318 + 186 + + + + Qt::StrongFocus + + + 图案参数设置 + + + + + 50 + 30 + 214 + 87 + + + + + + + + + + + + + 图案宽度(像素) + + + + + + + 图案高度(像素) + + + + + + + + + 180 + 130 + 80 + 35 + + + + + 0 + 35 + + + + 确定 + + + + + + diff --git a/dlginputaddr.cpp b/dlginputaddr.cpp new file mode 100644 index 0000000..9f65370 --- /dev/null +++ b/dlginputaddr.cpp @@ -0,0 +1,843 @@ +#include "dlginputaddr.h" +#include "ui_dlginputaddr.h" +#include +#include +#include +#include +#include +#include +#include +#include "qnamespace.h" +#include +#include +// 修改超级密码,一周一变,增加校验码,且顺序改为 123C4DD +#define MAC_FILE_PATH "/home/plg/conf/mac.bin" + +DlgInputAddr::DlgInputAddr(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgInputAddr) +{ + ui->setupUi(this); + connect(this,SIGNAL(changePowerCnt(QString )),ui->labPowerMinuteCnt,SLOT(setText(QString))); + connect(this,SIGNAL(changePrintCnt(QString )),ui->labPrintDotCnt,SLOT(setText(QString))); + curDate =QDate::currentDate(); + QDate curDate1; + curDate1.setDate(2017,11,13); + if(curDatelineEdit->setValidator(new QIntValidator(100000, 999999, this)); + ui->superNodeIp3->setValidator(new QIntValidator(1, 255, this)); + ui->superNodeIp2->setValidator(new QIntValidator(0, 255, this)); + ui->superNodeIp1->setValidator(new QIntValidator(0, 255, this)); + ui->superNodeIp0->setValidator(new QIntValidator(1, 255, this)); + + ui->edgeIp3->setValidator(new QIntValidator(1, 255, this)); + ui->edgeIp2->setValidator(new QIntValidator(0, 255, this)); + ui->edgeIp1->setValidator(new QIntValidator(0, 255, this)); + ui->edgeIp0->setValidator(new QIntValidator(1, 255, this)); + //ui->lineEditLanIP->setInputMask("119.23.201.56"); + //ui->lineEditLanMask->setInputMask("10.0.0.11"); + adjustSize(); +#else + ui->superNodeIP->close(); + ui->superNodeIp3->close(); + ui->superNodeIp2->close(); + ui->superNodeIp1->close(); + ui->superNodeIp0->close(); + ui->edgeIP->close(); + ui->edgeIp3->close(); + ui->edgeIp2->close(); + ui->edgeIp1->close(); + ui->edgeIp0->close(); + adjustSize(); +#endif +} + + +DlgInputAddr::~DlgInputAddr() +{ + delete ui; +} + +void DlgInputAddr::SetAddr() +{ + jd.addr = ui->lineEdit->text().toInt(0,10); + if(jd.addr < 100001 || jd.addr > 999999) jd.addr = 100001; + + //QStringList superNodeIpList = ui->superNodeIpEdit->text().split("."); + quint8 ip3 = ui->superNodeIp3->text().toInt(0,10); + quint8 ip2 = ui->superNodeIp2->text().toInt(0,10); + quint8 ip1 = ui->superNodeIp1->text().toInt(0,10); + quint8 ip0 = ui->superNodeIp0->text().toInt(0,10); + jd.superNodeIp = (ip3<<24) + (ip2<<16) + (ip1<<8) + ip0; + + ip3 = ui->edgeIp3->text().toInt(0,10); + ip2 = ui->edgeIp2->text().toInt(0,10); + ip1 = ui->edgeIp1->text().toInt(0,10); + ip0 = ui->edgeIp0->text().toInt(0,10); + jd.edgeIp = (ip3<<24) + (ip2<<16) + (ip1<<8) + ip0; + + SaveJm(); + SaveAddrBackup(); +} +void DlgInputAddr::vpnConnect() +{ + QStringList edgeArgList; + //QProcess edge + //edge -d n2n0 -c vernonbach -k encryptvb -a 10.0.0.11 -l xxx.xxx.xxx.xxx:1000 >/dev/null & + edgeArgList<<"-d"<<"n2n0"; + edgeArgList<<"-c"<<"vernonbach"; + edgeArgList<<"-k"<<"encryptvb"; + edgeArgList<<"-a"<>24)&0xFF).arg((jd.edgeIp>>16)&0xFF).arg((jd.edgeIp>>8)&0xFF).arg((jd.edgeIp)&0xFF); + edgeArgList<<"-l"<>24)&0xFF).arg((jd.superNodeIp>>16)&0xFF).arg((jd.superNodeIp>>8)&0xFF).arg((jd.superNodeIp)&0xFF); + edgeArgList<<">/dev/null &"; + QProcess::startDetached("edge",edgeArgList); +} + +QString DlgInputAddr::GetAddr() +{ + ReadJm(); + return ui->lineEdit->text(); +} + +void DlgInputAddr::SaveJm() +{ + QFile file("/lib/syst"); +// QFile Macfile(MAC_FILE_PATH); + + if (file.isOpen()) { + file.close(); + } + +/* if (Macfile.isOpen()) { + file.close(); + }*/ + jdDataRwLock.lockForWrite(); + if(!file.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + QMessageBox::warning(0,"警告",QString("无法打开文件 1") ); + } + else { + file.seek(0); + //file.write((char *)&jd.addr,(long long int)sizeof(jd)); + file.write((char *)&jd,(qint64)sizeof(jd)); +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); + } + /////// +/* if(!Macfile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + //QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") ); + } + else { + Macfile.seek(0); + //file.write((char *)&jd.addr,(long long int)sizeof(jd)); + Macfile.write((char *)&jd.addr,(qint64)sizeof(jd.addr)); +#if 1 + fsync(Macfile.handle()); +#endif + Macfile.close(); + }*/ + jdDataRwLock.unlock(); +} + +void DlgInputAddr::ReadJm() +{ + QFile file("/lib/syst"); + QFile Macfile(MAC_FILE_PATH); + unsigned int addr; + + if(!Macfile.exists()) + { + if(!Macfile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") ); + } + } + + if(!file.exists()) + { + if(!file.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + QMessageBox::warning(0,"警告",QString("无法打开文件") ); + } + else { + file.close(); + ResetJm(); + show(); + } + } + else { + if (file.isOpen()) { + file.close(); + } + jdDataRwLock.lockForRead(); + if(!file.open(QIODevice::ReadOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + QMessageBox::warning(0,"警告",QString("无法打开文件") ); + } + else { + file.seek(0); + //file.read((char *)&jd.addr,(long long int)sizeof(jd)); + file.read((char *)&jd,(qint64)sizeof(jd)); + file.close(); + } +//////////////////// + if (Macfile.isOpen()) { + Macfile.close(); + } + //jdDataRwLock.lockForRead(); + if(!Macfile.open(QIODevice::ReadOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + //QMessageBox::warning(0,"警告",QString("无法打开文件") ); + } + else { + Macfile.seek(0); + //file.read((char *)&jd.addr,(long long int)sizeof(jd)); + Macfile.read((char *)&addr,(qint64)sizeof(addr)); + Macfile.close(); + } + + jdDataRwLock.unlock(); + } + if((jd.addr != addr) && (addr >= 100001 && addr <= 999999)){ + jd.addr = addr; + SaveJm(); + } + ui->lineEdit->setText(QString().sprintf("%06d",jd.addr) ); + ui->labPowerMax->setText(QString("%1").arg(jd.powerMinuteMax)); + ui->labPrintMax->setText(QString("%1").arg(jd.printMax)); + ui->labPowerMinuteCnt->setText(QString("%1").arg(jd.powerMinuteCnt)); + ui->labPrintDotCnt->setText(QString("%1").arg(jd.printCnt)); + ui->EditStartTime->setText(QString("%1").arg(jd.start)); + ui->EditEndTime->setText(QString("%1").arg(jd.end)); + + //qDebug()<<"jd.superNodeIp"<superNodeIp3->setText(QString::number((jd.superNodeIp>>24)&0xFF)); + ui->superNodeIp2->setText(QString::number((jd.superNodeIp>>16)&0xFF)); + ui->superNodeIp1->setText(QString::number((jd.superNodeIp>>8)&0xFF)); + ui->superNodeIp0->setText(QString::number((jd.superNodeIp)&0xFF)); + + ui->edgeIp3->setText(QString::number((jd.edgeIp>>24)&0xFF)); + ui->edgeIp2->setText(QString::number((jd.edgeIp>>16)&0xFF)); + ui->edgeIp1->setText(QString::number((jd.edgeIp>>8)&0xFF)); + ui->edgeIp0->setText(QString::number((jd.edgeIp)&0xFF)); + //ui->lineEditLanIP->setInputMask("119.23.201.56"); + +} + +void DlgInputAddr::setNodeIpAndPrivateIp(bool bNodeIpSetDone) +{ + ui->label->setVisible(bNodeIpSetDone); + ui->lineEdit->setEnabled(bNodeIpSetDone); + ui->lineEdit->setVisible(bNodeIpSetDone); + ui->label_2->setVisible(bNodeIpSetDone); + ui->EditStartTime->setEnabled(bNodeIpSetDone); + ui->EditStartTime->setVisible(bNodeIpSetDone); + ui->label_3->setVisible(bNodeIpSetDone); + ui->EditEndTime->setEnabled(bNodeIpSetDone); + ui->EditEndTime->setVisible(bNodeIpSetDone); + + ui->horizontalLayout->setEnabled(bNodeIpSetDone); + ui->labPowerMinuteCnt->setVisible(bNodeIpSetDone); + ui->labPowerMax->setVisible(bNodeIpSetDone); + ui->labPrintDotCnt->setVisible(bNodeIpSetDone); + ui->labPrintMax->setVisible(bNodeIpSetDone); + ui->line->setVisible(bNodeIpSetDone); + ui->line_2->setVisible(bNodeIpSetDone); + ui->line_3->setVisible(bNodeIpSetDone); + //adjustSize(); +} + +void DlgInputAddr::on_buttonBox_clicked(QAbstractButton *button) +{ + //QMessageBox::warning(0,"警告",QString("无法打开文件 3") ); + if(ui->buttonBox->button(QDialogButtonBox::Ok) == button) //判断按下的是否为"确定”按钮 + { + if(!ui->lineEdit->text().isEmpty()) //判断lineEdit是否为空,不为空返回0 + { + SetAddr(); + vpnConnect(); + emit changeMac(QString(" Mac:%1").arg(jd.addr)); + } + } + setNodeIpAndPrivateIp(true); + //else if(button == ui->buttonBox->button((QDialogButtonBox::Cancel))) + // ui->lineEdit->setText("001002"); +} +#define XXXX + +char DlgInputAddr::isEnabled()// check where is enable?10秒钟1次 +{ + unsigned int repairTimeLess; + char res=0; + static int cnt=0; + static char changTimeCnt=0; + + curDate =QDate::currentDate(); + unsigned int ndate = curDate.toString("yyyyMMdd").toInt(0,10); + + if(cnt<5) + { + cnt++; + if((jd.workout && jd.nDate<=jd.start) && ndate>=jd.start && ndate< jd.end ) + { + jd.nDate = ndate; + jd.workout =0; + SaveJm(); +// qDebug()<ndate ) { + res |=(1<<2); + if( jd.workout==0) + { + jd.nDate = ndate; + jd.workout =1; + SaveJm(); +// qDebug()<jd.end ) + { + QString jdEnd = QString::number(jd.end); + + QDateTime currentTime = QDateTime::currentDateTime(); + QDateTime endTime = QDateTime::fromString(jdEnd, "yyyyMMdd"); +// qDebug() << "currentTime.toTime_t()" << currentTime.toTime_t(); +// qDebug() << "endTime.toTime_t(" << endTime.toTime_t(); + + repairTimeLess = (endTime.toTime_t() - currentTime.toTime_t()) / (60*60); + + emit printErrorStatus(QString(tr("Mac:%1维护时间剩余")+"%2").arg(jd.addr).arg(repairTimeLess)+tr("小时,喷码机将停止工作.请与供应商联系!"),2); + } + + //qDebug()<3) + { + changTimeCnt=0; + QTime time1= QTime::currentTime(); + //qDebug()<=jd.end); + else { + // jd.nDate = ndate; + // SaveJm(); + //qDebug()< +void adjustdate1(int year, int mon, int mday, int hour, int min, int sec) { + time_t t; + struct tm nowtime; + nowtime.tm_sec = sec; // Seconds.[0-60] (1 leap second) + nowtime.tm_min = min; // Minutes.[0-59] + nowtime.tm_hour = hour; // Hours. [0-23] + nowtime.tm_mday = mday; // Day.[1-31] + nowtime.tm_mon = mon - 1; // Month. [0-11] + nowtime.tm_year = year - 1900; // Year- 1900. + nowtime.tm_isdst = -1; // DST.[-1/0/1] + t = mktime(&nowtime); + // qDebug()< +#include /*用到time函数和gmtime函数。*/ + +int getWeekNumber() +{ + int nweek = 0; + int wd = 0; + time_t t; /*声明time_t结构体 t 。*/ + struct tm *ptr; /*声明tm结构体指针。*/ + + time(&t); /*初始化time_t结构体t 。*/ + ptr = gmtime(&t); /*获得已初始化的tm结构体。*/ + nweek = ptr->tm_yday / 7 + 1; /*以1月1日那周为第1周。*/ + wd = ptr->tm_wday; /*算出今天是星期几。*/ + if (wd - ptr->tm_yday % 7 < 0)/*表示是新的一周。*/ + { + nweek++; + } + //printf("从1月1日算起今周是第 %d 周。\n", nweek); + + return nweek; +} +// 一时一变 +unsigned char DlgInputAddr::checkSupperInit(QString str) +{ + QString s; + QDate curDate; + curDate =QDate::currentDate(); + QTime curTime; + curTime = QTime::currentTime(); +// check crc + //s.sprintf("%04d%02d", curDate.year(), curDate.month()); + s.sprintf("%04d%02d", curDate.year(), getWeekNumber()+curDate.day()+curTime.hour()); + unsigned long m,n; + + m= str.toLong(0,10); + n= mb_crc2(s,0xa061); + s.sprintf("%06ld",n*100+ (m%100)); + //qDebug()<>=1; + crc^=m; // + } + else crc>>=1; + } + } + return(crc ); +} + + +void DlgInputAddr::enCodeMsh(QString s) +{ + + +} + +void DlgInputAddr::SaveAddrBackup() +{ + QFile Macfile(MAC_FILE_PATH); + if (Macfile.isOpen()) { + Macfile.close(); + } + jdDataRwLock.lockForWrite(); + if(!Macfile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + //QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") ); + } + else { + Macfile.seek(0); + Macfile.write((char *)&jd,(qint64)sizeof(jd)); +#if 1 + fsync(Macfile.handle()); +#endif + Macfile.close(); + } + jdDataRwLock.unlock(); +} diff --git a/dlginputaddr.h b/dlginputaddr.h new file mode 100644 index 0000000..f354208 --- /dev/null +++ b/dlginputaddr.h @@ -0,0 +1,83 @@ +#ifndef DLGINPUTADDR_H +#define DLGINPUTADDR_H +#include +#include "myinclude.h" +#include +#include +#include + +#include +typedef struct { // 28B + unsigned int addr; + unsigned char enable; //1Byte + unsigned char validity; // 1Byte + unsigned char powerEn; // 1Byte + unsigned char printEn; // 1Byte + + unsigned int powerMinuteMax; + unsigned int powerMinuteCnt; + unsigned int printMax; + unsigned int printCnt; // printDot/1024 + + unsigned int start;// yyyymmdd + unsigned int end; // yyyymmdd + unsigned int nDate; + unsigned int workout; + unsigned int nc; + unsigned int superNodeIp; + unsigned int edgeIp; +}JMDATA; + +namespace Ui { + class DlgInputAddr; +} + +class DlgInputAddr : public QDialog +{ + Q_OBJECT + +public: + explicit DlgInputAddr(QWidget *parent = 0); + ~DlgInputAddr(); + + void SetAddr(); + QString GetAddr(); + void vpnConnect(); + void SaveJm(); + void ReadJm(); + void SaveAddrBackup(); + void workcnt(); + char isEnabled(); + void ResetJm(); + JMDATA jd; + void SetNewJm(unsigned int validity); + unsigned char checWhJmDate(QString s );// 日期维护 + unsigned char checWhJm(QString s );// 维护 + unsigned char checWhJmOLD(QString s );// 维护1 + unsigned char checkSupperJm(QString s );// 超级 + unsigned char checkSupperJmOLD(QString s );// 超级1 + void enCodeMsh(QString s );// 墨水 + unsigned char checkSysJm(QString str); + unsigned long mb_crc2(QString str, unsigned int x); + unsigned int mb_crc1(QString s, unsigned int m); + unsigned int enValidity(unsigned long m,unsigned int xx); + void CheckDate(); + unsigned char checkSupperInit(QString str); + void setNodeIpAndPrivateIp(bool bNodeIpSetDone); +private slots: + void on_buttonBox_clicked(QAbstractButton *button); + void setTime(int year, int mon, int mday, int hour, int min, int sec); + +Q_SIGNALS: + void changePowerCnt(QString ); + void changePrintCnt(QString ); + void dateError(QString); + void printErrorStatus(QString,unsigned int); + void changeMac(QString); +private: + Ui::DlgInputAddr *ui; + QDate curDate; + QReadWriteLock jdDataRwLock; +}; + +#endif // DLGINPUTADDR_H diff --git a/dlginputaddr.ui b/dlginputaddr.ui new file mode 100644 index 0000000..d016f7f --- /dev/null +++ b/dlginputaddr.ui @@ -0,0 +1,290 @@ + + + DlgInputAddr + + + + 0 + 0 + 319 + 297 + + + + Dialog + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Qt::ImhNone + + + 6 + + + + + + + 请输入6位机编号(前3位为经销商编号) + + + + + + + + + PowerOnCnt + + + + + + + Qt::Vertical + + + + + + + PrintDotCnt + + + + + + + Qt::Vertical + + + + + + + PowerMax + + + + + + + Qt::Vertical + + + + + + + PrintMax + + + + + + + + + + + 开始时间 + + + + + + + true + + + + + + + 结束时间 + + + + + + + true + + + + + + + + + SuperNodeIP: + + + + + + + edgeIP: + + + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + . + + + + + + + 3 + + + + + + + + + + + + + buttonBox + accepted() + DlgInputAddr + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DlgInputAddr + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dlgmutilanguage.cpp b/dlgmutilanguage.cpp new file mode 100644 index 0000000..d0c37e0 --- /dev/null +++ b/dlgmutilanguage.cpp @@ -0,0 +1,125 @@ +#include "dlgmutilanguage.h" +#include "ui_dlgmutilanguage.h" +#include "InputMethod.h" +#include +#include + +DlgMutiLanguage::DlgMutiLanguage(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgMutiLanguage) +{ + ui->setupUi(this); +// ui->listWidget->hide(); + connect(ui->buttonBox,SIGNAL(accepted()),this,SLOT(SetNewLanguage())); + LangIndex=INPUT_METHOD_TYPE_CHINESE; +} + +DlgMutiLanguage::~DlgMutiLanguage() +{ + delete ui; +} + +void DlgMutiLanguage::setCurrentLanguage(){ + + if(LangIndex==INPUT_METHOD_TYPE_ENGLISH) ui->radioButton_2->setChecked(true); + else if(LangIndex==INPUT_METHOD_TYPE_CHINESE) ui->radioButton->setChecked(true); + else if(LangIndex==INPUT_METHOD_TYPE_VIETNAM) ui->radioButton_3->setChecked(true); + //else if(LangIndex==INPUT_METHOD_TYPE_RUSSIAN) ui->radioButton_4->setChecked(true); + //else if(LangIndex==INPUT_METHOD_TYPE_JAPANESE) ui->radioButton_5->setChecked(true); + //else if(LangIndex==INPUT_METHOD_TYPE_KOREAN) ui->radioButton_6->setChecked(true); + else ui->radioButton->setChecked(true); + +} + +int DlgMutiLanguage::getCurrentLanguage(){ +// LangIndex = INPUT_METHOD_TYPE_CHINESE; +// if(ui->radioButton_2->isChecked()) { +// LangIndex = INPUT_METHOD_TYPE_ENGLISH; +// QMessageBox::information(this,tr("提示"),tr("重启后切换到英文界面")); +// buf.append("English\r\n"); +// buf.append("WINPY_utf8.txt\r\n"); +// } +// else if(ui->radioButton_3->isChecked()) { +// LangIndex = INPUT_METHOD_TYPE_VIETNAM; +// QMessageBox::information(this,tr("提示"),tr("重启后切换到越南语界面")); +// buf.append("Vietnamese\r\n"); +// buf.append("YN_utf8.txt\r\n"); +// } +// /*else if(ui->radioButton->isChecked()) { + +// } +// else if(ui->radioButton->isChecked()) { + +// } +// else if(ui->radioButton->isChecked()) { + +// }*/ +// else { +// QMessageBox::information(this,tr("提示"),tr("重启后切换到中文界面")); +// buf.append("Chinese\r\n"); +// buf.append("WINPY_utf8.txt\r\n"); +// } + return LangIndex; +} +void DlgMutiLanguage::SetNewLanguage(){ + + LangIndex = INPUT_METHOD_TYPE_CHINESE; + + QFile file("/home/plg/UseEn"); + +// QMessageBox::StandardButton ret; +// ret = QMessageBox::information(this, tr("警告"), +// tr("确定要切换显示语言吗?\r\n(重启才能生效)"), +// QMessageBox::Ok | QMessageBox::Cancel); +// if (ret != QMessageBox::Ok){ +// return; +// } + QByteArray buf; + buf.clear(); + + if(file.open(QIODevice::ReadWrite)) {//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 + + + if(ui->radioButton_2->isChecked()) { + LangIndex = INPUT_METHOD_TYPE_ENGLISH; + buf.append("English\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + else if(ui->radioButton_3->isChecked()) { + LangIndex = INPUT_METHOD_TYPE_VIETNAM; + buf.append("Turkish\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + else if(ui->radioButton_4->isChecked()) { + LangIndex = INPUT_METHOD_TYPE_SPANISH; + buf.append("Spanish\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + else if(ui->radioButton_5->isChecked()) { + LangIndex = INPUT_METHOD_TYPE_THAI; + buf.append("Thai\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + /*else if(ui->radioButton->isChecked()) { + + } + else if(ui->radioButton->isChecked()) { + + } + else if(ui->radioButton->isChecked()) { + + }*/ + else { + //QMessageBox::information(this,tr("提示"),tr("重启后切换到中文界面")); + buf.append("Chinese\r\n"); + buf.append("WINPY_utf8.txt\r\n"); + } + file.write(buf); +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) + #if 1 + fsync(file.handle()); +#endif + file.close(); + + } +} diff --git a/dlgmutilanguage.h b/dlgmutilanguage.h new file mode 100644 index 0000000..35abb4e --- /dev/null +++ b/dlgmutilanguage.h @@ -0,0 +1,28 @@ +#ifndef DLGMUTILANGUAGE_H +#define DLGMUTILANGUAGE_H + +#include + +namespace Ui { + class DlgMutiLanguage; +} + +class DlgMutiLanguage : public QDialog +{ + Q_OBJECT + +public: + explicit DlgMutiLanguage(QWidget *parent = 0); + ~DlgMutiLanguage(); + + void setCurrentLanguage(); + int getCurrentLanguage(); + int LangIndex; +public slots: + void SetNewLanguage(); +private: + Ui::DlgMutiLanguage *ui; + +}; + +#endif // DLGMUTILANGUAGE_H diff --git a/dlgmutilanguage.ui b/dlgmutilanguage.ui new file mode 100644 index 0000000..df0fe62 --- /dev/null +++ b/dlgmutilanguage.ui @@ -0,0 +1,140 @@ + + + DlgMutiLanguage + + + + 0 + 0 + 354 + 300 + + + + 界面语言设置 + + + + :/icon/TEXT.PNG:/icon/TEXT.PNG + + + + + 110 + 240 + 221 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 60 + 29 + 271 + 171 + + + + + + + true + + + 英语 + + + + + + + 西班牙语 + + + + + + + true + + + 土耳其语 + + + + + + + 中文 + + + + + + + 泰语 + + + + + + + + + 40 + 210 + 291 + 17 + + + + (注意: 选择切换显示语言, 重启后才能生效) + + + + + + + + + buttonBox + accepted() + DlgMutiLanguage + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DlgMutiLanguage + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/dlgmywarring.cpp b/dlgmywarring.cpp new file mode 100644 index 0000000..56e8278 --- /dev/null +++ b/dlgmywarring.cpp @@ -0,0 +1,35 @@ +#include "dlgmywarring.h" +#include "ui_dlgmywarring.h" + +DlgMyWarring::DlgMyWarring(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgMyWarring) +{ + ui->setupUi(this); + connect(ui->pushButtonOK,SIGNAL(pressed()),this,SLOT(pushButtonPressed())); + QFont font; + font.setFamily("wenquanyi"); + font.setPixelSize(24); + ui->labelTitle->setFont(font); +} + +DlgMyWarring::~DlgMyWarring() +{ + delete ui; +} + +void DlgMyWarring::SetWarringText(QString txt){ + + ui->label->setText(txt); + +} + +void DlgMyWarring::SetTitleText(QString txt){ + + ui->labelTitle->setText(txt); + +} + +void DlgMyWarring::pushButtonPressed(){ + DlgMyWarring::hide(); +} diff --git a/dlgmywarring.h b/dlgmywarring.h new file mode 100644 index 0000000..9415bb5 --- /dev/null +++ b/dlgmywarring.h @@ -0,0 +1,26 @@ +#ifndef DLGMYWARRING_H +#define DLGMYWARRING_H + +#include + +namespace Ui { + class DlgMyWarring; +} + +class DlgMyWarring : public QDialog +{ + Q_OBJECT + +public: + explicit DlgMyWarring(QWidget *parent = 0); + ~DlgMyWarring(); + + void SetWarringText(QString txt); + void SetTitleText(QString txt); +public slots: + void pushButtonPressed(); +private: + Ui::DlgMyWarring *ui; +}; + +#endif // DLGMYWARRING_H diff --git a/dlgmywarring.ui b/dlgmywarring.ui new file mode 100644 index 0000000..baf08ae --- /dev/null +++ b/dlgmywarring.ui @@ -0,0 +1,166 @@ + + + DlgMyWarring + + + + 0 + 0 + 464 + 213 + + + + 警告 + + + + :/icon/a9.ico:/icon/a9.ico + + + + + 20 + 40 + 431 + 111 + + + + + + + + + 0 + 85 + 255 + + + + + + + + + 0 + 85 + 255 + + + + + + + + + 150 + 147 + 140 + + + + + + + + + 12 + + + + 5 + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 0 + + + + + + 310 + 170 + 93 + 27 + + + + 确定 + + + + + + 10 + 10 + 441 + 31 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 150 + 147 + 140 + + + + + + + + + 16 + + + + TextLabel + + + Qt::AlignCenter + + + true + + + + + + + + diff --git a/dlgselectinputlanguage.cpp b/dlgselectinputlanguage.cpp new file mode 100644 index 0000000..d2a2b48 --- /dev/null +++ b/dlgselectinputlanguage.cpp @@ -0,0 +1,33 @@ +#include "dlgselectinputlanguage.h" +#include "ui_dlgselectinputlanguage.h" + +DlgSelectInputLanguage::DlgSelectInputLanguage(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgSelectInputLanguage) +{ + ui->setupUi(this); + selectIndex = 0; + connect(ui->radioButtonChinese,SIGNAL(clicked(bool)),this,SLOT(selectChanged1(bool))); + connect(ui->radioButtonEnglish,SIGNAL(clicked(bool)),this,SLOT(selectChanged2(bool))); + connect(ui->radioButtonVietnam,SIGNAL(clicked(bool)),this,SLOT(selectChanged3(bool))); + +} + +DlgSelectInputLanguage::~DlgSelectInputLanguage() +{ + delete ui; +} + +void DlgSelectInputLanguage::selectChanged1(bool ok){ + selectIndex=1; + hide(); +} +void DlgSelectInputLanguage::selectChanged2(bool ok){ + selectIndex=0; + hide(); +} + +void DlgSelectInputLanguage::selectChanged3(bool ok){ + selectIndex=2; + hide(); +} diff --git a/dlgselectinputlanguage.h b/dlgselectinputlanguage.h new file mode 100644 index 0000000..787926f --- /dev/null +++ b/dlgselectinputlanguage.h @@ -0,0 +1,28 @@ +#ifndef DLGSELECTINPUTLANGUAGE_H +#define DLGSELECTINPUTLANGUAGE_H + +#include + +namespace Ui { + class DlgSelectInputLanguage; +} + +class DlgSelectInputLanguage : public QDialog +{ + Q_OBJECT + +public: + explicit DlgSelectInputLanguage(QWidget *parent = 0); + ~DlgSelectInputLanguage(); + int selectIndex; + +public slots: + + void selectChanged1(bool ok); + void selectChanged2(bool ok); + void selectChanged3(bool ok); +private: + Ui::DlgSelectInputLanguage *ui; +}; + +#endif // DLGSELECTINPUTLANGUAGE_H diff --git a/dlgselectinputlanguage.ui b/dlgselectinputlanguage.ui new file mode 100644 index 0000000..0d745d7 --- /dev/null +++ b/dlgselectinputlanguage.ui @@ -0,0 +1,55 @@ + + + DlgSelectInputLanguage + + + + 0 + 0 + 291 + 162 + + + + Qt::StrongFocus + + + Dialog + + + + + 20 + 10 + 241 + 131 + + + + + + + 汉语(Chinese) + + + + + + + 英语(English) + + + + + + + 越南语(Vietnam) + + + + + + + + + diff --git a/dlgshowmsg.cpp b/dlgshowmsg.cpp new file mode 100644 index 0000000..5877490 --- /dev/null +++ b/dlgshowmsg.cpp @@ -0,0 +1,36 @@ +#include "dlgshowmsg.h" +#include "ui_dlgshowmsg.h" + +DlgShowMsg::DlgShowMsg(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgShowMsg) +{ + + ui->setupUi(this); + this->setToolTip("警告"); + connect(ui->pushButtonOK,SIGNAL(pressed()),this,SLOT(OnpushButtonOKPressed())); + this->hide(); + +} + +DlgShowMsg::~DlgShowMsg() +{ + delete ui; +} + + +void DlgShowMsg::hideMsg() +{ + ui->label->setText(""); + this->hide(); +} + +void DlgShowMsg::showMsg(QString txt){ + ui->label->setText(txt); + this->show(); +} + +void DlgShowMsg::OnpushButtonOKPressed(){ + ui->label->setText(""); + this->hide(); +} diff --git a/dlgshowmsg.h b/dlgshowmsg.h new file mode 100644 index 0000000..ff63fc2 --- /dev/null +++ b/dlgshowmsg.h @@ -0,0 +1,25 @@ +#ifndef DLGSHOWMSG_H +#define DLGSHOWMSG_H + +#include + +namespace Ui { + class DlgShowMsg; +} + +class DlgShowMsg : public QDialog +{ + Q_OBJECT + +public: + explicit DlgShowMsg(QWidget *parent = 0); + ~DlgShowMsg(); + void showMsg(QString txt); + void hideMsg(); +private slots: + void OnpushButtonOKPressed(); +private: + Ui::DlgShowMsg *ui; +}; + +#endif // DLGSHOWMSG_H diff --git a/dlgshowmsg.ui b/dlgshowmsg.ui new file mode 100644 index 0000000..819880d --- /dev/null +++ b/dlgshowmsg.ui @@ -0,0 +1,68 @@ + + + DlgShowMsg + + + + 0 + 0 + 298 + 91 + + + + 警告 + + + + + + + + + + + Qt::AlignCenter + + + + + + + 确定 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/dlgvarlength.cpp b/dlgvarlength.cpp new file mode 100644 index 0000000..b8f9513 --- /dev/null +++ b/dlgvarlength.cpp @@ -0,0 +1,44 @@ +#include "dlgvarlength.h" +#include "ui_dlgvarlength.h" + +DlgVarLength::DlgVarLength(QWidget *parent) : + QDialog(parent), + ui(new Ui::DlgVarLength) +{ + ui->setupUi(this); + connect(ui->pushButtonOK,SIGNAL(pressed()),this,SLOT(pushButtonOK_Pressed())); + + +} + +DlgVarLength::~DlgVarLength() +{ + delete ui; +} +void DlgVarLength::applyUI(int len) +{ + int tmp=len/2; + ui->spinHeadLen->setMaximum( tmp); + ui->spinEndLen->setMaximum( tmp); + + ui->spinHeadLen->setValue(headLen); + ui->spinEndLen->setValue(endLen); + ui->spinVarLen->setValue(varLen); + ui->spinVarLen1->setValue(varLen1); + ui->checkVarEN->setChecked(varEn); + ui->pushButtonOK->setFocus(); + //ui->lab_AllLength ->setText(QString().sprintf("%0.1f",len)); + ui->lineEditAllLen ->setText(QString().sprintf("%d",len)); +} + +void DlgVarLength::pushButtonOK_Pressed() +{ + headLen = ui->spinHeadLen->value(); + endLen = ui->spinEndLen->value(); + varLen = ui->spinVarLen->value(); + varLen1 = ui->spinVarLen1->value(); + varEn = ui->checkVarEN->isChecked(); + emit on_set(); + this->hide(); + +} diff --git a/dlgvarlength.h b/dlgvarlength.h new file mode 100644 index 0000000..28da5a2 --- /dev/null +++ b/dlgvarlength.h @@ -0,0 +1,32 @@ +#ifndef DLGVARLENGTH_H +#define DLGVARLENGTH_H + +#include + +namespace Ui { + class DlgVarLength; +} + +class DlgVarLength : public QDialog +{ + Q_OBJECT + +public: + explicit DlgVarLength(QWidget *parent = 0); + ~DlgVarLength(); + int headLen; + int endLen; + short varLen; + short varLen1; + bool varEn; + void applyUI(int len); + +public slots: + void pushButtonOK_Pressed(); +Q_SIGNALS: + void on_set(); +private: + Ui::DlgVarLength *ui; +}; + +#endif // DLGVARLENGTH_H diff --git a/dlgvarlength.ui b/dlgvarlength.ui new file mode 100644 index 0000000..db20ab0 --- /dev/null +++ b/dlgvarlength.ui @@ -0,0 +1,202 @@ + + + DlgVarLength + + + Qt::WindowModal + + + + 0 + 0 + 386 + 166 + + + + Qt::StrongFocus + + + 变长喷印参数 + + + + + + + + + 100 + 16777215 + + + + 头部长度(m) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 16777215 + + + + 尾部长度(m) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 16777215 + + + + 总长(m) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 9999 + + + + + + + 9999 + + + + + + + true + + + + 120 + 16777215 + + + + false + + + true + + + + + + + + 100 + 16777215 + + + + 调整长度(mm) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 60 + 0 + + + + -200 + + + 200 + + + + + + + + 100 + 16777215 + + + + 调整长度(mm) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 60 + 0 + + + + -200 + + + 200 + + + + + + + Qt::RightToLeft + + + 可变长度允许 + + + + + + + + 100 + 60 + + + + 确定 + + + true + + + + + + + + + + diff --git a/emergency b/emergency new file mode 100644 index 0000000..d910a01 Binary files /dev/null and b/emergency differ diff --git a/english-0412-2OK.ts b/english-0412-2OK.ts new file mode 100644 index 0000000..6335cdb --- /dev/null +++ b/english-0412-2OK.ts @@ -0,0 +1,4100 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + 退格 + Backspace + + + 全选 + SelectAll + + + + DlgInputAddr + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + 开始时间 + StartDate + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 警告 + Warnning + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + 英文 + English + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + ! + + + + 2 + @ + 1 {2?} + + + + 3 + # + 1 {3?} + + + + 4 + $ + 1 {4?} + + + + 5 + % + 1 {5?} + + + + 6 + ^ + 1 {6?} + + + + 7 + & + & + + + + 8 + * + 1 {8?} + + + + 9 + ( + 1 {9?} + + + + 0 + ) + 1 {0?} + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + ? + + + + 特殊字 + SpecialChar + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + 错误 + Error + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + Picture Edit + + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Insert +Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Insert +Piture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + + 字符 +光标 + Character +Cursor + + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + 系统维护设置成功! + Syster maintenance setting success ! + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + 开 + On + + + + + + + + + + + + 关 + Off + + + + + + + + + 警告 + Warnning + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + + + + 启动 + Start + + + + + + + + + + + + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + 错误 + Error + + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + TextEditOption + + + Form + Form + + + + 新建 + NewFile + + + + + 另存为 + Save as + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Insert +Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 9 + 1 {9?} + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + Trigger Mode + + + + 延时触发 + Time Delayed +Triggering + + + + 光电边沿触发 + Optical Edge +Triggering + + + + 光电电平触发 + Electrical Level +Triggering + + + + 同步器触发 + Synchronizer + Triggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth +(mm) + + + + 同步喷印模式 + Synchronizer + Mode + + + + 按字符宽度 + as per font + width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + Character + Width: + + + + 重复次数 + Repeat + Times + + + + + + + 重复间隔(毫秒) + RepeatInterval + (ms) + + + + + + 触发延时(毫秒) + TriggerDelay + (ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay (ms): + + + + 电眼清零 + PhotodEtector +ResetCounter + + + + 自动调速 + AutoSpeed +Enable + + + + 同步打印 + Synchronizer + Enable + + + + 同步器清零 + Synchronizer +ResetCounter + + + + 脉冲数修正 + Correction +Pulses + + + + 脉冲输出使能 + PulseOutput +Enable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + Character width + + + + 喷印比例(%) + Printing scale (%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english-1.ts b/english-1.ts new file mode 100644 index 0000000..c17b1b1 --- /dev/null +++ b/english-1.ts @@ -0,0 +1,5362 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + cp %1/*.dpn %2/ + + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DialogSaveFile + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 预览文件内容: + Preview: + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 请输入文件名: + File Name: + + + + 取消 + Cancel + + + + + 保存 + Save + + + + 警告 + Warnning + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + PrintMax + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Mac:%1 + + + + + 喷码机恢复工作! + InkJet Back to Work! + + + + 喷码机维护时间已到,请48小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! + + + + + 当前日期: + CurDate: + + + + + 正确? + Correct? + + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + Confirm + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + 错误!粘度计下位灯故障. + Error! Viscometer inferior lamp failure. + + + + 错误!粘度计故障:检测不到上位灯. + Error:Viscometer fault! the upper lamp is not detected. + + + + 粘度检测异常,粘度值太大!!! + The viscosity anomaly detection, viscosity too high!!! + + + + 正在开墨线..... + InkLine Openning...... + + + + 回收泵全速开 + ReclaimPump ON + + + + + + + + 粘度泵开 + ViscosityPump ON + + + + + + + + + 循环阀开 + CycleValve ON + + + + + + + + 墨线阀开 + InkLineValve ON + + + + + 清洗阀开 + CleanValve ON + + + + + 清洗阀关 + CleanValve OFF + + + + + + + + 墨线阀关 + InkLineValve OFF + + + + + + + + 粘度泵关 + ViscosityPump OFF + + + + + + + 供墨阀开 + InkValve ON + + + + 正常开墨线状态,请等待%1秒 + InkLine Raedy,Please wait %1 s + + + + + + + 循环阀关 + CycleValve OFF + + + + 开晶振电压,正在检测相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + + + 正在测试相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + + + 相位检测正常,开启高压 + Phase Ready + + + + + 相位检测异常 + Phase error + + + + 开墨线完成 + InkLine Open Complete + + + + 开墨线完成,可以打印! + InkLine Ready,You Can To Print Now + + + + 正在关闭墨线 + Closing InkLine..... + + + + 回收泵变全压运行 + ReclaimPump ON + + + + 清洗阀点动%1次 + CleanValve work %1 times + + + + 循环阀开,请等待%1s + CycleValve on,please wait for %1 s + + + + 关回收泵 + ReclaimPump OFF + + + + %1秒后关回收泵 + Wait %1s and ReclaimPump OFF + + + + + 可以关机断电 + InkJet can Shoutdown + + + + + 正在关机..... + Shutdown ...... + + + + 正在快速开墨线..... + Is InkLine Openning ...... + + + + 打开晶振电压 + OscillatorVoltage ON + + + + 正常开墨线状态 + + + + + 5秒后打开晶振电压 + crystals voltage on after 5s + + + + 开晶振电压,正在检测相位,请等待%1s + is phase testting, please wait for %1 s + + + + 快速开墨线完成 + InkLine Open Finish + + + + 快速开墨线完成,可以打印! + InkLine Open Finish + + + + 正在快速关闭墨线 + Is InkLine OFF ...... + + + + 回收泵关 + ReclaimPump OFF + + + + 回收泵变全速运行 + ReclaimPump On + + + + 回收泵全速运行 + ReclaimPump ON + + + + 回收泵全速运行,请等待%1秒 + Is ReclaimPump On, Wait %1s + + + + 快速关闭墨线完成 + Complete the quick closing InkLine + + + + + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + Speed is too fast or interval is too short! Unable to print all, stop print now!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + Speed is too fast or interval is too short! Unable to print all char!!! + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + 打开文件出错次数超多3次,自动清除默认喷印文件. + Automatically clear the default file because openFile error. + + + + 非法关机次数过多,自动清除默认喷印文件. + Automatically clear the default file because illegal shutdown. + + + + 上次出现非法关机. + Illegal shutdown Last time. + + + + 自动循环中,请等待%1秒............... + Is AutoCyclling ,Wait %1s...... + + + + + 自动循环完成!!! + Auto Cycle finish!!! + + + + 正在自检,请等待%1秒............... + Is InkJet Testting, Wait %1 s...... + + + + + + + + 供墨阀关 + InkValve OFF + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 条形码 + BarCode + + + + 二维码 + QRCode + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 立即重新计米 + ResetCounterNow + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 墨水缸满 + Inkstand +Full + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + 2014-08-23 + 1 {2014-08-23?} + + + + + + + 开 + Collector +Open + + + + Push + + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + 维护时间已到喷码机停止工作 + The maintenance time has come,Inkjet printer stop working! + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + 开墨线 + OPEN + + + + 关墨线 + CLOSE + + + + 墨线状态 + INKLINE + + + + 喷 嘴 +逆清洗 + nozzles +Clean + + + + 机箱: + CASE: + + + + 正在喷印...... + Printting...... + + + + 墨线正常,可以喷印. + InkLine ready to print. + + + + + 墨线正常. + InkLine Ready. + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + + 高压故障,快速关墨线 + high voltage error, closing now. + + + + 维护时间已到,喷码机将停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + + 相位故障,FPGA自动关高压. + phase error,FPGA turnoff the high voltage. + + + + + 相位故障,准备关机 + + + + + %1.%2[%3.%4]米/秒 + %1.%2[%3.%4]m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + File not save,please save it Now! + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线! + InkLine is Close,Please Open it! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + 请切换为自动状态,再继续操作! + Please switch to automatic state, to continue the operation! + + + + 打开墨线 + InkLine OPEN + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭墨线 + InkLine Close + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 墨线未关,是否关闭墨线后关机! + Whether chalk line did not closed, shutdown after the inkline closed! + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + 条形码信息编辑 + BarCode Edit + + + + 二维码信息编辑 + QRCode Edit + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + RowHeight + + + + 无加粗 + Normal + + + + 加粗1倍 + Bold1 + + + + 加粗2倍 + Bold2 + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 字符光标 + Character +Cursor + + + + 像素光标 + Pixel +Cursor + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 文件另存为... + Save As...... + + + + 另存为 + Save As + + + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 文件保存为... + Save...... + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 墨线时间: + WorkingTime: + + + + 0 + 1 {0?} + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + Not print continue counter + + + + 打印优化 + Print optimization + + + + 电眼误触禁止 + Prohibition ElectricEye +re-trigger + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QBarCode + + + Dialog + + + + + 条形码类型 + BarType + + + + 文本信息 + Input: + + + + 显示缩放 + Scale + + + + 条形码高度 + BarHeight + + + + 1点 + 1Dot + + + + 2点 + 2Dot + + + + 3点 + 3Dot + + + + 4点 + 4Dot + + + + + 5点 + 5Dot + + + + 6点 + 6Dot + + + + 条码宽度 + BarWidth + + + + 字体 + Font + + + + 文本宽度调整 + TextWidth + + + + 居中对齐 + CenterAlign + + + + 左对齐 + LeftAlign + + + + 右对齐 + RightAlign + + + + 文本对齐 + TextAlign + + + + 文本加粗 + TextBold + + + + 插入到文档 + InsertToDoc + + + + FileName + + + + + TextLabel + + + + + 预览 + Preview + + + + 条形码保存 + Save + + + + 墨水类型 + InkType + + + + 黑墨 + BlackInk + + + + 白墨 + WhiteInk + + + + 返回 + Return + + + + 文件未保存 + File Not Saved + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵 + 12 Matrix + + + + 16点阵 + 16 Matrix + + + + BARCODE_128 + + + + + BARCODE_93 + + + + + 自适应编码 + AUTO + + + + 7点 + 7Dot + + + + 9点 + 9Dot + + + + 12点 + 12Dot + + + + 16点 + 16Dot + + + + 24点 + 24Dot + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + TabWidth: %1,Height: %2,TextWidth: %3 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回路阀 + FeedBack +Valve + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + Manul + + + + 自动 + Auto + + + + + + + 启动 + Start + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 密码不正确! + Incorrect Password! + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + 错误 + Error + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + + + + + + 提示 + Tips + + + + 开墨线 + Open InkLine + + + + 关墨线 + Close InkLine + + + + 清洗阀 + Clean Valve + + + + 墨线阀 + InkLine Valve + + + + 供墨阀 + InkValve + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + If you start cleaning, be sure the recycling tank has opened more than 10 mm, and stop to clean after 1 minute + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + 小喷嘴片 + Small Nozzle + + + + 大喷嘴片 + Big Nozzle + + + + English interface + + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 自动清洗时间约为一分钟,然后自动停止 + Auto Cleanning,wait 1 minute. + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + + 正在进入手动模式...... + Enter Manual Mode..... + + + + 正在喷嘴逆清洗...... + Is Nozzles Cleanning..... + + + + + + + + + 喷嘴逆清洗完成 + Nozzles Cleanning Finish. + + + + 正在开回收槽...... + ReclaimTank Openning...... + + + + 正在关回收槽...... + ReclaimTank Closing...... + + + + 密码不正确! + Incorrect Password! + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 重置高压前,请先关墨线! + Please Turnoff InkLine before Reset High voltage! + + + + 重置高压前,请先关闭回收槽! + Please Turnoff ReclaimTank before Reset High voltage! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 墨线未打开! + InkLine Not Opened! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + 高压设置异常 + High Voltage Set False + + + + 高压设置异常,本次重置操作无效! + High Voltage Set False! + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + + + 警告 + Warnning + + + + 确定要切换中英文界面? + You want to switch Language? + + + + 重启后切换到英文界面 + Switch to English GUI After the restart + + + + 重启后切换到中文界面 + Switch to Chinese GUI After the restart + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 12 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 另存为123 + SaveAs + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 保存... + Save..... + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 禁止电眼清零 + ForbiddenMagicEyeReset + + + + 允许电眼清零 + AllowMagicEyeReset + + + + 允许电眼立即清零 + AllowMagicEyeResetNow + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 图片另存为... + SaveAs + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 图片保存为... + Save to...... + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + dlgQrCode + + + Dialog + + + + + 返回 + Return + + + + + + TextLabel + + + + + 信息 + Text: + + + + 保存 + Save + + + + 预览 + Preview + + + + 插入到文档 + InsertToDoc + + + + 自动刷新 + AutoShow + + + + 黑墨 + BlackInk + + + + 白墨 + WhiteInk + + + + [%1 X %2] + + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english.qm b/english.qm new file mode 100644 index 0000000..d133f48 Binary files /dev/null and b/english.qm differ diff --git a/english.ts b/english.ts new file mode 100644 index 0000000..386dbad --- /dev/null +++ b/english.ts @@ -0,0 +1,8513 @@ + + + +UTF-8 + + DacDisplayAndEdit + + 墨点 + InkDot + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + 默认值 + Default + + + 编辑 + Edit + + + 是 + YES + + + 否 + NO + + + 完成 + OK + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + 提示 + Tips + + + %1 + %1 + + + + DevOp + + + 字高超出范围 + The char height is out of range + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + + + 错误 + Error + + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + + + + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 输入密码 + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogCycleprint + + + Dialog + + + + + 1循环范围:0- + 1Cycle range:0- + + + + 1循环次数: + 1Number of cycles: + + + + 2循环范围:0- + 2Cycle range:0- + + + + 2循环次数: + 2Number of cycles: + + + + 3循环范围:0- + Cycle range:0- + + + + 3循环次数: + 3Number of cycles: + + + + 6循环次数: + 6Number of cycles: + + + + 6循环范围:0- + Cycle range:0- + + + + 5循环范围:0- + Cycle range:0- + + + + 5循环次数: + 5Number of cycles: + + + + 4循环范围:0- + Cycle range:0- + + + + 4循环次数: + 4Number of cycles: + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 7点(左横) + 7Dot(Left-Horizontal) + + + + 7点(右横) + 7Dot(Right-Horizontal) + + + + 9点(左横) + 9Dot(Left-Horizontal) + + + + 9点(右横) + 9Dot(Right-Horizontal) + + + + 7点(孟加拉) + 7Dot(Bengali) + + + + 32点 + 32 Matrix + + + + 7点(rf7) + 7点(数字) + 7 Dot(rf7) + + + + 21点(rf21) + 21 Dot(rf21) + + + + 12点(新罗马) + 12 Dot(Rome) + + + + 123456890ABCDEFGWXYZ + + + + + - + + + + + 查字库标识 + check ID + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInputTxt + + + Dialog + + + + + DialogInsertVari + + + Dialog + + + + 二维码: + QRCode + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + 变量2 + Counter 2 + + + + DataMatrix + + + + + QRCode + + + + + BarCode128 + + + + + 计数器1 + CNT1 + + + + 计数器2 + CNT2 + + + + 随机码1 + RandomCode1 + + + + 有效日期 + ExpireDate + + + + 生产日期 + CurrentDate + + + + Class + + + + + 计数器3 + CNT3 + + + + 数字个数 + Digit Number + + + + 9个 + 9 + + + + 11个 + 11 + + + + 10个 + 10 + + + + 3个 + 3 + + + + 6个 + 6 + + + + 12个 + 12 + + + + 13个 + 13 + + + + 14个 + 14 + + + + 15个 + 15 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DialogSaveFile + + + Dialog + File...... + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 预览文件内容: + Preview: + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 请输入文件名: + File Name: + + + + 取消 + Cancel + + + + + 保存 + Save + + + + 警告 + Warnning + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogShowCounter + + + Dialog + File...... + + + + 米标显示: + Meter scale display: + + + + 目前循环范围: + Current cycle range: + + + + + + 米 + metre + + + + 剩余米数: + Remaining meters: + + + + 循环次数: + Number of cycles: + + + + 立即重新计米 + ResetCounterNow + + + + 起始: + Start: + + + + 结束: + End: + + + + Dialoginputpasswd + + + Dialog + File...... + + + + 修改密码: + Change Password: + + + + Dialogmodifypasswd + + + Dialog + File...... + + + + 修改密码: + Change Password: + + + + 密码授权 + Password authorization + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + 0 + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + PrintMax + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + + SuperNodeIP: + SuperNodeIP: + + + + edgeIP: + edgeIP: + + + + + + + + + . + . + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + 警告 + Warnning + + + 无法打开文件 + Cannot open file + + + + 喷码机恢复工作! + InkJet Back to Work! + + + + Mac:%1维护时间剩余 + 维护时间剩余 + Mac:% 1 maintenance time remaining + + + + 小时,喷码机将停止工作.请与供应商联系! + Hours, the jet printer will stop working. +Please contact the supplier! + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + Mac:% 1 maintenance time has passed, the inkjet printer has stopped working! Please contact the supplier + + + 喷码机维护时间已到,请148小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! {148小?} + + + 喷码机维护时间已到,请48小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! + + + + + 当前日期: + CurDate: + + + + + 正确? + Correct? + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + DlgMutiLanguage + + + 界面语言设置 + LanguageSettings + + + + 中文 + Chinese + + + + 泰语 + Thai + + + + 英语 + English + + + + 土耳其语 + Turkish + + + + 西班牙语 + Spanish + + + 汉语(Chinese) + Chinese + + + + (注意: 选择切换显示语言, 重启后才能生效) + (Note: Select toggle display language and restart it to take effect) + + + 警告 + Warnning + + + + DlgMyWarring + + + 警告 + Warnning + + + + 确定 + Confirm + + + + TextLabel + + + + + DlgSelectInputLanguage + + + Dialog + File...... + + + + 汉语(Chinese) + Chinese + + + + 英语(English) + English + + + + 越南语(Vietnam) + Vietnam + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + Confirm + + + + DlgVarLength + + + 变长喷印参数 + Variable length parameter + + + + 头部长度(m) + Head length (m) + + + + 尾部长度(m) + Tail length (m) + + + + + 调整长度(mm) + Adj Length (mm) + + + + 总长(m) + Total Length (m) + + + + 确定 + Confirm + + + + 可变长度允许 + Variable length Enable + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + Main + + + + 图案编辑 + PicEdit + + + + 打印设置 + Setting + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + 网络管理 + NetSet + + + + 电压调整 + VolSet + + + + Save + + + + + 不连续电压 + Discontinuous voltage + + + + + vol0 + + + + + + vol1 + + + + + + vol2 + + + + + + vol3 + + + + + + vol4 + + + + + + vol5 + + + + + + vol6 + + + + + + vol7 + + + + + + vol8 + + + + + + vol9 + + + + + + vol10 + + + + + + vol11 + + + + + + vol12 + + + + + + vol13 + + + + + + vol14 + + + + + + vol15 + + + + + + vol16 + + + + + + vol17 + + + + + + vol18 + + + + + + vol19 + + + + + + vol20 + + + + + + vol21 + + + + + + vol22 + + + + + + vol23 + + + + + + vol24 + + + + + + vol25 + + + + + + vol26 + + + + + + vol27 + + + + + + vol28 + + + + + + vol29 + + + + + + vol30 + + + + + + vol31 + + + + + + vol32 + + + + + + vol33 + + + + + + vol34 + + + + + + vol35 + + + + + + vol36 + + + + + + vol37 + + + + + + vol38 + + + + + + vol39 + + + + + 连续电压 + Continuous voltage + + + + 满列电压 + Full train voltage + + + + fvol0 + + + + + fvol1 + + + + + fvol2 + + + + + fvol3 + + + + + fvol4 + + + + + fvol5 + + + + + fvol6 + + + + + fvol7 + + + + + fvol8 + + + + + fvol9 + + + + + fvol10 + + + + + fvol11 + + + + + fvol12 + + + + + fvol13 + + + + + fvol14 + + + + + fvol15 + + + + + fvol16 + + + + + fvol17 + + + + + fvol18 + + + + + fvol19 + + + + + fvol20 + + + + + fvol21 + + + + + fvol22 + + + + + fvol23 + + + + + fvol24 + + + + + fvol25 + + + + + fvol26 + + + + + fvol27 + + + + + fvol28 + + + + + fvol29 + + + + + fvol30 + + + + + fvol31 + + + + + fvol32 + + + + + fvol33 + + + + + fvol34 + + + + + fvol35 + + + + + fvol36 + + + + + fvol37 + + + + + fvol38 + + + + + fvol39 + + + + + 其他调整 + Other adjustments + + + + 整体缩放(%) : + Overall scaling (%) : + + + + WriteByte + + + + + ReadByte + + + + + + + Address: + + + + + + Value: + + + + + WriteWord + + + + + ReadWord + + + + + ReadDword + + + + + WriteDword + + + + + ValueH: + + + + + ValueL: + + + + + + + 信息编辑 + EditTXT + + + + 触发设置 + TrigSet + + + + + 系统管理 + SysSet + + + + + 日志信息 + LogInfo + + + + 定时开机循环完成,准备关机 + self checking done in alarm resump, ready to poweroff + + + + 准备关机 + ready poweroff + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + POST,Wait for 60 s...... + + + + 开始自检,请等待%1秒............... + POST,Wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 墨水或溶剂空,准备关机 + Ink or mekeup empty, prepare shutdown + + + + 压力波动超过设定的5个值. + The pressure fluctuation exceeds the set 5 values + + + + 停止打印,自动关闭高压. + Stop printing and automatically turn off high voltage + + + + 压力异常:上次压力值%1,当前压力值%2 + Pressure fault:last value is %1, current value is %2 + + + + 高压异常:上次电流值%1,当前电流值%2 + High voltage fault:last current value is %1, current current value is %2 + + + + 混合阀打开2: + The mixing valve opens 2: + + + 混合阀打开1. + The mixing valve opens 1 + + + 混合阀打开2. + The mixing valve opens 2 + + + + 提示 + hint + + + + 是否接收新的信息! + Whether to receive new information! + + + 请立即检查过滤器是否堵塞或者漏气! + Please immediately check whether the filter is blocked or leaking! + + + 请清理过滤器或者检查是否泄露! + Please clean the filter or check for leaks! + + + + + 错误!粘度计下位灯故障. + Error! Viscometer inferior lamp failure. + + + + + 错误!粘度计故障:检测不到上位灯. + Error:Viscometer fault! the upper lamp is not detected. + + + + 粘度检测异常,粘度值太大!!! + The viscosity anomaly detection, viscosity too high!!! + + + + + 错误!!!!!!!!!!!粘度偏大故障 + Error! Viscosity larger fault + + + + 定时开机 + timed start + + + + + 压力泄漏或压力传感器故障! + Pressure leakage or pressure sensor failure! + + + + 运行中压力泄漏,停齿轮泵! + If the pressure leaks during operation, stop the gear pump! + + + + + 测试时间结束,准备关机 + The test time is over, ready to shut down + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + The speed is too high, please stop immediately and contact the supplier! + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + The speed is too high, please clean the filter or check for leaks! + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + Excessive viscosity, may be viscosity sensor or viscometer damage, please contact manufacturers! + + + + 混合阀打开1: + The mixing valve opens 1: + + + + + 警告!!!!!!!!!!!粘度值偏低 + Warning! Low viscosity + + + 正在开墨线..... + InkLine Openning...... + + + 回收泵全速开 + ReclaimPump ON + + + 粘度泵开 + ViscosityPump ON + + + 循环阀开 + CycleValve ON + + + 墨线阀开 + InkLineValve ON + + + 清洗阀开 + CleanValve ON + + + 清洗阀关 + CleanValve OFF + + + 墨线阀关 + InkLineValve OFF + + + 粘度泵关 + ViscosityPump OFF + + + 供墨阀开 + InkValve ON + + + 正常开墨线状态,请等待%1秒 + InkLine Raedy,Please wait %1 s + + + 循环阀关 + CycleValve OFF + + + 开晶振电压,正在检测相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 正在测试相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 相位检测正常,开启高压 + Phase Ready + + + 相位检测异常 + Phase error + + + 开墨线完成 + InkLine Open Complete + + + 开墨线完成,可以打印! + InkLine Ready,You Can To Print Now + + + 正在关闭墨线 + Closing InkLine..... + + + 回收泵变全压运行 + ReclaimPump ON + + + 清洗阀点动%1次 + CleanValve work %1 times + + + 循环阀开,请等待%1s + CycleValve on,please wait for %1 s + + + 关回收泵 + ReclaimPump OFF + + + %1秒后关回收泵 + Wait %1s and ReclaimPump OFF + + + 可以关机断电 + InkJet can Shoutdown + + + 正在关机..... + Shutdown ...... + + + 正在快速开墨线..... + Is InkLine Openning ...... + + + 打开晶振电压 + OscillatorVoltage ON + + + 5秒后打开晶振电压 + crystals voltage on after 5s + + + 开晶振电压,正在检测相位,请等待%1s + is phase testting, please wait for %1 s + + + 快速开墨线完成 + InkLine Open Finish + + + 快速开墨线完成,可以打印! + InkLine Open Finish + + + 正在快速关闭墨线 + Is InkLine OFF ...... + + + 回收泵关 + ReclaimPump OFF + + + 回收泵变全速运行 + ReclaimPump On + + + 回收泵全速运行 + ReclaimPump ON + + + 回收泵全速运行,请等待%1秒 + Is ReclaimPump On, Wait %1s + + + 快速关闭墨线完成 + Complete the quick closing InkLine + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + Speed is too fast or interval is too short! Unable to print all, stop print now!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + Speed is too fast or interval is too short! Unable to print all char!!! + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + 打开文件出错次数超多3次,自动清除默认喷印文件. + Automatically clear the default file because openFile error. + + + 非法关机次数过多,自动清除默认喷印文件. + Automatically clear the default file because illegal shutdown. + + + 上次出现非法关机. + Illegal shutdown Last time. + + + 自动循环中,请等待%1秒............... + Is AutoCyclling ,Wait %1s...... + + + 自动循环完成!!! + Auto Cycle finish!!! + + + 正在自检,请等待%1秒............... + Is InkJet Testting, Wait %1 s...... + + + 供墨阀关 + InkValve OFF + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + 中文 + Chinese + + + + Tiếng Việt + + + + + Russian + + + + + Japanese + + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 导出日志到U盘 + Export logs to USB flash disk + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + + + + 提示 + Tips + + + + 是否确认将所有日志文件导出到U盘? + Are you sure to export all log files to USB flash disk? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + 选择历史记录文件 + Choose record file + + + + 是否确认将历史日志文件全部清除? + Are you sure to clear all history log files? + + + + 是否确认将当前日志全部清除? + Are you sure to clear all current logs? + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 条形码 + BarCode + + + + 二维码 + QRCode + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 获取数据 + get the data + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 紧急停机 + Emergency stop + + + 晶振电压 + CrystalVOL + + + + 粘度 + Viscosity + + + + 压力 + Pressure + + + + + 隔膜位置 + DiaphragmPOS + + + + + 暂停打印 +停止高压 + Pause to print +Stop high pressure + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Mekeup +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + 故障恢复 + Fault +Reset + + + + 立即重新计米 + ResetCounterNow + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨水缸满 + Inkstand +Full + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + 2014-08-23 + 1 {2014-08-23?} + + + + 高压包 + High Voltage + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 泵启动 + Pump to start + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, Turn OFF collector and inkLine + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + 维护时间已到喷码机停止工作 + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + 开墨线 + OPEN + + + 关墨线 + CLOSE + + + 墨线状态 + INKLINE + + + 喷 嘴 +逆清洗 + nozzles +Clean + + + + + 机箱: + CASE: + + + 正在喷印...... + Printting...... + + + 墨线正常,可以喷印. + InkLine ready to print. + + + 墨线正常. + InkLine Ready. + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + 高压故障,快速关墨线 + high voltage error, closing now. + + + 维护时间已到,喷码机将停止工作! + The maintenance time has come,Inkjet printer stop working! + + + 相位故障,FPGA自动关高压. + phase error,FPGA turnoff the high voltage. + + + + 高压故障,关回收槽 + HighVoltFault,ReclainTank auto Colse + + + + 高压故障,关回收槽和墨线 + HighVoltFault,ReclainTank auto Colse + + + + 回收故障. + Recovery failure. + + + + 回收异常,墨线可能偏离.(%1) + Recovery abnormal, InkLine may deviate (%1) + + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,准备关机 + Phase Fault, ShoutDown Now + + + + 电眼交替 + Alter by electronic Eye + + + %1.%2[%3.%4]米/秒 + %1.%2[%3.%4]m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + File not save,please save it Now! + + + + + + + 变量数大于8个,某些变量将不起作用!!! + The variable number is greater than 8, and some variables will not work!!! + + + + + 请减少信息中的变量(或计数器)数量. + Please reduce the number of variables (or counters) in the printe file. + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + + 错误 + Error + + + + 喷印间隔过短,应高于%1! + Printing interval is too short, +should be higher than %1! + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + 开始打印1 + Start printing 1 + + + + 继续打印 +保持高压 + To continue printing + +Keep the high pressure + + + + 正在排气 ............... + Exhausting............... + + + + 泵停止 + Pump stop + + + + + 最多支持的列数目为:%1请减小信息长度. + The maximum number of columns supported is:%1, please decrease the length of the information. + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + Get DM code content is empty! + + + + + 获取DM码内容: + get DM code data: + + + + + 获取DM码内容跟上次相同 + Get the same DM code content as last time + + + + 高压故障:两高压偏转板间的电压检测异常 + High-voltage fault: two high voltage deflection plate voltage detection abnormal + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + 1. high pressure deflector and high voltage base, wet and dirty, please clean and dry high pressure plate and high voltage base; + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + 2., the machine changes the motherboard or high voltage package, please enter the "system settings", click "reset high", and set the word high to 90, reset the high voltage alarm value should be between 480 and 550; + + + + 3.高压线路漏电,请更换高压线路; + 3. high voltage line leakage, please replace the high voltage line; + + + + 4.高压底座漏电,请更换高压底座。 + 4. high voltage base leakage, please replace the high voltage base. + + + + 墨水过多:墨水溢出 + Excessive ink: ink overflow + + + + 1. 请停止添加墨水; + 1. please stop adding ink; + + + + 2. 请排出多余墨水。 + 2. please discharge excess ink. + + + + 墨水液位:墨水即将耗尽 + Ink level: ink is about to run out + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + 1., the ink is exhausted, 3 hours after the automatic shutdown, please add ink in time. + + + + 回收故障:未检测到有墨水回收 + Recovery failure: no ink recovery was detected + + + + 1. 墨水未射入回收管,请修正墨线方向; + 1. ink not into recycling tube, please correct line direction; + + + + 2. 墨水粘度太低,请更换新墨水; + 2. ink viscosity is too low, please replace the new ink; + + + + 3. 回收管堵塞,请清通或者更换回收管; + 3. recovery of pipe blockage, please clear or replace the recovery tube; + + + + 4. 回收泵故障,请清洗或者更换回收泵; + 4., the recovery pump failure, please clean or replace the recovery pump; + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + 5. after confirming that all the parameters and equipment are not abnormal, please enter the "print settings", cancel the "recovery troubleshooting" check, return to the main window interface, click the "fault recovery" button. + + + + 溶剂液位:溶剂即将耗尽 + Mekeup level: mekeup is about to run out + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + 1. mekeup depletion, 3 hours after the automatic shutdown, please add solvent in time. + + + + + 粘度故障报警 + Viscosity alarm + + + + 粘度故障:墨水粘度无法自动调整 + Viscosity fault: Ink viscosity can not be adjusted automatically + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + 1. the mixing valve fails, please flush or replace the mixing valve; + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + 2. the ink in the ink pot is abnormal. Please replace the ink; + + + + 粘度计异常: + Viscometer anomaly: + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + 1. the filter screen is blocked before the pump. Please replace the strainer before the pump; + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + 2. viscosity pump abnormal, please clean or replace viscosity pump; + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + 3. viscosity sensor abnormal, please check the sensor or replace the it. + + + + 相位故障报警 + Phase alarm + + + + 相位故障:相位信号检测异常 + Phase fault: phase detection exception + + + + 1. 墨水分裂不正常,请调整墨水分裂; + 1. ink dot split abnormal, please adjust the ink split; + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + 2. charging tank or check head dirty, please clean the charging tank and phase head; + + + + 3. 放大板功能性异常,请更换放大板; + 3. the magnifying board is abnormal. Please replace it; + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + 4. phase detection head and its distance is too far away, check the nozzle moving mechanism, adjusting the distance between the head and the ink; + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + 5., the ground has not received or outside interference, please connect the ground wire or isolate the outside interference; + + + + 6. 墨水质量异常,请更换新墨水。 + 6. the ink is of exceptional quality. Please replace the ink. + + + + 回收槽开关检测完成! + Recycling tank switch detection completed! + + + 墨线未开,请先开墨线! + InkLine is Close,Please Open it! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 正在加高压... + High voltage is being up... + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + + 暂停喷印............... + Pause printing... + + + + + 墨水缸满报警 + The ink jar is full of alarm + + + + + 墨水液位报警 + Ink level alarm + + + + + 溶剂液位报警 + Mekeup level alarm + + + + + 高压故障,暂停打印. + High voltage fault, Pause Printing. + + + + 相位故障:飞行时间错误! + Phase fault: wrong flight time! + + + + 相位故障:相位检测错误! + Phase fault: phase detection error! + + + + 齿轮泵转速 + Gear pump speed + + + + %1.%2[%3.%4]米/分 + %1.%2[%3.%4]m/min + + + + 停止打印 + Stop printing + + + + + 随机码文本将展出到U盘,请插入U盘 + The RandomCode save U disk. Please insert the U disk + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + 请切换为自动状态,再继续操作! + Please switch to automatic state, to continue the operation! + + + 打开墨线 + InkLine OPEN + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + 打开回收槽 + Opening collector + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + 关闭墨线 + InkLine Close + + + 关闭回收槽 + Closing collector + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + 墨线未关,是否关闭墨线后关机! + Whether chalk line did not closed, shutdown after the inkline closed! + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + 条形码信息编辑 + BarCode Edit + + + + + 二维码信息编辑 + QRCode Edit + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + ModbusSerial + + + 接收到开始打印命令 + Start printing command received + + + + 接收到暂停打印命令 + Pause printing command received + + + + 接收到停止打印命令 + Stop printing command received + + + + 接收到DM码数据命令 + DM code data command received + + + + MyFileDialog + + + 确定 + Confirm + + + + NetworkManager + + + Form + + + + + 手动设定 + Manual + + + + + IP: + + + + + Mask: + + + + + GW: + + + + + 取消 + Cancel + + + + 有线LAN + LAN + + + + WiFi: + + + + + SSID: + + + + + Status: + + + + + auth: + + + + + Encryption: + + + + + Plaintext (open / no authentication) + + + + + 主获取数据按钮 + get data button + + + + 断开 + Disconnect + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + 设备码: + Equipment code: + + + + 服务IP: + Service IP: + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + 8754 + 8754 + + + + 服务端口: + Service port: + + + + PSK: + + + + + 连接 + Connect + + + + Password: + + + + + 扫描 + Scan + + + + 清除 + Remove + + + + 获取数据 + get the data + + + + Network: + + + + + 添加网络 + Add network + + + + 测试 + Test + + + + 应用配置 + Application configuration + + + + 去掉数字码 + remove data code + + + + 去掉QR码 + remove QR code + + + + ScanSSID + + + + + 1 + 1 + + + + 47.111.170.144 + 47.111.170.144 + + + 错误 + Error + + + + wpa_supplicant service is not running. +Do you want to start it? + + + + + Disconnected + + + + + Inactive + + + + + Scanning + + + + + Authenticating + + + + + Associating + + + + + Associated + + + + + 4-Way Handshake + + + + + Group Handshake + + + + + Completed + + + + + Unknown + + + + + Could not get status from wpa_supplicant + + + + + Select any network + + + + + WPS AP in active PBC mode found + + + + + Press the PBC button on the screen to start registration + + + + + WPS AP with recently selected registrar + + + + + WPS AP detected + + + + + PBC mode overlap detected + + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + + + + + Network configuration received + + + + + Registration started + + + + + Registrar does not yet know PIN + + + + + Registration failed + + + + + Registration succeeded + + + + + WPA Pre-Shared Key Error + + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + + Network ID Error + + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + + + + + Failed to add network to wpa_supplicant +configuration. + + + + + Failed to enable network in wpa_supplicant +configuration. + + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + + + + + Yes + + + + + No + + + + + Failed to remove network from wpa_supplicant +configuration. + + + + + 是否去获取数据! + to get data ? + + + + 获取数据中... + get data ... + + + + + 上报数据中... + Reported data ... + + + + + + + 提示 + Tips + + + + + IP设置错误! + IP set error! + + + + 应用成功 + Apply success + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + 相检墨点: + Phase Detect Dot: + + + 相检占空比(%) + PhaseDetectDuty + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + DetectDelay + DetectDelay + + + + detect_num + + + + + 相检: + phase: + + + 相位偏移: + Phase offset: + + + 相检: + Phase: + + + + FullTimeEn + + + + + DetectVol + + + + + HighLowRatio + + + + + 充电占空比100% + ChargeDuty {100%} + + + + 相位检测电压: + 相位检测电压 + PhaseVol: + + + 检测延时: + Phase Delay: + + + + 检测点数量: + 检测点数量 + Num: + + + + 检测延迟 : + 检测墨点数量: + Number: + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + RowHeight + + + + 无加粗 + Normal + + + + 加粗1倍 + Bold1 + + + + 加粗2倍 + Bold2 + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 字符光标 + Character +Cursor + + + + 像素光标 + Pixel +Cursor + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 文件另存为... + Save As...... + + + + 另存为 + Save As + + + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 文件保存为... + Save...... + + + + 本条信息的变量超过规定数量! + The variables in this message exceed the specified quantity! + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + Please input a char. + Please input a char. + + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + 信息中的变量数超过了最大值(8)!,请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + + + 两个变量之间至少要空出一个墨点! + One point between two variables! + + + + PrintNet + + + 获取二维码内容: + Get the QR code content: + + + + 获取数字码: + Get a digital code: + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + + 慢速1 + Slow 1 + + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + 其它设置 + OtherSetting + + + + 更换信息文件时执行的动作: + Excute when change file: + + + + 产品计数器自动清0 + ProductAutoReset + + + + 总产品计数器自动清0 + TotalProductAutoReset + + + + 高压故障关回收槽 + ReclainTankColse +WhenHighVoltFault + + + + 无交替 + None + + + + 普通交替 + General Alter + + + + 电眼触发交替 + Electronic Trigger + + + 更换信息文件时执行的动作 + Action when File Replace + + + + 导出随机码文本 + ExportRandomCodeFile + + + + 无 + None + + + + 外接显示屏: + Extra Screen: + + + + 复位到起始值 + Reset to the starting value + + + + 小屏 + Small + + + + 大屏 + BIg + + + + 总产品计数值 + Product Counter + + + + + 计数器1 + CNT1 + + + + + 计数器2 + CNT2 + + + + + + + 起始值: + StartValue: + + + + + + + 结束值: + EndValue: + + + + + + 清零 + ResetCnt + + + + 可变长度 + VariableLength + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 墨线时间 + InkLineTime + + + + 墨线时间: + WorkingTime: + + + + + + 0 + 1 {0?} + + + + 开机次数: + PowerOnTimes: + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + 速度优先 + Speed First + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + Not print +continue counter + + + 打印优化 + Print +optimization + + + + 电眼误触禁止 + Prohibition +ElectricEye re-trigger + + + + TextLabel + + + + 0211模式 + 0211 Mode + + + 空列打印 + Blank column +print + + + + 字形优化 + char Optimize + + + + 有效期(天): + Expire Days + + + 2018-05-24 + 24Dot {2018-05-24?} + + + 2018/05/24 + 24Dot {2018/05/24?} + + + + + 高级设置 + AdvancedSetting + + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 修改授权 + Modify authorization + + + + 省点 + save point + + + + dd MM yy + + + + + + 调整电压 + Adjust the voltage + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 检测回收槽 + detect Collector + + + + + 锁定脉冲计数 + Lock pulse count + + + + 每条信息只打印一次 + Print once per message + + + + 非字宽 + Not word wide + + + + 使用齿轮泵 + Use gear pumps + + + + 高压阈值: + High voltage threshold: + + + + 不检测喷头盖 + Do not test sprinkler caps + + + + 打印时绿灯常亮 + green light is always on +when printing + + + + 复位发送打印数据 + Reset sending print data + + + + 计数器设置 + Counter setting + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + Note: when "section meter" under "other settings" page is checked, counter 1 is not available. + + + + 计数器3设置 + Counter 3 Setup + + + + 计数器3 + CNT3 + + + 生产日期: + Production Date: + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + Counter save shutdown value + + + + 距离尾部(mm): + Distance from tail (mm): + + + 当计数达到 : + Count reached: + + + + 特殊条件计数 + Special condition count + + + + 首尾交替 + Head tail alternation + + + 显示 + display + + + + 米标显示 + M the display + + + + 上移 + Move up + + + + 下移 + Move down + + + + 打印电压缩放 + Print voltage scaling + + + + 整体缩放(%) : + Overall scaling (%) : + + + + 显示屏显示: + Show on Screen: + + + + date time + + + + + ddhhmm + + + + + 特殊变量结束值: + Special variable end value: + + + + 特殊变量起始值: + Special variable starting value: + + + + 打印 + Print + + + + 分段计米 + CNT1 by Group + + + + 插 入 + Insert + + + + 添 加 + Add + + + + 全部删除 + Del All + + + + 删 除 + Del + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + + 重设值 + ResetCurrentCounter + + + + + + 重复数: + RepeatTimes: + + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + + + 输入密码 + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + %4d天 %02d:%02d:%02d + %4d Day %02d:%02d:%02d + + + + + + + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + 提示:可变长度参数不正确 + Hint: Incorrect variable length parameter + + + 要求:调整长度小于喷印间隔 + Requirement: Adjust the length less than the printing interval + + + + 错误 + error + + + + 密码: + Pwssword: + + + + 取消授权 + Quit authorized setting + + + + 随机码文件为空,不需要导出 + No randomCode file to export + + + + 随机码文本将展出到U盘,请插入U盘 + The RandomCode save U disk. Please insert the U disk + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + CNT1 distance can not divisible by Increment. the end value will set to %1 + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + CNT1 distance can not divisible by Increment. the end value will set to %1 + + + + 1 + 1 + + + + 正在打印第%1组设置,不可删除 + %1 is printing,can not delete + + + + 是否确认删除第%1组设置? + delete %1? + + + + 是否确认删除全部设置? + delete all? + + + + 字体宽度不能为0 + Font width cannot be 0 + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 解锁脉冲计数 + Unlock pulse count + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QBarCode + + + Dialog + + + + + 条形码类型 + BarType + + + 文本信息 + Input: + + + + 显示缩放 + Scale + + + + 条形码高度 + BarHeight + + + + 1点 + 1Dot + + + + 2点 + 2Dot + + + + 3点 + 3Dot + + + + 4点 + 4Dot + + + + + 5点 + 5Dot + + + + 6点 + 6Dot + + + + 文本1 + TEXT1 + + + + 文本3 + TEXT3 + + + + 计数器2 + CNT2 + + + + 文本2 + TEXT2 + + + + 计数器1 + CNT1 + + + + 插入文档 + InsertToDoc + + + + 条码保存 + Save + + + + 增加数字行 + add number row + + + + 日期 + Date + + + + 时间 + Time + + + 增加数字行 + Add number line + + + + 条码宽度 + BarWidth + + + 字体 + Font + + + 文本宽度调整 + TextWidth + + + 居中对齐 + CenterAlign + + + 左对齐 + LeftAlign + + + 右对齐 + RightAlign + + + 文本对齐 + TextAlign + + + 文本加粗 + TextBold + + + 插入到文档 + InsertToDoc + + + + FileName + + + + + 预览 + Preview + + + 条形码保存 + Save + + + + 墨水类型 + InkType + + + + 黑墨 + BlackInk + + + + 白墨 + WhiteInk + + + 条形保存 + Save + + + + 返回 + Return + + + + 文件未保存 + File Not Saved + + + 5点阵 + 5 Matrix + + + 7点阵 + 7 Matrix + + + 9点阵 + 9 Matrix + + + 12点阵 + 12 Matrix + + + 16点阵 + 16 Matrix + + + + CODE_128 + BARCODE_93 + + + + 自适应编码 + AUTO + + + + CODE_93 + + + + + 7点 + 7Dot + + + + 9点 + 9Dot + + + + 12点 + 12Dot + + + + 16点 + 16Dot + + + + 24点 + 24Dot + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + TabWidth: %1,Height: %2,TextWidth: %3 + + + + QObject + + + + 手动设定 + Manual Mode + + + + 应用 + Apply + + + + 起始值 + StartValue + + + + 结束值 + EndValue + + + + 循环值 + RepeatValue + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SceneEditOption + + + Form + Form + + + + 预览 + Preview + + + + 新建 + New + + + + 打开 + OpenFile + + + + + 保存 + Save + + + + 另存为 + SaveAs + + + + 新增图元 + NewItem + + + + 编辑图元 + EditItem + + + + 删除图元 + DelItem + + + + 放大 + Zoom In + + + + 缩小 + Zoom Out + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + without save it + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + 回路阀 + FeedBack +Valve + + + + 回收泵 + Recycle Pump + + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 系统升级 + System upgrade + + + + 排气 + Exhaust + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 自动清洗 + AutoClean + + + 齿轮泵 + The gear pump + + + + 电机测试 + Motor Test + + + + 更新字库 + UpdateFontLibrary + + + + 齿轮泵开 + Gear pump open + + + + 齿轮泵关 + Gear pump close + + + + 导出字库 + Export Character Library + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + Cancel + Cancel + + + + (1/2) Cleaning, please wait... + (1/2) Cleaning, please wait... + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + + + + + + + + + + 警告 + Warnning + + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + + 手动 + Manul + + + + + + 自动 + Auto + + + + + + + + + + + 启动 + Start + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + + + + 密码不正确! + Incorrect Password! + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + + + 错误 + Error + + + + 没找到对应字库,更新失败! + No corresponding word library found, update failed! + + + + 更新失败! + Update failed! + + + + 找不到更新软件! + Unable to find update software! + + + + 是否确认更新系统? + Are you sure to update the system? + + + + 系统更新成功,重启后生效! + The system has been updated successfully and will take effect after reboot! + + + + 文件不存在! + File does not exist! + + + + 压力 + Pressure + + + + autoclean cancel or status: + autoclean cancel or status: + + + + (2/3) Cleaning + (2/3) Cleaning + + + + (3/3) Cleaning + (3/3) Cleaning" + + + + 混合阀打开3: + 混合阀打开3. + The mixing valve opens 3: + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + autoclean start + autoclean start + + + + 是否确认启动自动清洗? + Start up auto clean: + + + + 是否确认墨水排除,加入清洗剂? + Ink empty and cleaning agent in? + + + + (1/3) Cleaning + (1/3) Cleaning + + + + 是否确认导出字库到U盘? + Export Character Library to usb disk? + + + + U盘不可识别! + usb disk not recognized! + + + + 字库导出完成! + Character library export done! + + + + 是否开始电机测试? + Startup motor test? + + + + 正在排气,是否停止? + Venting, do you want to stop? + + + 更新文件不存在! + Update file was not found! + + + 是否确认备份系统文件? + Confirm to backup system file? + + + 系统备份成功! + System backup suceess ! + + + 备份操作失败! + Backup operation failed! + + + + + + + + + + + + + + + + + 提示 + Tips + + + 开墨线 + Open InkLine + + + 关墨线 + Close InkLine + + + 清洗阀 + Clean Valve + + + 墨线阀 + InkLine Valve + + + 供墨阀 + InkValve + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + If you start cleaning, be sure the recycling tank has opened more than 10 mm, and stop to clean after 1 minute + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 粘度校正(%): + ViscosityAdjust: + + + + 新晶振 + NewCrystal + + + + 场景模式 + SceneMode + + + + 墨水温度: + InkTemp: + + + + °C + °C + + + + 0 + 0 + + + + 0.6 + 0.6 + + + + 1.0 + 1.0 + + + + 1.6 + 1.6 + + + + 2.0 + 2.0 + + + Pulse Counter: + Pulse Counter: + + + 脉冲计数器: + Pulse Counter: + + + + 隔膜位置偏移: + DiaphragmOffset: + + + + 5 + 5 + + + + 风扇开启温度: + Fan opening temperature: + + + + 10 + 10 + + + + 15 + 15 + + + + 20 + 20 + + + + 25 + 25 + + + + 30 + 30 + + + + 40 + 40 + + + + 45 + 45 + + + + 50 + 50 + + + + 55 + 55 + + + + 60 + 60 + + + + 重置高压 + Reset High Voltage + + + + 界面语言设置 + LanguageSettings + + + + 应用当前配置 + Apply + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 脉冲计数器: + Pulse counter: + + + + 隔膜位置: + DiaphragmPosition: + + + 混合阀管路: + MixingValvePiping: + + + 旧管路 + OldPiping + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + 小喷嘴片 + Small Nozzle + + + 大喷嘴片 + Big Nozzle + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 自动清洗时间约为一分钟,然后自动停止 + Auto Cleanning,wait 1 minute + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + 正在进入手动模式...... + Enter Manual Mode..... + + + + 正在喷嘴逆清洗...... + Is Nozzles Cleanning..... + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + Automatic search takes a long time. Do you want to confirm the optimal frequency of crystal oscillator in the range of 2K? + + + + Tiếng Việt(Vietnamese interface) + + + + + Chinese interface(中文界面) + + + + + English interface(英文界面) + + + + 喷嘴逆清洗完成 + Nozzles Cleanning Finish. + + + 正在开回收槽...... + ReclaimTank Openning...... + + + 正在关回收槽...... + ReclaimTank Closing...... + + + + 清洗完成 + The cleaning is done + + + 密码不正确! + Incorrect Password! + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + 重置高压前,请先关墨线! + Please Turnoff InkLine before Reset High voltage! + + + 重置高压前,请先关闭回收槽! + Please Turnoff ReclaimTank before Reset High voltage! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + 墨线未打开! + InkLine Not Opened! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + 高压设置异常 + High Voltage Set False + + + 高压设置异常,本次重置操作无效! + High Voltage Set False! + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + 警告 + Warnning + + + 确定要切换中英文界面? + You want to switch Language? + + + 重启后切换到英文界面 + Switch to English GUI After the restart + + + 重启后切换到中文界面 + Switch to Chinese GUI After the restart + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + wenquanyi + + + + + 12 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + + 警告 + Warnning + + + + + + + 无法打开文件 + Cannot open file + + + + + Application + Application + + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 二维码变量设置 + QR Variable Edit + + + + 完成 + OK + + + 另存为123 + SaveAs + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 保存... + Save..... + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + + + + 延时(毫秒): + Delay(ms): + + + + 允许电眼复位 + Allows ELE-EYE Reset + + + + 允许电眼立即复位 + Allows ELE-EYE Reset now + + + + 电眼清零 + PhotodEyeResetCounter + + + + 镜像交替间隔 + MirrorAlternately + + + + 镜象交替类型 + MirrorMode + + + + 无镜像打印 + NoMirror + + + + 自动水平翻转 + AutoRollover + + + + 自动垂直翻转 + AutoVerticalFlip + + + + 中心对称旋转 + CenterRotation + + + + 同步器正反转打印 + EncoderAlwasyValid + + + + 同步器只正转打印 + EncoderValidOnlyForward + + + + 同步器只反转打印 + EncoderValidOnlyReverse + + + 对应编码器脉冲数 + Encoder/pulse + + + + 脉冲信号值: + Pulse signal value: + + + + + 封锁时间(毫秒) + LockTime(ms) + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 禁止电眼清零 + ForbiddenMagicEyeReset + + + 允许电眼清零 + AllowMagicEyeReset + + + 允许电眼立即清零 + AllowMagicEyeResetNow + + + 镜像交替间隔数 + Mirror interval + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + + 重复间隔(毫米) + Repeat Gap (mm) + + + + + 封锁间隔(毫米) + Lock Gap(mm) + + + + + + + 延时(毫米): + Delay(mm): + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + 提示:参数不正确 + Hint: The parameter is incorrect + + + 要求:触发长度小于喷印间隔 + Requirement: The trigger length is less than the printing interval + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 封锁间隔(毫秒) + Lock Gap(ms) + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 图像扩张 + Image expansion + + + + 图像裁剪 + Image clipping + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 图片另存为... + SaveAs + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 图片保存为... + Save to...... + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + dlgQrCode + + + Dialog + + + + + 信息前缀 + Text + + + + 变量(初值) + Curent-Couter + + + + 信息后缀 + Suffix-Text + + + + 条形码 + BarCode + + + + 默认 + default + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + DM code size: + + + + 自动插入时间 + Automatic insert time + + + + 变量增量 + Increment + + + 增量 + Increment + + + + 返回 + Return + + + + + TextLabel + + + + 信息 + Text: + + + + 正相打印 + NormalPrint + + + + 反相打印 + RP-Print + + + + DataMatrix + + + + + QRCode + + + + + 插入文档 + InsertToDoc + + + + 计数器(变量) + CNT(Var) + + + + 保存 + Save + + + + 预览 + Preview + + + 插入到文档 + InsertToDoc + + + + 自动刷新 + AutoShow + + + 黑墨 + BlackInk + + + 白墨 + WhiteInk + + + + 警告 + Warnning + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + Input exceeds the size of the selected DM code, please select a larger size! + + + + [%1 X %2] + + + + + logo_Form + + + Form + + + + + zkWidget + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + 请新创建建图片 + Please set up a new pattern file + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english0417.ts b/english0417.ts new file mode 100644 index 0000000..f53bc97 --- /dev/null +++ b/english0417.ts @@ -0,0 +1,4210 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + 开始时间 + StartDate + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 警告 + Warnning + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + 1 {1?} + + + + 2 + @ + 1 {2?} + + + + 3 + # + 1 {3?} + + + + 4 + $ + 1 {4?} + + + + 5 + % + 1 {5?} + + + + 6 + ^ + 1 {6?} + + + + 7 + & + 1 {7?} + + + + 8 + * + 1 {8?} + + + + 9 + ( + 1 {9?} + + + + 0 + ) + 1 {0?} + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + SpecialChar + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + + 字符 +光标 + Character +Cursor + + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + 系统维护设置成功! + Syster maintenance setting success ! + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + + + + + 自动 + + + + + + + + 启动 + Start + + + + + + + + + + + + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + 错误 + Error + + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + 提示 + Tips + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + English interface + + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + 重启后切换到英文界面 + + + + + 重启后切换到中文界面 + + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Insert +Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 9 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english0524.ts b/english0524.ts new file mode 100644 index 0000000..d252282 --- /dev/null +++ b/english0524.ts @@ -0,0 +1,4223 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + 开始时间 + StartDate + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 警告 + Warnning + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + 1 {1?} + + + + 2 + @ + 1 {2?} + + + + 3 + # + 1 {3?} + + + + 4 + $ + 1 {4?} + + + + 5 + % + 1 {5?} + + + + 6 + ^ + 1 {6?} + + + + 7 + & + 1 {7?} + + + + 8 + * + 1 {8?} + + + + 9 + ( + 1 {9?} + + + + 0 + ) + 1 {0?} + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + + 字符 +光标 + Character +Cursor + + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + 系统维护设置成功! + Syster maintenance setting success ! + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + + + + + 自动 + + + + + + + + 启动 + Start + + + + + + + + + + + + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + 错误 + Error + + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + 提示 + Tips + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + English interface + + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + 重启后切换到英文界面 + + + + + 重启后切换到中文界面 + + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 9 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english20141023-ok.ts b/english20141023-ok.ts new file mode 100644 index 0000000..6917e5a --- /dev/null +++ b/english20141023-ok.ts @@ -0,0 +1,4401 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + PrintMax + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + Confirm + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + 错误!粘度计下位灯故障. + Error! Viscometer inferior lamp failure. + + + + 错误!粘度计故障:检测不到上位灯. + Error:Viscometer fault! the upper lamp is not detected. + + + + 粘度检测异常,粘度值太大!!! + The viscosity anomaly detection, viscosity too high!!! + + + + + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + Speed is too fast or interval is too short! Unable to print all, stop print now!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + Speed is too fast or interval is too short! Unable to print all char!!! + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 立即重新计米 + ResetCounterNow + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + 2014-08-23 + 1 {2014-08-23?} + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 机箱: + CASE: + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + %1.%2[%3.%4]米/秒 + %1.%2[%3.%4]m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + File not save,please save it Now! + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + RowHeight + + + + 无加粗 + Normal + + + + 加粗1倍 + Bold1 + + + + 加粗2倍 + Bold2 + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 字符光标 + Character +Cursor + + + + 像素光标 + Pixel +Cursor + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + Not print continue counter + + + + 打印优化 + Print optimization + + + + 电眼误触禁止 + Prohibition ElectricEye +re-trigger + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + Manul + + + + 自动 + Auto + + + + + + + 启动 + Start + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 密码不正确! + + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + 错误 + Error + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + + + + + + 提示 + Tips + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + English interface + + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + 警告 + Warnning + + + + 确定要切换中英文界面? + + + + + 重启后切换到英文界面 + + + + + 重启后切换到中文界面 + + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 12 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english20141023.ts b/english20141023.ts new file mode 100644 index 0000000..0797643 --- /dev/null +++ b/english20141023.ts @@ -0,0 +1,4399 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + Confirm + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + 错误!粘度计下位灯故障. + + + + + 错误!粘度计故障:检测不到上位灯. + + + + + 粘度检测异常,粘度值太大!!! + + + + + + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 立即重新计米 + + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + 2014-08-23 + 1 {2014-08-23?} + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + + 墨水或溶剂空,准备关机 + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + 维护时间已到,喷码机停止工作! + + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + %1.%2[%3.%4]米/秒 + + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + + + + + 无加粗 + + + + + 加粗1倍 + + + + + 加粗2倍 + + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 字符光标 + + + + + 像素光标 + + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 编辑现有的多字体文件 +请使用修改模式!!! + + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + + + + + 打印优化 + + + + + 电眼误触禁止 + + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + + + + + 自动 + + + + + + + + 启动 + Start + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 密码不正确! + + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + 错误 + Error + + + + 配置文件/udisk/sysPara.bin不存在! + + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + + + + + + 提示 + Tips + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + English interface + + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + 警告 + Warnning + + + + 确定要切换中英文界面? + + + + + 重启后切换到英文界面 + + + + + 重启后切换到中文界面 + + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 12 + 1 {12?} + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/english24-1.ts b/english24-1.ts new file mode 100644 index 0000000..4a193f1 --- /dev/null +++ b/english24-1.ts @@ -0,0 +1,4223 @@ + + + +UTF-8 + + DacDisplayAndEdit + + + Form + + + + + 10 + + + + + 07 + + + + + 02 + + + + + 20 + + + + + 06 + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 30 + + + + + 00 + + + + + 墨点 + InkDot + + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + + 默认值 + Default + + + + + 编辑 + Edit + + + + 是 + YES + + + + 否 + NO + + + + 完成 + OK + + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + + 提示 + Tips + + + + %1 + %1 + + + + DevOp + + 错误 + Error + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInsertVari + + + Dialog + + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + + 变量2 + Counter 2 + + + + 数字个数 + Digit Number + + + + 3个 + 3 + + + + 6个 + 6 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + 开始时间 + StartDate + + + 结束时间 + EndDate + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + Self-checking started, please wait for 60 s...... + + + + 开始自检,请等待%1秒............... + Self-checking started, please wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 警告 + Warnning + + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + + 中文 + Chinese + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + 选择历史记录文件 + Choose record file + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + + 故障恢复 + FaultReset + + + + 产品总计数 + Grand Total + + + + 回收故障 + Recycle +Fault + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, and turn collector and ink-jet off + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + + + 相位故障,准备关机 + + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + 错误 + Error + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + 暂停喷印............... + Pause printing... + + + + 停止打印 + Stop printing + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + + 打开回收槽 + Opening collector + + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + + 关闭回收槽 + Closing collector + + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + MyFileDialog + + + 确定 + Confirm + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + + 相检墨点: + Phase Detect Dot: + + + + 相检占空比(%) + PhaseDetectDuty + + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + + 字符 +光标 + Character +Cursor + + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 放弃保存 + Quit without save + + + + 另存为 + Save As + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + 慢速1 + Slow 1 + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + + + 起始值: + StartValue: + + + + + + 结束值: + EndValue: + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 高级设置 + AdvancedSetting + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + 重设值 + ResetCurrentCounter + + + + + 重复数: + RepeatTimes: + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + 系统维护设置成功! + Syster maintenance setting success ! + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + + 提升授权 + More authorized setting + + + + 取消授权 + Quit authorized setting + + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + + 回收泵 + Recycle Pump + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 更新字库 + UpdateFontLibrary + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + 警告 + Warnning + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + 手动 + + + + + 自动 + + + + + + + + 启动 + Start + + + + + + + + + + + + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + 错误 + Error + + + + 更新文件不存在! + Update file was not found! + + + + 是否确认备份系统文件? + Confirm to backup system file? + + + + 系统备份成功! + System backup suceess ! + + + + 备份操作失败! + Backup operation failed! + + + + 提示 + Tips + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 重置高压 + Reset High Voltage + + + + 应用当前配置 + Apply + + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + + 混合阀管路: + MixingValvePiping: + + + + 旧管路 + OldPiping + + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + + English interface + + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + 最佳晶振电压完成 + Suitable voltage search done + + + + 重启后切换到英文界面 + + + + + 重启后切换到中文界面 + + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + 9 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + Application + Application + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + 延时(毫秒): + Delay(ms): + + + + 电眼清零 + PhotodEyeResetCounter + + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + 重复间隔(毫米) + Repeat interval (mm) + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + zkWidget + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + 请新创建建图片 + Please set up a new pattern file + + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/icon/10008.ico b/icon/10008.ico new file mode 100644 index 0000000..fafe3f7 Binary files /dev/null and b/icon/10008.ico differ diff --git a/icon/BarCode1.png b/icon/BarCode1.png new file mode 100644 index 0000000..6f4a30a Binary files /dev/null and b/icon/BarCode1.png differ diff --git a/icon/Epauseprint.png b/icon/Epauseprint.png new file mode 100644 index 0000000..bea7724 Binary files /dev/null and b/icon/Epauseprint.png differ diff --git a/icon/Epauseprint1.png b/icon/Epauseprint1.png new file mode 100644 index 0000000..31fd969 Binary files /dev/null and b/icon/Epauseprint1.png differ diff --git a/icon/Epauseprint2.png b/icon/Epauseprint2.png new file mode 100644 index 0000000..b4906c8 Binary files /dev/null and b/icon/Epauseprint2.png differ diff --git a/icon/Estartprint.png b/icon/Estartprint.png new file mode 100644 index 0000000..06e9403 Binary files /dev/null and b/icon/Estartprint.png differ diff --git a/icon/Estartprint1.png b/icon/Estartprint1.png new file mode 100644 index 0000000..46ff46a Binary files /dev/null and b/icon/Estartprint1.png differ diff --git a/icon/Estartprint2.png b/icon/Estartprint2.png new file mode 100644 index 0000000..3dc3b22 Binary files /dev/null and b/icon/Estartprint2.png differ diff --git a/icon/Estartprint3.png b/icon/Estartprint3.png new file mode 100644 index 0000000..f307286 Binary files /dev/null and b/icon/Estartprint3.png differ diff --git a/icon/EstopPrint2.png b/icon/EstopPrint2.png new file mode 100644 index 0000000..771773d Binary files /dev/null and b/icon/EstopPrint2.png differ diff --git a/icon/EstopPrint3.png b/icon/EstopPrint3.png new file mode 100644 index 0000000..e6ba04a Binary files /dev/null and b/icon/EstopPrint3.png differ diff --git a/icon/Hint.bmp b/icon/Hint.bmp new file mode 100644 index 0000000..9936169 Binary files /dev/null and b/icon/Hint.bmp differ diff --git a/icon/TEXT.PNG b/icon/TEXT.PNG new file mode 100644 index 0000000..54d35cd Binary files /dev/null and b/icon/TEXT.PNG differ diff --git a/icon/a9.ico b/icon/a9.ico new file mode 100644 index 0000000..2e64559 Binary files /dev/null and b/icon/a9.ico differ diff --git a/icon/apply.png b/icon/apply.png new file mode 100644 index 0000000..7f6011e Binary files /dev/null and b/icon/apply.png differ diff --git a/icon/arrowdown.png b/icon/arrowdown.png new file mode 100644 index 0000000..8fb9e0e Binary files /dev/null and b/icon/arrowdown.png differ diff --git a/icon/arrowleft.png b/icon/arrowleft.png new file mode 100644 index 0000000..8d8b0da Binary files /dev/null and b/icon/arrowleft.png differ diff --git a/icon/arrowright.png b/icon/arrowright.png new file mode 100644 index 0000000..cab9a6a Binary files /dev/null and b/icon/arrowright.png differ diff --git a/icon/arrowup.png b/icon/arrowup.png new file mode 100644 index 0000000..debe79a Binary files /dev/null and b/icon/arrowup.png differ diff --git a/icon/bypm.png b/icon/bypm.png new file mode 100644 index 0000000..63317d2 Binary files /dev/null and b/icon/bypm.png differ diff --git a/icon/cleanup.png b/icon/cleanup.png new file mode 100644 index 0000000..26885df Binary files /dev/null and b/icon/cleanup.png differ diff --git a/icon/closereclaimtanl.png b/icon/closereclaimtanl.png new file mode 100644 index 0000000..ee27208 Binary files /dev/null and b/icon/closereclaimtanl.png differ diff --git a/icon/controlbyhand.png b/icon/controlbyhand.png new file mode 100644 index 0000000..fa448dd Binary files /dev/null and b/icon/controlbyhand.png differ diff --git a/icon/counter.png b/icon/counter.png new file mode 100644 index 0000000..97ab155 Binary files /dev/null and b/icon/counter.png differ diff --git a/icon/edit.png b/icon/edit.png new file mode 100644 index 0000000..bb415c5 Binary files /dev/null and b/icon/edit.png differ diff --git a/icon/exit.png b/icon/exit.png new file mode 100644 index 0000000..17fc230 Binary files /dev/null and b/icon/exit.png differ diff --git a/icon/export.png b/icon/export.png new file mode 100644 index 0000000..50dcbe4 Binary files /dev/null and b/icon/export.png differ diff --git a/icon/exportpdf.png b/icon/exportpdf.png new file mode 100644 index 0000000..eef5132 Binary files /dev/null and b/icon/exportpdf.png differ diff --git a/icon/factorysetting.png b/icon/factorysetting.png new file mode 100644 index 0000000..6f1be9c Binary files /dev/null and b/icon/factorysetting.png differ diff --git a/icon/filedelete.png b/icon/filedelete.png new file mode 100644 index 0000000..ebd30cf Binary files /dev/null and b/icon/filedelete.png differ diff --git a/icon/filedelete2.png b/icon/filedelete2.png new file mode 100644 index 0000000..da57f90 Binary files /dev/null and b/icon/filedelete2.png differ diff --git a/icon/fileimport.png b/icon/fileimport.png new file mode 100644 index 0000000..d046ba2 Binary files /dev/null and b/icon/fileimport.png differ diff --git a/icon/filenew.png b/icon/filenew.png new file mode 100644 index 0000000..af5d122 Binary files /dev/null and b/icon/filenew.png differ diff --git a/icon/fileopen.png b/icon/fileopen.png new file mode 100644 index 0000000..fc6f17e Binary files /dev/null and b/icon/fileopen.png differ diff --git a/icon/fileoperation.png b/icon/fileoperation.png new file mode 100644 index 0000000..a8bfacc Binary files /dev/null and b/icon/fileoperation.png differ diff --git a/icon/filesave.png b/icon/filesave.png new file mode 100644 index 0000000..8feec99 Binary files /dev/null and b/icon/filesave.png differ diff --git a/icon/filesaveas.png b/icon/filesaveas.png new file mode 100644 index 0000000..ad89341 Binary files /dev/null and b/icon/filesaveas.png differ diff --git a/icon/font.png b/icon/font.png new file mode 100644 index 0000000..a49feb5 Binary files /dev/null and b/icon/font.png differ diff --git a/icon/ghost.png b/icon/ghost.png new file mode 100644 index 0000000..ea7b80b Binary files /dev/null and b/icon/ghost.png differ diff --git a/icon/import.png b/icon/import.png new file mode 100644 index 0000000..72f5e86 Binary files /dev/null and b/icon/import.png differ diff --git a/icon/insert.png b/icon/insert.png new file mode 100644 index 0000000..58e4128 Binary files /dev/null and b/icon/insert.png differ diff --git a/icon/keybackspace.png b/icon/keybackspace.png new file mode 100644 index 0000000..3832cc3 Binary files /dev/null and b/icon/keybackspace.png differ diff --git a/icon/keydelete.png b/icon/keydelete.png new file mode 100644 index 0000000..da7627e Binary files /dev/null and b/icon/keydelete.png differ diff --git a/icon/keydown.png b/icon/keydown.png new file mode 100644 index 0000000..fdcad10 Binary files /dev/null and b/icon/keydown.png differ diff --git a/icon/keyend.png b/icon/keyend.png new file mode 100644 index 0000000..ad63dc5 Binary files /dev/null and b/icon/keyend.png differ diff --git a/icon/keyenter.png b/icon/keyenter.png new file mode 100644 index 0000000..2d094c2 Binary files /dev/null and b/icon/keyenter.png differ diff --git a/icon/keyhide.png b/icon/keyhide.png new file mode 100644 index 0000000..b868245 Binary files /dev/null and b/icon/keyhide.png differ diff --git a/icon/keyhome.png b/icon/keyhome.png new file mode 100644 index 0000000..f90d58e Binary files /dev/null and b/icon/keyhome.png differ diff --git a/icon/keyinput.png b/icon/keyinput.png new file mode 100644 index 0000000..09cf0c7 Binary files /dev/null and b/icon/keyinput.png differ diff --git a/icon/keyleft.png b/icon/keyleft.png new file mode 100644 index 0000000..9e9afc8 Binary files /dev/null and b/icon/keyleft.png differ diff --git a/icon/keyright.png b/icon/keyright.png new file mode 100644 index 0000000..a68344c Binary files /dev/null and b/icon/keyright.png differ diff --git a/icon/keyshift.png b/icon/keyshift.png new file mode 100644 index 0000000..460fbe4 Binary files /dev/null and b/icon/keyshift.png differ diff --git a/icon/keyup.png b/icon/keyup.png new file mode 100644 index 0000000..b9a0b79 Binary files /dev/null and b/icon/keyup.png differ diff --git a/icon/lastpage.png b/icon/lastpage.png new file mode 100644 index 0000000..59025c9 Binary files /dev/null and b/icon/lastpage.png differ diff --git a/icon/leftright.png b/icon/leftright.png new file mode 100644 index 0000000..9e3e7cb Binary files /dev/null and b/icon/leftright.png differ diff --git a/icon/linespace.png b/icon/linespace.png new file mode 100644 index 0000000..1c53ca6 Binary files /dev/null and b/icon/linespace.png differ diff --git a/icon/localdisk.png b/icon/localdisk.png new file mode 100644 index 0000000..0aafc21 Binary files /dev/null and b/icon/localdisk.png differ diff --git a/icon/lockphase.png b/icon/lockphase.png new file mode 100644 index 0000000..5877c78 Binary files /dev/null and b/icon/lockphase.png differ diff --git a/icon/nextpage.png b/icon/nextpage.png new file mode 100644 index 0000000..58c6e5b Binary files /dev/null and b/icon/nextpage.png differ diff --git a/icon/openreclaimtanl.png b/icon/openreclaimtanl.png new file mode 100644 index 0000000..f46aaac Binary files /dev/null and b/icon/openreclaimtanl.png differ diff --git a/icon/pauseprint.png b/icon/pauseprint.png new file mode 100644 index 0000000..5b9544a Binary files /dev/null and b/icon/pauseprint.png differ diff --git a/icon/pauseprint1.png b/icon/pauseprint1.png new file mode 100644 index 0000000..dadf838 Binary files /dev/null and b/icon/pauseprint1.png differ diff --git a/icon/pauseprint2.png b/icon/pauseprint2.png new file mode 100644 index 0000000..e29bf97 Binary files /dev/null and b/icon/pauseprint2.png differ diff --git a/icon/poweroff.png b/icon/poweroff.png new file mode 100644 index 0000000..0dbcc35 Binary files /dev/null and b/icon/poweroff.png differ diff --git a/icon/preview.png b/icon/preview.png new file mode 100644 index 0000000..26196c5 Binary files /dev/null and b/icon/preview.png differ diff --git a/icon/pulse.png b/icon/pulse.png new file mode 100644 index 0000000..2f49508 Binary files /dev/null and b/icon/pulse.png differ diff --git a/icon/screenfix.png b/icon/screenfix.png new file mode 100644 index 0000000..75c0b21 Binary files /dev/null and b/icon/screenfix.png differ diff --git a/icon/searchsuitablefrequency.png b/icon/searchsuitablefrequency.png new file mode 100644 index 0000000..76552d0 Binary files /dev/null and b/icon/searchsuitablefrequency.png differ diff --git a/icon/searchsuitablevoltage.png b/icon/searchsuitablevoltage.png new file mode 100644 index 0000000..1ff457e Binary files /dev/null and b/icon/searchsuitablevoltage.png differ diff --git a/icon/specialchar.png b/icon/specialchar.png new file mode 100644 index 0000000..39cf8ba Binary files /dev/null and b/icon/specialchar.png differ diff --git a/icon/startprint.png b/icon/startprint.png new file mode 100644 index 0000000..535a193 Binary files /dev/null and b/icon/startprint.png differ diff --git a/icon/startprint1.png b/icon/startprint1.png new file mode 100644 index 0000000..f879b63 Binary files /dev/null and b/icon/startprint1.png differ diff --git a/icon/startprint2.png b/icon/startprint2.png new file mode 100644 index 0000000..7eb28ff Binary files /dev/null and b/icon/startprint2.png differ diff --git a/icon/stopprint.png b/icon/stopprint.png new file mode 100644 index 0000000..335446d Binary files /dev/null and b/icon/stopprint.png differ diff --git a/icon/stopprint1.png b/icon/stopprint1.png new file mode 100644 index 0000000..df72b1b Binary files /dev/null and b/icon/stopprint1.png differ diff --git a/icon/stopprint2.png b/icon/stopprint2.png new file mode 100644 index 0000000..176c319 Binary files /dev/null and b/icon/stopprint2.png differ diff --git a/icon/sure.png b/icon/sure.png new file mode 100644 index 0000000..6facb3a Binary files /dev/null and b/icon/sure.png differ diff --git a/icon/textbold.png b/icon/textbold.png new file mode 100644 index 0000000..9cbc713 Binary files /dev/null and b/icon/textbold.png differ diff --git a/icon/time.png b/icon/time.png new file mode 100644 index 0000000..8767bb4 Binary files /dev/null and b/icon/time.png differ diff --git a/icon/udisk.png b/icon/udisk.png new file mode 100644 index 0000000..f5fc1c2 Binary files /dev/null and b/icon/udisk.png differ diff --git a/icon/updatefont.png b/icon/updatefont.png new file mode 100644 index 0000000..b42f68e Binary files /dev/null and b/icon/updatefont.png differ diff --git a/icon/updatesoftware.png b/icon/updatesoftware.png new file mode 100644 index 0000000..2fa3352 Binary files /dev/null and b/icon/updatesoftware.png differ diff --git a/icon/updown.png b/icon/updown.png new file mode 100644 index 0000000..351f42c Binary files /dev/null and b/icon/updown.png differ diff --git a/icon/vari.png b/icon/vari.png new file mode 100644 index 0000000..2bdfa03 Binary files /dev/null and b/icon/vari.png differ diff --git a/icon/zoomin.png b/icon/zoomin.png new file mode 100644 index 0000000..2e586fc Binary files /dev/null and b/icon/zoomin.png differ diff --git a/icon/zoomout.png b/icon/zoomout.png new file mode 100644 index 0000000..a736d39 Binary files /dev/null and b/icon/zoomout.png differ diff --git a/image.qrc b/image.qrc new file mode 100644 index 0000000..a0a29a9 --- /dev/null +++ b/image.qrc @@ -0,0 +1,963 @@ + + + image/ALARMGreen.PNG + image/ALARMRed.PNG + image/ALARMYellow.PNG + image/suctionON.png + image/jetOFF.png + image/jetON.png + image/suctionOFF.png + image/reset.png + image/Turkey_logo.png + icon/exportpdf.png + icon/fileopen.png + icon/filesave.png + icon/zoomin.png + icon/zoomout.png + icon/filenew.png + icon/textbold.png + icon/preview.png + icon/edit.png + icon/filesaveas.png + icon/font.png + icon/pauseprint.png + icon/startprint.png + icon/stopprint.png + icon/closereclaimtanl.png + icon/openreclaimtanl.png + icon/poweroff.png + icon/arrowdown.png + icon/arrowleft.png + icon/arrowright.png + icon/arrowup.png + icon/fileimport.png + icon/apply.png + icon/cleanup.png + icon/controlbyhand.png + icon/factorysetting.png + icon/searchsuitablevoltage.png + icon/time.png + icon/updatefont.png + icon/updatesoftware.png + icon/screenfix.png + icon/searchsuitablefrequency.png + icon/counter.png + icon/lockphase.png + icon/keybackspace.png + icon/keydown.png + icon/keyenter.png + icon/keyright.png + icon/keyshift.png + icon/keyup.png + icon/keyinput.png + icon/filedelete.png + icon/filedelete2.png + icon/keydelete.png + icon/keyend.png + icon/keyhide.png + icon/keyhome.png + icon/keyleft.png + icon/lastpage.png + icon/nextpage.png + icon/specialchar.png + icon/vari.png + icon/exit.png + icon/export.png + icon/fileoperation.png + icon/udisk.png + icon/import.png + icon/localdisk.png + icon/insert.png + icon/sure.png + icon/leftright.png + icon/updown.png + icon/pulse.png + icon/linespace.png + 0/image/digitalWidth1.bmp + 0/image/digitalWidth2.bmp + 0/image/digitalWidth3.bmp + 0/image/digitalWidth4.bmp + 0/image/digitalWidth5.bmp + 0/image/digitalWidth6.bmp + 0/image/digitalWidth7.bmp + 0/image/digitalWidth8.bmp + 1/image/digitalWidth1.bmp + 1/image/digitalWidth2.bmp + 1/image/digitalWidth3.bmp + 1/image/digitalWidth4.bmp + 1/image/digitalWidth5.bmp + 1/image/digitalWidth6.bmp + 1/image/digitalWidth7.bmp + 1/image/digitalWidth8.bmp + 2/image/digitalWidth1.bmp + 2/image/digitalWidth2.bmp + 2/image/digitalWidth3.bmp + 2/image/digitalWidth4.bmp + 2/image/digitalWidth5.bmp + 2/image/digitalWidth6.bmp + 2/image/digitalWidth7.bmp + 2/image/digitalWidth8.bmp + 3/image/digitalWidth1.bmp + 3/image/digitalWidth2.bmp + 3/image/digitalWidth3.bmp + 3/image/digitalWidth4.bmp + 3/image/digitalWidth5.bmp + 3/image/digitalWidth6.bmp + 3/image/digitalWidth7.bmp + 3/image/digitalWidth8.bmp + 4/image/digitalWidth1.bmp + 4/image/digitalWidth2.bmp + 4/image/digitalWidth3.bmp + 4/image/digitalWidth4.bmp + 4/image/digitalWidth5.bmp + 4/image/digitalWidth6.bmp + 4/image/digitalWidth7.bmp + 4/image/digitalWidth8.bmp + 5/image/digitalWidth1.bmp + 5/image/digitalWidth2.bmp + 5/image/digitalWidth3.bmp + 5/image/digitalWidth4.bmp + 5/image/digitalWidth5.bmp + 5/image/digitalWidth6.bmp + 5/image/digitalWidth7.bmp + 5/image/digitalWidth8.bmp + 6/image/digitalWidth1.bmp + 6/image/digitalWidth2.bmp + 6/image/digitalWidth3.bmp + 6/image/digitalWidth4.bmp + 6/image/digitalWidth5.bmp + 6/image/digitalWidth6.bmp + 6/image/digitalWidth7.bmp + 6/image/digitalWidth8.bmp + 7/image/digitalWidth1.bmp + 7/image/digitalWidth2.bmp + 7/image/digitalWidth3.bmp + 7/image/digitalWidth4.bmp + 7/image/digitalWidth5.bmp + 7/image/digitalWidth6.bmp + 7/image/digitalWidth7.bmp + 7/image/digitalWidth8.bmp + 8/image/digitalWidth1.bmp + 8/image/digitalWidth2.bmp + 8/image/digitalWidth3.bmp + 8/image/digitalWidth4.bmp + 8/image/digitalWidth5.bmp + 8/image/digitalWidth6.bmp + 8/image/digitalWidth7.bmp + 8/image/digitalWidth8.bmp + 13/image/digitalWidth1.bmp + 13/image/digitalWidth2.bmp + 13/image/digitalWidth3.bmp + 13/image/digitalWidth4.bmp + 13/image/digitalWidth5.bmp + 13/image/digitalWidth6.bmp + 13/image/digitalWidth7.bmp + 13/image/digitalWidth8.bmp + 0/image/digitalWidth175.bmp + 0/image/digitalWidth275.bmp + 0/image/digitalWidth375.bmp + 0/image/digitalWidth475.bmp + 0/image/digitalWidth575.bmp + 0/image/digitalWidth675.bmp + 0/image/digitalWidth775.bmp + 0/image/digitalWidth875.bmp + 1/image/digitalWidth175.bmp + 1/image/digitalWidth275.bmp + 1/image/digitalWidth375.bmp + 1/image/digitalWidth475.bmp + 1/image/digitalWidth575.bmp + 1/image/digitalWidth675.bmp + 1/image/digitalWidth775.bmp + 1/image/digitalWidth875.bmp + 2/image/digitalWidth175.bmp + 2/image/digitalWidth275.bmp + 2/image/digitalWidth375.bmp + 2/image/digitalWidth475.bmp + 2/image/digitalWidth575.bmp + 2/image/digitalWidth675.bmp + 2/image/digitalWidth775.bmp + 2/image/digitalWidth875.bmp + 3/image/digitalWidth175.bmp + 3/image/digitalWidth275.bmp + 3/image/digitalWidth375.bmp + 3/image/digitalWidth475.bmp + 3/image/digitalWidth575.bmp + 3/image/digitalWidth675.bmp + 3/image/digitalWidth775.bmp + 3/image/digitalWidth875.bmp + 4/image/digitalWidth175.bmp + 4/image/digitalWidth275.bmp + 4/image/digitalWidth375.bmp + 4/image/digitalWidth475.bmp + 4/image/digitalWidth575.bmp + 4/image/digitalWidth675.bmp + 4/image/digitalWidth775.bmp + 4/image/digitalWidth875.bmp + 5/image/digitalWidth175.bmp + 5/image/digitalWidth275.bmp + 5/image/digitalWidth375.bmp + 5/image/digitalWidth475.bmp + 5/image/digitalWidth575.bmp + 5/image/digitalWidth675.bmp + 5/image/digitalWidth775.bmp + 5/image/digitalWidth875.bmp + 6/image/digitalWidth175.bmp + 6/image/digitalWidth275.bmp + 6/image/digitalWidth375.bmp + 6/image/digitalWidth475.bmp + 6/image/digitalWidth575.bmp + 6/image/digitalWidth675.bmp + 6/image/digitalWidth775.bmp + 6/image/digitalWidth875.bmp + 7/image/digitalWidth175.bmp + 7/image/digitalWidth275.bmp + 7/image/digitalWidth375.bmp + 7/image/digitalWidth475.bmp + 7/image/digitalWidth575.bmp + 7/image/digitalWidth675.bmp + 7/image/digitalWidth775.bmp + 7/image/digitalWidth875.bmp + 8/image/digitalWidth175.bmp + 8/image/digitalWidth275.bmp + 8/image/digitalWidth375.bmp + 8/image/digitalWidth475.bmp + 8/image/digitalWidth575.bmp + 8/image/digitalWidth675.bmp + 8/image/digitalWidth775.bmp + 8/image/digitalWidth875.bmp + 13/image/digitalWidth175.bmp + 13/image/digitalWidth275.bmp + 13/image/digitalWidth375.bmp + 13/image/digitalWidth475.bmp + 13/image/digitalWidth575.bmp + 13/image/digitalWidth675.bmp + 13/image/digitalWidth775.bmp + 13/image/digitalWidth875.bmp + icon/startprint1.png + icon/startprint2.png + icon/stopprint1.png + icon/stopprint2.png + icon/pauseprint1.png + icon/pauseprint2.png + icon/TEXT.PNG + buge_record.txt + icon/Epauseprint.png + icon/Epauseprint1.png + icon/Epauseprint2.png + icon/Estartprint.png + icon/Estartprint1.png + icon/Estartprint2.png + icon/EstopPrint2.png + icon/BarCode1.png + icon/bypm.png + 11/image/BARV16.bmp + 11/image/BARV12.bmp + 9/image/DMTV32.bmp + 9/image/DMTV26.bmp + 9/image/DMTV24.bmp + 9/image/DMTV22.bmp + 9/image/DMTV20.bmp + 9/image/DMTV18.bmp + 9/image/DMTV16.bmp + 9/image/DMTV14.bmp + 9/image/DMTV12.bmp + 9/image/DMTV10.bmp + 10/image/QRV37.bmp + 10/image/QRV33.bmp + 10/image/QRV29.bmp + 10/image/QRV25.bmp + 10/image/QRV21.bmp + image/AH12.png + image/ZFKD.png + image/MIV12.png + icon/10008.ico + icon/a9.ico + image/AH13.png + image/MIV13.png + image/ZFKD2.png + 12/image/digitalWidth13.bmp + 12/image/digitalWidth1375.bmp + 12/image/digitalWidth16.bmp + 12/image/digitalWidth1675.bmp + 12/image/digitalWidth1575.bmp + 12/image/digitalWidth15.bmp + 12/image/digitalWidth1475.bmp + 12/image/digitalWidth14.bmp + 12/image/digitalWidth1275.bmp + 12/image/digitalWidth12.bmp + 12/image/digitalWidth1175.bmp + 12/image/digitalWidth11.bmp + 12/image/digitalWidth1075.bmp + 12/image/digitalWidth10.bmp + 12/image/digitalWidth975.bmp + 12/image/digitalWidth9.bmp + 12/image/digitalWidth475.bmp + 12/image/digitalWidth1.bmp + 12/image/digitalWidth875.bmp + 12/image/digitalWidth8.bmp + 12/image/digitalWidth775.bmp + 12/image/digitalWidth7.bmp + 12/image/digitalWidth675.bmp + 12/image/digitalWidth6.bmp + 12/image/digitalWidth575.bmp + 12/image/digitalWidth4.bmp + 12/image/digitalWidth375.bmp + 12/image/digitalWidth3.bmp + 12/image/digitalWidth275.bmp + 12/image/digitalWidth2.bmp + 12/image/digitalWidth5.bmp + 12/image/digitalWidth175.bmp + 40/image/digitalWidth875.bmp + 40/image/digitalWidth4.bmp + 40/image/digitalWidth375.bmp + 40/image/digitalWidth3.bmp + 40/image/digitalWidth275.bmp + 40/image/digitalWidth2.bmp + 40/image/digitalWidth175.bmp + 40/image/digitalWidth475.bmp + 40/image/digitalWidth5.bmp + 40/image/digitalWidth8.bmp + 40/image/digitalWidth775.bmp + 40/image/digitalWidth7.bmp + 40/image/digitalWidth675.bmp + 40/image/digitalWidth6.bmp + 40/image/digitalWidth575.bmp + 40/image/digitalWidth1.bmp + 41/image/digitalWidth1.bmp + 41/image/digitalWidth2.bmp + 41/image/digitalWidth3.bmp + 41/image/digitalWidth4.bmp + 41/image/digitalWidth5.bmp + 41/image/digitalWidth6.bmp + 41/image/digitalWidth7.bmp + 41/image/digitalWidth8.bmp + 41/image/digitalWidth175.bmp + 41/image/digitalWidth275.bmp + 41/image/digitalWidth375.bmp + 41/image/digitalWidth475.bmp + 41/image/digitalWidth575.bmp + 41/image/digitalWidth675.bmp + 41/image/digitalWidth775.bmp + 41/image/digitalWidth875.bmp + 42/image/digitalWidth1.bmp + 42/image/digitalWidth2.bmp + 42/image/digitalWidth3.bmp + 42/image/digitalWidth4.bmp + 42/image/digitalWidth5.bmp + 42/image/digitalWidth6.bmp + 42/image/digitalWidth7.bmp + 42/image/digitalWidth8.bmp + 42/image/digitalWidth175.bmp + 42/image/digitalWidth275.bmp + 42/image/digitalWidth375.bmp + 42/image/digitalWidth475.bmp + 42/image/digitalWidth575.bmp + 42/image/digitalWidth675.bmp + 42/image/digitalWidth775.bmp + 42/image/digitalWidth875.bmp + 43/image/digitalWidth1.bmp + 43/image/digitalWidth2.bmp + 43/image/digitalWidth3.bmp + 43/image/digitalWidth4.bmp + 43/image/digitalWidth5.bmp + 43/image/digitalWidth6.bmp + 43/image/digitalWidth7.bmp + 43/image/digitalWidth8.bmp + 43/image/digitalWidth175.bmp + 43/image/digitalWidth275.bmp + 43/image/digitalWidth375.bmp + 43/image/digitalWidth475.bmp + 43/image/digitalWidth575.bmp + 43/image/digitalWidth675.bmp + 43/image/digitalWidth775.bmp + 43/image/digitalWidth875.bmp + 44/image/digitalWidth1.bmp + 44/image/digitalWidth2.bmp + 44/image/digitalWidth3.bmp + 44/image/digitalWidth4.bmp + 44/image/digitalWidth5.bmp + 44/image/digitalWidth6.bmp + 44/image/digitalWidth7.bmp + 44/image/digitalWidth8.bmp + 44/image/digitalWidth175.bmp + 44/image/digitalWidth275.bmp + 44/image/digitalWidth375.bmp + 44/image/digitalWidth475.bmp + 44/image/digitalWidth575.bmp + 44/image/digitalWidth675.bmp + 44/image/digitalWidth775.bmp + 44/image/digitalWidth875.bmp + 45/image/digitalWidth1.bmp + 45/image/digitalWidth2.bmp + 45/image/digitalWidth3.bmp + 45/image/digitalWidth4.bmp + 45/image/digitalWidth5.bmp + 45/image/digitalWidth6.bmp + 45/image/digitalWidth7.bmp + 45/image/digitalWidth8.bmp + 45/image/digitalWidth175.bmp + 45/image/digitalWidth275.bmp + 45/image/digitalWidth375.bmp + 45/image/digitalWidth475.bmp + 45/image/digitalWidth575.bmp + 45/image/digitalWidth675.bmp + 45/image/digitalWidth775.bmp + 45/image/digitalWidth875.bmp + 46/image/digitalWidth1.bmp + 46/image/digitalWidth2.bmp + 46/image/digitalWidth3.bmp + 46/image/digitalWidth4.bmp + 46/image/digitalWidth5.bmp + 46/image/digitalWidth6.bmp + 46/image/digitalWidth7.bmp + 46/image/digitalWidth8.bmp + 46/image/digitalWidth175.bmp + 46/image/digitalWidth275.bmp + 46/image/digitalWidth375.bmp + 46/image/digitalWidth475.bmp + 46/image/digitalWidth575.bmp + 46/image/digitalWidth675.bmp + 46/image/digitalWidth775.bmp + 46/image/digitalWidth875.bmp + 47/image/digitalWidth1.bmp + 47/image/digitalWidth2.bmp + 47/image/digitalWidth3.bmp + 47/image/digitalWidth4.bmp + 47/image/digitalWidth5.bmp + 47/image/digitalWidth6.bmp + 47/image/digitalWidth7.bmp + 47/image/digitalWidth8.bmp + 47/image/digitalWidth175.bmp + 47/image/digitalWidth275.bmp + 47/image/digitalWidth375.bmp + 47/image/digitalWidth475.bmp + 47/image/digitalWidth575.bmp + 47/image/digitalWidth675.bmp + 47/image/digitalWidth775.bmp + 47/image/digitalWidth875.bmp + 48/image/digitalWidth1.bmp + 48/image/digitalWidth2.bmp + 48/image/digitalWidth3.bmp + 48/image/digitalWidth4.bmp + 48/image/digitalWidth5.bmp + 48/image/digitalWidth6.bmp + 48/image/digitalWidth7.bmp + 48/image/digitalWidth8.bmp + 48/image/digitalWidth175.bmp + 48/image/digitalWidth275.bmp + 48/image/digitalWidth375.bmp + 48/image/digitalWidth475.bmp + 48/image/digitalWidth575.bmp + 48/image/digitalWidth675.bmp + 48/image/digitalWidth775.bmp + 48/image/digitalWidth875.bmp + 20/image/digitalWidth1.bmp + 20/image/digitalWidth2.bmp + 20/image/digitalWidth3.bmp + 20/image/digitalWidth4.bmp + 20/image/digitalWidth5.bmp + 20/image/digitalWidth6.bmp + 20/image/digitalWidth7.bmp + 20/image/digitalWidth8.bmp + 20/image/digitalWidth175.bmp + 20/image/digitalWidth275.bmp + 20/image/digitalWidth375.bmp + 20/image/digitalWidth475.bmp + 20/image/digitalWidth575.bmp + 20/image/digitalWidth675.bmp + 20/image/digitalWidth775.bmp + 20/image/digitalWidth875.bmp + 21/image/digitalWidth1.bmp + 21/image/digitalWidth2.bmp + 21/image/digitalWidth3.bmp + 21/image/digitalWidth4.bmp + 21/image/digitalWidth5.bmp + 21/image/digitalWidth6.bmp + 21/image/digitalWidth7.bmp + 21/image/digitalWidth8.bmp + 21/image/digitalWidth175.bmp + 21/image/digitalWidth275.bmp + 21/image/digitalWidth375.bmp + 21/image/digitalWidth475.bmp + 21/image/digitalWidth575.bmp + 21/image/digitalWidth675.bmp + 21/image/digitalWidth775.bmp + 21/image/digitalWidth875.bmp + 22/image/digitalWidth1.bmp + 22/image/digitalWidth2.bmp + 22/image/digitalWidth3.bmp + 22/image/digitalWidth4.bmp + 22/image/digitalWidth5.bmp + 22/image/digitalWidth6.bmp + 22/image/digitalWidth7.bmp + 22/image/digitalWidth8.bmp + 22/image/digitalWidth175.bmp + 22/image/digitalWidth275.bmp + 22/image/digitalWidth375.bmp + 22/image/digitalWidth475.bmp + 22/image/digitalWidth575.bmp + 22/image/digitalWidth675.bmp + 22/image/digitalWidth775.bmp + 22/image/digitalWidth875.bmp + 23/image/digitalWidth1.bmp + 23/image/digitalWidth2.bmp + 23/image/digitalWidth3.bmp + 23/image/digitalWidth4.bmp + 23/image/digitalWidth5.bmp + 23/image/digitalWidth6.bmp + 23/image/digitalWidth7.bmp + 23/image/digitalWidth8.bmp + 23/image/digitalWidth175.bmp + 23/image/digitalWidth275.bmp + 23/image/digitalWidth375.bmp + 23/image/digitalWidth475.bmp + 23/image/digitalWidth575.bmp + 23/image/digitalWidth675.bmp + 23/image/digitalWidth775.bmp + 23/image/digitalWidth875.bmp + 24/image/digitalWidth1.bmp + 24/image/digitalWidth2.bmp + 24/image/digitalWidth3.bmp + 24/image/digitalWidth4.bmp + 24/image/digitalWidth5.bmp + 24/image/digitalWidth6.bmp + 24/image/digitalWidth7.bmp + 24/image/digitalWidth8.bmp + 24/image/digitalWidth175.bmp + 24/image/digitalWidth275.bmp + 24/image/digitalWidth375.bmp + 24/image/digitalWidth475.bmp + 24/image/digitalWidth575.bmp + 24/image/digitalWidth675.bmp + 24/image/digitalWidth775.bmp + 24/image/digitalWidth875.bmp + 25/image/digitalWidth1.bmp + 25/image/digitalWidth2.bmp + 25/image/digitalWidth3.bmp + 25/image/digitalWidth4.bmp + 25/image/digitalWidth5.bmp + 25/image/digitalWidth6.bmp + 25/image/digitalWidth7.bmp + 25/image/digitalWidth8.bmp + 25/image/digitalWidth175.bmp + 25/image/digitalWidth275.bmp + 25/image/digitalWidth375.bmp + 25/image/digitalWidth475.bmp + 25/image/digitalWidth575.bmp + 25/image/digitalWidth675.bmp + 25/image/digitalWidth775.bmp + 25/image/digitalWidth875.bmp + 26/image/digitalWidth1.bmp + 26/image/digitalWidth2.bmp + 26/image/digitalWidth3.bmp + 26/image/digitalWidth4.bmp + 26/image/digitalWidth5.bmp + 26/image/digitalWidth6.bmp + 26/image/digitalWidth7.bmp + 26/image/digitalWidth8.bmp + 26/image/digitalWidth175.bmp + 26/image/digitalWidth275.bmp + 26/image/digitalWidth375.bmp + 26/image/digitalWidth475.bmp + 26/image/digitalWidth575.bmp + 26/image/digitalWidth675.bmp + 26/image/digitalWidth775.bmp + 26/image/digitalWidth875.bmp + 27/image/digitalWidth1.bmp + 27/image/digitalWidth2.bmp + 27/image/digitalWidth3.bmp + 27/image/digitalWidth4.bmp + 27/image/digitalWidth5.bmp + 27/image/digitalWidth6.bmp + 27/image/digitalWidth7.bmp + 27/image/digitalWidth8.bmp + 27/image/digitalWidth175.bmp + 27/image/digitalWidth275.bmp + 27/image/digitalWidth375.bmp + 27/image/digitalWidth475.bmp + 27/image/digitalWidth575.bmp + 27/image/digitalWidth675.bmp + 27/image/digitalWidth775.bmp + 27/image/digitalWidth875.bmp + 28/image/digitalWidth1.bmp + 28/image/digitalWidth2.bmp + 28/image/digitalWidth3.bmp + 28/image/digitalWidth4.bmp + 28/image/digitalWidth5.bmp + 28/image/digitalWidth6.bmp + 28/image/digitalWidth7.bmp + 28/image/digitalWidth8.bmp + 28/image/digitalWidth175.bmp + 28/image/digitalWidth275.bmp + 28/image/digitalWidth375.bmp + 28/image/digitalWidth475.bmp + 28/image/digitalWidth575.bmp + 28/image/digitalWidth675.bmp + 28/image/digitalWidth775.bmp + 28/image/digitalWidth875.bmp + 11/image/BARV5.bmp + 11/image/BARV7.bmp + 11/image/BARV9.bmp + 11/image/BARV24.bmp + 11/image/BARV105.bmp + 11/image/BARV107.bmp + 11/image/BARV109.bmp + 11/image/BARV112.bmp + 11/image/BARV116.bmp + 11/image/BARV124.bmp + 11/image/BARV205.bmp + 11/image/BARV207.bmp + 11/image/BARV209.bmp + 11/image/BARV212.bmp + 11/image/BARV216.bmp + 11/image/BARV224.bmp + 80/image/digitalWidth8.bmp + 81/image/curDate875.bmp + 66/image/digitalWidth875.bmp + 66/image/digitalWidth8.bmp + 81/image/curDate8.bmp + 80/image/expiryDate8.bmp + 80/image/expiryDate875.bmp + 80/image/digitalWidth1.bmp + 80/image/digitalWidth175.bmp + 81/image/curDate1.bmp + 82/image/class1.bmp + 82/image/class91.bmp + 30/image/digitalWidth1.bmp + 30/image/digitalWidth2.bmp + 30/image/digitalWidth3.bmp + 30/image/digitalWidth4.bmp + 30/image/digitalWidth5.bmp + 30/image/digitalWidth6.bmp + 30/image/digitalWidth7.bmp + 30/image/digitalWidth8.bmp + 30/image/digitalWidth175.bmp + 30/image/digitalWidth275.bmp + 30/image/digitalWidth375.bmp + 30/image/digitalWidth475.bmp + 30/image/digitalWidth575.bmp + 30/image/digitalWidth675.bmp + 30/image/digitalWidth775.bmp + 30/image/digitalWidth875.bmp + 31/image/digitalWidth1.bmp + 31/image/digitalWidth2.bmp + 31/image/digitalWidth3.bmp + 31/image/digitalWidth4.bmp + 31/image/digitalWidth5.bmp + 31/image/digitalWidth6.bmp + 31/image/digitalWidth7.bmp + 31/image/digitalWidth8.bmp + 31/image/digitalWidth175.bmp + 31/image/digitalWidth275.bmp + 31/image/digitalWidth375.bmp + 31/image/digitalWidth475.bmp + 31/image/digitalWidth575.bmp + 31/image/digitalWidth675.bmp + 31/image/digitalWidth775.bmp + 31/image/digitalWidth875.bmp + 32/image/digitalWidth1.bmp + 32/image/digitalWidth2.bmp + 32/image/digitalWidth3.bmp + 32/image/digitalWidth4.bmp + 32/image/digitalWidth5.bmp + 32/image/digitalWidth6.bmp + 32/image/digitalWidth7.bmp + 32/image/digitalWidth8.bmp + 32/image/digitalWidth175.bmp + 32/image/digitalWidth275.bmp + 32/image/digitalWidth375.bmp + 32/image/digitalWidth475.bmp + 32/image/digitalWidth575.bmp + 32/image/digitalWidth675.bmp + 32/image/digitalWidth775.bmp + 32/image/digitalWidth875.bmp + 33/image/digitalWidth1.bmp + 33/image/digitalWidth2.bmp + 33/image/digitalWidth3.bmp + 33/image/digitalWidth4.bmp + 33/image/digitalWidth5.bmp + 33/image/digitalWidth6.bmp + 33/image/digitalWidth7.bmp + 33/image/digitalWidth8.bmp + 33/image/digitalWidth175.bmp + 33/image/digitalWidth275.bmp + 33/image/digitalWidth375.bmp + 33/image/digitalWidth475.bmp + 33/image/digitalWidth575.bmp + 33/image/digitalWidth675.bmp + 33/image/digitalWidth775.bmp + 33/image/digitalWidth875.bmp + 34/image/digitalWidth1.bmp + 34/image/digitalWidth2.bmp + 34/image/digitalWidth3.bmp + 34/image/digitalWidth4.bmp + 34/image/digitalWidth5.bmp + 34/image/digitalWidth6.bmp + 34/image/digitalWidth7.bmp + 34/image/digitalWidth8.bmp + 34/image/digitalWidth175.bmp + 34/image/digitalWidth275.bmp + 34/image/digitalWidth375.bmp + 34/image/digitalWidth475.bmp + 34/image/digitalWidth575.bmp + 34/image/digitalWidth675.bmp + 34/image/digitalWidth775.bmp + 34/image/digitalWidth875.bmp + 35/image/digitalWidth1.bmp + 35/image/digitalWidth2.bmp + 35/image/digitalWidth3.bmp + 35/image/digitalWidth4.bmp + 35/image/digitalWidth5.bmp + 35/image/digitalWidth6.bmp + 35/image/digitalWidth7.bmp + 35/image/digitalWidth8.bmp + 35/image/digitalWidth175.bmp + 35/image/digitalWidth275.bmp + 35/image/digitalWidth375.bmp + 35/image/digitalWidth475.bmp + 35/image/digitalWidth575.bmp + 35/image/digitalWidth675.bmp + 35/image/digitalWidth775.bmp + 35/image/digitalWidth875.bmp + 36/image/digitalWidth1.bmp + 36/image/digitalWidth2.bmp + 36/image/digitalWidth3.bmp + 36/image/digitalWidth4.bmp + 36/image/digitalWidth5.bmp + 36/image/digitalWidth6.bmp + 36/image/digitalWidth7.bmp + 36/image/digitalWidth8.bmp + 36/image/digitalWidth175.bmp + 36/image/digitalWidth275.bmp + 36/image/digitalWidth375.bmp + 36/image/digitalWidth475.bmp + 36/image/digitalWidth575.bmp + 36/image/digitalWidth675.bmp + 36/image/digitalWidth775.bmp + 36/image/digitalWidth875.bmp + 38/image/digitalWidth1.bmp + 38/image/digitalWidth2.bmp + 38/image/digitalWidth3.bmp + 38/image/digitalWidth4.bmp + 38/image/digitalWidth5.bmp + 38/image/digitalWidth6.bmp + 38/image/digitalWidth7.bmp + 38/image/digitalWidth8.bmp + 38/image/digitalWidth175.bmp + 38/image/digitalWidth275.bmp + 38/image/digitalWidth375.bmp + 38/image/digitalWidth475.bmp + 38/image/digitalWidth575.bmp + 38/image/digitalWidth675.bmp + 38/image/digitalWidth775.bmp + 38/image/digitalWidth875.bmp + 37/image/digitalWidth1.bmp + 37/image/digitalWidth2.bmp + 37/image/digitalWidth3.bmp + 37/image/digitalWidth4.bmp + 37/image/digitalWidth5.bmp + 37/image/digitalWidth6.bmp + 37/image/digitalWidth7.bmp + 37/image/digitalWidth8.bmp + 37/image/digitalWidth175.bmp + 37/image/digitalWidth275.bmp + 37/image/digitalWidth375.bmp + 37/image/digitalWidth475.bmp + 37/image/digitalWidth575.bmp + 37/image/digitalWidth675.bmp + 37/image/digitalWidth775.bmp + 37/image/digitalWidth875.bmp + 90/image/digitalWidth1.bmp + 90/image/digitalWidth8.bmp + 90/image/digitalWidth8.xcf + 90/image/digitalWidth8 (____).bmp + 90/image/digitalWidth88.bmp + 90/image/digitalWidth175.bmp + 90/image/expiryDate8.bmp + 90/image/expiryDate8_backup.bmp + 90/image/expiryDate875.bmp + 90/image/expiryDate875_backup.bmp + 91/image/curDate1.bmp + 91/image/curDate8.bmp + 91/image/curDate8_backup.bmp + 91/image/curDate875.bmp + 91/image/digitalWidth1.bmp + 91/image/digitalWidth8.bmp + 91/image/digitalWidth8.xcf + 91/image/digitalWidth8 (____).bmp + 91/image/digitalWidth88.bmp + 91/image/expiryDate8.bmp + 91/image/expiryDate875.bmp + 50/image/digitalWidth1.bmp + 50/image/digitalWidth2.bmp + 50/image/digitalWidth3.bmp + 50/image/digitalWidth4.bmp + 50/image/digitalWidth5.bmp + 50/image/digitalWidth6.bmp + 50/image/digitalWidth7.bmp + 50/image/digitalWidth8.bmp + 50/image/digitalWidth175.bmp + 50/image/digitalWidth275.bmp + 50/image/digitalWidth375.bmp + 50/image/digitalWidth475.bmp + 50/image/digitalWidth575.bmp + 50/image/digitalWidth675.bmp + 50/image/digitalWidth775.bmp + 50/image/digitalWidth875.bmp + 51/image/digitalWidth1.bmp + 51/image/digitalWidth2.bmp + 51/image/digitalWidth3.bmp + 51/image/digitalWidth4.bmp + 51/image/digitalWidth5.bmp + 51/image/digitalWidth6.bmp + 51/image/digitalWidth7.bmp + 51/image/digitalWidth8.bmp + 51/image/digitalWidth175.bmp + 51/image/digitalWidth275.bmp + 51/image/digitalWidth375.bmp + 51/image/digitalWidth475.bmp + 51/image/digitalWidth575.bmp + 51/image/digitalWidth675.bmp + 51/image/digitalWidth775.bmp + 51/image/digitalWidth875.bmp + 52/image/digitalWidth1.bmp + 52/image/digitalWidth2.bmp + 52/image/digitalWidth3.bmp + 52/image/digitalWidth4.bmp + 52/image/digitalWidth5.bmp + 52/image/digitalWidth6.bmp + 52/image/digitalWidth7.bmp + 52/image/digitalWidth8.bmp + 52/image/digitalWidth175.bmp + 52/image/digitalWidth275.bmp + 52/image/digitalWidth375.bmp + 52/image/digitalWidth475.bmp + 52/image/digitalWidth575.bmp + 52/image/digitalWidth675.bmp + 52/image/digitalWidth775.bmp + 52/image/digitalWidth875.bmp + 53/image/digitalWidth1.bmp + 53/image/digitalWidth2.bmp + 53/image/digitalWidth3.bmp + 53/image/digitalWidth4.bmp + 53/image/digitalWidth5.bmp + 53/image/digitalWidth6.bmp + 53/image/digitalWidth7.bmp + 53/image/digitalWidth8.bmp + 53/image/digitalWidth175.bmp + 53/image/digitalWidth275.bmp + 53/image/digitalWidth375.bmp + 53/image/digitalWidth475.bmp + 53/image/digitalWidth575.bmp + 53/image/digitalWidth675.bmp + 53/image/digitalWidth775.bmp + 53/image/digitalWidth875.bmp + 54/image/digitalWidth1.bmp + 54/image/digitalWidth2.bmp + 54/image/digitalWidth3.bmp + 54/image/digitalWidth4.bmp + 54/image/digitalWidth5.bmp + 54/image/digitalWidth6.bmp + 54/image/digitalWidth7.bmp + 54/image/digitalWidth8.bmp + 54/image/digitalWidth175.bmp + 54/image/digitalWidth275.bmp + 54/image/digitalWidth375.bmp + 54/image/digitalWidth475.bmp + 54/image/digitalWidth575.bmp + 54/image/digitalWidth675.bmp + 54/image/digitalWidth775.bmp + 54/image/digitalWidth875.bmp + 55/image/digitalWidth1.bmp + 55/image/digitalWidth2.bmp + 55/image/digitalWidth3.bmp + 55/image/digitalWidth4.bmp + 55/image/digitalWidth5.bmp + 55/image/digitalWidth6.bmp + 55/image/digitalWidth7.bmp + 55/image/digitalWidth8.bmp + 55/image/digitalWidth175.bmp + 55/image/digitalWidth275.bmp + 55/image/digitalWidth375.bmp + 55/image/digitalWidth475.bmp + 55/image/digitalWidth575.bmp + 55/image/digitalWidth675.bmp + 55/image/digitalWidth775.bmp + 55/image/digitalWidth875.bmp + 56/image/digitalWidth1.bmp + 56/image/digitalWidth2.bmp + 56/image/digitalWidth3.bmp + 56/image/digitalWidth4.bmp + 56/image/digitalWidth5.bmp + 56/image/digitalWidth6.bmp + 56/image/digitalWidth7.bmp + 56/image/digitalWidth8.bmp + 56/image/digitalWidth175.bmp + 56/image/digitalWidth275.bmp + 56/image/digitalWidth375.bmp + 56/image/digitalWidth475.bmp + 56/image/digitalWidth575.bmp + 56/image/digitalWidth675.bmp + 56/image/digitalWidth775.bmp + 56/image/digitalWidth875.bmp + 57/image/digitalWidth1.bmp + 57/image/digitalWidth2.bmp + 57/image/digitalWidth3.bmp + 57/image/digitalWidth4.bmp + 57/image/digitalWidth5.bmp + 57/image/digitalWidth6.bmp + 57/image/digitalWidth7.bmp + 57/image/digitalWidth8.bmp + 57/image/digitalWidth175.bmp + 57/image/digitalWidth275.bmp + 57/image/digitalWidth375.bmp + 57/image/digitalWidth475.bmp + 57/image/digitalWidth575.bmp + 57/image/digitalWidth675.bmp + 57/image/digitalWidth775.bmp + 57/image/digitalWidth875.bmp + 58/image/digitalWidth1.bmp + 58/image/digitalWidth2.bmp + 58/image/digitalWidth3.bmp + 58/image/digitalWidth4.bmp + 58/image/digitalWidth5.bmp + 58/image/digitalWidth6.bmp + 58/image/digitalWidth7.bmp + 58/image/digitalWidth8.bmp + 58/image/digitalWidth175.bmp + 58/image/digitalWidth275.bmp + 58/image/digitalWidth375.bmp + 58/image/digitalWidth475.bmp + 58/image/digitalWidth575.bmp + 58/image/digitalWidth675.bmp + 58/image/digitalWidth775.bmp + 58/image/digitalWidth875.bmp + 100/image/digitalWidth1.bmp + 100/image/digitalWidth8.bmp + 100/image/digitalWidth8.xcf + 100/image/digitalWidth8 (____).bmp + 100/image/digitalWidth88.bmp + 100/image/digitalWidth175.bmp + 100/image/expiryDate8.bmp + 100/image/expiryDate8_backup.bmp + 100/image/expiryDate875.bmp + 100/image/expiryDate875_backup.bmp + 101/image/curDate1.bmp + 101/image/curDate8.bmp + 101/image/curDate8_backup.bmp + 101/image/curDate875.bmp + 101/image/digitalWidth1.bmp + 101/image/digitalWidth8.bmp + 101/image/digitalWidth8.xcf + 101/image/digitalWidth8 (____).bmp + 101/image/digitalWidth88.bmp + 101/image/expiryDate8.bmp + 101/image/expiryDate875.bmp + icon/Estartprint3.png + icon/EstopPrint3.png + conf/VoltDataStd21.bin + conf/VoltDataStd25.bin + conf/VoltePara_No73.bin + conf/VoltParaHi.bin + + diff --git a/image/AH12.png b/image/AH12.png new file mode 100644 index 0000000..49bb9fa Binary files /dev/null and b/image/AH12.png differ diff --git a/image/AH13.png b/image/AH13.png new file mode 100644 index 0000000..11f3fc7 Binary files /dev/null and b/image/AH13.png differ diff --git a/image/ALARMBlue.PNG b/image/ALARMBlue.PNG new file mode 100644 index 0000000..80d3092 Binary files /dev/null and b/image/ALARMBlue.PNG differ diff --git a/image/ALARMGreen.PNG b/image/ALARMGreen.PNG new file mode 100644 index 0000000..eda3d7d Binary files /dev/null and b/image/ALARMGreen.PNG differ diff --git a/image/ALARMRed.PNG b/image/ALARMRed.PNG new file mode 100644 index 0000000..6952cb4 Binary files /dev/null and b/image/ALARMRed.PNG differ diff --git a/image/ALARMYellow.PNG b/image/ALARMYellow.PNG new file mode 100644 index 0000000..df40b32 Binary files /dev/null and b/image/ALARMYellow.PNG differ diff --git a/image/DMTV10X10.bmp b/image/DMTV10X10.bmp new file mode 100644 index 0000000..a7b96db Binary files /dev/null and b/image/DMTV10X10.bmp differ diff --git a/image/DMTV12X12.bmp b/image/DMTV12X12.bmp new file mode 100644 index 0000000..140e6f2 Binary files /dev/null and b/image/DMTV12X12.bmp differ diff --git a/image/DMTV14X14.bmp b/image/DMTV14X14.bmp new file mode 100644 index 0000000..a20042a Binary files /dev/null and b/image/DMTV14X14.bmp differ diff --git a/image/DMTV16X16.bmp b/image/DMTV16X16.bmp new file mode 100644 index 0000000..a874b5c Binary files /dev/null and b/image/DMTV16X16.bmp differ diff --git a/image/DMTV18X18.bmp b/image/DMTV18X18.bmp new file mode 100644 index 0000000..eb7ffd2 Binary files /dev/null and b/image/DMTV18X18.bmp differ diff --git a/image/DMTV20X20.bmp b/image/DMTV20X20.bmp new file mode 100644 index 0000000..041d96c Binary files /dev/null and b/image/DMTV20X20.bmp differ diff --git a/image/DMTV22X22.bmp b/image/DMTV22X22.bmp new file mode 100644 index 0000000..3d226af Binary files /dev/null and b/image/DMTV22X22.bmp differ diff --git a/image/DMTV24X24.bmp b/image/DMTV24X24.bmp new file mode 100644 index 0000000..5e3e9d8 Binary files /dev/null and b/image/DMTV24X24.bmp differ diff --git a/image/DMTV26X26.bmp b/image/DMTV26X26.bmp new file mode 100644 index 0000000..ef092c0 Binary files /dev/null and b/image/DMTV26X26.bmp differ diff --git a/image/MIV12.png b/image/MIV12.png new file mode 100644 index 0000000..b265dc6 Binary files /dev/null and b/image/MIV12.png differ diff --git a/image/MIV13.png b/image/MIV13.png new file mode 100644 index 0000000..a1ea758 Binary files /dev/null and b/image/MIV13.png differ diff --git a/image/QRV25X21.bmp b/image/QRV25X21.bmp new file mode 100644 index 0000000..54da2a7 Binary files /dev/null and b/image/QRV25X21.bmp differ diff --git a/image/QRV29X25.bmp b/image/QRV29X25.bmp new file mode 100644 index 0000000..b14d055 Binary files /dev/null and b/image/QRV29X25.bmp differ diff --git a/image/QRV33X29.bmp b/image/QRV33X29.bmp new file mode 100644 index 0000000..059e4b4 Binary files /dev/null and b/image/QRV33X29.bmp differ diff --git a/image/Turkey_logo.png b/image/Turkey_logo.png new file mode 100644 index 0000000..f51bc18 Binary files /dev/null and b/image/Turkey_logo.png differ diff --git a/image/ZFKD.png b/image/ZFKD.png new file mode 100644 index 0000000..975dd2d Binary files /dev/null and b/image/ZFKD.png differ diff --git a/image/ZFKD2.png b/image/ZFKD2.png new file mode 100644 index 0000000..41c0031 Binary files /dev/null and b/image/ZFKD2.png differ diff --git a/image/atxt0.png b/image/atxt0.png new file mode 100644 index 0000000..bde7eb9 Binary files /dev/null and b/image/atxt0.png differ diff --git a/image/atxt1.png b/image/atxt1.png new file mode 100644 index 0000000..b41e2c5 Binary files /dev/null and b/image/atxt1.png differ diff --git a/image/atxt2.png b/image/atxt2.png new file mode 100644 index 0000000..54613ce Binary files /dev/null and b/image/atxt2.png differ diff --git a/image/atxt3.png b/image/atxt3.png new file mode 100644 index 0000000..6778a4e Binary files /dev/null and b/image/atxt3.png differ diff --git a/image/atxt4.png b/image/atxt4.png new file mode 100644 index 0000000..2464f98 Binary files /dev/null and b/image/atxt4.png differ diff --git a/image/atxt5.png b/image/atxt5.png new file mode 100644 index 0000000..19a8cd4 Binary files /dev/null and b/image/atxt5.png differ diff --git a/image/atxt6.png b/image/atxt6.png new file mode 100644 index 0000000..5b917d2 Binary files /dev/null and b/image/atxt6.png differ diff --git a/image/atxt7.png b/image/atxt7.png new file mode 100644 index 0000000..876d065 Binary files /dev/null and b/image/atxt7.png differ diff --git a/image/atxt8.png b/image/atxt8.png new file mode 100644 index 0000000..53a326e Binary files /dev/null and b/image/atxt8.png differ diff --git a/image/counter.png b/image/counter.png new file mode 100644 index 0000000..9eeab07 Binary files /dev/null and b/image/counter.png differ diff --git a/image/counterz.png b/image/counterz.png new file mode 100644 index 0000000..66e0bb0 Binary files /dev/null and b/image/counterz.png differ diff --git a/image/dd.txt b/image/dd.txt new file mode 100644 index 0000000..d192163 --- /dev/null +++ b/image/dd.txt @@ -0,0 +1 @@ +压缩机故障,请检查! \ No newline at end of file diff --git a/image/exit.png b/image/exit.png new file mode 100644 index 0000000..6721a39 Binary files /dev/null and b/image/exit.png differ diff --git a/image/exit1.png b/image/exit1.png new file mode 100644 index 0000000..96833de Binary files /dev/null and b/image/exit1.png differ diff --git a/image/g b/image/g new file mode 100644 index 0000000..8876378 Binary files /dev/null and b/image/g differ diff --git a/image/gg b/image/gg new file mode 100644 index 0000000..ceb9c32 Binary files /dev/null and b/image/gg differ diff --git a/image/h b/image/h new file mode 100644 index 0000000..51c5293 Binary files /dev/null and b/image/h differ diff --git a/image/h12 b/image/h12 new file mode 100644 index 0000000..df82449 Binary files /dev/null and b/image/h12 differ diff --git a/image/h2 b/image/h2 new file mode 100644 index 0000000..30deae1 Binary files /dev/null and b/image/h2 differ diff --git a/image/jetOFF.png b/image/jetOFF.png new file mode 100644 index 0000000..8447c87 Binary files /dev/null and b/image/jetOFF.png differ diff --git a/image/jetOFF1.png b/image/jetOFF1.png new file mode 100644 index 0000000..85b041b Binary files /dev/null and b/image/jetOFF1.png differ diff --git a/image/jetON.png b/image/jetON.png new file mode 100644 index 0000000..08526c7 Binary files /dev/null and b/image/jetON.png differ diff --git a/image/jetON1.png b/image/jetON1.png new file mode 100644 index 0000000..d59047f Binary files /dev/null and b/image/jetON1.png differ diff --git a/image/prduct.png b/image/prduct.png new file mode 100644 index 0000000..f950290 Binary files /dev/null and b/image/prduct.png differ diff --git a/image/qtopia b/image/qtopia new file mode 100644 index 0000000..a9acbb9 --- /dev/null +++ b/image/qtopia @@ -0,0 +1,32 @@ +#!/bin/sh + +export TSLIB_TSDEVICE=/dev/input/event0 +export TSLIB_CONFFILE=/usr/local/etc/ts.conf +export TSLIB_PLUGINDIR=/usr/local/lib/ts +export TSLIB_CALIBFILE=/etc/pointercal +export QTDIR=/opt/Qtopia +export QPEDIR=/opt/Qtopia +export PATH=$QTDIR/bin:$PATH +export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH + + +TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent +if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen < $TS_INFO_FILE" ]; then + export QWS_MOUSE_PROTO="TPanel:/dev/input/event0 USB:/dev/input/mice" + if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then + rm /etc/pointercal + fi +else + export QWS_MOUSE_PROTO="USB:/dev/input/mice" + >/etc/pointercal +fi +unset TS_INFO_FILE + +export QWS_KEYBOARD=TTY:/dev/tty1 +export KDEDIR=/opt/kde + +export HOME=/root + +exec /opt/Qtopia/bin/SunJet -qws +#exec $QPEDIR/bin/qpe 1>/dev/null 2>/dev/null + diff --git a/image/qtopia1 b/image/qtopia1 new file mode 100644 index 0000000..a9acbb9 --- /dev/null +++ b/image/qtopia1 @@ -0,0 +1,32 @@ +#!/bin/sh + +export TSLIB_TSDEVICE=/dev/input/event0 +export TSLIB_CONFFILE=/usr/local/etc/ts.conf +export TSLIB_PLUGINDIR=/usr/local/lib/ts +export TSLIB_CALIBFILE=/etc/pointercal +export QTDIR=/opt/Qtopia +export QPEDIR=/opt/Qtopia +export PATH=$QTDIR/bin:$PATH +export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH + + +TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent +if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen < $TS_INFO_FILE" ]; then + export QWS_MOUSE_PROTO="TPanel:/dev/input/event0 USB:/dev/input/mice" + if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then + rm /etc/pointercal + fi +else + export QWS_MOUSE_PROTO="USB:/dev/input/mice" + >/etc/pointercal +fi +unset TS_INFO_FILE + +export QWS_KEYBOARD=TTY:/dev/tty1 +export KDEDIR=/opt/kde + +export HOME=/root + +exec /opt/Qtopia/bin/SunJet -qws +#exec $QPEDIR/bin/qpe 1>/dev/null 2>/dev/null + diff --git a/image/reset.png b/image/reset.png new file mode 100644 index 0000000..62f5e32 Binary files /dev/null and b/image/reset.png differ diff --git a/image/send b/image/send new file mode 100644 index 0000000..274c005 --- /dev/null +++ b/image/send @@ -0,0 +1 @@ +1234 \ No newline at end of file diff --git a/image/speed.png b/image/speed.png new file mode 100644 index 0000000..5fd6b98 Binary files /dev/null and b/image/speed.png differ diff --git a/image/suction.png b/image/suction.png new file mode 100644 index 0000000..a18a9cf Binary files /dev/null and b/image/suction.png differ diff --git a/image/suctionOFF.png b/image/suctionOFF.png new file mode 100644 index 0000000..de10de5 Binary files /dev/null and b/image/suctionOFF.png differ diff --git a/image/suctionOFF1.png b/image/suctionOFF1.png new file mode 100644 index 0000000..32a3094 Binary files /dev/null and b/image/suctionOFF1.png differ diff --git a/image/suctionON.png b/image/suctionON.png new file mode 100644 index 0000000..199b824 Binary files /dev/null and b/image/suctionON.png differ diff --git a/image/suctionON1.png b/image/suctionON1.png new file mode 100644 index 0000000..60326b4 Binary files /dev/null and b/image/suctionON1.png differ diff --git a/image/textEdit.html b/image/textEdit.html new file mode 100644 index 0000000..952d622 --- /dev/null +++ b/image/textEdit.html @@ -0,0 +1,5 @@ + +QTextEdit Demonstration +

你好下 上,我时易r于

diff --git a/image/txt0.png b/image/txt0.png new file mode 100644 index 0000000..e6fc582 Binary files /dev/null and b/image/txt0.png differ diff --git a/image/txt1.png b/image/txt1.png new file mode 100644 index 0000000..72a0fb9 Binary files /dev/null and b/image/txt1.png differ diff --git a/image/txt11.png b/image/txt11.png new file mode 100644 index 0000000..919ba0f Binary files /dev/null and b/image/txt11.png differ diff --git a/image/txt12.png b/image/txt12.png new file mode 100644 index 0000000..089f3f0 Binary files /dev/null and b/image/txt12.png differ diff --git a/image/txt13.png b/image/txt13.png new file mode 100644 index 0000000..7e0a12d Binary files /dev/null and b/image/txt13.png differ diff --git a/image/txt14.png b/image/txt14.png new file mode 100644 index 0000000..54b3fb2 Binary files /dev/null and b/image/txt14.png differ diff --git a/image/txt2.png b/image/txt2.png new file mode 100644 index 0000000..5f5a520 Binary files /dev/null and b/image/txt2.png differ diff --git a/image/txt3.png b/image/txt3.png new file mode 100644 index 0000000..a0eae8f Binary files /dev/null and b/image/txt3.png differ diff --git a/image/txt4.png b/image/txt4.png new file mode 100644 index 0000000..b01900a Binary files /dev/null and b/image/txt4.png differ diff --git a/image/txt5.png b/image/txt5.png new file mode 100644 index 0000000..3977870 Binary files /dev/null and b/image/txt5.png differ diff --git a/image/txt6.png b/image/txt6.png new file mode 100644 index 0000000..5fab91d Binary files /dev/null and b/image/txt6.png differ diff --git a/image/txt7.png b/image/txt7.png new file mode 100644 index 0000000..5a2e3be Binary files /dev/null and b/image/txt7.png differ diff --git a/image/txt8.png b/image/txt8.png new file mode 100644 index 0000000..cf1fcfa Binary files /dev/null and b/image/txt8.png differ diff --git a/image/txt9.png b/image/txt9.png new file mode 100644 index 0000000..31166eb Binary files /dev/null and b/image/txt9.png differ diff --git a/image/txta.png b/image/txta.png new file mode 100644 index 0000000..2d065de Binary files /dev/null and b/image/txta.png differ diff --git a/image/txtb.png b/image/txtb.png new file mode 100644 index 0000000..370ce56 Binary files /dev/null and b/image/txtb.png differ diff --git a/image/txtc.png b/image/txtc.png new file mode 100644 index 0000000..a11bf95 Binary files /dev/null and b/image/txtc.png differ diff --git a/image/txtd.png b/image/txtd.png new file mode 100644 index 0000000..3a26d73 Binary files /dev/null and b/image/txtd.png differ diff --git a/image/u2 b/image/u2 new file mode 100644 index 0000000..96015ba --- /dev/null +++ b/image/u2 @@ -0,0 +1,5 @@ +#!/bin/sh + +cp /udisk/asc.bin /opt/zk/. + + diff --git a/image/udisk.png b/image/udisk.png new file mode 100644 index 0000000..3b5337d Binary files /dev/null and b/image/udisk.png differ diff --git a/image/update b/image/update new file mode 100644 index 0000000..7520c91 --- /dev/null +++ b/image/update @@ -0,0 +1,9 @@ +#!/bin/sh + +mkdir /opt/mm + +cp /udisk/mm/* /opt/mm/. + +cp /udisk/qtopia /bin/qtopia +chmod +x /bin/qtopia + diff --git a/image/xinxi.png b/image/xinxi.png new file mode 100644 index 0000000..1f9269a Binary files /dev/null and b/image/xinxi.png differ diff --git a/image/显示屏1.jpg b/image/显示屏1.jpg new file mode 100644 index 0000000..39a61aa Binary files /dev/null and b/image/显示屏1.jpg differ diff --git a/image/显示屏2.jpg b/image/显示屏2.jpg new file mode 100644 index 0000000..3604da4 Binary files /dev/null and b/image/显示屏2.jpg differ diff --git a/image/显示屏3.jpg b/image/显示屏3.jpg new file mode 100644 index 0000000..f6f155a Binary files /dev/null and b/image/显示屏3.jpg differ diff --git a/inkjetprinter.ui b/inkjetprinter.ui new file mode 100644 index 0000000..8ec07fa --- /dev/null +++ b/inkjetprinter.ui @@ -0,0 +1,2594 @@ + + + InkJetPrinter + + + + 0 + 0 + 640 + 480 + + + + + 0 + 0 + + + + TabWidget + + + QTabBar::scroller +{ + width:60px; +} + + + QTabWidget::North + + + QTabWidget::Rounded + + + 10 + + + + 16 + 16 + + + + true + + + false + + + + 主窗口 + + + + + 信息编辑 + + + + + 图案编辑 + + + + + 打印设置 + + + + + 触发设置 + + + + + 系统设置 + + + + + 系统管理 + + + + + 其他信息 + + + + + 日志信息 + + + + + 网络管理 + + + + + 电压调整 + + + + + 510 + 410 + 85 + 27 + + + + Save + + + + + + 10 + 0 + 611 + 411 + + + + Qt::StrongFocus + + + 3 + + + + 不连续电压 + + + + + 10 + 0 + 581 + 371 + + + + + + + vol0 + + + + + + + 20 + + + 4096 + + + 1 + + + + + + + 20 + + + 4095 + + + + + + + vol1 + + + + + + + vol2 + + + + + + + vol3 + + + + + + + vol4 + + + + + + + vol5 + + + + + + + vol6 + + + + + + + vol7 + + + + + + + vol8 + + + + + + + vol9 + + + + + + + vol10 + + + + + + + vol11 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol12 + + + + + + + vol13 + + + + + + + vol14 + + + + + + + vol15 + + + + + + + vol16 + + + + + + + vol17 + + + + + + + vol18 + + + + + + + vol19 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol20 + + + + + + + vol21 + + + + + + + vol22 + + + + + + + vol23 + + + + + + + vol24 + + + + + + + vol25 + + + + + + + vol26 + + + + + + + vol27 + + + + + + + vol28 + + + + + + + vol29 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol30 + + + + + + + vol31 + + + + + + + vol32 + + + + + + + vol33 + + + + + + + vol34 + + + + + + + vol35 + + + + + + + vol36 + + + + + + + vol37 + + + + + + + vol38 + + + + + + + vol39 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + + + 连续电压 + + + + + 0 + 0 + 581 + 371 + + + + + + + vol0 + + + + + + + 20 + + + 4096 + + + 1 + + + + + + + 20 + + + 4095 + + + + + + + vol1 + + + + + + + vol2 + + + + + + + vol3 + + + + + + + vol4 + + + + + + + vol5 + + + + + + + vol6 + + + + + + + vol7 + + + + + + + vol8 + + + + + + + vol9 + + + + + + + vol10 + + + + + + + vol11 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol12 + + + + + + + vol13 + + + + + + + vol14 + + + + + + + vol15 + + + + + + + vol16 + + + + + + + vol17 + + + + + + + vol18 + + + + + + + vol19 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol20 + + + + + + + vol21 + + + + + + + vol22 + + + + + + + vol23 + + + + + + + vol24 + + + + + + + vol25 + + + + + + + vol26 + + + + + + + vol27 + + + + + + + vol28 + + + + + + + vol29 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + vol30 + + + + + + + vol31 + + + + + + + vol32 + + + + + + + vol33 + + + + + + + vol34 + + + + + + + vol35 + + + + + + + vol36 + + + + + + + vol37 + + + + + + + vol38 + + + + + + + vol39 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + + + 满列电压 + + + + + 10 + 0 + 581 + 371 + + + + + + + fvol0 + + + + + + + 20 + + + 4096 + + + 1 + + + + + + + 20 + + + 4095 + + + + + + + fvol1 + + + + + + + fvol2 + + + + + + + fvol3 + + + + + + + fvol4 + + + + + + + fvol5 + + + + + + + fvol6 + + + + + + + fvol7 + + + + + + + fvol8 + + + + + + + fvol9 + + + + + + + fvol10 + + + + + + + fvol11 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4095 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + fvol12 + + + + + + + fvol13 + + + + + + + fvol14 + + + + + + + fvol15 + + + + + + + fvol16 + + + + + + + fvol17 + + + + + + + fvol18 + + + + + + + fvol19 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + fvol20 + + + + + + + fvol21 + + + + + + + fvol22 + + + + + + + fvol23 + + + + + + + fvol24 + + + + + + + fvol25 + + + + + + + fvol26 + + + + + + + fvol27 + + + + + + + fvol28 + + + + + + + fvol29 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + fvol30 + + + + + + + fvol31 + + + + + + + fvol32 + + + + + + + fvol33 + + + + + + + fvol34 + + + + + + + fvol35 + + + + + + + fvol36 + + + + + + + fvol37 + + + + + + + fvol38 + + + + + + + fvol39 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + 20 + + + 4096 + + + + + + + + + 其他调整 + + + + + 0 + 10 + 154 + 31 + + + + + + + 整体缩放(%) : + + + + + + + 40 + + + 150 + + + 100 + + + + + + + + + + + FpgaDebug + + + + + 320 + 60 + 101 + 27 + + + + WriteByte + + + + + + 480 + 60 + 101 + 27 + + + + ReadByte + + + + + + 20 + 10 + 581 + 31 + + + + + + + Address: + + + + + + + Qt::Vertical + + + + + + + 65535 + + + + + + + Qt::Vertical + + + + + + + Value: + + + + + + + Qt::Vertical + + + + + + + 255 + + + + + + + + + 20 + 120 + 581 + 31 + + + + + + + Address: + + + + + + + Qt::Vertical + + + + + + + 65535 + + + + + + + Qt::Vertical + + + + + + + Value: + + + + + + + Qt::Vertical + + + + + + + 65535 + + + + + + + + + 320 + 180 + 101 + 27 + + + + WriteWord + + + + + + 480 + 180 + 101 + 27 + + + + ReadWord + + + + + + 480 + 370 + 101 + 27 + + + + ReadDword + + + + + + 320 + 370 + 101 + 27 + + + + WriteDword + + + + + + 20 + 250 + 581 + 80 + + + + + + + Address: + + + + + + + 65535 + + + + + + + ValueH: + + + + + + + 65535 + + + + + + + 65535 + + + + + + + ValueL: + + + + + + + + + + MainWindow + QWidget +
mainwindow.h
+ 1 +
+ + PicEdit + QWidget +
PicEdit.h
+ 1 +
+ + PrintSetting + QWidget +
PrintSetting.h
+ 1 +
+ + SystemSetting + QWidget +
SystemSetting.h
+ 1 +
+ + OtherInfo + QWidget +
OtherInfo.h
+ 1 +
+ + LogInfo + QWidget +
LogInfo.h
+ 1 +
+ + TriggerCtrl + QWidget +
TriggerCtrl.h
+ 1 +
+ + SystemManage + QWidget +
SystemManage.h
+ 1 +
+ + ZkEdit + QWidget +
ZkEdit.h
+ 1 +
+ + NetworkManager + QWidget +
Network/NetworkManager.h
+ 1 +
+
+ + +
diff --git a/insertspacenumdialog.ui b/insertspacenumdialog.ui new file mode 100644 index 0000000..bb897fb --- /dev/null +++ b/insertspacenumdialog.ui @@ -0,0 +1,103 @@ + + + InsertSpaceNumDialog + + + + 0 + 0 + 336 + 94 + + + + Qt::StrongFocus + + + 插入空格数 + + + + + 110 + 50 + 221 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 311 + 31 + + + + + + + 空格个数: + + + + + + + + 220 + 0 + + + + 1 + + + + + + + + + + buttonBox + accepted() + InsertSpaceNumDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + InsertSpaceNumDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/loginfo.ui b/loginfo.ui new file mode 100644 index 0000000..99edf42 --- /dev/null +++ b/loginfo.ui @@ -0,0 +1,275 @@ + + + LogInfo + + + + 0 + 0 + 626 + 437 + + + + Qt::StrongFocus + + + Form + + + + + + + + 1 + + + + 当前状态 + + + + + + true + + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + + + 255 + 255 + 255 + + + + + + + + Qt::NoFocus + + + true + + + + + + + + + 清空当前状态 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 历史状态 + + + + + + true + + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + + + 255 + 255 + 255 + + + + + + + + Qt::NoFocus + + + true + + + + + + + + + TextLabel + + + + + + + 删除历史文件 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 打开历史文件 + + + + + + + 导出日志到U盘 + + + + + + + + + + 版本信息 + + + + + + true + + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + + + 255 + 255 + 255 + + + + + + + + Qt::NoFocus + + + true + + + + + + + + + + + + + + diff --git a/logo_form.cpp b/logo_form.cpp new file mode 100644 index 0000000..1d00112 --- /dev/null +++ b/logo_form.cpp @@ -0,0 +1,30 @@ +#include "logo_form.h" +#include "ui_logo_form.h" +#include "InkJetPrinter.h" + +logo_Form::logo_Form(QWidget *parent) : + QWidget(parent), + ui(new Ui::logo_Form) +{ + ui->setupUi(this); + +#ifdef TURKEY_LOGO + ui->logo_label->setPixmap(QPixmap(QString::fromUtf8(":/image/Turkey_logo.png"))); + + show_timer = new QTimer(this); + connect(show_timer, SIGNAL(timeout()), this, SLOT(logo_timer_fun())); + show_timer->start(5000); +#endif +} + +logo_Form::~logo_Form() +{ + delete ui; +} +extern InkJetPrinter *pInkJectPrinter; + +void logo_Form::logo_timer_fun() +{ + show_timer->stop(); + pInkJectPrinter->show(); +} diff --git a/logo_form.h b/logo_form.h new file mode 100644 index 0000000..c8c8999 --- /dev/null +++ b/logo_form.h @@ -0,0 +1,26 @@ +#ifndef LOGO_FORM_H +#define LOGO_FORM_H + +#include + +namespace Ui { +class logo_Form; +} + +class logo_Form : public QWidget +{ + Q_OBJECT + +public: + + explicit logo_Form(QWidget *parent = 0); + ~logo_Form(); +private slots: + void logo_timer_fun(); +private: + + QTimer *show_timer; + Ui::logo_Form *ui; +}; + +#endif // LOGO_FORM_H diff --git a/logo_form.ui b/logo_form.ui new file mode 100644 index 0000000..8870667 --- /dev/null +++ b/logo_form.ui @@ -0,0 +1,32 @@ + + + logo_Form + + + + 0 + 0 + 640 + 480 + + + + Form + + + + + 0 + 0 + 640 + 480 + + + + + + + + + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..e7e6028 --- /dev/null +++ b/main.cpp @@ -0,0 +1,231 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "InkJetPrinter.h" +#include "logo_form.h" +#include "MyInputMethod.h" +#include "mainwindow.h" +#include +#include +#include +#include +#include "myinclude.h" +#include "Public.h" +#include "Log/filelogger.h" +//#define SYS_CN + +/* +1. WenQuanYiMH_12_50.qpf2 是由 Zfull-GB_12_50(Zpix.ttf)在PCMAKEQPF软件下生成的,它包含较完整的字体库 nono 20160302 + +2. 基于WenQuanYiCN编越南语,中文通用字库 +3. 基于WenQuanYiMicroHei编 普通版本字库 +#git commit -am "测试提交新数据" +#git push +#git clone xiongnie@119.23.201.56:/var/repo_dir/QtUI.git +#git pull xiongnie@119.23.201.56:/var/repo_dir/QtUI.git +#git remote add origin git@github.com:username/Hello-World.git +#git push origin master 将本地项目给提交到服务器中 +#----------------------------------------------------------- +#git pull 本地与服务器端同步 +#----------------------------------------------------------------- +#git push (远程仓库名) (分支名) 将本地分支推送到服务器上去。 +#git push origin serverfix:awesomebranch + + +git remote add origin xiongnie@119.23.201.56:/var/repo_dir/QRUIV53.git + + +### + + + */ + + + +InkJetPrinter *pInkJectPrinter; +MyInputMethod *myInputMethod; + +//#include +//#include +//#include + +int main(int argc, char *argv[]) +{ + + QApplication a(argc, argv,QApplication::GuiServer); + QApplication::setStyle(QStyleFactory::create("Windows")); + QFont f = a.font(); + QString langurageFile; + QFile file(SYS_ROOT_DIR"UseEn"); + + if(file.exists()) + { +#ifdef VNLG + QString langurageType = Public::ReadLanguageName();//"";// + //qDebug()<<"La:"<load(langurageFile)==false){ + translator->deleteLater(); + QMessageBox::critical(0,("错误"),("无法加载中文翻译文件") + langurageFile); + } + else { + QApplication::installTranslator(translator); + } + + +#ifndef Q_OS_WIN32 + //QWSServer::setCurrentInputMethod(new MyInputMethod()); + myInputMethod = new MyInputMethod(); + QWSServer::setCurrentInputMethod(myInputMethod); +#endif + // 配置日志 + QString configFileName = ":/conf/config.ini"; + QSettings* logSettings = new QSettings(configFileName, QSettings::IniFormat, &a); + logSettings->beginGroup("logging"); + FileLogger* logger = new FileLogger(logSettings, 10000, &a); + logger->installMsgHandler(); + + + + InkJetPrinter w; +#ifndef Q_OS_WIN32 + w.setWindowTitle(("比洋喷码")); + w.setStyleSheet("QTabBar::tab {height:40px;} QTabBar::scroller{ width:40px;} QRadioButton::indicator{ width: 25px; height: 25px; } \ + QCheckBox::indicator { width: 18px; height: 18px; }"); + + const QString style_main2="QTabBar::tab {height:35px;border-top-left-radius: 6px;border-top-right-radius: 6px;padding-left: 11px;padding-right: 11px;border: 2px solid #C4C4C3;} \ + QTabBar::tab:selected {background-color: rgb(255, 170, 127);height:38px;}\ + QTabBar::tab:!selected {margin-top: 3px;}\ + QTabBar::scroller{ width:40px;} \ + QRadioButton::indicator{ width: 25px; height: 25px; } \ + QCheckBox::indicator { width: 18px; height: 18px; } "; + w.setStyleSheet(style_main2); + + w.showFullScreen(); /*保证全屏,看不到系统标题*/ +#endif + + w.show(); + + pInkJectPrinter = &w; + + return a.exec(); +} + diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..3ebaa1e --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,5299 @@ +/* +* +* +*2013-9-15高压报警停止充电 +*/ + +/* + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否初始化产品计数?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + updateTotalCnt(0); + sysPara->devOp->clearProductCnt(1); + sysPara->saveParaToFile(); + + } + */ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "InputMethod.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef Q_OS_WIN + #include +#else + #define reboot(a,...) (0 == 0) +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "DevOp.h" +#include "Public.h" +#include "LogInfo.h" +#include "myinclude.h" +#include "QBarCode.h" +#include "scene/picscene.h" +#include +#include "MyInputMethod.h" +#include +#include "VerBVersion.h" +//#define SAVEWHENPREVIEW // 预览时先保存 +#define MDTFLAG 0xff00FF10 +#define QRFLAG 0xff00FF20 +#define BARFLAG 0xff00FF30 +#define MMVAR 1 + +#define MAX_ALLOW_VISICOSITY_OVERFLOW_NUM 120 //连续超那么多次,会被认为粘度故障 + +#define EXPIRY_VARI_RECONISE 0x0000FF +#define RECICLARNUMBER 21 + +unsigned char test_flag,open_close; +extern QFile PrintDatafile; + +MainWindow::MainWindow(QWidget *parent) : + QWidget(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); //不使用布局 + + //ui->textEdit->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }"); + QFont font = ui->textEdit->font(); + font.setPixelSize(12); + ui->textEdit->setFont(font); + previewFlag =0; + ui->textEditOption->bindText(ui->textEdit); + ui->textEditOption->bindPicWidget(ui->PicWidgetDisp); + ui->textEditOption->bindStackWidget(ui->stackedWidgetOption,ui->stackedWidgetText); + //ui->textEditOption->setl +#ifdef _2DCODE_ + dlgqrcode = new dlgQrCode();//ui->textEditOption->dlgQrcode ;// + //barcode = ui->textEditOption->barcode;//new QBarCode(); + barcode = new QBarCode(); +#endif + //ui->pushButtonEditBarCode->hide(); + + connect(ui->labelFaultResume,SIGNAL(pressed()),this,SLOT(onLabelFaultRusumePressed())); + + connect(ui->labelStatusHighVoltageFault,SIGNAL(pressed()),this,SLOT(onStatusHighVoltageFault())); + connect(ui->labelStatusInkLeak,SIGNAL(pressed()),this,SLOT(onStatusInkLeak())); + connect(ui->labelStatusInkSwint,SIGNAL(pressed()),this,SLOT(onStatusInkSwint())); + connect(ui->labelStatusInkWaterLevel,SIGNAL(pressed()),this,SLOT(onStatusInkWaterLevel())); + connect(ui->labelStatusRecycleWarn,SIGNAL(pressed()),this,SLOT(onStatusRecycleWarn())); + connect(ui->labelStatusSolvLevelWarn,SIGNAL(pressed()),this,SLOT(onStatusSolvLevelWarn())); + connect(ui->labelStatusViscosityWarn,SIGNAL(pressed()),this,SLOT(onStatusViscosityWarn())); + connect(ui->labelStatusChargefault,SIGNAL(pressed()),this,SLOT(onStatusChargefault())); + //connect(ui->labelStatu,SIGNAL(pressed()),this,SLOT(on())); labelStatusChargefault + //connect(ui->labelStatu,SIGNAL(pressed()),this,SLOT(on())); + + + connect(ui->textEdit,SIGNAL(textChanged ()),this,SLOT(ontextEdittextChanged())); + connect(ui->textEdit,SIGNAL(cursorPositionChanged()),this,SLOT(onTextEditCursorPositionChanged())); + connect(ui->textEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), ui->textEditOption, SLOT(currentCharFormatChanged(QTextCharFormat))); + + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(displayTime())); + timer->start(1000); + airPushTimer = new QTimer(this); + connect(airPushTimer, SIGNAL(timeout()), this, SLOT(airPushingProcess())); + timerShowItem = new QTimer(this); + connect(timerShowItem, SIGNAL(timeout()), this, SLOT(onShowAndHideItem())); +// if(sysPara->para.EditMode==SCENE) +// { +// timerShowItem->start(10); +// } + + printintFlag = false; + startPrintingFlag = false; + + connect(ui->labelProductCnt,SIGNAL(pressed()),this,SLOT(onLabelProductCntPressed())); + connect(ui->labelTotalProductCnt,SIGNAL(pressed()),this,SLOT(onLabelTotalProductCntPressed())); + connect(ui->textEditOption->getPushButtonPreview(),SIGNAL(pressed()),this,SLOT(onPushButtonPreviewPressed())); + + connect(ui->textEditOption,SIGNAL(fileNameChanged(QString)),ui->labelOpenedFileName,SLOT(setText(QString))); + connect(ui->textEditOption,SIGNAL(fileNameChanged(QString)),this,SLOT(changeTxtMode(QString))); + + connect(ui->textEditOption,SIGNAL(PicfileNameOpen(QString,bool)),this,SLOT(openPicFIleOpen(QString,bool))); // 由TEXTOPTION界面按键触发 + connect(ui->pushButtonTXTOpen,SIGNAL(clicked()),ui->textEditOption,SLOT( showDlg())); + connect(ui->pushButtonCNTResetNow,SIGNAL(pressed()),this,SLOT(onPushButtonCNTResetNowPressed())); +#ifdef _2DCODE_ + connect(ui->pushButtonEditBarCode,SIGNAL(pressed()),this,SLOT(onEditBarCode())); + connect(ui->pushButtonQREnCode,SIGNAL(pressed()),this,SLOT(onEditQRCode())); + + connect(ui->textEditOption, SIGNAL(fontSizeChange(int)), barcode, SLOT(setFontSize(int))); + connect(barcode,SIGNAL(onBarCodeClose()),this,SLOT(onBarCodeClose())); + connect(dlgqrcode,SIGNAL(onQRCodeCloseNow()),this,SLOT(onQRCodeClose())); +#endif + connect(this,SIGNAL(ShowWarnningText(QString,QString)),this,SLOT(ShowWarnningText1(QString,QString))); + + msgtest = new QMessageBox(this); + connect(msgtest, SIGNAL(finished(int)), this, SLOT(OnFinished(int))); + + //QFile file(SYS_ROOT_DIR"UseEn"); + if( Public::ReadLanguageName()!="Chinese") + { + ui->pushButtonStartPrint->setIcon(QIcon(":/icon/Estartprint2.png")); + //ui->pushButtonPausePrint->setIcon(QIcon(":/icon/Epauseprint2.png")); + ui->pushButtonStopPrint->setIcon(QIcon(":/icon/EstopPrint2.png")); + if(Public::ReadLanguageName()=="Thai"){ + ui->pushButtonStartPrint->setIcon(QIcon(":/icon/Estartprint3.png")); + ui->pushButtonStopPrint->setIcon(QIcon(":/icon/EstopPrint3.png")); + } + } + // 立即清零 +#ifdef ENGLISH + ui->pushButtonStartPrint->setIcon(QIcon(":/icon/Estartprint2.png")); + ui->pushButtonPausePrint->setIcon(QIcon(":/icon/Epauseprint2.png")); + ui->pushButtonStopPrint->setIcon(QIcon(":/icon/EstopPrint2.png")); +#endif + +#ifndef CLEARCNTNOW + ui->pushButtonCNTResetNow->hide(); +#endif + fileChange=true; + pushButtonFlag = true; + + if(sysPara) + { + sysPara->status.FileChangeRestCntFlag=0; + } + + Public::derivePixelSizeFromHeight(12); +#if 1 + pPicScene = new PicScene(this); + pPicScene->setSceneRect(QRectF(0, 0, 3200, MAX_PRINT_ROW_NUM)); + //ui->fileSceneViewer->pView->setScene((QGraphicsScene *)pPicScene); + ui->graphicsView->setScene(pPicScene); + ui->graphicsView->centerOn(0,0); + ui->senceEditOption->bindScene(pPicScene, ui->graphicsView, ui->textEdit); + ui->senceEditOption->bindStackWidget(ui->stackedWidgetOption,ui->stackedWidgetText); + //connect(ui->senceEditOption,SIGNAL(addPicTextItem()),this,SLOT(onAddPicTextItem())); + //connect(ui->senceEditOption,SIGNAL(importFile(QString)),this,SLOT(onSceneImport(QString))); + //connect(ui->senceEditOption,SIGNAL(delItem()),this,SLOT(onDeleteItem())); + //connect(ui->senceEditOption,SIGNAL(saveScene(QString)),this,SLOT(onSaveScene(QString))); + //connect(ui->senceEditOption,SIGNAL(openSceneFile(QString)),this,SLOT(onOpenSceneFile(QString))); + connect(ui->senceEditOption,SIGNAL(generateQRCode(QString)),this,SLOT(onGenerateQRCode(QString))); + connect(ui->senceEditOption,SIGNAL(previewScene()),this,SLOT(onPreviewScene())); + //connect(ui->senceEditOption,SIGNAL(editItem()),this,SLOT(onEditItem())); + //connect(ui->textEditOption,SIGNAL(scenefileOpen(QString)),this,SLOT(onOpenSceneFile(QString))); + connect(ui->textEditOption,SIGNAL(scenefileOpen(QString,bool)),ui->senceEditOption,SLOT(onFileOpen(QString,bool))); + connect(this,SIGNAL(scenefileOpen(QString,bool)),ui->senceEditOption,SLOT(onFileOpen(QString,bool))); + connect(ui->senceEditOption,SIGNAL(editItemMode()),ui->textEditOption,SLOT(onEditItemMode())); + //connect(ui->textEditOption,SIGNAL(editItemDone()),this,SLOT(onEditItemDone())); + connect(ui->textEditOption,SIGNAL(editItemDone()),ui->senceEditOption,SLOT(onEditItemDone())); + + connect(ui->senceEditOption,SIGNAL(fileNameChanged(QString)),ui->labelOpenedFileName,SLOT(setText(QString))); + connect(ui->senceEditOption,SIGNAL(fileNameChanged(QString)),this,SLOT(changeTxtMode(QString))); + +// connect(ui->scrollArea->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(update_scroll())); + //qDebug()<<"viewer size"<graphicsView->size(); + //ui->graphicsView->setSizePolicy(QSizePolicy::Fixed); +#endif + +// ui->textEditOption->modbus_insert_pic("/home/plg/doc/QR_aa.bmp"); + +#if 0 + qDebug()<<"edit size heigh:"<stackedWidgetText->size().height()<<"edit size width:"<stackedWidgetText->size().width(); + qDebug()<<"edit geometry bottomLeft:"<stackedWidgetText->geometry().bottomLeft(); + qDebug()<<"edit geometry height:"<stackedWidgetText->geometry().height(); + qDebug()<<"edit geometry x:"<stackedWidgetText->geometry().x(); + qDebug()<<"edit geometry y:"<stackedWidgetText->mapToGlobal(ui->stackedWidgetText->pos()); +#endif + m_2sFlag = false; + moveToThread(&ShowThead); + //connect(&ShowThead, SIGNAL(started()), this, SLOT(onShowAndHideItem()),Qt::QueuedConnection); + //ShowThead.start(); + ui->pushButtonStart->setHidden(true);//屏蔽紧急停机按钮 +// if(PrintDatafile.exists()) PrintDatafile.remove(); +// if(!PrintDatafile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看 +// //QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") ); +// } +} + +MainWindow::~MainWindow() +{ + disconnect(&ShowThead, SIGNAL(started()), this, SLOT(onShowAndHideItem())); + if (ShowThead.isRunning()) { + ShowThead.quit(); + ShowThead.wait(); + } + + delete ui; + delete timer; + delete pPicScene; + +} + +/*显示当前系统时间 */ +void MainWindow::displayTime() +{ + if(sysPara){ +// sysPara->status.productCnt = 123; +// sysPara->status.lastProductCnt = sysPara->status.productCnt ; //这会让产品计数显示出来 +// qDebug()<<"sysPara->status.productCnt="<status.productCnt; +#ifdef BOART_TEMP_DEVICE + if(1) + { + if(sysPara->devOp->GetTemp(BOART_TEMP_DEVICE, (quint8 *)&sysPara->status.boardTemp) !=-1) + { + ui->labelCurrentTime->setText(tr("机箱:")+QString().sprintf("%d ",sysPara->status.boardTemp)+"°C"); // 主板温度 + } + } + else +#endif + { + ui->labelCurrentTime->setText(tr("机箱:")+QString().sprintf("%d ",sysPara->status.AD_FIXED/4)+"°C"); // 机箱温度 + } + ui->labDate->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + //UpdateDateTimeQRCode(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + // ui->pushButtonCNTResetNow->setEnabled( sysPara->para.printTriggerMode != PRINT_TRIGGER_TIME ); + + static bool CleanUPEn=1,preCleanUP=0; + if(!sysPara->para.isCheckMagnet) + { + CleanUPEn = (sysPara->status.currReclaimTankPos<70) && (sysPara->status.statWarn & WARN_STATUS_HDINT); + } + else + { + CleanUPEn = (sysPara->status.currReclaimTankPos<70) ; + } + if(CleanUPEn != preCleanUP){ + ui->pushButtonCleanUP->setEnabled(CleanUPEn); + } + preCleanUP=CleanUPEn; + + //static int delayCount2 = 0; + if(m_2sFlag) + { + //++delayCount2; + //if(delayCount2 %10 ==5) + { + + sysPara->devOp->controlInkValve(!sysPara->devOp->isInkValveOpen()); //控制供墨阀开关 + //setRunStatus(tr("我已关闭供墨阀")); + } + + } + +#ifdef __ADC_INPUT__ + if(sysPara->status.boardTemp >= sysPara->para.FanTemperature) + { + //sysPara->devOp->controlFan1(1); + //sysPara->devOp->controlFan2(1); + } + else + { + //sysPara->devOp->controlFan1(0); + //sysPara->devOp->controlFan2(0); + } +#endif + + ///////自动设置喷头温度 +// if(sysPara->status.boardTemp <= 20) +// { +// sysPara->para.temperature = 38; +// } +// else if(sysPara->status.boardTemp > 20 && sysPara->status.boardTemp <26 ) +// { +// sysPara->para.temperature = 35; +// } +// else if(sysPara->status.boardTemp >= 26 && sysPara->status.boardTemp < 30 ) +// { +// sysPara->para.temperature = 32; +// } +// else if(sysPara->status.boardTemp >= 30 ) +// { +// sysPara->para.temperature = 20; +// } + QFile file("/dev/input/event1"); + if(!file.exists()) + { + QWSServer::setCursorVisible(false); + } + else + { + QWSServer::setCursorVisible(true); + } + } +} + +void MainWindow::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; + ui->textEditOption->bindSysPara(sysPara); + ui->widgetPrintTextDisplay->bindSysPara(sysPara); +#ifdef _2DCODE_ + barcode->bindSysPara(sysPara); + dlgqrcode->setSysPara(sysPara); + dlgqrcode->barCodeFlag = this->sysPara->para.qrOption.barCodeFlag; + dlgqrcode->SetOption((qrOption_t*)&sysPara->para.qrOption); +#endif +#ifdef PICSCENE + ui->senceEditOption->bindSysPara(sysPara); +#endif +} + +void MainWindow::updateSysParaToUI(){ + if(sysPara){ + //nothing here + ui->textEditOption->updateSysParaToUI(); + } +} + +void MainWindow::applyUIPara(){ + if(sysPara){ + + } +} + +void MainWindow::CheckStatus(int Flag){ + if(sysPara){ + static unsigned int lastProductCnt=0; + int AutoCount=0; + int bcAutoCount=0; + static int lastMinutes = 0; + //QDate curDate=QDate::currentDate(); + int currMinutes = QDateTime::currentDateTime().time().minute(); + int usbDate = sysPara->status.ExpiryVarNum || sysPara->status.CurrDateVariNum ||sysPara->status.classVariNum; + if(usbDate) + { + //qDebug()<<"CheckStatus"; + bool needSendPrintData=false; + //if(sysPara->print.CurDateVar.endRowPos && (sysPara->print.CurDateVar.day != curDate.day())) + if (sysPara->status.ExpiryVarNum && (lastMinutes != currMinutes)) + { + ExpiryDotUpdate(1); + needSendPrintData = true; + } + //if(sysPara->print.ExpiryVar.endRowPos && (sysPara->para.ExpiryDay != r_ExpiryDay)) + if(sysPara->status.CurrDateVariNum && (lastMinutes != currMinutes)) + { + ExpiryDotUpdate(2); + needSendPrintData = true; + } + if(sysPara->status.classVariNum && (lastMinutes != currMinutes)) + { + ExpiryDotUpdate(3); + needSendPrintData = true; + } + lastMinutes = currMinutes; + //sysPara->print.CurDateVar.day = curDate.day(); + if(needSendPrintData) + { + sysPara->status.ExpiryDispUpdate=10; + SendPrintDataToFpga(0); + } + //if(ui->stackedWidgetText->currentWidget()==ui->pagePrintTextDisplay) + // ui->widgetPrintTextDisplay->update(); + //sysPara->status.ExpiryDispUpdate=1; + + } + if(sysPara->status.productCnt != lastProductCnt) + //if( sysPara->para.calandar_and_dat.cnt1CurrValue != sysPara->para.qrOption.counter ) + { + lastProductCnt = sysPara->status.productCnt; + //sysPara->para.qrOption.counter = sysPara->status.productCnt ; + //sysPara->para.qrOption.counter ++;//= sysPara->para.calandar_and_dat.cnt1CurrValue; + sysPara->para.qrOption.counter +=sysPara->para.qrOption.CntInc; + //if(sysPara->para.qrOption.counter% 60) sysPara->para.qrOption.counter+=40; + + AutoCount = (sysPara->status.QRvariNum?1:0); + //bcAutoCount = (sysPara->status.BCvariNum?1:0); +#ifdef MYARMTEST + qDebug()<<"CheckStatus:"<para.qrOption.counter<status.productCnt<para.qrOption.counter <status.QRvariNum; + } + //else qDebug()<<"P:"<status.productCnt; + + if( sysPara->para.qrOption.RecFromHost || AutoCount ) + { + sysPara->para.qrOption.RecFromHost=0; + sysPara->para.qrOption.type = sysPara->print.QRvars[0].type; + sysPara->para.qrOption.height = sysPara->print.QRvars[0].height; + sysPara->para.qrOption.width = sysPara->print.QRvars[0].width; + + if(ui->stackedWidgetText->currentWidget()==ui->pagePrintTextDisplay) + { + onUpdateDispQRCode(1); // 更新二维码显示 + //qDebug()<<"PN:"<status.LightUpCnt ++ ; + if((sysPara->status.LightUpCnt%3) == 0){ + if(printintFlag && startPrintingFlag && !sysPara->status.RedLightOnFlag && !sysPara->status.YellowLightOnFlag){ + //if(printintFlag && startPrintingFlag && !sysPara->status.RedLightOnFlag){ //打印状态指示灯 + sysPara->status.GreenLightOnFlag = true; + } + else{ + sysPara->status.GreenLightOnFlag = false; + sysPara->devOp->controlGreenLight(false); + //sysPara->devOp->controlGreenLight(true); + } + if(sysPara->status.GreenLightOnFlag){ //报警会时有时无 + if(!sysPara->para.isCheckPrintLight) + { + sysPara->devOp->controlGreenLight(!sysPara->devOp->isGreenLightEnable()); + } + else + { + sysPara->devOp->controlGreenLight(true); + } + } + } + if(sysPara->status.circleProductCnt && (sysPara->status.productCnt >= sysPara->para.cnt1EndValue)) + { + if(sysPara) + { + sysPara->devOp->clearProductCnt(3 | 0x10);// [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt = 0; + } + } + } + + } +} + + +void MainWindow::RefreshStatusLight(){ + if(sysPara){ + +#ifdef DEBUG1 + sysPara->status.statWarn =0| WARN_STATUS_HDINT;//sysPara->status.statWarn; + enablePrintButton(true); +#endif +#ifndef SYS_LINUX + sysPara->status.statWarn =0;//sysPara->status.statWarn; + enablePrintButton(true); +#endif + + + //ui->pushButtonCleanUP->setEnabled( (sysPara->status.currReclaimTankPos<70) && (sysPara->status.statWarn & WARN_STATUS_HDINT)); // sysPara->status.currReclaimTankPos +#ifdef __HV_FOR_WANG_DEBUG__ /* 盖上喷头盖,启动高压 */ + static int hdint = 0; + static int reclainTankReachEnd = 0; + //int curr_swit = !(sysPara->status.statWarn & WARN_STATUS_INK_SWINT);// curr_swit墨线开关 1->开, 0->关 + if((!(sysPara->status.statWarn & WARN_STATUS_HDINT)) && (hdint == 0)) { //喷头盖由开变关 + if (sysPara->status.reclainTankReachEnd) { +#if 0 + int actHvAmp = sysPara->para.HighVoltageAmplitude; + float tempHvAmp;// = sysPara->para.HighVoltageAmplitude * 1.73; + if(sysPara->para.HighVoltageAmplitude == 0) { + tempHvAmp = 0; + } + else if(sysPara->para.HighVoltageAmplitude == 1) { + tempHvAmp = 63.5; + } + else { + tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 0.51; + } + sysPara->para.HighVoltageAmplitude = (unsigned char)tempHvAmp; +#endif + sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); +#if 0 + sysPara->para.HighVoltageAmplitude = actHvAmp; +#endif + } + } + hdint = !(sysPara->status.statWarn & WARN_STATUS_HDINT); + + if(sysPara->status.reclainTankReachEnd && reclainTankReachEnd == 0) { //开回收槽到底 + if (!(sysPara->status.statWarn & WARN_STATUS_HDINT)) { //喷头盖是关闭的状态 +#if 0 + int actHvAmp = sysPara->para.HighVoltageAmplitude; + float tempHvAmp;// = sysPara->para.HighVoltageAmplitude * 1.73; + if(sysPara->para.HighVoltageAmplitude == 0) { + tempHvAmp = 0; + } + else if(sysPara->para.HighVoltageAmplitude == 1) { + tempHvAmp = 63.5; + } + else { + tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 0.51; + } + sysPara->para.HighVoltageAmplitude = (unsigned char)tempHvAmp; +#endif + sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); +#if 0 + sysPara->para.HighVoltageAmplitude = actHvAmp; +#endif + } + } + reclainTankReachEnd = sysPara->status.reclainTankReachEnd; +#endif + + if(sysPara->status.lastStatWarn != sysPara->status.statWarn){ + if(!(sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){//墨线开关 + ui->labelStatusInkSwint->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + else { + ui->labelStatusInkSwint->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + } + + if(!(sysPara->status.statWarn & WARN_STATUS_HDINT)){//喷头盖 + ui->labelStatusHDINT->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + + if(printintFlag && startPrintingFlag) + setRunStatus(tr("正在喷印...............")); + } + else { + ui->labelStatusHDINT->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + if(printintFlag && startPrintingFlag) + setRunStatus(tr("喷头盖开, 喷印无法正常进行!!!")); + } + + + if(!(sysPara->status.statWarn & WARN_STATUS_SUMP_WARN)){ //液位渗漏,高电平警告 + ui->labelStatusInkLeak->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + else { + ui->labelStatusInkLeak->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + strTitle = tr("墨水缸满报警"); + if(sysPara->devOp->isMixValveOpen()) { + sysPara->devOp->controlMixValve(false); //关掉混合阀 + } + } + if(!(sysPara->status.statWarn & WARN_STATUS_INK_WARN)){ + ui->labelStatusInkWaterLevel->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + else { + ui->labelStatusInkWaterLevel->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + strTitle = tr("墨水液位报警"); + + + } + if(!(sysPara->status.statWarn & WARN_STATUS_SOLV_WARN)){ + ui->labelStatusSolvLevelWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + else { + ui->labelStatusSolvLevelWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + strTitle = tr("溶剂液位报警"); + + } + + if(!(sysPara->status.statWarn & WARN_STATUS_RECYCLE_FAULT) ){ + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + + } + else { + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + + } + + //static int HVfaultCnt=0; + if(!(sysPara->status.statWarn & WARN_STATUS_POWER_MON)){ + if(!sysPara->status.lastHighVoltageFault) + { + ui->labelStatusHighVoltageFault->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + // HVfaultCnt=0; + //sysPara->status.HVFaultCloseEn=0; + } + else { + ui->labelStatusHighVoltageFault->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + #ifndef DEBUG1 + if(startPrintingFlag && printintFlag){ //已经在打印,则暂停打印 2013-9-15高压报警停止充电 + on_pushButtonPausePrint_pressed(); + LogInfo::setRunStatusText(tr("高压故障,暂停打印")); + setRunStatus(tr("高压故障,暂停打印")); + + strTitle = tr("高压故障,暂停打印."); + + sysPara->status.lastHighVoltageFault = true; + } + + + #endif + //if(HVfaultCnt<9)HVfaultCnt++; + //else{ + if((sysPara->status.currReclaimTankPos != 0) && sysPara->para.HVFaultCloseEn ) + { + //HVfaultCnt++; + // 高压故障关回收槽 + if(sysPara->status.HVFaultCloseEn==0){ + sysPara->status.reclaimTankBlockedAppending=0; + sysPara->status.reclaimCloseCnt=100; + on_pushButtonReclaimTankClose_pressed(); + sysPara->status.reclaimTankBlockedAppending=1; + LogInfo::setRunStatusText(tr("高压故障,关回收槽")); + setRunStatus(tr("高压故障,关回收槽和墨线")); + } + sysPara->status.HVFaultCloseEn=1; + } + //} + } + + } + + + //if(sysPara->status.viscosityDelayCnt) + //ui->label_3->setText( QString::number(sysPara->status.viscosityDelayCnt/100,10) );//labViscoCnt + + /*-----------------------------------------------------------------------------------*/ + sysPara->status.lastStatWarn = sysPara->status.statWarn; + if(sysPara->status.lastViscosityFault != sysPara->status.viscosityFault){ + if(sysPara->status.viscosityFault==0){ + ui->labelStatusViscosityWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + else { + if(sysPara->status.viscosityFault==1){ + + ui->labelStatusViscosityWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + + } + else if(sysPara->status.viscosityFault==2) { + ui->labelStatusViscosityWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMYellow.PNG"))); + + } + } + } + sysPara->status.lastViscosityFault = sysPara->status.viscosityFault; + /*-----------------------------------------------------------------------------------*/ + //updatePhaseIndicatorLight(); //此部分工作交给InkJetPrinter的来做了 + + + if(!(sysPara->status.statWarn & WARN_STATUS_RECYCLE_FAULT)){ //20140211 nie + if(sysPara->status.RecycleWarnCnt) + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + sysPara->status.RecycleWarnCnt = 0; + sysPara->status.lastRecycleWarn = 0; + } +#ifdef RETANKACK + else { + if(sysPara->status.RecycleWarnCnt==0) ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + if(( sysPara->status.currReclaimTankPos/10 < sysPara->para.reclaimTankTime*0.85 ) | (sysPara->status.statWarn & WARN_STATUS_HDINT) ) + sysPara->status.RecycleWarnCnt=0; + if(!sysPara->status.lastRecycleWarn && !sysPara->status.isPumpValveControledByHand && sysPara->status.selfCheckDone){ + if(sysPara->para.RecycleWarnAction && startPrintingFlag && printintFlag ) + on_pushButtonStopPrint_pressed(); + if(sysPara->status.RecycleWarnCnt > 10) + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + + if(sysPara->status.RecycleWarnCnt > RECYCLE_WARN_DELAY){ + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + if(sysPara->para.RecycleWarnAction){ + sysPara->status.lastRecycleWarn = 1; + if((sysPara->status.currReclaimTankPos != 0) && !sysPara->devOp->isReclaimTankCloseEnable()){ + on_pushButtonReclaimTankClose_pressed(); + LogInfo::setRunStatusText(tr("回收故障,关闭回收槽,关墨线")); + setRunStatus(tr("回收故障,关闭回收槽,关墨线")); + //ui->labelStatusInkSwint->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + + } + } + } + else{ + sysPara->status.RecycleWarnCnt ++ ; + } + // + } + else { + //sysPara->status.RecycleWarnCnt=0; + } + } +#else + else { + if(!sysPara->status.lastRecycleWarn && !sysPara->status.isPumpValveControledByHand && sysPara->status.selfCheckDone) + { + if(sysPara->status.RecycleWarnCnt > RECYCLE_WARN_DELAY) + { + sysPara->status.lastRecycleWarn = RECYCLE_WARN_DELAY; + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + sysPara->status.reclaimCloseCnt=100; + if(sysPara->para.RecycleWarnAction) + { + if((sysPara->status.currReclaimTankPos != 0) && !sysPara->devOp->isReclaimTankCloseEnable()){ + on_pushButtonStopPrint_pressed(); + on_pushButtonReclaimTankClose_pressed(); + LogInfo::setRunStatusText(tr("回收故障,关闭回收槽,关墨线")); + setRunStatus(tr("回收故障,关闭回收槽,关墨线")); + //ui->labelStatusInkSwint->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + + + } + } + else setRunStatus(tr("回收故障.")); + + } + else + { + sysPara->status.RecycleWarnCnt ++ ; + ui->labelStatusRecycleWarn->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMYellow.PNG"))); + if(sysPara->status.RecycleWarnCnt%10==9) + LogInfo::setRunStatusText(tr("回收异常,墨线可能偏离.(%1)").arg(sysPara->status.RecycleWarnCnt)); + } + } + else if(sysPara->status.lastRecycleWarn)sysPara->status.lastRecycleWarn--; + } +#endif + +#ifdef MIMA + if(sysPara->status.WorkTimeOut) { + + if( printintFlag) on_pushButtonStopPrint_pressed(); + else sysPara->devOp->printCtrl( PRINT_CTRL_STOP); + setRunStatus(tr("维护时间已到,喷码机停止工作!")); + } +#endif + //ui->labelCurrentTime->setText( QString().sprintf("c:%d,s:%d",sysPara->status.RecycleWarnCnt,sysPara->status.reclaimTankstatus) ); + /*-----------------------------------------------------------------------------------*/ + +// sysPara->status.LightUpCnt ++ ; +// if((sysPara->status.LightUpCnt%3) == 0){ +// if(printintFlag && startPrintingFlag && !sysPara->status.RedLightOnFlag && !sysPara->status.YellowLightOnFlag){ //打印状态指示灯 +// sysPara->status.GreenLightOnFlag = true; +// } +// else{ +// sysPara->status.GreenLightOnFlag = false; +// sysPara->devOp->controlGreenLight(false); +// } +// if(sysPara->status.GreenLightOnFlag){ //报警会时有时无 +// sysPara->devOp->controlGreenLight(!sysPara->devOp->isGreenLightEnable()); +// } +// } + + + if(ui->labelRunStatus->text().length()<4){ + if(startPrintingFlag ){ + if(printintFlag) + setRunStatus(tr("正在喷印...............")); + else + setRunStatus(tr("暂停喷印...............")); + } + } + +// 20160620 新增主界面显示:压力,粘度,隔膜位置,晶振电压数,相位 + + + //ui->labPress->setText(QString("%1").arg(sysPara->status.PRESSURE)); + //ui->labViso->setText(QString("%1").arg(sysPara->status.viscosity) ); + //ui->labPosition->setText(QString("%1").arg(sysPara->status.SEPTAL_POSITION)); + //ui->labOscVol->setText(QString("%1").arg(sysPara->para.oscillatorVoltage) ); + + ui->labPress->setText(QString("%1/%2").arg(sysPara->status.PRESSURE).arg(sysPara->para.pressure)); + ui->labViso->setText(QString("%1/%2").arg(sysPara->status.viscosity).arg(sysPara->para.viscosity) ); + if(sysPara->para.gearPumpEnable) + { + ui->labPosition->setText(QString("%1").arg(sysPara->status.gearPumpRunSpeed)); + } + else + { + ui->labPosition->setText(QString("%1/%2").arg(sysPara->status.SEPTAL_POSITION).arg(sysPara->para.septalPostion) ); + } + //ui->labOscVol->setText(QString("%1").arg(sysPara->para.oscillatorVoltage) ); + ui->labOscVol->setText(QString::number(sysPara->status.HV_DETOUT) + "/" + QString::number(sysPara->para.maxHighVoltageDAC)); + //ui->labOscVol->setText(QString::number(sysPara->status.HV_DETOUT) + "/" + "600"); + + + } +} + + +bool MainWindow::updatePhaseIndicatorLight(){ + + if(sysPara<0) return 0; + + if(dlgMyWarringShowDlyCnt)dlgMyWarringShowDlyCnt--; + if(dlgMyWarringShowDlyCnt==1) dlgMyWarring.hide(); + + /*------------------------------------------喷头盖未关或回收槽未全部打开的时候不报相位故障-------------------------------------------------*/ + if((!sysPara->status.flight_tm_error && !sysPara->status.detect_phase_error) || (sysPara->status.statWarn & WARN_STATUS_HDINT) || !sysPara->status.reclainTankReachEnd){ + //故障后必须等手动按故障恢复才会继续 + if(!sysPara->para.suspendAfterPhaseFault && !sysPara->para.powerOffAfterPhaseFault){ + if(sysPara->status.lastPhaseFault){ + sysPara->status.lastPhaseFault = 0; + ui->labelStatusChargefault->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + } + } + sysPara->status.phaseErrorCnt = 0; + } + else { + if(sysPara->status.phaseErrorCnt < 10) + sysPara->status.phaseErrorCnt ++ ; + else { + if(!sysPara->status.lastPhaseFault){ + ui->labelStatusChargefault->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMRed.PNG"))); + sysPara->status.lastPhaseFault = 1; + if(sysPara->status.flight_tm_error) + { + LogInfo::setRunStatusText(tr("相位故障:飞行时间错误!")); + } + if(sysPara->status.detect_phase_error) + { + LogInfo::setRunStatusText(tr("相位故障:相位检测错误!")); + } + + } + if(sysPara->para.powerOffAfterPhaseFault ){ + if(!sysPara->status.powerOffAfterPhaseFaultAppending){ + sysPara->status.powerOffAfterPhaseFaultAppending = 1; + _on_pushButtonPowerOff_pressed(false); + LogInfo::setRunStatusText(tr("相位故障,准备关机")); + setRunStatus(tr("相位故障,准备关机")); + strTitle = tr("相位故障,准备关机"); + + + } + } + else if(sysPara->para.suspendAfterPhaseFault){ + if(sysPara->para.stopCounterMeterAfterFault){ + if(startPrintingFlag && printintFlag){ //已经在打印,则暂停打印 + on_pushButtonPausePrint_pressed(); + LogInfo::setRunStatusText(tr("相位故障,暂停打印")); + setRunStatus(tr("相位故障,暂停打印")); + strTitle = tr("相位故障,暂停打印"); + + } + } + else if(!sysPara->status.DACDisable){ + sysPara->devOp->printCtrl(PRINT_CTRL_DAC_DISABLE); + sysPara->status.DACDisable = true; + LogInfo::setRunStatusText(tr("相位故障,屏蔽DAC输出")); + setRunStatus(tr("相位故障,屏蔽充电")); + strTitle = tr("相位故障,屏蔽充电"); + + } + + } + } + } + + + return sysPara->status.lastPhaseFault; +} + +void MainWindow::updateSysStatusToUI(){ + + if(sysPara){ + if(sysPara->para.gearPumpEnable) + { + ui->label_11->setText(tr("齿轮泵转速")); + } + else + { + ui->label_11->setText(tr("隔膜位置")); + } + RefreshStatusLight(); + if(sysPara->status.lastProductCnt != sysPara->status.productCnt){ //产品计数 + ui->labelProductCnt->setText(QString::number(sysPara->status.productCnt)); + updateTotalCnt(0); + /* qDebug()<<"total_syn_pulse_num" //<status.productCnt) + << QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16) + << (unsigned int)(sysPara->status.total_syn_pulse_num) + << (unsigned int)(sysPara->status.volGap_pulse_num); */ + + + } + if(sysPara->status.ExpiryDispUpdate >0 ) + { + sysPara->status.ExpiryDispUpdate--; + ui->widgetPrintTextDisplay->update();// 2018.5.25 + } + if(sysPara->para.alterPrint.enable==1) ui->labelXFileName->setText (tr("交替打印")); + else if(sysPara->para.alterPrint.enable==2) ui->labelXFileName->setText (tr("电眼交替")); + else ui->labelXFileName->setText (""); + /*--------------------------------------------------------------------------*/ + //if(sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER && printintFlag){ //同步器速度 + if(( + (sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + ||(((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL) + ||(sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + )&& sysPara->para.eleEyeTriggerSynPrintEn) + ) + )//&&printintFlag + { + if(sysPara->para.synPulseNumPerMm) { + + unsigned int tmp = ((unsigned int) sysPara->status.synPulseCntPer1s ) & 0xffffff; + unsigned int mm = tmp /sysPara->para.synPulseNumPerMm * 60; // 1min总脉冲/毫米脉冲数 = 1min走过的距离mm数 + int dotNum = sysPara->para.divideRatio?(FPGA_SYS_HZ/(sysPara->para.divideRatio*2)):0;// 1s时间内墨点数 (即晶振频率 64000) + int colNum = sysPara->para.dotNumPerCol?dotNum/sysPara->para.dotNumPerCol:0; // 第列可用墨点数 = 1s时间内墨点数/ 列需要墨点数 + int pulseNum = colNum*sysPara->para.synNumPerCol/(1<<8); //synNumPerCol是被放大后的值 + + int maxMM = 0; + if(!sysPara->para.charWidthSetEnable) + { + if( (sysPara->status.currPrintRow != 0) + && (sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + /*&& (sysPara->para.currPrintMode == FAST_PRINT || sysPara->para.currPrintMode == STANDARD_PRINT) */){ + maxMM = calculateMaxSpeed(pulseNum); + maxMM = maxMM *60; + if(sysPara->para.alterPrint.enable) + { + maxMM = maxMM * 2; + } + } + else + { + maxMM = (pulseNum/sysPara->para.synPulseNumPerMm) * 60;// 列的最大间距 + // qDebug()<< "[Info] OLD COUNT mm" << maxMM; + } + } + else + { + maxMM = (pulseNum/sysPara->para.synPulseNumPerMm) * 60;// 列的最大间距 + } + +#ifdef DEBUG2 + qDebug()<<"mm"<<"dotNum"<<"colNum"<<"pulseNum"<<"maxMM"<<"synNPCol"<<"divFre"; + qDebug()<para.synNumPerCol<para.divideRatio<para.dotNumPerCol; +#endif + ui->labelSynRate->setText(tr("%1.%2[%3.%4]米/分").arg(mm/1000).arg(mm%1000,3,10,QLatin1Char('0')) + .arg(maxMM/1000).arg(maxMM%1000,3,10,QLatin1Char('0'))); + } + else + ui->labelSynRate->setText(""); + sysPara->status.lastSynPulseCntPer1s = sysPara->status.synPulseCntPer1s; + } + else + ui->labelSynRate->setText(""); + + /*--------------------------------------------------------------------------*/ + if(sysPara->status.lastSynColDelay != sysPara->status.synColDelay){ +// if(sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + if((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + ||((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL + ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + && sysPara->para.eleEyeTriggerSynPrintEn)) + ui->labelSynColDelay->setText(tr("列延时:%1点").arg(sysPara->status.synColDelay)); + sysPara->status.lastSynColDelay = sysPara->status.synColDelay; + } + /*--------------------------------------------------------------------------*/ + if(!sysPara->status.fpgaVersionNum && !sysPara->status.lostCommuFlag){ //因为进入系统就会进主界面,马上就会将版本号读出 + sysPara->devOp->readFpgaVersionNum(); + if(sysPara->status.fpgaVersionNum){ + sysPara->devOp->writeFpgaPrintPara(true); + } + ui->labelFpgaVersionNum->setText(QString("%1/F%2.%3.%4").arg(SOFTWARE_VER_NUM).arg(0).arg(0).arg(0) ); + } + else{ + QString ARM_Version; + ARM_Version.sprintf("%d.%d.%02dS", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER); + ui->labelFpgaVersionNum->setText(QString("%1/F%2.%3.%4").arg(ARM_Version).arg(sysPara->status.fpgaVersionNum >> 12) + .arg((sysPara->status.fpgaVersionNum>>8) & 0x0f).arg(sysPara->status.fpgaVersionNum&0xff) ); + } + bool found_CNT1 = false; + bool found_CNT2 = false; + bool found_CNT3 = false; + /*--------------------------------------------------------------------------*/ + if(sysPara->status.variNum && (ui->stackedWidgetText->currentWidget() == ui->pagePrintTextDisplay)){ + + bool updatePrintTextDisplayFlag = false; + + for(int i = 0; i < sysPara->status.variNum; i++){ + int val = 0; + switch( Public::getType(sysPara->status.vars[i].type)) + { + case CALANDAR_YEAR:val = sysPara->status.calandar_and_dat.year;break; + case CALANDAR_MONTH:val = sysPara->status.calandar_and_dat.month;break; + case CALANDAR_DAY:val = sysPara->status.calandar_and_dat.day;break; + //case CALANDAR_WEEK:val = sysPara->status.calandar_and_dat.week;break; + + case CALANDAR_WEEK:val = sysPara->status.calandar_and_dat.week;break; + case CALANDAR_HOUR:val = sysPara->status.calandar_and_dat.hour;break; + case CALANDAR_MINUTE:val = sysPara->status.calandar_and_dat.minute;break; + case CALANDAR_SECOND:val = sysPara->status.calandar_and_dat.second;break; + +#ifdef DEBUG_CNT + case CALANDAR_CNT1:val = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,10).toInt();break; + case CALANDAR_CNT2:val = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,10).toInt();break; +#else + case CALANDAR_CNT1:val = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt();found_CNT1=true;break; + case CALANDAR_CNT2:val = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt();found_CNT2=true;break; +#endif + case CALANDAR_CNT3:val = QString::number(sysPara->status.Status_Counter3.cnt3CurrValue,16).toInt();found_CNT3=true;break; + + case RANDOMNUM : val = QString::number( sysPara->status.calandar_and_dat.RandomValue1, 16).toInt(); break; + //val = QString::number( sysPara->status.calandar_and_dat.RandomValue2 ,16).toInt(); + + case EXPIRYDATE: break; + default:qDebug() << "error,unknown variable type:" << sysPara->status.vars[i].type; + } + + if(sysPara->status.vars[i].currVal != val) + //{ + updatePrintTextDisplayFlag = true; + sysPara->status.vars[i].currVal = val; + //} + + } + if(updatePrintTextDisplayFlag) //减少不必要的刷新动作 + { + ui->widgetPrintTextDisplay->updateSysStatusToUI(); + } + } + emit setCNT1Select(found_CNT1); + emit setCNT2Select(found_CNT2); + emit setCNT3Select(found_CNT3); + if(sysPara->para.isEnableGetDataButton) + { + ui->pushButtonGetData->setEnabled(true); + } + else + { + ui->pushButtonGetData->setEnabled(false); + } + if(SIMULATE_PRINTING_MODE) + enablePrintButton(true); + + ui->label->setText(QString::number(sysPara->para.printTotalColNum)); + } +} + +void MainWindow::showPrintBitImage(){ + if(sysPara){ +// unsigned char *dat = sysPara->status.printDat; + unsigned char *dat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + for(int j = sysPara->status.currPrintCol - 1; j >= 0 ; j --){ + for(int i = 0; i < sysPara->status.currPrintRow; i++){ + if(dat[j*MAX_PRINT_ROW_BYTE_NUM + i/8] & (1<<(i%8))) + printf("1"); + else + printf(" "); + } + printf("\n"); + } + } +} + +//void MainWindow::on_pushButtonTXTOpen_pressed(){ + +//} + +void MainWindow::openPicFIleOpen(QString filePath,bool insertFlag) { + fileChange=true; +#ifdef TXTEDIT + ui->textEditOption->onFileOpenN(filePath,insertFlag); + emit setMainTabNow(0); +#else + Q_UNUSED(insertFlag); + + if(sysPara) { + + + + if(//filePath.endsWith(".gif") || filePath.endsWith(".jpeg") || + //filePath.endsWith(".jpg") || + // ||filePath.endsWith(".bmp") + filePath.endsWith(".png")) + { + QFile file(filePath); + if(!file.open(QIODevice::ReadOnly)){ + QMessageBox::warning(this,tr("警告"),tr("无法打开文件") + filePath); + return ; + } + else { + + QByteArray data = file.readAll(); + QTextCodec *codec = Qt::codecForHtml(data); + QString str = codec->toUnicode(data); + + if(filePath.startsWith(UDISK_DOC_ROOT_DIR)) + str.replace(DOC_ROOT_DIR,UDISK_DOC_ROOT_DIR); //做相应处理 + file.close (); + ui->PicWidgetDisp->loadImage (filePath,false); + ui->labelOpenedFileName->setText (QFileInfo(filePath).fileName()); + LogInfo::setRunStatusText(tr("打开文件:")+(QString)(QFileInfo(filePath).fileName())); + if(sysPara){ + //QString str1 =QFileInfo( filePath).fileName (); + sysPara->sysFile= PARA_ROOT_DIR+QFileInfo( filePath).baseName()+".dpn"; + sysPara->loadParaFromFile ();// 从磁盘读取参数文件 + emit openFileChange(); + // emit openFileChange(); + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",filePath.toAscii().constData()); + } + /* other action */ + PreviewPressed(); + + + if(sysPara->status.addSpace) + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol/2, sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow); + else ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol, sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow); + ui->stackedWidgetText->setCurrentWidget(ui->pagePrintTextDisplay); + ui->widgetPrintTextDisplay->setScaleRatio(3); + //ui->labelTextWidthHeight->setText(tr("[ %1行 x %2列 ]").arg(sysPara->status.currPrintRow).arg(sysPara->status.currPrintCol)); + } + } + } +#endif + +} + +void MainWindow::on_pushButtonGetData_pressed() +{ + emit getJSONData(); +} + +void MainWindow::onPushButtonPreviewPressed(){ + if(sysPara) + { + sysPara->para.EditMode = TXTFILE; + if(previewFlag==0) { +#ifdef SAVEWHENPREVIEW + if(ui->textEditOption->fileName.isEmpty()){ + QMessageBox::StandardButton ret = QMessageBox::Ok; + ret = QMessageBox::warning(this, tr("提示"), + tr("文件未保存,是否先保存文件!"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok) + { + ui->textEditOption->on_bottonSave_clicked(); + } + } + else + ui->textEditOption->on_bottonSave_clicked(); +#else + +#endif + PreviewPressed(); + } + } +} + + +int MainWindow::getVarStarRow(int x,int y,int h,int w,char *dat) +{ + int t_x_start_pos = x; + int t_x_end_pos = t_x_start_pos + w; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(t_x_end_pos > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + t_x_end_pos = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int t_y_start_pos = y - h/2; + //int t_y_end_pos = y ; + if(t_y_start_pos < 0) + t_y_start_pos = 0; + + for(int j=y - h/2;j>0;j--) + { + char startRowFound=0; + for(int i = t_x_start_pos; i < t_x_end_pos; i++) + { + if( (dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] & (1 << (j%8)))) + { + startRowFound=1; + dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] &=~ (1 << (j%8));//将画点取消掉 + } + } + if(startRowFound)continue; + t_y_start_pos=j+1; + // qDebug()<<"F:"<status.currPrintRow = 0; + sysPara->status.variNum = 0; + sysPara->status.QRvariNum = 0; + sysPara->status.ExpiryVarNum=0; +// unsigned char *dat = sysPara->status.printDat; +// memset(dat,0,sizeof(sysPara->status.printDat)); + unsigned char *dat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + LogInfo::setRunStatusText(tr("MaxCol4000: %1").arg(MaxCol4000)); + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + memset(dat,0,sizeof(sysPara->status.printDat_Normal)); + }else{ + dat =sysPara->status.printDat; + memset(dat,0,sizeof(sysPara->status.printDat)); + } + //qDebug()<<"Preview:"; +//////////////////////////////////////////////////////在这里清变量参数 + sysPara->status.ExpiryVarNum=0; + sysPara->status.CurrDateVariNum = 0; + sysPara->status.classVariNum = 0; + sysPara->print.ExpiryVar.startColPos = 0; + sysPara->print.ExpiryVar.endRowPos = 0; + sysPara->print.ExpiryVar.letterSpace =0; + sysPara->print.CurDateVar.startColPos = 0; + sysPara->print.CurDateVar.endRowPos = 0; + sysPara->print.CurDateVar.letterSpace = 0; + ///////////////////////////////////////////////////////////////// + if(sysPara->para.EditMode==PICFILE) + { + + ui->PicWidgetDisp->getPrintDat (dat,0,sysPara); + ui->PicWidgetDisp->readVar (sysPara,0); + + // qDebug ()<<"v-n1:"<status.variNum<<"v-nLeter1:"<status.vars[0].letterSpace<<"v-nLeter2:"<status.vars[1].letterSpace<<"v-nLeter3:"<status.vars[2].letterSpace; + sysPara->status.variNum=ui->PicWidgetDisp->getVarNum (); + sysPara->status.currPrintCol=ui->PicWidgetDisp->getWidth (); + sysPara->status.currPrintRow=ui->PicWidgetDisp->getPicRealHeight(); + + ui->PicWidgetDisp->getCharRamData(sysPara); + + //qDebug()<<"H0:"<PicWidgetDisp->getHeight()<PicWidgetDisp->getPicRealHeight(); + + } + // end of PICFILE + else if(sysPara->para.EditMode==TXTFILE)// TXTFLE + { + sysPara->status.addSpace = sysPara->para.checkSpace; + ontextEdittextChanged(); + coldot = (int)ui->textEdit->document()->size().width(); + if(coldot > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + { + coldot = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + QMessageBox::warning(this, tr("警告"), + tr("最多支持的列数目为:%1请减小信息长度.").arg((MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide))); + } + int maxPicHeight = MAX_PRINT_ROW_NUM + 12; + QSize size(coldot,maxPicHeight); + + sysPara->status.currPrintRow =0; +// qDebug()<<"currPrintCol="<status.currPrintCol<<" coldot="<textEdit->document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + + image.save("./printImage.bmp"); + //ui->widgetPrintTextDisplay + int firstRow = maxPicHeight; + /*--------------------------------------------------------------------------*/ + for(int j = 0; j < maxPicHeight; j++){ //计算首行位置 + for(int i = 0; i < coldot; i++){ + QRgb rgb = image.pixel(i,j); + if(rgb !=0x00ffffff )//& 0xff000000) + { + //qDebug()<maxPicHeight)?maxPicHeight:lastRow; + sysPara->status.ExpiryVarNum=0; + sysPara->status.CurrDateVariNum = 0; + sysPara->status.classVariNum = 0; + sysPara->print.ExpiryVar.startColPos = 0; + sysPara->print.ExpiryVar.endRowPos = 0; + sysPara->print.ExpiryVar.letterSpace =0; + sysPara->print.CurDateVar.startColPos = 0; + sysPara->print.CurDateVar.endRowPos = 0; + sysPara->print.CurDateVar.letterSpace = 0; + + //接下来就是要把打印到数据data填充以及确认变量的个数,变量对应的开始列和结束行 + for(int j = 0; j < lastRow - firstRow; j++){ // Y + for(int i = 0; i < coldot; i++){ // + QRgb rgb = image.pixel(i,j + firstRow); + if(rgb&0x80000000) { //判断alpha,rgb<0xFFE0E0E0->过滤偏白背景 + //if((rgb & 0xffffff) == 0xff0000) {j=40; break;} + if((rgb & 0xf0f0ff) == 0xf0f000){ //处理变量, 查找左下角,因为同一行的左下角是对齐的 看起来这个颜色是黄色 + + bool foundvar=0; + if(j>0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0xf0f0ff) != 0xf0f000 ){foundvar =1;} + //QRgb r_rgb = image.pixel(i,j + firstRow-1);if((r_rgb & 0xf0f0ff) == 0xf0f000 )foundvar =0; + } + if(foundvar){ + if(sysPara->status.variNum < MAX_VARI_NUM){ + sysPara->status.vars[sysPara->status.variNum].startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->status.vars[sysPara->status.variNum].endRowPos = j; + if(varLastRowstatus.variNum ++;TempVarNum++; + i+=5; + //qDebug()<<"VARr:"<status.QRvariNum>=4)continue; + if((rgb & 0x00ffff0) == 0x00ff10) { //MDT + sysPara->print.QRvars[sysPara->status.QRvariNum].type=MDT; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00ffff0) == 0x00ff20) { //QR + //qDebug()<<"FLAG:"<print.QRvars[sysPara->status.QRvariNum].type=QR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + //qDebug()<<"qr start row:"<print.QRvars[sysPara->status.QRvariNum].startColPos; + //qDebug()<<"qr end row:"<print.QRvars[sysPara->status.QRvariNum].endRowPos; + + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00fffff0) == 0x00ff30) { //BAR + sysPara->print.QRvars[sysPara->status.QRvariNum].type=BAR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + + if(varLastRowstatus.QRvariNum++; + + } + if(sysPara->status.QRvariNum>=4)sysPara->status.QRvariNum=4; + + } + //else if((rgb & 0xfffff0)==0xff00f0) + else if((rgb & 0x00ffffff)==EXPIRY_VARI_RECONISE) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + bool foundExVar=0; + if(j>0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0x00ffffff) != EXPIRY_VARI_RECONISE ){foundExVar =1;} + } + if(foundExVar) + { + qDebug()<<"expiryVar:"; + //if(sysPara->status.ExpiryVarNum <3) + { + sysPara->print.ExpiryVar.startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->print.ExpiryVar.endRowPos = j; + if(varLastRowstatus.ExpiryVarNum == 0) + sysPara->status.ExpiryVarNum ++; + i+=10; + } + //else TempVarNum++; + //dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + } + else if((rgb & 0xfffff0)==0xff0cf0) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + //qDebug()<<"before found CurDateVar:"<0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0xfffff0) != 0xff0cf0 ){foundExVar =1;} + } + if(foundExVar) + { + qDebug()<<"found CurDateVar:"; + //if(sysPara->status.ExpiryVarNum <2) + { + sysPara->print.CurDateVar.startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->print.CurDateVar.endRowPos = j; + if(varLastRowstatus.CurrDateVariNum == 0) + sysPara->status.CurrDateVariNum ++; + i+=10; + } + + //else TempVarNum++; + //dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + } + //else if((rgb & 0xffffff)==0x0032c8) + else if((rgb & 0x0000ff)>0x0000c0 && (rgb & 0x00ff00)>0x002F00 && (rgb & 0x00ff0000)==0x00000000) + { + //qDebug()<<"before found class:"<status.classVariNum <3) + { + EXPIRYVAR_t *currCLass = &sysPara->print.ClassVari ; + currCLass->startColPos = i+(sysPara->status.addSpace?i:0); + if (currCLass->startColPos>1) + currCLass->startColPos = currCLass->startColPos - 1; + currCLass->endRowPos = j; + if(varLastRowstatus.classVariNum == 0) + sysPara->status.classVariNum ++; + i+=5; + } + } + } + else { //Y = 0.299*R' + 0.587*G' + 0.114*B + int y = (((rgb&0xff)*299 + ((rgb>>8)&0xff)*587 + ((rgb>>16)&0xff)*114))/1000; + if(y < 125 ) { + dat[MAX_PRINT_ROW_BYTE_NUM*(i+(sysPara->status.addSpace?i:0)) + j/8] |= 1 << (j%8); //画黑点 + + if((j+1) > sysPara->status.currPrintRow) { + sysPara->status.currPrintRow = j+1; + //qDebug()<<"dddd currPrintRow:"<< sysPara->status.currPrintRow; + } + + } + } + }/*判断alpha end*/ + } + } + + // var + //qDebug() <<"VarNum"<8){ + setRunStatus(tr("变量数大于8个,某些变量将不起作用!!!")); + strTitle= tr("变量数大于8个,某些变量将不起作用!!!"); + strTitle.append("\r\n"); + strTitle.append(tr("请减少信息中的变量(或计数器)数量.")); + QMessageBox::warning(this, tr("警告"),strTitle,QMessageBox::Ok); + } + + //qDebug()<status.vars[0].startRowPos<status.vars[0].endRowPos<< sysPara->status.currPrintRow; + // ==============查找QRV, DMTV,BARV 变量 MAX_QVARI_NUM + //qDebug()<<"qrvar"<status.QRvariNum; + searchQrVar(); + //if(sysPara->status.ExpiryVarNum) + searchExpiryVar(); + //ui->widgetPrintTextDisplay->update(); + //=============== + if(sysPara->status.variNum){ + // + /*--------------------------------提取变量------------------------------------------*/ + QString pattern = ""; + + QRegExp rx(pattern); + QString textHtml = ui->textEdit->toHtml(); + int from = 0; + int varNum = 0; + // 正常变量 + while(from < textHtml.size() && from != -1) { + from = textHtml.indexOf(rx,from);//返回匹配到到起始地址 + bool ok; + if(from != -1){//找到匹配的 + from ++; + if(varNum < sysPara->status.variNum){ + sysPara->status.vars[varNum].digitalNum = rx.cap(3).toInt(&ok);//第二个匹配,数字到个数 + sysPara->status.vars[varNum].bold = (sysPara->status.vars[varNum].digitalNum%100) == 75; + if(sysPara->status.vars[varNum].bold) + sysPara->status.vars[varNum].digitalNum = sysPara->status.vars[varNum].digitalNum/100; + + sysPara->status.vars[varNum].type = rx.cap(2).toInt(&ok);//第一个匹配 + sysPara->status.vars[varNum].width = rx.cap(4).toInt(&ok)*(sysPara->status.addSpace?2:1); + sysPara->status.vars[varNum].height = rx.cap(5).toInt(&ok); + + //qDebug() <status.vars[varNum].startRowPos + // << "endRowPos" << sysPara->status.vars[varNum].endRowPos + // <<"Height"<status.vars[varNum].height; + //sysPara->status.vars[varNum].endRowPos = sysPara->status.vars[varNum].startRowPos + sysPara->status.vars[varNum].height-1; + sysPara->status.vars[varNum].startRowPos = sysPara->status.vars[varNum].endRowPos - sysPara->status.vars[varNum].height+1; + if(sysPara->status.vars[varNum].startRowPos<0)sysPara->status.vars[varNum].startRowPos=0; + //sysPara->status.vars[varNum].startRowPos = sysPara->status.vars[varNum].endRowPos - sysPara->status.vars[varNum].height+(sysPara->status.vars[varNum].height==15||sysPara->status.vars[varNum].height==16?0:1); + // qDebug()<<"Hei:"<status.vars[varNum].height; + /*-----------------------------------------------------------------------------------------*/ + int t_x_start_pos = sysPara->status.vars[varNum].startColPos; + int t_x_end_pos = t_x_start_pos + sysPara->status.vars[varNum].width ; + if(t_x_end_pos > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + t_x_end_pos = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int t_y_start_pos = sysPara->status.vars[varNum].startRowPos; + int t_y_end_pos = sysPara->status.vars[varNum].endRowPos+1 ; + if(t_y_start_pos < 0) + t_y_start_pos = 0; + for(int i = t_x_start_pos; i < t_x_end_pos; i++){ + for(int j = t_y_start_pos; j < t_y_end_pos; j++){ + + dat[MAX_PRINT_ROW_BYTE_NUM*(i+(sysPara->status.addSpace?0:0)) + j/8] &= ~(1 << (j%8)); //将画点取消掉 + + } + } + + sysPara->status.vars[varNum].height = rx.cap(5).toInt(&ok)-1; + if(sysPara->status.vars[varNum].height>16 ){ + if(sysPara->status.vars[varNum].height==24) + ; + else { + if(sysPara->status.vars[varNum].startRowPos) + { + sysPara->status.vars[varNum].endRowPos--; + sysPara->status.vars[varNum].startRowPos--; + } + + } + + } + + if(sysPara->status.vars[varNum].type == RANDOMNUM) + { + //qDebug()<<"RAND:"<status.vars[varNum].type<< sysPara->status.vars[varNum].digitalNum; + sysPara->status.RandomDigitNum = sysPara->status.vars[varNum].digitalNum; + + + } + + if(sysPara->status.vars[varNum].type >59 && sysPara->status.vars[varNum].type<70) + { + sysPara->status.vars[varNum].endRowPos = sysPara->status.vars[varNum].endRowPos-3; + sysPara->status.vars[varNum].startRowPos = sysPara->status.vars[varNum].startRowPos-3; + } + /*-----------------------------------------------------------------------------------------*/ + int pixelSize = Public::derivePixelSizeFromHeight(sysPara->status.vars[varNum].height); + + //qDebug()<<"MainWindows"<status.vars[varNum].height<status.vars[varNum].letterSpace = 0; + if(sysPara->status.vars[varNum].digitalNum){ //算出letterspace + QFont font; + //font.setFamily(Public::getFontFamily(pixelSize)); + font.setFamily(Public::getFontFamily(pixelSize,sysPara->status.vars[varNum].type )); // 20160812 + //pixelSize==7? font.setFamily(ui->textEditOption->getLabelFontFamily()->text()):font.setFamily(Public::getFontFamily(pixelSize, 0)); + font.setPixelSize(pixelSize); + font.setWeight(sysPara->status.vars[varNum].bold?QFont::Bold:QFont::Normal); + //font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + QFontMetrics fontMetrics(font); + int charWidth = (fontMetrics.width("0123456789"))/10 ; + sysPara->status.vars[varNum].letterSpace = sysPara->para.textEditCharSpace; + //sysPara->status.vars[varNum].width/sysPara->status.vars[varNum].digitalNum/(sysPara->status.addSpace?2:1) - charWidth; + } + + if(varNum<7) varNum ++; + } + else + { + qDebug() << tr("warning,界面上有变量未显示完全"); + } + } + } + } + + //if(sysPara->status.variNum) qDebug()<< sysPara->status.vars[0].startColPos<status.vars[0].endRowPos ; + + /*--------------------------------------------------------------------------*/ + generateCharRamData(); + + /*---------------------------------------------------------------------------*/ + //sysPara->status.currPrintRow ++;//总的行数,从1~n,而不是从0~n, + //if(sysPara->status.currPrintRow>39)sysPara->status.currPrintRow=39; + if(sysPara->status.currPrintRow>MAX_PRINT_ROW_NUM-1) sysPara->status.currPrintRow=MAX_PRINT_ROW_NUM-1; + bool found=0; + + lastRow = sysPara->status.currPrintRow; + //qDebug()<<"lastRow:"<status.currPrintRow; j >2 ; j--){ //计算首行位置 + for(int i = 0; i < coldot; i++){ + if(dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] & (1 << (j%8))){ + lastRow = j+1; + found=1;//qDebug()<<"fOUND:"<status.currPrintRow; + break; + } + } + if(found) + break; + } + if(lastRow>MAX_PRINT_ROW_NUM-1)lastRow =MAX_PRINT_ROW_NUM-1; + if(lastRow20 &&lastRow<=25) lastRow =24; + + sysPara->status.currPrintRow =lastRow; + //sysPara->status.currPrintRow = (lastRow > varLastRow) ? lastRow : varLastRow; //配合賴工省点打印少行問题 + //qDebug()<<"lastRow:"<status.currPrintRow; + + } + // end of TxtMode + + //qDebug() << "varnum:"<status.variNum; + // 交替打印 + // sysPara->status.currAlterPrintRow = sysPara->status.currPrintRow/2; + + +#ifdef _2DCODE_ + if(sysPara->status.QRvariNum) { + onUpdateDispQRCode(1); + } +#endif + //if(sysPara->status.currPrintRow==11) sysPara->status.currPrintRow=12; + int wmax = sysPara->status.currPrintRow; + sysPara->status.currAlterPrintRow = sysPara->status.currPrintRow/2; + if(sysPara->para.alterPrint.enable<1) sysPara->para.AlterMode=0; + else { + if(sysPara->para.AlterMode==0)sysPara->para.AlterMode=1; + wmax = sysPara->status.currAlterPrintRow; + } + /*-------------------------------切换到显示窗口-----------------------------------*/ + if(sysPara->status.addSpace) + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol/2,sysPara->status.currPrintRow); + else ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->status.currPrintRow); + + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow); + ui->stackedWidgetText->setCurrentWidget(ui->pagePrintTextDisplay); + ui->stackedWidgetOption->setCurrentWidget(ui->pageOption); + ui->labelTextWidthHeight->setText(tr("[ %1行 x %2列 ]").arg(wmax).arg(sysPara->status.currPrintCol)); + ui->widgetPrintTextDisplay->update(); + //qDebug()<<"3"<status.currPrintRow; + } + previewFlag=0; +} + +void MainWindow::showDat(unsigned char * Dat) +{ +#ifdef DEBUG1 + int i,j,x=MAX_PRINT_ROW_BYTE_NUM*sysPara->status.currPrintCol; + for(j=0;j<2;j++){ + for(i=0;iwidgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow); + //sysPara->devOp->writeFpgaPrintPara(); /*务必放在最后一步*/ + //sysPara->devOp->writeFpgaVariCtrl(); + //SendPrintDataToFpga (m); + emit ui->widgetPrintTextDisplay->update(); + + } +} + +/* + 000 000 000 0000 0 000000 000 0000000 000 000 + 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 000 0 000 0 000 0 0 + 0 0 0 0 000 0 0 00 0 00 0 0 0 0 0 00 + 0 0 0 0 0 0 0 0 0 0 0 0 0 000 0 + 0 0 0 0 0 00000000 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 000 00000 0000000 0000 0 0000 000 0 000 0000 + + */ +//#define DEBUG4 + +void MainWindow::generateCharRamData(){/* 生成字模数据 */ + if(sysPara->status.variNum){ + QTextEdit textEdit; + textEdit.document()->setDocumentMargin(0); + textEdit.setLineWrapMode(QTextEdit::NoWrap); + int ramAddress = 0; + int i; + qDebug()<<"sysPara->status.variNum:"<status.variNum; + for( i = 0; i < sysPara->status.variNum; i++){ + vars_t *p_var = &sysPara->status.vars[i]; + p_var->bassAddr = -1; + if(p_var->original){ //清除原来的记录 + if(p_var->dat){ + free(p_var->dat); + } + p_var->original = false; + } + + int j; +#if 0 //同一个点陣的变量有BUG + qDebug()<<"p_var->height:"<height; + if(p_var->height>6) + { + for( j = 0; j < i; j ++){ //重复检测是否有重复大小的字存在 + + if(p_var->height == sysPara->status.vars[j].height){ + p_var->bassAddr = sysPara->status.vars[j].bassAddr; + p_var->datHeight = sysPara->status.vars[j].datHeight; + p_var->datWidth = sysPara->status.vars[j].datWidth; + p_var->rowByteNum = sysPara->status.vars[j].rowByteNum; + p_var->dat = sysPara->status.vars[j].dat; + break; + } + } + } +#endif + + if(p_var->bassAddr == -1){ + + int width = (p_var->digitalNum)?(10*p_var->width/p_var->digitalNum):12; + int width2 = width;//+(sysPara->status.addSpace?width:0); + int height = Public::derivePixelSizeFromHeight(p_var->height); + textEdit.clear(); + int DPI = textEdit.logicalDpiX(); + DPI = DPI?DPI:1; //Pixel = DPI * Point / 72 + textEdit.insertHtml(QString("0123456789") + .arg(Public::getFontFamily(height,p_var->type)) // 20160812 增加横向字体 p_var->type <9 正常, p_var->type 20~28 左横 p_var->type 40~48 右横 + .arg(height*72/DPI).arg(p_var->bold?600:400)); //600表示加粗,400表示普通 + QFont font = textEdit.font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,p_var->letterSpace); + textEdit.setFont(font); + +// qDebug() << "height:" << height << "fontFamily:" << Public::getFontFamily(height); +// qDebug() << "width2:" << width2 << "fontFamily:" << Public::getFontFamily(height); + + + int imgHeight = height + 12; + QSize size(width,imgHeight); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff); + QPainter painter(&image); + textEdit.show(); //如果不显示,似乎不会绘制 + + textEdit.document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + textEdit.hide(); + image.save(QString::number(i) + "varRam.png"); +#ifdef DEBUG4 + //image.save("./var.png"); +#endif + // 找到最下面的行 + int lastValidRow = 0; + for(int k = imgHeight - 1; k >= 0 ; k--){ + for(int j = 0; j < width; j ++){ + QRgb rgb = image.pixel(j,k); + if(rgb&0xff000000){ + lastValidRow = k + 1; + break; + } + } + if(lastValidRow != 0) + break; + } + + qDebug()<<"lastValidRow"<endRowPos<< p_var->startRowPos; + int rowDiff = p_var->endRowPos - p_var->startRowPos; + int firstValidRow = 0; // 变量的第一行所处的行地址 + int firstValidRowDiff;// 看起来和上面的参数一样 + qDebug()<<"rowDiff"<=0) + break; + } + rowDiff = lastValidRow-firstValidRow; + firstValidRowDiff = firstValidRow/2; +*/ + + if(lastValidRow >= rowDiff){ + firstValidRow = lastValidRow - rowDiff; + firstValidRowDiff = firstValidRow; + } + else { + firstValidRow = 0; + firstValidRowDiff = lastValidRow > rowDiff; + } + + + firstValidRow = firstValidRow >= 0?firstValidRow:0; //纠正 + + int rowByteNum = rowDiff/8 + ((rowDiff%8)?1:0); // 一列占用字节数 + unsigned char *dat = (unsigned char *)calloc(width2,rowByteNum); +#ifdef DEBUG4 + s2.sprintf ("firstValidRow:%d,lastValidRow:%d,rowByteNum:%d,width:%d ,rowDiff:%d\n\r",firstValidRow,lastValidRow,rowByteNum,width,rowDiff) ; + qDebug()<> 24)&0xff) > 0x80){ // 判断是否有效的像素点 + dat[rowByteNum*(j+(sysPara->status.addSpace?j:0) )+ currRow/8] |= (1<<(currRow%8)); +#ifdef DEBUG4 + s2.sprintf("%02X",rowByteNum*j + currRow/8); + str+=s2; +#endif + } + else{ +#ifdef DEBUG4 + s2.sprintf(" -"); + str+=s2; +#endif + } + } +#ifdef DEBUG4 + qDebug()<startRowPos,p_var->endRowPos,p_var->height); + //qDebug()<bassAddr = ramAddress; + p_var->datHeight = height; + + p_var->datWidth = width2; + p_var->rowByteNum = rowByteNum; + p_var->dat = dat; + p_var->original = true; + p_var->currVal = -1; //相当于初始化 + ramAddress += rowByteNum * width2; + + } + } + } +} +void MainWindow::updateTotalCnt(int en) +{ + // No50 USEING + //sysPara->para.totalProductCnt += (sysPara->status.productCnt>sysPara->status.lastProductCnt)?sysPara->status.productCnt-sysPara->status.lastProductCnt: + // (sysPara->status.productCnt>=0&&sysPara->status.productCnt<20)?sysPara->status.productCnt:0; + //if(en) sysPara->para.totalProductCnt=0; + + //sysPara->para.totalProductCnt = sysPara->status.totalProductCnt; // No51版本改进 + sysPara->status.lastProductCnt = sysPara->status.productCnt; + ui->labelProductCnt->setText(QString::number(sysPara->status.productCnt)); + ui->labelTotalProductCnt->setText(QString::number( sysPara->para.totalProductCnt+sysPara->status.totalProductCnt)); + +} + +void MainWindow::on_pushButtonStartPrint_pressed() +{ + if(sysPara->status.isPrinting){ + qDebug("Mainwindow: Printing 开始打印"); + }else{ + qDebug("Mainwindow: Non printing 开始打印"); + } + static int fileCount = 0; + fileCount++; + if(fileCount > 5) + { + fileCount = 1; + } +// QString fileName = "/home/plg/doc/SavePrintFile"; +// fileName += QString::number(fileCount) + ".html"; +// QTextDocumentWriter writer(fileName); +// writer.write(ui->textEditOption->textEdit->document()); + + if(sysPara){ + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; +#ifdef X86TEST + //sysPara->status.statWarn |=WARN_STATUS_HDINT; +#endif +#ifndef SYS_LINUX + sysPara->status.statWarn =0; +#endif +#ifdef MYTEST + +#else +#ifdef AM335TEST + +#else +#ifdef MIMA + static int xxxm=0; + if(xxxm==0){ + QFile file("/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtssl.o"); + if(!file.exists()) + { + LogInfo::setRunStatusText(QString("missing libQtssl.o")); + return; + } + } + xxxm=1; + if(sysPara->status.WorkTimeOut) { sysPara->devOp->printCtrl(PRINT_CTRL_STOP); + return; + } +#endif +#endif +#endif + + /******2020/2/29*****/ +// qDebug()<<"sysPara->para.printTriggerMode "<< sysPara->para.printTriggerMode; + if(sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) //同步模式下,判断喷印间隔是否设置合理 + { + QSizeF size = ui->textEdit->document()->size(); + float stroke,print_len_min; + stroke = sysPara->para.printColDelay/sysPara->para.synPulseNumPerMm; + print_len_min = stroke * size.width(); + if(print_len_min > sysPara->para.synTriggerPrintLenMm && !sysPara->para.charWidthSetEnable) + { + QMessageBox::information(this,tr("错误"),tr("喷印间隔过短,应高于%1!").arg(print_len_min)); + return; + } + } + /******2020/2/29 end*****/ + if(!SIMULATE_PRINTING_MODE){ + if (!sysPara->status.reclainTankReachEnd) { + return; + } + if((sysPara->status.statWarn & WARN_STATUS_HDINT)){ + QMessageBox::information(this,tr("错误"),tr("喷头盖未关,请先关喷头盖!")); + return ; + } + if((sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){ + QMessageBox::information(this,tr("错误"),tr("墨线未开,请先开墨线开关!")); + return ; + } + } + //if(printintFlag && !sysPara->status.FileChangeRestCntFlag) return; + // 发送数据到 外接屏 2017-07-25 + sysPara->devOp->DatToDisp(sysPara->para.lastOpenedFileName,0); +#ifdef __HV_FOR_WANG_DEBUG__ /* 盖上喷头盖,启动高压 */ + //sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); +#else + sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); +#endif + sysPara->status.waitHightVolOff = 0; + if(!printintFlag)setRunStatus(tr("正在加高压...")); + // 复位计数器 + if(sysPara->status.FileChangeRestCntFlag){ + if(sysPara->para.ResetAllProductCntEn) + { + sysPara->devOp->clearProductCnt(3 | 0x10); // [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt=0; + } + else if(sysPara->para.ResetProductCntEn) + { + sysPara->devOp->clearProductCnt(3); + } + sysPara->status.FileChangeRestCntFlag=0; + sysPara->saveParaToFile(); + } + if(sysPara->para.EditMode == TXTFILE||sysPara->para.EditMode== PICFILE) + PreviewPressed(); //生成打印数据,确定变量的位置和对应生成字模 + else if(sysPara->para.EditMode == SCENE) + onPreviewScene(); + + if(sysPara->status.currPrintCol > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)){ + QMessageBox::critical(0,tr("错误"),tr("当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度").arg(sysPara->status.currPrintCol).arg((MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide))); + return ; + } + // LogInfo::setRunStatusText(tr("有效打印区域 %1行 x %2 列").arg(sysPara->status.currPrintRow).arg(sysPara->status.currPrintCol)); + //if(sysPara->para.printTriggerMode != PRINT_TRIGGER_SYNCHRONIZER) + if(!((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) + ||((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL + ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) + && sysPara->para.eleEyeTriggerSynPrintEn)) + ) + { + int dotNumPerCol = sysPara->status.currPrintRow*(1 + sysPara->para.printRowDelay) + sysPara->para.printColDelay; + //long long int printClkNum = dotNumPerCol*(1 + sysPara->para.charBold)*sysPara->status.currPrintCol*(2*sysPara->para.divideRatio); + //long printTmUs = printClkNum/(FPGA_SYS_HZ/1000000); + long printTmUs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*sysPara->status.currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000000); + // LogInfo::setRunStatusText(tr("打印耗时 %1.%2 毫秒 /次").arg(printTmUs/1000).arg(printTmUs%1000,3,10,QLatin1Char('0'))); + + //qDebug()<<"mainWIN:"<<((printTmUs/1000 + 3) > (sysPara->para.printDelayMs) )<< (sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD); + //qDebug()<<"PDL:"<para.printDelayMs; + + if((printTmUs/1000 + 3) > (sysPara->para.printDelayMs) + && (sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD) + && (sysPara->para.printTriggerMode == PRINT_TRIGGER_TIME ) + ) // 在电眼方式下,是否需要判呢? + { + QMessageBox::critical(0,tr("错误"),tr("打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms").arg(printTmUs/1000).arg(sysPara->para.printDelayMs)); + return ; + } + } + else{ + LogInfo::setRunStatusText(tr("同步目标每列有%1.%2个同步脉冲").arg(sysPara->para.synNumPerCol/(1<<8)).arg((sysPara->para.synNumPerCol%(1<<8))*1000/(1<<8),3,10,QLatin1Char('0'))); + } + sysPara->status.isPrinting=true; + + //if(!printintFlag) sleep(1); + + setRunStatus(tr("开始打印")); + SendPrintDataToFpga(0); // 0--正常打印,1--打印交替部分信息1; 2--打印交替部分信息2, + if(sysPara->para.isCheckInsertTime) + { + if(!startPrintingFlag) + { + LogInfo::setRunStatusText(tr("开始打印")); + } + } + else + { + LogInfo::setRunStatusText(tr("开始打印")); + } + /*-------------------------------------------------------------------*/ + ui->labelSynColDelay->setText(""); + sysPara->status.lastSynColDelay = -1; //目的是为了清空原来的数据 + /*--------------------------------暂停按钮------------------------------*/ + ui->pushButtonPausePrint->setEnabled(true); + // ui->pushButtonPausePrint->setText(tr("暂停打印")); + /*---------------------------------开关回收槽------------------------------*/ + enableReclaimCtrlButton(false); + updatePrintDisplayLabel(); + // 20170717 移动此,以观察条形码打印异常问题。 + if(!startPrintingFlag) + { + sysPara->devOp->printCtrl(PRINT_CTRL_START); + printintFlag = true; + } + else + { + //如果已经在打印,则不要在发送start命令,只要更新相应的数据即可 + if(!printintFlag) //如果在暂停,重复取消暂停 + on_pushButtonPausePrint_pressed(); + } + startPrintingFlag = true; + } +} + +void MainWindow::SendPrintDataToFpga(unsigned char alterEnable) +{ + if(!sysPara) return ; + fileChange=false; + sysPara->devOp->writeFpgaPrintPara(1); /*务必放在最后一步*/ + sysPara->devOp->writeFpgaVariCtrl(); + + unsigned char blankDat[BLANK_COL_NUM*MAX_PRINT_ROW_BYTE_NUM]; + memset(blankDat,0,sizeof(blankDat)); + sysPara->devOp->fpgaWr(0,blankDat,sizeof(blankDat));//...所加的空白偏移地址 + // 交替打印处理 +#ifdef FXCHG + unsigned char *dat; + size_t sizeofdat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + sizeofdat = sizeof(sysPara->status.printDat_Normal); + }else{ + dat =sysPara->status.printDat; + sizeofdat = sizeof(sysPara->status.printDat); + } + sysPara->devOp->fpgaWr(sizeof(blankDat),dat,sizeofdat-sizeof(blankDat)); + +/* + if(sysPara->para.printOnce) + { + if(sysPara->status.oneCodePrintOnce) + { + sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printDat, sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM); + } + sysPara->status.oneCodePrintOnce = false; + } + else + { + //sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printDat, sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM); + sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printDat,sizeof(sysPara->status.printDat)-sizeof(blankDat)); + } +*/ +#else + if(sysPara->para.alterPrint.enable) + { + int len=MAX_PRINT_ROW_BYTE_NUM*(sysPara->status.currPrintCol); + if(alterEnable==1) sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printAlterDat1,len ); // alter1 + else if(alterEnable==2) sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printAlterDat2, len); // alter2 + else sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printAlterDat1, sizeof(sysPara->status.printAlterDat1)-sizeof(blankDat)); // alter2 + } + else + + sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printDat,sizeof(sysPara->status.printDat)-sizeof(blankDat)); //将要打印的数据发送到fpga +#endif + +#if 0 + int printDataIndex=0; + char xor_value; + QFile xor_record_file("xor_record.txt"); + + for (int i = 0; i< sizeof(blankDat);) { + xor_value = 0; + xor_value ^= blankDat[i]; + xor_value ^= blankDat[i+1]; + xor_value ^= blankDat[i+2]; + xor_value ^= blankDat[i+3]; + xor_value ^= blankDat[i+4]; + sysPara->devOp->fpgaWr(i,blankDat + i,5); + + //sysPara->devOp->readPrintDataXor(); + sysPara->devOp->readbuilDat(); + if (((sysPara->status.build_dat.builTime & 0xFF00)>>8) != xor_value) { + //out << "Result: " << qSetFieldWidth(10) << left << 3.14 << 2.7; + qDebug()<<"sequence "<status.build_dat.builTime & 0xFF00)>>8)<<"xor_value "<status.build_dat.builTime).arg(xor_value)); + } + i = i+5; + printDataIndex = i; + } + + for (int i = 0; i< sizeof(sysPara->status.printDat) - sizeof(blankDat);) { + xor_value = 0; + xor_value ^= sysPara->status.printDat[i]; + xor_value ^= sysPara->status.printDat[i+1]; + xor_value ^= sysPara->status.printDat[i+2]; + xor_value ^= sysPara->status.printDat[i+3]; + xor_value ^= sysPara->status.printDat[i+4]; + sysPara->devOp->fpgaWr(printDataIndex + i, (unsigned char*)sysPara->status.printDat + i, 5); + + //sysPara->devOp->readPrintDataXor(); + sysPara->devOp->readbuilDat(); + if (((sysPara->status.build_dat.builTime & 0xFF00)>>8) != xor_value) { + qDebug()<<"sequence "<status.build_dat.builTime & 0xFF00)>>8)<<"xor_value "<status.reclainTankReachEnd){ + setRunStatus(tr("回收槽未到底!!!!!!")); + } + else if(startPrintingFlag ){ + if(printintFlag) + setRunStatus(tr("正在喷印...............")); + else + setRunStatus(tr("暂停喷印...............")); + } + else + setRunStatus(""); +} + +void MainWindow::on_pushButtonStopPrint_pressed() +{ + if(sysPara->status.isPrinting){ + qDebug("Mainwindow: Printing 停止打印"); + }else{ + qDebug("Mainwindow: Non printing 停止打印"); + } + if(sysPara){ + if (!sysPara->status.reclainTankReachEnd && !SIMULATE_PRINTING_MODE) { + return; + } + sysPara->status.isPrinting=false; + sysPara->devOp->printCtrl2(1); + sysPara->devOp->printCtrl( PRINT_CTRL_STOP);//:PRINT_CTRL_STOPSYNCNT + LogInfo::setRunStatusText(tr("停止打印")); + ui->pushButtonStartPrint->setEnabled(true); + + ui->pushButtonPausePrint->setEnabled(false); + // ui->pushButtonPausePrint->setText(tr("暂停打印")); + enableReclaimCtrlButton(true); + printintFlag = false; + startPrintingFlag = false; + updatePrintDisplayLabel(); + sysPara->status. waitHightVolOff = 1; +#ifndef __HV_FOR_WANG_DEBUG__ + sysPara->status.waitHightVolOff = 3; +#endif + + sysPara->saveParaToFile(); // 将相关配置保存 + +#ifdef RANDDEBUG + if(sysPara->status.RandomBackCnt>5 && (sysPara->status.RandomNum>0)) + { + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("提示"), + tr("随机码文本将展出到U盘,请插入U盘"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + LogInfo::setRunStatusText("正在导出随机码文件到U盘......"); + sysPara->devOp->RandTxtBakup(0); //备份到U盘 + LogInfo::setRunStatusText("随机码文件导出完成."); + + } + } +#endif + + } +} + +void MainWindow::on_pushButtonPausePrint_pressed() +{ + if(sysPara){ +#ifdef MIMA + if(sysPara->status.WorkTimeOut && !SIMULATE_PRINTING_MODE) { sysPara->devOp->printCtrl(PRINT_CTRL_STOP); + return; + } +#endif + if (!sysPara->status.reclainTankReachEnd && !SIMULATE_PRINTING_MODE) { + return; + } + sysPara->devOp->printCtrl(PRINT_CTRL_PAUSE); + LogInfo::setRunStatusText(printintFlag?tr("暂停打印"):tr("继续打印")); + ui->pushButtonStartPrint->setEnabled(true); + //if(printintFlag){ sysPara->status.waitHightVolOff=2; } + printintFlag = !printintFlag; + //ui->pushButtonPausePrint->setText(printintFlag?tr("暂停打印"):tr("继续打印")); + //ui->pushButtonPausePrint->setText(printintFlag?tr("暂停打印\n保持高压"):tr("暂停打印\n停止高压")); + if(printintFlag) + { + ui->pushButtonPausePrint->setText(tr("继续打印\n保持高压")); + ui->pushButtonPausePrint->setStyleSheet("QPushButton{color:rgb(0, 255, 0)}"); + sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); + } + else + { + ui->pushButtonPausePrint->setText(tr("暂停打印\n停止高压")); + ui->pushButtonPausePrint->setStyleSheet("QPushButton{color:rgb(255, 0, 0)}"); + //sysPara->devOp->highVoltageCtrl(0); + } + updatePrintDisplayLabel(); + + sysPara->saveParaToFile(); // 将相关配置保存 +#ifdef RANDDEBUG + if(sysPara->status.RandomBackCnt>5 && (sysPara->status.RandomNum>0)) + { + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("提示"), + tr("随机码文本将展出到U盘,请插入U盘"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + LogInfo::setRunStatusText("正在导出随机码文件到U盘......"); + sysPara->devOp->RandTxtBakup(0); //备份到U盘 + LogInfo::setRunStatusText("随机码文件导出完成."); + + } + } +#endif + + } +} + +void MainWindow::resetReclaimCtrlButtonText(){ + ui->pushButtonReclaimTanOpen->setText(tr("开")); + ui->pushButtonReclaimTankClose->setText(tr("关")); +} + +void MainWindow::enableReclaimCtrlButton(bool enable){ + ui->pushButtonReclaimTanOpen->setEnabled(enable); + ui->pushButtonReclaimTankClose->setEnabled(enable); + +} + +void MainWindow::enablePushButtonStart(bool enable) +{ + ui->pushButtonStart->setEnabled(enable); +} + +void MainWindow::enablePrintButton(bool enable){ + ui->pushButtonPausePrint->setEnabled(false); + ui->pushButtonStartPrint->setEnabled(enable); + ui->pushButtonStopPrint->setEnabled(enable); +} + +static int mainInkPumpCtrlStatus = 0; +static int mainInkPumpCtrlCnt = 0; +//100ms 为单位 +void MainWindow::airPushingProcess() +{ + if(sysPara){ + if (sysPara->status.airPushing) { + //qDebug()<< "start airPushingProcess "<status.airPushingOnTime; + // 执行排气 7 秒 + setRunStatus(tr("正在排气 ...............")); + ++sysPara->status.airPushingOnTime; + if(sysPara->status.airPushingOnTime >= 50) { + static int delayCount = 0; + ++delayCount; + m_2sFlag = true; + //sysPara->devOp->controlInkValve(false); //关供墨阀 + if(delayCount >= 40) + { + m_2sFlag = false; + } + + if(delayCount >= 60) + { + delayCount = 0; + airPushTimer->stop(); + sysPara->devOp->controlViscosityPump(false); + reclaimTanOpen(); + //qDebug()<< "start stop"; + sysPara->status.airPushingDone = 1; + sysPara->status.airPushing = 0; + sysPara->status.airPushingOnTime = 0; + } + + + return; + } +// if (sysPara->status.SEPTAL_POSITION > sysPara->para.septalPostion + 50) { +// sysPara->devOp->controlCycleValve(true); +// } +// else if (sysPara->status.SEPTAL_POSITION < sysPara->para.septalPostion - 50) { +// sysPara->devOp->controlCycleValve(false); +// } + // 以500ms 间隔开关循环阀 + if (sysPara->status.airPushingOnTime%10 >= 5) { + sysPara->devOp->controlCycleValve(true); + } + else { + sysPara->devOp->controlCycleValve(false); + } + if (mainInkPumpCtrlStatus == 0) { + if(++mainInkPumpCtrlCnt > 15) { //100ms 为单位, 时间到关闭 + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 1; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 1) { //100ms 为单位, 时间到开启 + sysPara->devOp->controlMainInkPump(true); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 2; + } + else if (mainInkPumpCtrlStatus == 2) { + if(++mainInkPumpCtrlCnt>7) { + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 3; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 3) { + if(++mainInkPumpCtrlCnt>8) { + sysPara->devOp->controlMainInkPump(true); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 4; + mainInkPumpCtrlCnt = 0; + } + } + else if (mainInkPumpCtrlStatus == 4) { + if(++mainInkPumpCtrlCnt>8) { + sysPara->devOp->controlMainInkPump(false); + sysPara->devOp->mainInkCtrl(); + mainInkPumpCtrlStatus = 3; + mainInkPumpCtrlCnt = 0; + } + } + } + } +} + +void MainWindow::reclaimTanOpen() +{ + // 还原当前模式 + if (sysPara->status.airPushing) { + sysPara->status.isPumpValveControledByHand = sysPara->status.byHandStore; + } + sysPara->status.isPumpValveControledByHand = false; + sysPara->status.canRunAirPushing = 0; + sysPara->devOp->mainInkCtrl(); + sysPara->devOp->controlReclaimTankClose(false);//开回收槽之前先让关回收槽停止 + MySleep(1000); + sysPara->devOp->controlReclaimTankOpen(!sysPara->devOp->isReclaimTankOpenEnable()); + ui->pushButtonReclaimTanOpen->setText(sysPara->devOp->isReclaimTankOpenEnable()?tr("停止"):tr("开")); + ui->pushButtonReclaimTankClose->setText(tr("关")); + enablePrintButton(SIMULATE_PRINTING_MODE); + sysPara->devOp->highVoltageCtrl(0); /*回收槽动作的时候务必关高压*/ + //LogInfo::setRunStatusText(sysPara->devOp->isReclaimTankOpenEnable()?tr("打开回收槽"):tr("停止打开")); + setRunStatus(sysPara->devOp->isReclaimTankOpenEnable()?tr("正在打开回收槽..."):tr("停止打开")); + if (!sysPara->para.reclaimTankTime) { + LogInfo::setRunStatusText(tr("警告!回收槽开关时间未设置!")); + } + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + sysPara->status.reclainOpenAppending = true; + sysPara->status.reclainCloseAppending = false; + sysPara->status.reclaimBlockedCnt = 0; +} + +void MainWindow::on_pushButtonReclaimTanOpen_pressed() +{ + if(sysPara){ + if (!sysPara->status.reclaimTankBlockedAppending) { + if (sysPara->status.canRunAirPushing && (sysPara->status.currReclaimTankPos == 0)) { // 回收槽关闭的情况下才可以执行排气;//2019/10/24 当回收槽未在顶的位置,不需要排气 + if (!sysPara->status.airPushing) { // 先执行排气后开回收槽 + sysPara->status.byHandStore = sysPara->status.isPumpValveControledByHand; + sysPara->status.isPumpValveControledByHand = true; + sysPara->devOp->mainInkCtrl(); + sysPara->devOp->controlCycleValve(true); +#ifdef __AIR_RELEASE_OLD__ + // 粘度泵跟随循环阀动作 + sysPara->devOp->controlViscosityPump(true); +#else + sysPara->devOp->controlViscosityPump(false);//关粘度泵 +#endif + sysPara->devOp->controlMainInkPump(true);//主墨泵敞开 + sysPara->devOp->mainInkCtrl(); + sysPara->devOp->controlReclaimPump(true, false); // 回收泵开 + sysPara->devOp->controlInkValve(true); //墨水阀 + + //qDebug()<< "start airpushings"; + + sysPara->status.airPushing = 1; + sysPara->status.airPushingDone = 0; + sysPara->status.airPushingOnTime = 0; + airPushTimer->start(100); // 100ms + } + } + else + reclaimTanOpen(); + } + if(sysPara->status.reclaimTankBlockedAppending) { + sysPara->status.reclaimTankBlockedAppending = false; + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->para.reclaimTankTime = sysPara->status.currReclaimTankPos/10; + onReclainTankPositionChanged(sysPara->para.reclaimTankTime * 10); + } + } + } +} + +void MainWindow::on_pushButtonReclaimTankClose_pressed() +{ + if(sysPara){ + if(sysPara->status.reclaimTankBlockedAppending){ + sysPara->status.reclaimTankBlockedAppending = false; + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->status.currReclaimTankPos = 0; + onReclainTankPositionChanged(0); + } + } + + sysPara->devOp->controlReclaimTankClose(!sysPara->devOp->isReclaimTankCloseEnable()); + ui->pushButtonReclaimTanOpen->setText(tr("开")); + ui->pushButtonReclaimTankClose->setText(sysPara->devOp->isReclaimTankCloseEnable()?tr("停止"):tr("关")); + enablePrintButton(SIMULATE_PRINTING_MODE); + sysPara->devOp->highVoltageCtrl(0); + //LogInfo::setRunStatusText(sysPara->devOp->isReclaimTankCloseEnable()?tr("关闭回收槽"):tr("停止关闭")); + setRunStatus(sysPara->devOp->isReclaimTankCloseEnable()?tr("正在关闭回收槽..."):tr("停止关闭")); + if(!sysPara->para.reclaimTankTime){ + LogInfo::setRunStatusText(tr("警告!回收槽开关时间未设置!")); + } + sysPara->status.currReclaimOperationCnt = 0; + sysPara->status.reclainTankReachEnd = false; + sysPara->status.reclainOpenAppending = false; + sysPara->status.reclainCloseAppending = true; + sysPara->status.reclaimBlockedCnt = 0; + + } +} + +void MySleep(unsigned int msec); +/* + * 关机前务必保存参数 + * */ +void MainWindow::checkForPowerOff(){ + if(sysPara->status.powerOffAppending){ + if(!sysPara->status.selfCheckDone) + sysPara->status.selfCheckDone = true; + this->setDisabled(true); + emit setDisableAll(); +////////关机时提高转速和回收泵压力,粘度泵和循环阀///// + quint16 gearPumpValue_backup = sysPara->para.gearPumpValue; + int reclaimPumpPWMWidth_backup = sysPara->para.reclaimPumpPWMWidth;; + if(!(sysPara->status.statWarn & WARN_STATUS_INK_WARN)) + { + if(!TEST_MODE && sysPara->para.flagOfReclaimPumEnable){ + for(int i=25;i>21;i--) + { + if(i == 25){ + sysPara->status.isPumpValveControledByHand = true; //停止自动 + sysPara->devOp->controlInkValve(true); + sysPara->devOp->controlReclaimPump(true,false); + sysPara->devOp->controlViscosityPump(true); + sysPara->devOp->controlCycleValve(true); + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + } + if(i == 22){ + sysPara->devOp->controlInkValve(false); + } + this->setRunStatus(tr("正在准备关机,请等待%1秒...............").arg(i*2)); + MySleep(2000); + } + } + +// sysPara->status.flagOfPowerOff = true; + sysPara->devOp->fpgaWrD(0xA442,0,1);//打开回收槽 + sysPara->status.isPumpValveControledByHand = true; //停止自动 + if(sysPara->para.gearPumpEnable ){ + if(!sysPara->para.flagOfReclaimPumEnable){ + sysPara->para.gearPumpValue = 360; + sysPara->devOp->WriteMoterPump(); + } + else{ + sysPara->devOp->controlReclaimPump(true,false); + sysPara->para.gearPumpValue = 0; + sysPara->devOp->WriteMoterPump(); + } + } + else{ + sysPara->para.reclaimPumpPWMWidth = 95; + sysPara->devOp->controlReclaimPump(true,true); + } + + if(!sysPara->devOp->isViscosityPumpOpen()) + sysPara->devOp->controlViscosityPump(true); + sysPara->devOp->controlCycleValve(true); + sysPara->devOp->controlInkValve(false); //关供墨 + + if(!TEST_MODE){ + for(int i=14;i>7;i--) + { + if(i==13) + sysPara->devOp->fpgaWrD(0xA442,1,1);//停止回收槽 + this->setRunStatus(tr("正在准备关机,请等待%1秒...............").arg(i*3)); + MySleep(3000); + } + } + + if(!sysPara->status.lostCommuFlag){ + sysPara->para.calandar_and_dat.cnt1CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + sysPara->para.calandar_and_dat.cnt2CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); + sysPara->para.Counter3.cnt3CurrValue = QString::number(sysPara->status.Status_Counter3.cnt3CurrValue,16).toInt(); + + updateTotalCnt(0); + sysPara->saveParaToFile(); // 关机前将相关配置保存 + } + sysPara->status.powerOffAppending = false; + sysPara->devOp->controlViscosityPump(false); + sysPara->devOp->controlCycleValve(false); + if(!TEST_MODE){ + for(int i=7;i>0;i--) + { + if(i == 7) + sysPara->devOp->fpgaWrD(0xA442,2,1);//关闭回收槽 + this->setRunStatus(tr("正在准备关机,请等待%1秒...............").arg(i*3)); + MySleep(3000); + } + } + } + system("touch /home/plg/runFlag"); //表示是正常关机 + emit CloseJd(); + sysPara->para.gearPumpValue=gearPumpValue_backup; + sysPara->para.reclaimPumpPWMWidth = reclaimPumpPWMWidth_backup; + sysPara->devOp->controlCompressPump(false); + setRunStatus(tr("准备关机......")); + qDebug()<<"准备关机"; + sysPara->para.totalProductCnt +=sysPara->status.totalProductCnt; + sysPara->devOp->clearProductCnt(3 | 0x10);//总产器计数器立即清零 + sysPara->para.ReadFileErrorCnt=0; + sysPara->para.PowerOnErrorCnt=0; + if(sysPara->para.isCntSaveStateValue) + { + sysPara->para.cnt1CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); + sysPara->para.cnt2CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); + sysPara->para.cnt3CurrValue = QString::number(sysPara->status.Status_Counter3.cnt3CurrValue,16).toInt(); + } + updateTotalCnt(0); + sysPara->saveParaToFile(); // 关机前将相关配置保存 + +#ifdef SYS_LINUX +#ifdef __STC_POWER__ + sysPara->devOp->Heartbeat(0); //发送关机命令 + MySleep(200); + //QProcess process; + //process.startDetached("poweroff"); + //qApp->exit(0); +#endif + system("sync");//缓存同步 + sleep(5); + sysPara->devOp->powerOff(); + QProcess process; + process.startDetached("shutdown -h now"); + //qDebug()<<"run shutdown -h now"; + qApp->exit(0); + //qDebug()<<"qApp->exit(0)"; +#endif + } +} + +void MainWindow::on_pushButtonStart_pressed() +{ + //QFont font; + //font.setPointSize(30); + // ui->pushButtonStart->setFont(font); + pushButtonFlag = !pushButtonFlag; + if(pushButtonFlag) + { + ui->pushButtonStart->setStyleSheet("QPushButton{background-color:rgb(0, 255, 0)}"); + ui->pushButtonStart->setText(tr("泵启动")); + } + else + { + ui->pushButtonStart->setStyleSheet("QPushButton{background-color:rgb(255, 0, 0)}"); + ui->pushButtonStart->setText(tr("泵停止")); + } + //ui->pushButtonStart->setEnabled(false); + emit pushButtonStartPressed(pushButtonFlag); +} + +void MainWindow::_on_pushButtonPowerOff_pressed(bool notice){ + if(sysPara){ + if(sysPara->status.currReclaimTankPos != 0) + { + QMessageBox::StandardButton ret = QMessageBox::Ok; + if(notice) + ret = QMessageBox::warning(this, tr("警告"), + tr("回收槽未关,是否关闭回收槽后关机!"), + QMessageBox::Ok | QMessageBox::Cancel); + if (!notice || ret == QMessageBox::Ok){ + + system((char *)((QString("mkdir %1").arg(TESTDIR)).toAscii().data())); + system((char *)((QString("cp %1/*.bin %2/. ").arg(PARA_ROOT_DIR).arg(TESTDIR)).toAscii().data())); //先备份UP* + sysPara->status.reclaimCloseCnt=10; + on_pushButtonStopPrint_pressed(); + on_pushButtonReclaimTankClose_pressed(); + MySleep(1000); + sysPara->status.powerOffAppending = true; + enableReclaimCtrlButton(false); //所有的按钮全部屏蔽 + + } + } + else { + QMessageBox::StandardButton ret = QMessageBox::Ok; + if(notice) + ret = QMessageBox::warning(this, tr("警告"), + tr("是否确认关机?"), + QMessageBox::Ok | QMessageBox::Cancel); + + if (!notice || ret == QMessageBox::Ok){ + sysPara->status.powerOffAppending = true; + //system((char *)((QString("mkdir %1").arg(TESTDIR)).toAscii().data())); + //system((char *)((QString("cp %1/*.bin %2/. ").arg(PARA_ROOT_DIR).arg(TESTDIR)).toAscii().data())); //先备份UP* + checkForPowerOff(); + } + } + } +} +void MainWindow::on_pushButtonPowerOff_pressed() +{ + //if(!sysPara->status.lostCommuFlag) + _on_pushButtonPowerOff_pressed(true); +} + +void MySleep(unsigned int msec) +{ + + QTime dieTime = QTime::currentTime().addMSecs(msec); + + while( QTime::currentTime() < dieTime ) + + QCoreApplication::processEvents(QEventLoop::AllEvents, 100); + +} + +extern MyInputMethod *myInputMethod; + +void MainWindow::ontextEdittextChanged() +{ + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + QSizeF size = ui->textEdit->document()->size(); + ui->labelTextWidthHeight->setText(tr("[ %1行 x %2列 ]").arg(size.height()).arg(size.width())); + if(size.width() > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)){ + myInputMethod->getInputMethod()->on_Key_Backspace_released(); + MySleep(300); + //QMessageBox::warning(this, tr("警告"), + // tr("最多支持的列数目为:%1请减小信息长度.").arg(MAX_PRINT_COL_NUM)); + } + if(size.width() == 0) + { //在通过关标选择文本然后删除的时候,不会调用cursorPosition事件 + onTextEditCursorPositionChanged(); + } +} + + +void MainWindow::onTextEditCursorPositionChanged(){ + + for(int i = 0; i < 2; i++){ + QTextCharFormat fmt = ui->textEdit->currentCharFormat (); + QString s = ui->textEdit->document()->toPlainText(); + QFont font = fmt.font(); + QLabel *labelFontSize = ui->textEditOption->getLabelFontSize(); + QLabel *labelFontFamily = ui->textEditOption->getLabelFontFamily(); + QCheckBox *checkBoxBold = ui->textEditOption->getCheckBoxBold(); + bool ok; + //qDebug()<<"onTextEditCursorPositionChanged"<< font.family()<text().toInt(&ok,10)<logicalDpiX(); + DPI = DPI?DPI:1; + int pixeSize = font.pointSizeF()*DPI/72; + if(pixeSize >= Public::getMinFontPixelSize()){ + labelFontSize->setText(QString::number(Public::getAdjustedPixelSize(pixeSize))); + checkBoxBold->setChecked(font.weight() == QFont::Bold); + labelFontFamily->setText(font.family()); + barcode->setFontSize(Public::getAdjustedPixelSize(pixeSize)); + break; + } + else { + if(s.length()<=1) { + ui->textEdit->selectAll(); + font.setFamily(Public::getFontFamily(labelFontSize->text().toInt(&ok,10) )); + ui->textEditOption->setFontFormat(); //设置完格式后,在第二轮重设字体 + ui->textEdit->moveCursor(QTextCursor::End); + } else + ui->textEditOption->setFontFormat(); //设置完格式后,在第二轮重设字体 + } + } + } +} + +void MainWindow::onLabelFaultRusumePressed(){ + if(sysPara){ + sysPara->status.flagOfSpeedAlarm = false; + sysPara->status.mainInkPumpError = false; + sysPara->status.mainInkPumpRunTmCnt = 0; + sysPara->status.compressPumpError = false; + sysPara->status.compressPumpRunTmCnt = 0; + sysPara->devOp->resumeFault(); + ui->labelRunStatus->clear(); + sysPara->status.beeperOnFlag = false; + sysPara->devOp->controlBeeper(false); + sysPara->status.heaterONTimeCnt = 0; //加热块计数清零 + ui->labelStatusChargefault->setPixmap(QPixmap(QString::fromUtf8(":/image/ALARMGreen.PNG"))); + sysPara->status.DACDisable = false; + sysPara->status.lastPhaseFault = 0; + sysPara->status.phaseErrorCnt = 0; + sysPara->status.lastHighVoltageFault = false; + + if(sysPara->status.gearPumpRunStopFlag && pushButtonFlag) + { + emit repeatInitedPid(); + sysPara->status.gearPumpRunStopFlag = false;//齿轮泵报警恢复 + } + if((sysPara->devOp->color_flag == 2) ||(sysPara->devOp->color_flag == 1)||(sysPara->devOp->color_flag == 4)) + { + sysPara->devOp->color_flag = 3; + sysPara->devOp->controlYellowLight(false); + sysPara->devOp->controlRedLight(false); + } + sysPara->status.visocityValueOverflowNum = 0; + + if(sysPara->status.visocityValueOverflowNum>=MAX_ALLOW_VISICOSITY_OVERFLOW_NUM) // + sysPara->status.viscosityFault = 0; + + sysPara->status.powerOffAfterPhaseFaultAppending = 0; + sysPara->status.lastwarmInkPump = 0; + sysPara->status.RecycleWarnCnt =0; + sysPara->status.lastRecycleWarn =0 ; + sysPara->status.powerOffAfterInkOrSOLVEmptyAppending=0; + //sysPara->status.lastStatWarn=0; // 机器报故障后,点击故障恢复按钮,再点击打印按钮,“正在喷印中…”字符未立即显示出来,需等待大约10秒才会出现。 + //LogInfo::setRunStatusText(tr("故障恢复")); + sysPara->status.RecycleWarnCnt=0; + sysPara->status.HVFaultCloseEn=0; + + if(sysPara->status.flagOfPressureFault){ + sysPara->status.flagOfPressureFault = false; + sysPara->status.isPumpValveControledByHand = false; + sysPara->devOp->mainInkCtrl(); + emit clearPressureFault(); + } + + if(printintFlag) + sysPara->devOp->highVoltageCtrl(sysPara->para.HighVoltageAmplitude); + } +} + + void MainWindow::onEnableReclaimCtrlButton(bool flag) +{ + enableReclaimCtrlButton(flag); +} + +void MainWindow::onLabelProductCntPressed(){ + if(sysPara){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否初始化产品计数?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + updateTotalCnt(0); + sysPara->devOp->clearProductCnt(1); + sysPara->saveParaToFile(); + + } + } +} + +void MainWindow::onLabelTotalProductCntPressed(){ + if(sysPara){ + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否清除总产品计数?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->devOp->clearProductCnt(1 | 0x10 );// [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt = 0; + + } + } +} + +void MainWindow::onPushButtonCNTResetNowPressed(){ + if(sysPara){ + + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("警告"), + tr("是否立即重新计米?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret == QMessageBox::Ok){ + sysPara->devOp->clearProductCnt(3 | 0x10);// [3]总产品计数器清零FPGA + sysPara->para.totalProductCnt = 0; + } + + } + + + +} + +void MainWindow::on_bottonEditText_pressed() +{ + //qDebug()<<"EditMode"<para.EditMode; + if(sysPara->para.EditMode==TXTFILE){ + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + ui->stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + ui->stackedWidgetOption->setCurrentWidget(ui->textEditOption); + ontextEdittextChanged(); //显示大小 + int coldot = (int)ui->textEdit->document()->size().width(); + if(coldot > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + { + coldot = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + QMessageBox::warning(this, tr("警告"), + tr("最多支持的列数目为:%1请减小信息长度.").arg((MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide))); + } + } + else if(sysPara->para.EditMode==PICFILE){ + emit openCurrFile(sysPara->para.lastOpenedFileName); + } + else if(sysPara->para.EditMode==SCENE){ + //qDebug()<<"SCENE"; + //emit openCurrFile(sysPara->para.lastOpenedFileName); + ui->stackedWidgetText->setCurrentWidget(ui->fileSceneViewer); + ui->stackedWidgetOption->setCurrentWidget(ui->senceEditOption); + } + +} + +void MainWindow::on_pushButtonReduceTextDisplay_pressed() +{ + ui->widgetPrintTextDisplay->reduceDisplay(); +} + +void MainWindow::on_pushButtonEnlargeTextDisplay_pressed() +{ + + ui->widgetPrintTextDisplay->enlargeDisplay(); + //update(); +} + +/* + * value以100ms为单位 + * */ +void MainWindow::onReclainTankPositionChanged(int value){ + static bool init = false; + static int totalCharNum = 0; + if(!init){ + int w = ui->labelReclaimStatus->geometry().width() - 1; //预留几个像素 + QFontMetrics fontMetrics = QApplication::fontMetrics(); + w -= fontMetrics.width(QString(" |>|")); + int t = fontMetrics.width(QChar('-')); + if(fontMetrics.width(QChar('-')) != fontMetrics.width(QChar(' '))){ + LogInfo::setRunStatusText(tr("警告:‘-’和空格的宽度不一样")); //可能有的字体两者宽度不同 + } + totalCharNum = t?w/t:w; //t永远都不应该为零,保险起见 + init = true; + } + if(sysPara){ + int reclaimTime = sysPara->para.reclaimTankTime?sysPara->para.reclaimTankTime:15; + int charNum = value*totalCharNum/(reclaimTime*10); + charNum = (charNum > totalCharNum)?totalCharNum:charNum; + QString str = " |"; + for(int i = 0; i <= totalCharNum; i++){ //多加”>|“ + if(i < charNum) + str.append(QChar('-')); + else if(i == charNum) + str.append(QChar('>')); + else + str.append(QChar(' ')); + } + str.append(QChar('|')); + ui->labelReclaimStatus->setText(str); + } +} + + +void MainWindow::setRunStatus(QString str){ +// QFont ft; +// ft.setPointSize(16); +// ft.setBold(true); +// ft.setFamily("Microsoft YaHei"); +// ui->labelRunStatus->setFont(ft);P>p> + switch(sysPara->devOp->color_flag){ + case 1: + ui->labelRunStatus->setStyleSheet("color:yellow"); + break; + case 2: + ui->labelRunStatus->setStyleSheet("color:red"); + break; + default: + ui->labelRunStatus->setStyleSheet("color:black"); + break; + } + ui->labelRunStatus->setText(str); +} + + +void MainWindow::changeTxtMode(QString str){ + if(sysPara){ + fileChange=true; + sysPara->status.FileChangeRestCntFlag = true; + emit openFileChange(); + unsigned char SpecialVarEnable = 0; + sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&SpecialVarEnable,1); + } +} + +void MainWindow::update_scroll() +{ + ui->widgetPrintTextDisplay->scroll_update(); +} + +void MainWindow::changeEditMode(int editMode) +{ + if(sysPara){ + //qDebug()<<"changeEditMode"<para.EditMode; + if(sysPara->para.EditMode==PICFILE){ + ui->stackedWidgetText->setCurrentWidget(ui->pagePrintTextDisplay); + ui->stackedWidgetOption->setCurrentWidget(ui->pageOption); + ui->widgetPrintTextDisplay->update(); + ui->pushButtonTXTOpen->show(); + ui->textEditOption->editMode=sysPara->para.EditMode; + } + else if(sysPara->para.EditMode==TXTFILE) + { + // ui->stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + // ui->stackedWidgetOption->setCurrentWidget(ui->textEditOption); + sysPara->para.EditMode=TXTFILE; + ui->stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + ui->stackedWidgetOption->setCurrentWidget(ui->textEditOption); + ui->widgetPrintTextDisplay->update(); + ui->pushButtonTXTOpen->hide(); + ui->textEditOption->editMode=sysPara->para.EditMode; + ui->textEditOption->editItemModeDone(); + } + else if(sysPara->para.EditMode==SCENE) + { + //qDebug()<<"CCCCCENE"; + sysPara->para.EditMode=SCENE; + ui->stackedWidgetText->setCurrentWidget(ui->fileSceneViewer); + ui->stackedWidgetOption->setCurrentWidget(ui->senceEditOption); + ui->widgetPrintTextDisplay->update(); + ui->pushButtonTXTOpen->hide(); + ui->textEditOption->editMode=sysPara->para.EditMode; + } + //ontextEdittextChanged(); //显示大小 20140831 + if(sysPara->para.EditMode==SCENE) + { + onSwitchTimerShowItem(true); + } + else + { + onSwitchTimerShowItem(false); + } + } +} + +TextEditOption* MainWindow::getTexteditOption() +{ + return ui->textEditOption; +} + +void MainWindow::SetEditMode(int mode) +{ + ui->textEditOption->editMode = sysPara->para.EditMode; +// if(sysPara->para.EditMode==SCENE) +// { +// timerShowItem->start(10); +// } +} + +void MainWindow::setRunStatus(QPixmap pixMap){ + ui->labelRunStatus->setPixmap(pixMap); +} +void MainWindow::SetMainTabEdit(int n){ + +} + +void MainWindow::testPrint(){ + //on_pushButtonStartPrint_pressed(); +} + + +void MainWindow::onEditBarCode(){ +#ifdef _2DCODE_ + if(sysPara) { + dlgqrcode->move( 0,10); + barcode->setWindowTitle(tr("条形码信息编辑")); + //qDebug()<<"bcOption->height"<para.bcOption.height; + barcode->SetOption((bcOption_t*)&sysPara->para.bcOption); + barcode->show(); + //barcode->GetOption((bcOption_t*)&sysPara->para.bcOption); + } +#endif + +} +void MainWindow::onBarCodeClose(){ +#ifdef _2DCODE_ + barcode->GetOption((bcOption_t*)&sysPara->para.bcOption); +// unsigned char *dat = sysPara->status.printDat; + unsigned char *dat; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + if(barcode->flagCount) + { + barcode->getDat(dat,0); + barcode->flagCount=0; + ui->widgetPrintTextDisplay->update(); + } + if(barcode->flagInsert ) + { + barcode->flagInsert=0; + if(sysPara->para.EditMode==PICFILE) + { + + } + else + { + //ui->textEditOption->InsertBarCodeToEdit(barcode->pictureName,barcode->imgBar.width(),barcode->imgBar.height()); + QString html = ""; + QTextCharFormat fmt = ui->textEditOption->textEdit->currentCharFormat (); + ui->textEditOption->textEdit->insertHtml (html); + ui->textEditOption->textEdit->mergeCurrentCharFormat(fmt); + ui->stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + ui->stackedWidgetOption->setCurrentWidget(ui->textEditOption); + } + } + sysPara->saveParaToFile(); +#endif +} + +void MainWindow::onEditQRCode(){ +#ifdef _2DCODE_ + if(sysPara) { + dlgqrcode->SetOption((qrOption_t*)&sysPara->para.qrOption); + dlgqrcode->move( (this->width() - dlgqrcode->width())/2 ,10); + dlgqrcode->setWindowTitle(tr("二维码信息编辑")); + + dlgqrcode->setCntCheckBoxHide(1); + + dlgqrcode->show(); + } +#endif +} +void MainWindow::onInitQRCode(){ +#ifdef _2DCODE_ + if(sysPara) { + dlgqrcode->SetOption((qrOption_t*)&sysPara->para.qrOption); + dlgqrcode->move( (this->width() - dlgqrcode->width())/2 ,10); + dlgqrcode->setWindowTitle(tr("二维码信息编辑")); + //dlgqrcode->show(); + } +#endif +} +void MainWindow::onQRCodeClose(){ +#ifdef _2DCODE_ + dlgqrcode->GetOption((qrOption_t*)&sysPara->para.qrOption); + if(dlgqrcode->flagInsert ) { + //dlgqrcode->GetOption((qrOption_t*)&sysPara->para.qrOption); + dlgqrcode->flagInsert=0; + if(sysPara->para.EditMode==PICFILE){ + + } + else { + // qDebug()<<"flagInsert2"<flagInsert<bcWidth<bcHeight; + ui->textEditOption->InsertBarCodeToEdit(dlgqrcode->pictureName,dlgqrcode->bcWidth,dlgqrcode->bcHeight); + ui->stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + ui->stackedWidgetOption->setCurrentWidget(ui->textEditOption); + + } + } + if( sysPara->para.qrOption.barCodeFlag != dlgqrcode->barCodeFlag) + { + sysPara->para.qrOption.barCodeFlag = dlgqrcode->barCodeFlag; + ui->textEditOption->textEdit->setHtml(QApplication::translate("MainWindow", "\n" + "\n" + "


", 0, QApplication::UnicodeUTF8)); + } + sysPara->saveParaToFile(); +#endif +} + + void MainWindow::onGenerateQRCode(QString strData) + { + dlgqrcode->extSetText(strData); + dlgqrcode->GetOption((qrOption_t *)&sysPara->para.qrOption); + } + +void MainWindow::onShowAndHideItem() +{ + /////////特殊条件 + //while(1) + { + static bool startFlag= false, lastStarFlag = false; + + QList items = pPicScene->items(); + foreach (QGraphicsItem *item, items) + { + PicTextItem *picText = qgraphicsitem_cast(item); + if(picText->SpecialConditions) + { + //setRunStatus(tr("六个内容(%1,%2)").arg(picText->CatchCnt1CurrValue).arg(QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt())); + if(picText->CatchCnt1StartValue <= QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt() && + QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt() <= picText->CatchCnt1CurrValue) + { + picText->show(); + startFlag = true; + } + else + { + picText->hide(); + startFlag = false; + } + if(startFlag != lastStarFlag) + { + lastStarFlag = startFlag; + //on_pushButtonStartPrint_pressed(); + if(sysPara->para.EditMode == TXTFILE||sysPara->para.EditMode== PICFILE) + PreviewPressed(); //生成打印数据,确定变量的位置和对应生成字模 + else if(sysPara->para.EditMode == SCENE) + onPreviewScene(); +// unsigned char blankDat[BLANK_COL_NUM*MAX_PRINT_ROW_BYTE_NUM]; +// memset(blankDat,0,sizeof(blankDat)); +// sysPara->devOp->fpgaWr(0,blankDat,sizeof(blankDat));//...所加的空白偏移地址 +// sysPara->devOp->fpgaWr(sizeof(blankDat),sysPara->status.printDat,sizeof(sysPara->status.printDat)-sizeof(blankDat)); + } + } + } + //QApplication::processEvents(); + } + ////////////// + } + +void MainWindow::onSwitchTimerShowItem(bool flag) +{ + if(flag) + { + // timerShowItem->start(10); + } + else + { + timerShowItem->stop(); + unsigned char SpecialVarEnable = 0; + sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&SpecialVarEnable,1); + } +} + +void MainWindow::JSON_UpdateDATA(){ + + QLabel *labelFontSize = ui->textEditOption->getLabelFontSize(); + bool ok; + int font_size = labelFontSize->text().toInt(&ok,10); + QString font_family = Public::getFontFamily(font_size); + static int save_uniCode = 33; //数据码固定33位 + ui->textEditOption->textEdit->clear(); + + QString strContentPrint(sysPara->Get_JSON_DATA.PrintingContent); + strContentPrint.replace(' '," "); + QString strContent = sysPara->Get_JSON_DATA.QRCodeContent; + int left_int = strContent.indexOf("https://dwz.cn/"); + if(left_int == 0) + { + strContent = strContent.mid(8, strContent.size()); + strContent = "www." + strContent; + } + if(sysPara->para.isRemoveCode) + { + QSize size(2,5); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff);//填充白色 + //image.fill(0x00f0f000);//填充白色 +// QPainter painter(&image); +// //image.save("./printImage.jpg"); +// ui->textEdit->document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + image.save("/home/plg/doc/modbusQR.bmp"); + } + else + { + if(dlgqrcode->barCodeFlag == 1) + { + barcode->extSetText(QString::fromUtf8(strContent.toStdString().c_str())); + barcode->GetOption((bcOption_t*)&sysPara->para.bcOption); + } + else + { + dlgqrcode->extSetText(QString::fromUtf8(strContent.toStdString().c_str()), true); + dlgqrcode->GetOption((qrOption_t *)&sysPara->para.qrOption); + } + } + QString save_text = ui->textEditOption->textEdit->toHtml(); + + if(save_text.contains("", Qt::CaseSensitive)){ + int left_int = save_text.indexOf(""); + QString str_html = save_text.left(left_int); //get the QRcode pic left html + QString right_str_html = save_text.mid(left_int, save_text.size()); + + +// qDebug()<<"right_str_html="<").arg(font_family).arg(font_size) + .arg(ui->textEditOption->getCheckBoxBold()->isChecked()? 600:400); + //str_html += QString::fromUtf8(sysPara->Get_JSON_DATA.PrintingContent); + str_html += strContentPrint.toUtf8(); + str_html += "
"; +#endif + + if(!sysPara->para.isRemoveDigitCode) + { + str_html += ""; + + // qDebug()<<"str_html="< + 201289985295612398451182413082479asd
+ + asdasdasdasd

+ */ + + left_int = right_str_html.indexOf(";\">") + 1; + int index_size = QString(";\">").size(); + QString right_html = right_str_html.mid(left_int+index_size+save_uniCode, right_str_html.size()); + save_uniCode = QString::fromUtf8(sysPara->Get_JSON_DATA.ProductUniqueCode).size(); + // qDebug()<<"right_html="< ").arg(font_family) + .arg(font_size).arg(ui->textEditOption->getCheckBoxBold()->isChecked()? 600:400); + txt_fomart += QString::fromUtf8(sysPara->Get_JSON_DATA.ProductUniqueCode); + + if(!right_html.startsWith("<")){ //situation: "$ProductUniqueCodexxxx
" + QString crash_word = right_html.left(right_html.indexOf("<")); + txt_fomart += crash_word; + // qDebug()<<"crash_word="<"); + index_size = QString("
").size(); + QString final_str = right_html.mid(left_int +index_size, right_html.size()); + + str_html += final_str; + } + else + { + str_html += right_str_html; + } +// QMessageBox::StandardButton ret; +// ret = QMessageBox::question(this, tr("提示"),tr("是否接收新的信息!"), QMessageBox::Ok | QMessageBox::Cancel); +// if (ret == QMessageBox::Ok) + { + ui->textEditOption->textEdit->setHtml(str_html); + ui->textEditOption->textEdit->moveCursor(QTextCursor::EndOfLine); + } + } + else{ + QString txt_fomart = ""; +#if 1 + txt_fomart += QString::fromUtf8("").arg(font_family).arg(font_size) + .arg(ui->textEditOption->getCheckBoxBold()->isChecked()? 600:400); + txt_fomart += strContentPrint.toUtf8(); + txt_fomart += ""; +#endif + //ui->textEditOption->textEdit->insertHtml(txt_fomart); + + //ui->textEditOption->modbus_insert_pic("/home/plg/doc/modbusQR.bmp"); + //QString html = ""; + txt_fomart += ""; + txt_fomart += QString::fromUtf8(" ").arg(font_family).arg(font_size); + + if(!sysPara->para.isRemoveDigitCode) + { + txt_fomart += QString::fromUtf8(" ").arg(font_family).arg(font_size) + .arg(ui->textEditOption->getCheckBoxBold()->isChecked()? 600:400); + txt_fomart += QString::fromUtf8(sysPara->Get_JSON_DATA.ProductUniqueCode); + save_uniCode = QString::fromUtf8(sysPara->Get_JSON_DATA.ProductUniqueCode).size(); + txt_fomart += "   "; + } + else + { + txt_fomart += QString::fromUtf8(" ").arg(font_family).arg(font_size); + } +// QMessageBox::StandardButton ret; +// ret = QMessageBox::question(this, tr("提示"),tr("是否接收新的信息!"), QMessageBox::Ok | QMessageBox::Cancel); +// if (ret == QMessageBox::Ok) + { + ui->textEditOption->textEdit->insertHtml(txt_fomart); + } +// QString refresh_text = ui->textEditOption->textEdit->toHtml(); +// ui->textEditOption->textEdit->setHtml(refresh_text); +// ui->textEditOption->textEdit->moveCursor(QTextCursor::EndOfLine); + } + + if(sysPara->para.EditMode == TXTFILE||sysPara->para.EditMode== PICFILE) + PreviewPressed(); //生成打印数据,确定变量的位置和对应生成字模 + else if(sysPara->para.EditMode == SCENE) + onPreviewScene(); + //on_pushButtonStartPrint_pressed(); + + ui->label_24->setFocus(); //prevent keyboard pop up +} + +QStringList stringListRecive; + +// mdOpenFile(QString("/home/plg/doc/%1").arg(fileName)); +void MainWindow::modbusUpdateQRCode(){ +// QString temp = QString(); + sysPara->modbusStatus.printFinishFlag = 0;//置打印标志 + sysPara->status.printDoneFlag = false; + static QString lastReceiveContent = ""; + char temp[120] = {0}; + int i,j = 0; + for(i=0; i<110; i+=2) + { + //if(sysPara->modbusParas.QRcode_buf[i] == 0) break; + temp[j] = sysPara->modbusParas.QRcode_buf[i]; + j++; + } + if(strlen(&temp[1]) == 0) + { + LogInfo::setRunStatusText(tr("获取DM码内容为空!")); + return; + } + + if(sysPara->para.EditMode == TXTFILE) + { + QString receiveContent = QString::fromUtf8(&temp[1]); + dlgqrcode->extSetText(receiveContent); + LogInfo::setRunStatusText(tr("获取DM码内容:")); + LogInfo::setRunStatusText(receiveContent); + +// dlgqrcode->extSetText("asbasb"); + dlgqrcode->GetOption((qrOption_t *)&sysPara->para.qrOption); + +// ui->textEditOption->modbus_insert_pic("/home/plg/doc/QR_aa.bmp"); + ui->textEditOption->textEdit->clear();//插入之前先清空 + //ui->textEditOption->modbus_insert_pic("/home/plg/doc/modbusQR.bmp"); + QString html = ""; + ui->textEditOption->textEdit->setHtml(html); + ui->textEditOption->textEdit->moveCursor(QTextCursor::EndOfLine); + //sysPara->modbusStatus.printFinishFlag = 0;//置打印标志 + if(receiveContent == lastReceiveContent) + { + LogInfo::setRunStatusText(tr("获取DM码内容跟上次相同")); + //sysPara->modbusStatus.printFinishFlag = 1;//置打印标志 + MySleep(200); + sysPara->status.printDoneFlag = true; + return; + } + lastReceiveContent = receiveContent; + sysPara->status.oneCodePrintOnce = true; + on_pushButtonStartPrint_pressed();//开始打印 + } + else if(sysPara->para.EditMode == SCENE) + { + QString receiveContent = QString::fromUtf8(&temp[1]); + LogInfo::setRunStatusText(tr("获取DM码内容:")); + LogInfo::setRunStatusText(receiveContent); + if(receiveContent == lastReceiveContent) + { + LogInfo::setRunStatusText(tr("获取DM码内容跟上次相同")); + //sysPara->modbusStatus.printFinishFlag = 1;//置打印标志 + MySleep(200); + sysPara->status.printDoneFlag = true; + return; + } + lastReceiveContent = receiveContent; + + stringListRecive = receiveContent.split(";"); + + QString lastopenedFileName = sysPara->para.lastOpenedFileName; + lastopenedFileName = QFileInfo(lastopenedFileName).baseName(); + //LogInfo::setRunStatusText(tr("@文件名:")); + //LogInfo::setRunStatusText(lastopenedFileName); + int left_int = lastopenedFileName.indexOf('@'); + if(left_int == 0) + { + //LogInfo::setRunStatusText(tr("文件名:1")); + sysPara->status.forTemplateUse = true; + emit scenefileOpen(sysPara->para.lastOpenedFileName,false);//sceneeditoption 接收这个信号然后打开文件 + //emit fileNameChanged(QFileInfo(filePath).fileName()); + sysPara->status.forTemplateUse = false; + sysPara->status.oneCodePrintOnce = true; + on_pushButtonStartPrint_pressed();//开始打印 + } + } + + +} + +void MainWindow::onUpdateDispQRCode(int type){ +#ifdef _2DCODE_ + int varNum; + + qDebug()<<"onUpdateDispQRCode"; + //QRcode string test +// static int cc = 0; + for(varNum=0;varNumstatus.QRvariNum;varNum++){ + + + if(sysPara->print.QRvars[varNum].type<2) + { + sysPara->print.QRvars[varNum].Counter = sysPara->para.qrOption.counter; + sysPara->print.QRvars[varNum].cntNum = sysPara->para.qrOption.cntNum; + + //QRcode string test +// qDebug()<<"QRcode string test"; +// ++cc; +// QString text = "12345679801234567980123456798012345679801234567980"; +// text+=QString::number(cc%100); +// dlgqrcode->extSetText(text); +// dlgqrcode->GetOption((qrOption_t *)&sysPara->para.qrOption); + + + dlgqrcode->TextToQRImg((qrOption_t *)&sysPara->para.qrOption); // + dlgqrcode->getDat(sysPara,varNum); + }else if(sysPara->print.QRvars[varNum].type==2) + { + QString txt,txt2,txt3,txt4,txtVar1,txtVar2; + //char fmt[]="%08d%04d"; + txt2=sysPara->para.bcOption.TxtModule; + txt3=sysPara->para.bcOption.TxtLine; + txt4=sysPara->para.bcOption.TxtLine1; + sysPara->para.bcOption.var1Type =1; + sysPara->para.bcOption.var2Type =2; + txtVar1=barcode->getVarTxt(sysPara->para.bcOption.var1En,sysPara->para.bcOption.var1Type); + txtVar2=barcode->getVarTxt(sysPara->para.bcOption.var2En,sysPara->para.bcOption.var2Type); + //txt.sprintf(fmt,sysPara->status.calandar_and_dat.cnt1CurrValue,sysPara->status.calandar_and_dat.cnt2CurrValue); + txt = txt2.trimmed()+txtVar1+txt3.trimmed()+txtVar2+txt4.trimmed(); + barcode->TextToBCImg((bcOption_t *)&sysPara->para.bcOption,txt); // + barcode->getDat2(sysPara,varNum); + //qDebug()<<"update BAR"<status.calandar_and_dat.cnt1CurrValue<status.calandar_and_dat.cnt2CurrValue; + //qDebug()<print.QRvars[varNum].startRowPos = sysPara->print.QRvars[varNum].endRowPos-sysPara->print.QRvars[varNum].height; + if(sysPara->status.currPrintCol < (sysPara->print.QRvars[varNum].startColPos+sysPara->print.QRvars[varNum].width)) { + sysPara->status.currPrintCol = sysPara->print.QRvars[varNum].startColPos+sysPara->print.QRvars[varNum].width; + } + if (sysPara->status.currPrintRowprint.QRvars[varNum].endRowPos) { + sysPara->status.currPrintRow = sysPara->print.QRvars[varNum].endRowPos; + } + //sysPara->status.currPrintCol = (sysPara->status.currPrintColprint.QRvars[varNum].startColPos+sysPara->print.QRvars[varNum].width)? + // sysPara->print.QRvars[varNum].startColPos+sysPara->print.QRvars[varNum].width:sysPara->status.currPrintCol; + //sysPara->status.currPrintRow = (sysPara->status.currPrintRowprint.QRvars[varNum].endRowPos)?sysPara->print.QRvars[varNum].endRowPos:sysPara->status.currPrintRow; + +// qDebug()<<"onUpdate:"<< sysPara->print.QRvars[varNum].startColPos +// <print.QRvars[varNum].endRowPos <print.QRvars[varNum].width +// <print.QRvars[varNum].height <print.QRvars[varNum].type; + } + + if(type) + { + + sysPara->para.qrOption.DisplayUpdate=1; + // ui->widgetPrintTextDisplay->updateSysStatusToUI(); + if(sysPara->status.addSpace) + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol/2,sysPara->status.currPrintRow); + else ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->status.currPrintRow); + ui->stackedWidgetText->setCurrentWidget(ui->pagePrintTextDisplay); + ui->stackedWidgetOption->setCurrentWidget(ui->pageOption); + ui->labelTextWidthHeight->setText(tr("[ %1行 x %2列 ]").arg(sysPara->status.currPrintRow ).arg(sysPara->status.currPrintCol)); + ui->widgetPrintTextDisplay->update(); + //qDebug()<<"update BAR ??"; + } +#endif +} + +int MainWindow::searchExpiryVar() +{ + int varNum = 0; + if( sysPara->status.ExpiryVarNum || sysPara->status.CurrDateVariNum || sysPara->status.classVariNum) + { + QString pattern = ""; + // 1 type ,2 name,3 width,4 height + //

< + // + QRegExp rx(pattern); + QString textHtml = ui->textEdit->toHtml(); + int from = 0; + // int xx =textHtml.size(); + sysPara->print.ExpiryVar.type = 0; + sysPara->print.CurDateVar.type = 0; + //sysPara->print.CurDateVar[1].type = 0; + sysPara->print.ClassVari.type = 0; + while(from < textHtml.size() && from != -1){ + from = textHtml.indexOf(rx,from); + bool ok; + //qDebug()<print.ExpiryVar.type = type; + sysPara->print.ExpiryVar.width = rx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + sysPara->print.ExpiryVar.height = rx.cap(4).toInt(&ok); + //sysPara->print.ExpiryVar.startRowPos = sysPara->print.ExpiryVar.endRowPos-sysPara->print.ExpiryVar.height; + sysPara->print.ExpiryVar.startRowPos = sysPara->print.ExpiryVar.endRowPos-(sysPara->print.ExpiryVar.height-1); + if(sysPara->print.ExpiryVar.startRowPos < 0) + { + sysPara->print.ExpiryVar.startRowPos = 0; + } + if(rx.cap(2).contains("75")) + { + sysPara->print.ExpiryVar.bold = 1; + } + else + { + sysPara->print.ExpiryVar.bold = 0; + } + // 直接更新有效期,并退出? + ExpiryDotUpdate(1); + varNum++; + } + else if(type == CURDATE || type==CURDATE + 10 || type==CURDATE + 20 || type==CURDATE + 30) + { //currDate + //qDebug()<<"CurDateVar:"<print.CurDateVar[0].type == 0) { + qDebug()<<"1st CurDateVar:"; + currDate = &sysPara->print.CurDateVar[0]; + searchIndex = 2; + } + else { + qDebug()<<"2nd CurDateVar:"; + currDate = &sysPara->print.CurDateVar[1]; + searchIndex = 3; + } + currDate->type = type; + currDate->width = rx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + currDate->height = rx.cap(4).toInt(&ok); + currDate->startRowPos = currDate->endRowPos-currDate->height; + if(rx.cap(2).contains("875")) { + //qDebug()<<"bold"; + currDate->bold = 1; + } + else { + //qDebug()<<"normal"; + currDate->bold = 0; + } +#else + sysPara->print.CurDateVar.type = type; + sysPara->print.CurDateVar.width = rx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + sysPara->print.CurDateVar.height = rx.cap(4).toInt(&ok); + //sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-sysPara->print.CurDateVar.height; + sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-(sysPara->print.CurDateVar.height-1); + if(sysPara->print.CurDateVar.startRowPos < 0) + { + sysPara->print.CurDateVar.startRowPos = 0; + } + if(rx.cap(2).contains("875")) + { + //qDebug()<<"bold"; + sysPara->print.CurDateVar.bold = 1; + } + else + { + //qDebug()<<"normal"; + sysPara->print.CurDateVar.bold = 0; + } +#endif + //sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-(sysPara->print.CurDateVar.height-1); + //qDebug()<<"CurDateVar:startRowPos"<print.CurDateVar.startRowPos<<" height"<print.CurDateVar.height; + // 生产日期即当前日期 + ExpiryDotUpdate(2); + varNum++; + } + else if(type == CURCLASS) + { + //qDebug()<<"CURCLASS:"<print.ClassVari ; + currClass->type = type; + currClass->width = rx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + currClass->height = rx.cap(4).toInt(&ok); + currClass->startRowPos = currClass->endRowPos-currClass->height-1; + if(rx.cap(2).contains("875")) { + //qDebug()<<"bold"; + currClass->bold = 1; + } + else { + //qDebug()<<"normal"; + currClass->bold = 0; + } + + //sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-(sysPara->print.CurDateVar.height-1); + //qDebug()<<"CurDateVar:startRowPos"<print.CurDateVar.startRowPos<<" height"<print.CurDateVar.height; + // 生产日期即当前日期 + ExpiryDotUpdate(3); + varNum++; + } + } + else if(varNum>=3) break; + } + //break; + //if(varNum>sysPara->status.ExpiryVarNum)break; + } + } + return varNum; +} +void MainWindow::ExpiryDotUpdate(char Mode) +{ //更新有效期 + QTextEdit textEdit; + //textEdit.document()->setDocumentMargin(0); + textEdit.setLineWrapMode(QTextEdit::NoWrap); + int height,width; + //QDate curDate=QDate::currentDate(); + EXPIRYVAR_t *p_var;//=(Mode==1)?&sysPara->print.ExpiryVar:&sysPara->print.CurDateVar; + + if(sysPara->status.flagOfAdjustWidth_1){ + sysPara->print.ExpiryVar.splitMode = sysPara->status.splitMode_Adjust_1; + sysPara->status.flagOfAdjustWidth_1 = false; + } + if(sysPara->status.flagOfAdjustWidth_2){ + sysPara->print.CurDateVar.splitMode = sysPara->status.splitMode_Adjust_2; + sysPara->status.flagOfAdjustWidth_2 = false; + } + if(Mode==1) + { + qDebug()<<"Mode==1"; + if(sysPara->status.ExpiryVarNum == 0) { + return; + } + p_var = &sysPara->print.ExpiryVar; + QDate expiryDate=QDate::currentDate().addDays(sysPara->para.ExpiryDay); + sysPara->print.ExpiryVar.year = expiryDate.year(); + sysPara->print.ExpiryVar.month = expiryDate.month(); + sysPara->print.ExpiryVar.day = expiryDate.day(); + r_ExpiryDay = sysPara->para.ExpiryDay; + } + else if(Mode==2) + { + p_var = &sysPara->print.CurDateVar; + qDebug()<<"Mode==2"; + if(sysPara->status.CurrDateVariNum == 0) { + return; + } +#if 1 +// EXPIRYVAR_t *currDateVar; +// for (int i = 0; i <2; ++i) { +// if (sysPara->print.CurDateVar[i].type) { +// currDateVar = &sysPara->print.CurDateVar[i]; +// currDateVar->year = curDate.year(); +// currDateVar->month = curDate.month(); +// currDateVar->day = curDate.day(); +// } +// } +#else + sysPara->print.CurDateVar.year = curDate.year(); + sysPara->print.CurDateVar.month = curDate.month(); + sysPara->print.CurDateVar.day = curDate.day(); +#endif + } + else if(Mode==3) + { + p_var = &sysPara->print.ClassVari; + qDebug()<<"Mode==3"; + if(sysPara->status.classVariNum == 0) { + return; + } +#if 1 +// EXPIRYVAR_t *currDateVar; +// for (int i = 0; i <2; ++i) { +// if (sysPara->print.CurDateVar[i].type) { +// currDateVar = &sysPara->print.CurDateVar[i]; +// currDateVar->year = curDate.year(); +// currDateVar->month = curDate.month(); +// currDateVar->day = curDate.day(); +// } +// } +#else + sysPara->print.CurDateVar.year = curDate.year(); + sysPara->print.CurDateVar.month = curDate.month(); + sysPara->print.CurDateVar.day = curDate.day(); +#endif + } + else return; +//qDebug()<<"sysPara->status.ExpiryVarNum:"<status.ExpiryVarNum; + //if(sysPara->status.ExpiryVarNum) + { + textEdit.clear(); + height = p_var->height; + width = p_var->width; + + //qDebug()<<"height"<para.ExpirySplitMode) +// { +// case 0: str.sprintf("%04d-%02d-%02d",curDate.year(),curDate.month(),curDate.day());break; +// case 1: str.sprintf("%04d/%02d/%02d",curDate.year(),curDate.month(),curDate.day());break; +// case 2: str.sprintf("%04d%02d%02d",curDate.year(),curDate.month(),curDate.day());break; +// case 3: str.sprintf("%04d年%02d月%02d日",curDate.year(),curDate.month(),curDate.day());break; +// default:str.sprintf("%04d-%02d-%02d",curDate.year(),curDate.month(),curDate.day());break; +// } + + QHash dateFormat; + dateFormat.insert(0,"yyyy-MM-dd"); + dateFormat.insert(1,"yyyy/MM/dd"); + dateFormat.insert(2,"yyyyMMdd"); + dateFormat.insert(3,"yyyy年MM月dd日"); + dateFormat.insert(4,"yyyy-MM-dd hh:mm"); + dateFormat.insert(5,"yyyy/MM/dd hh:mm"); + dateFormat.insert(6,"yyyyMMddhhmm"); + dateFormat.insert(7,"yyyy年MM月dd日 hh:mm"); + dateFormat.insert(8,"hh:mm"); + dateFormat.insert(9,"ddhhmm"); + dateFormat.insert(10,"dd MM yy"); + dateFormat.insert(11,"dd/MM/yy"); + dateFormat.insert(12,"dd/MM/yyyy"); + dateFormat.insert(13,"dd-MM-yy"); + dateFormat.insert(14,"dd-MM-yyyy"); + //dateFormat.insert(10,"x"); + + /*****轮班变量功能 start******/ + /*00:00-08:00 + 08:00-16:00 + 16:00-00:00 + */ + QTime current_time =QTime::currentTime(); + int hour = current_time.hour(); + //qDebug()<<"current_hour="<para.ExpiryDay).toString(dateFormat.value(sysPara->print.ExpiryVar.splitMode)); + } + else if(Mode==2 ) { + DateTime = QDateTime::currentDateTime().toString(dateFormat.value(p_var->splitMode)); + } + else if (Mode == 3) { + if(hour >= 0 && hour <8) + { + dateFormat.insert(15,"A"); + DateTime = "A"; + } + else if(hour >= 8 && hour < 16) + { + dateFormat.insert(15,"B"); + DateTime = "B"; + } + else if(hour >= 16) + { + dateFormat.insert(15,"C"); + DateTime = "C"; + } + } + + /*****轮班变量功能 end******/ + //qDebug()<<"splitMode:"<splitMode; + //qDebug()<<"update DateTime:"<height); + //qDebug()<<"height"<bold:"<bold; + if(p_var->bold) { + textEdit.insertHtml(QString("%4") + .arg(Public::getFontFamily(height-1,p_var->type)) // 20160812 增加横向字体 p_var->type <9 正常, p_var->type 20~28 左横 p_var->type 40~48 右横 + .arg(height*72/DPI-1) + .arg(600) + .arg(DateTime) + ); //600表示加粗,400表示普通 + } + else { + textEdit.insertHtml(QString("%4") + .arg(Public::getFontFamily(height-1,p_var->type)) // 20160812 增加横向字体 p_var->type <9 正常, p_var->type 20~28 左横 p_var->type 40~48 右横 + .arg(height*72/DPI-1) + .arg(400) + .arg(DateTime) +// .arg("x") + ); //600表示加粗,400表示普通 + } + + //qDebug()<bold?QFont::Bold:QFont::Normal); + //QFontMetrics fontMetrics(font); + //int charWidth = (fontMetrics.width("0123456789"))/10 ; + //p_var->letterSpace = p_var->width/10/(sysPara->status.addSpace?2:1) - charWidth; + //font.setLetterSpacing(QFont::AbsoluteSpacing,p_var->letterSpace); + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace ); + textEdit.setFont(font); + //textEdit.document()->setDocumentMargin(0); + //qDebug()<para.ExpirySplitMode; + + int imgHeight = height + 12; + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + if(imgHeight> MAX_PRINT_ROW_NUM+12) + imgHeight = MAX_PRINT_ROW_NUM+12; + if(width> (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + width = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + QSize size(width+2,imgHeight); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff); + QPainter painter(&image); + textEdit.show(); //如果不显示,似乎不会绘制 + textEdit.document()->drawContents (&painter, image.rect()); /*将text写到pic*/ + textEdit.hide(); + //qDebug()<<"/Expiry.bmp"; + image.save("./Expiry.bmp"); +#ifdef DEBUG4 + image.save("./Expiry.bmp"); +#endif + int lastValidRow = 0; + for(int k = imgHeight - 1; k >= 0 ; k--){ + for(int j = 0; j < width+1; j ++){ + QRgb rgb = image.pixel(j,k); + if(rgb&0xff000000){ + lastValidRow = k + 1; + break; + } + } + if(lastValidRow != 0) + { + //qDebug()<<"lastValidRow"<status.ExpiryVarNum:"<status.ExpiryVarNum; + //qDebug()<<"GetData row:"<endRowPos<<" start:"<< p_var->startRowPos; + //qDebug()<<"GetData col:"<startColPos<<" start:"<< p_var->width; + int rowDiff = p_var->endRowPos - p_var->startRowPos; + int firstValidRow=0; + int firstValidRowDiff; + if(lastValidRow >= rowDiff) + { + firstValidRow = lastValidRow - rowDiff; + firstValidRowDiff = firstValidRow; + } + else + { + firstValidRow = 0; + firstValidRowDiff = lastValidRow > rowDiff; + } + + firstValidRow = firstValidRow >= 0?firstValidRow:0; //纠正 + //firstValidRow = 0; + //int rowByteNum = rowDiff/8 + ((rowDiff%8)?1:0); + //unsigned char *dat = (unsigned char *)calloc(width,rowByteNum); +#ifdef DEBUG4 + QString s2; + s2.sprintf ("firstValidRow:%d,lastValidRow:%d,rowByteNum:%d,width:%d ,rowDiff:%d\n\r",firstValidRow,lastValidRow,rowByteNum,width,rowDiff) ; + qDebug()<startColPos; + int hStart= p_var->startRowPos; + //int i = 0 ; + unsigned char *dat; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + }else{ + dat =sysPara->status.printDat; + } + for(int j = 2; j < width+1; j ++) + { + unsigned char c=0; + hStart= p_var->startRowPos; + c=dat[(wStart)*5+(hStart)/8]; + for(int k = firstValidRow; k <= lastValidRow; k++) + { + QRgb rgb = image.pixel(j,k); + //int currRow = k - firstValidRowDiff; + if(((rgb >> 24)&0xff) > 0x80) + { + c |= (1 << (hStart%8)); + //dat[rowByteNum*(j+(sysPara->status.addSpace?j:0) )+ currRow/8] |= (1<<(currRow%8)); + //str+="#"; + } + else + { + //str+="-"; + c &= ~(1 << (hStart%8)); + } + if(hStart%8==7) { + dat[(wStart)*5+(hStart)/8]=c; + c=dat[(wStart)*5+(hStart+1)/8]; + } + hStart++; + } + //str+="\n"; + dat[(wStart)*5+(hStart)/8]=c; + wStart++; + //if(sysPara->status.addSpace ) wStart++; //&& sysPara->print.QRvars[varNum].type==0 + } + //qDebug()<status.QRvariNum){ + QString pattern = ""; + // 1 type ,2 name,3 width,4 height + //

< + // + QRegExp rx(pattern); + //QString textHtml = ui->textEdit->toHtml(); + ///////////// + QTextEdit textEdit ; + for(int i=0;istatus.QRvariNum;i++) + { + + if(sysPara->print.QRvars[i].type==0){ + textEdit.insertHtml(QString("") + .arg(9).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + else if(sysPara->print.QRvars[i].type==1){ + textEdit.insertHtml(QString("") + .arg(10).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + else if(sysPara->print.QRvars[i].type==2){ + textEdit.insertHtml(QString("") + .arg(11).arg(sysPara->para.qrOption.height).arg(sysPara->para.qrOption.width)); //插入索引后 + } + } + QString textHtml = textEdit.toHtml(); + //////////// + int from = 0; + // int xx =textHtml.size(); + while(from < textHtml.size() && from != -1){ + from = textHtml.indexOf(rx,from); + bool ok; + //qDebug()<=9 && (sysPara->print.QRvars[varNum].type ==type-9)) + { + //sysPara->print.QRvars[varNum].type = type-9; + sysPara->para.qrOption.type = type-9; + sysPara->para.qrOption.width=sysPara->print.QRvars[varNum].width = rx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + sysPara->para.qrOption.height =sysPara->print.QRvars[varNum].height = rx.cap(4).toInt(&ok); + sysPara->print.QRvars[varNum].startRowPos = sysPara->print.QRvars[varNum].endRowPos-sysPara->print.QRvars[varNum].height; + + //qDebug()<<"type:"<print.QRvars[varNum].type<status.QRvariNum + // <print.QRvars[varNum].startColPos<print.QRvars[varNum].startRowPos<print.QRvars[varNum].endRowPos + // <print.QRvars[varNum].width<print.QRvars[varNum].height + // <status.statWarn & WARN_STATUS_POWER_MON)) return; +#endif + strTitle = tr("高压故障,暂停打印."); + + strWarring = tr("高压故障:两高压偏转板间的电压检测异常");strWarring.append("\r\n"); + strWarring.append(tr("1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座;"));strWarring.append("\r\n"); + strWarring.append( tr("2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间;"));strWarring.append("\r\n"); + //strWarring.append( tr("字高设置为90时,重置高压报警值应在480—550之间;"));strWarring.append("\r\n"); + strWarring.append( tr("3.高压线路漏电,请更换高压线路;"));strWarring.append("\r\n"); + strWarring.append( tr("4.高压底座漏电,请更换高压底座。"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); + +} +void MainWindow::onStatusInkLeak(){ +#ifdef X86TEST + +#else + if(!(sysPara->status.statWarn & WARN_STATUS_SUMP_WARN)) return; +#endif + strTitle = tr("墨水缸满报警"); + + strWarring = tr("墨水过多:墨水溢出");strWarring.append("\r\n"); + strWarring.append(tr("1. 请停止添加墨水;"));strWarring.append("\r\n"); + strWarring.append(tr("2. 请排出多余墨水。"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +} +void MainWindow::onStatusInkSwint(){ + if(!(sysPara->status.statWarn & WARN_STATUS_INK_SWINT)) return; + +} +void MainWindow::onStatusInkWaterLevel(){ +#ifdef X86TEST + +#else + if(!(sysPara->status.statWarn & WARN_STATUS_INK_WARN)) return; +#endif + strTitle = tr("墨水液位报警"); + + strWarring = tr("墨水液位:墨水即将耗尽");strWarring.append("\r\n"); + strWarring.append(tr("1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +} +void MainWindow::onStatusRecycleWarn(){ +#ifdef X86TEST + +#else + if(!(sysPara->status.statWarn & WARN_STATUS_RECYCLE_FAULT)) return; +#endif + strTitle = tr("回收故障,关闭回收槽,关墨线"); + strWarring = tr("回收故障:未检测到有墨水回收");strWarring.append("\r\n"); + strWarring.append( tr("1. 墨水未射入回收管,请修正墨线方向;"));strWarring.append("\r\n"); + strWarring.append( tr("2. 墨水粘度太低,请更换新墨水;"));strWarring.append("\r\n"); + strWarring.append( tr("3. 回收管堵塞,请清通或者更换回收管;"));strWarring.append("\r\n"); + strWarring.append(tr("4. 回收泵故障,请清洗或者更换回收泵;"));strWarring.append("\r\n"); + strWarring.append( tr("5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮."));strWarring.append("\r\n"); + //strWarring.append( tr(" 退回主窗口界面点击“故障恢复”按钮."));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +} +void MainWindow::onStatusSolvLevelWarn(){ +#ifdef X86TEST + +#else + if(!(sysPara->status.statWarn & WARN_STATUS_SOLV_WARN)) return; +#endif + + strTitle = tr("溶剂液位报警"); + + strWarring = tr("溶剂液位:溶剂即将耗尽");strWarring.append("\r\n"); + strWarring .append(tr("1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +} +void MainWindow::onStatusViscosityWarn(){ +#ifdef X86TEST + +#else + if(sysPara->status.viscosityFault==1) +#endif + { + strTitle = tr("粘度故障报警"); + strWarring = tr("粘度故障:墨水粘度无法自动调整");strWarring.append("\r\n"); + strWarring.append( tr("1. 混合阀失灵,请冲洗或者更换混合阀;"));strWarring.append("\r\n"); + strWarring.append( tr("2. 墨水罐内的墨水异常,请更换新墨水;"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +#ifdef X86TEST + +#else + } + else if(sysPara->status.viscosityFault==2) + { + +#endif + strTitle = tr("粘度故障报警"); + strWarring= tr("粘度计异常:");strWarring.append("\r\n"); + strWarring.append(tr("1. 泵前过滤网堵塞,请更换泵前滤网;"));strWarring.append("\r\n"); + strWarring.append( tr("2. 粘度泵异常,请清洗或更换粘度泵;"));strWarring.append("\r\n"); + strWarring.append(tr("3. 粘度传感器异常,请检查传感器线路或者更换传感器."));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); +} + +} +void MainWindow::onStatusChargefault(){ +#ifdef X86TEST + +#else + if(sysPara->status.lastPhaseFault) +#endif + { + + strTitle = tr("相位故障报警"); + strWarring = tr("相位故障:相位信号检测异常");strWarring.append("\r\n"); + strWarring.append(tr("1. 墨水分裂不正常,请调整墨水分裂;"));strWarring.append("\r\n"); + strWarring.append(tr("2. 充电槽或者相检头脏污,请清洗充电槽和相检头;"));strWarring.append("\r\n"); + strWarring.append(tr("3. 放大板功能性异常,请更换放大板;"));strWarring.append("\r\n"); + strWarring.append( tr("4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离;"));strWarring.append("\r\n"); + strWarring.append( tr("5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰;"));strWarring.append("\r\n"); + strWarring.append( tr("6. 墨水质量异常,请更换新墨水。"));strWarring.append("\r\n"); + emit ShowWarnningText(strTitle,strWarring); + + } +} + +void MainWindow::OnFinished(int event){ + //msgtest->setText("孔一:60分钟灌浆结束条件!请点击\"结束\"按钮!"); + //msgtest->show(); + msgtest->hide(); + +} + + + + + + +void MainWindow::onPreviewScene() +{ + +#if 1 + pPicScene->clearSelection(); + QSize size(pPicScene->itemsBoundingRect().width(),pPicScene->itemsBoundingRect().height()); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff);//填充白色 + //image.save("./printScene.jpg");//图片 + QPainter painter(&image); + pPicScene->render(&painter,QRectF(),pPicScene->itemsBoundingRect()); + //qDebug()<<"scene rect:"<itemsBoundingRect(); + //image.save("./printSceneDone.jpg");//图片 + +#endif + + int coldot=0; + if(sysPara){ + bool MaxCol4000; + if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1) + MaxCol4000 = false; + else + MaxCol4000 = true; + previewFlag=1; + sysPara->status.currPrintRow = 0; + sysPara->status.variNum = 0; + sysPara->status.QRvariNum = 0; +// unsigned char *dat = sysPara->status.printDat; +// memset(dat,0,sizeof(sysPara->status.printDat)); + unsigned char *dat; + if(MaxCol4000){ + dat =sysPara->status.printDat_Normal; + memset(dat,0,sizeof(sysPara->status.printDat_Normal)); + }else{ + dat =sysPara->status.printDat; + memset(dat,0,sizeof(sysPara->status.printDat)); + } + //qDebug()<<"Preview:"; + { + sysPara->status.addSpace = sysPara->para.checkSpace; + + coldot = (int)ui->textEdit->document()->size().width(); + coldot = pPicScene->itemsBoundingRect().width(); + if(coldot > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + coldot = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int maxPicHeight = MAX_PRINT_ROW_NUM + 12; + QSize size(coldot,maxPicHeight); + + sysPara->status.currPrintRow =0; + #ifdef SPACEFLAG + sysPara->status.currPrintCol = coldot + ( sysPara->status.addSpace?coldot:0) ; //checkSpace + #else + sysPara->status.currPrintCol = coldot; + #endif + + #ifdef VARCOLOR + + + #else +#if 0 + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff);//填充白色 + //image.fill(0x00f0f000);//填充白色 + QPainter painter(&image); + image.save("./printImage.jpg"); + ui->textEdit->document()->drawContents (&painter, image.rect()); /*将text写到pic*/ +#else + //QSize size(pPicScene->itemsBoundingRect().width(),pPicScene->itemsBoundingRect().height()); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff);//填充白色 + //image.save("./printScene.jpg");//图片 + QPainter painter(&image); + QRectF validRectF(pPicScene->itemsBoundingRect().x(),pPicScene->itemsBoundingRect().y(),coldot,maxPicHeight); + pPicScene->render(&painter,QRectF(),validRectF); + //qDebug()<<"items bound:"<itemsBoundingRect(); +#endif + #ifndef DEBUG1 + //image.save("/opt/printImage.jpg"); + #endif + //image.save("./printImageScene.bmp");//图片 + //image.save("./printImagenn.jpg");//图片 + + //ui->widgetPrintTextDisplay +// int firstRow = maxPicHeight; + int firstRow = 0; + /*--------------------------------------------------------------------------*/ + for(int j = 0; j < maxPicHeight; j++){ //计算首行位置 + for(int i = 0; i < coldot; i++){ + QRgb rgb = image.pixel(i,j); + if(rgb !=0x00ffffff )//& 0xff000000) + { + //qDebug()<maxPicHeight)?maxPicHeight:lastRow; + //接下来就是要把打印到数据data填充以及确认变量的个数,变量对应的开始列和结束行 + for(int j = 0; j < lastRow - firstRow; j++){ // Y + for(int i = 0; i < coldot; i++){ // + QRgb rgb = image.pixel(i,j + firstRow); + if(rgb&0x80000000){ //判断alpha + //if((rgb & 0xffffff) == 0xff0000) {j=40; break;} + #ifdef MMVAR + if((rgb & 0xf0f0ff) == 0xf0f000){ //处理变量, 查找左下角,因为同一行的左下角是对齐的 看起来这个颜色是黄色 + + bool foundvar=0; + if(j>0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0xf0f0ff) != 0xf0f000 ){foundvar =1;} + //QRgb r_rgb = image.pixel(i,j + firstRow-1);if((r_rgb & 0xf0f0ff) == 0xf0f000 )foundvar =0; + } + if(foundvar){ + if(sysPara->status.variNum < MAX_VARI_NUM){ + sysPara->status.vars[sysPara->status.variNum].startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->status.vars[sysPara->status.variNum].endRowPos = j; + //if(varLastRowstatus.variNum ++;TempVarNum++; + //i+=5;//scene 每一行可能都包含变量 + //qDebug()<<"VARr:"< 0)?(dat[MAX_PRINT_ROW_BYTE_NUM*(i - 1) + j/8] & (1 << (j%8))):0; + int downPointValue = (j < (lastRow - firstRow - 1))?(image.pixel(i,j + firstRow + 1) != 0x00ffffff):0; + if(!leftPointValue && !downPointValue){ //找左下脚的位置 + if(sysPara->status.variNum < MAX_VARI_NUM){ + sysPara->status.vars[sysPara->status.variNum].startColPos = i; + sysPara->status.vars[sysPara->status.variNum].endRowPos = j; + sysPara->status.variNum ++;TempVarNum++; + } + else TempVarNum++; + } + dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + + #endif + + else if( ((rgb & 0xfffff0) == 0x00ff10) || ((rgb & 0xfffff0) == 0x00ff20) ||((rgb & 0xfffff0) == 0x00ff30) ){ + // 0xff00ff01(DMT) 0xff00ff02(QR) 0xff00ff03(BAR) + //qDebug()<<"FLAG:"<status.QRvariNum>=4)continue; + if((rgb & 0x00ffff0) == 0x00ff10) { //MDT + sysPara->print.QRvars[sysPara->status.QRvariNum].type=MDT; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00ffff0) == 0x00ff20) { //QR + sysPara->print.QRvars[sysPara->status.QRvariNum].type=QR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00fffff0) == 0x00ff30) { //BAR + sysPara->print.QRvars[sysPara->status.QRvariNum].type=BAR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0); + + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1; + + if(varLastRowstatus.QRvariNum++; + + } + if(sysPara->status.QRvariNum>=4)sysPara->status.QRvariNum=4; + + } + //else if((rgb & 0xfffff0)==0xff00f0) + else if((rgb & 0x00ffffff)==EXPIRY_VARI_RECONISE) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + bool foundExVar=0; + if(j>0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0x00ffffff) != EXPIRY_VARI_RECONISE ){foundExVar =1;} + } + if(foundExVar) + { + if(sysPara->status.ExpiryVarNum <2) + { + sysPara->print.ExpiryVar.startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->print.ExpiryVar.endRowPos = j; + if(varLastRowstatus.ExpiryVarNum ++; + i+=5; + } + //else TempVarNum++; + //dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + } + else if((rgb & 0xfffff0)==0xff0cf0) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + bool foundExVar=0; + if(j>0){ + QRgb r_rgb = image.pixel(i,j + firstRow+1); + if((r_rgb & 0xfffff0) != 0xff0cf0 ){foundExVar =1;} + } + if(foundExVar) + { + if(sysPara->status.ExpiryVarNum <2) + { + sysPara->print.CurDateVar.startColPos = i+(sysPara->status.addSpace?i:0); + sysPara->print.CurDateVar.endRowPos = j; + if(varLastRowstatus.CurrDateVariNum ++; + i+=5; + } + //else TempVarNum++; + //dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + } + else if((rgb & 0xffffff)==0xff00ff) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + { + if(sysPara->status.classVariNum <3) { + EXPIRYVAR_t *currCLass = &sysPara->print.ClassVari ; + currCLass->day = QDateTime::currentDateTime().date().day(); + currCLass->startColPos = i+(sysPara->status.addSpace?i:0); + currCLass->endRowPos = j; + if(varLastRowstatus.classVariNum ++; + i+=5; + } + } + } + else + { //Y = 0.299*R' + 0.587*G' + 0.114*B //非变量 + int y = (((rgb&0xff)*299 + ((rgb>>8)&0xff)*587 + ((rgb>>16)&0xff)*114))/1000; + //qDebug()<<"y:"<status.addSpace?i:0)) + j/8] |= 1 << (j%8); //画黑点 + #else + dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + #endif +// if(j > sysPara->status.currPrintRow) +// sysPara->status.currPrintRow = j; + if((j+1) > sysPara->status.currPrintRow) { + sysPara->status.currPrintRow = j+1; + //qDebug()<<"dddd currPrintRow:"<< sysPara->status.currPrintRow; + } + } + } + + }/*判断alpha end*/ + } + } + + // var + //qDebug() <<"VarNum"<MAX_VARI_NUM){ + setRunStatus(tr("变量数大于8个,某些变量将不起作用!!!")); + strTitle= tr("变量数大于8个,某些变量将不起作用!!!"); + strTitle.append("\r\n"); + strTitle.append(tr("请减少信息中的变量(或计数器)数量.")); + QMessageBox::warning(this, tr("警告"),strTitle,QMessageBox::Ok); + } +#endif + //qDebug()<status.vars[0].startRowPos<status.vars[0].endRowPos<< sysPara->status.currPrintRow; + // ==============查找QRV, DMTV,BARV 变量 MAX_QVARI_NUM + //qDebug()<<"qrvar"<status.QRvariNum; + searchQrVar(); +#if 1 + sysPara->status.variNum = 0; + sysPara->status.ExpiryVarNum = 0; + sysPara->print.ExpiryVar.startColPos = 0; + sysPara->print.ExpiryVar.endRowPos = 0; + sysPara->print.ExpiryVar.letterSpace =0; + sysPara->print.CurDateVar.startColPos = 0; + sysPara->print.CurDateVar.endRowPos = 0; + sysPara->print.CurDateVar.letterSpace = 0; + sysPara->status.CurrDateVariNum = 0; + sysPara->status.QRvariNum=0;//lch add + int myvariNum=0; + int expiryVarNum = 0; + + QList items = pPicScene->items(); + foreach (QGraphicsItem *item, items) { + PicTextItem *picText = qgraphicsitem_cast(item); + //qDebug()<<"item position: "<< picText->pos(); + //qDebug()<<"item bound: "<< picText->boundingRect(); + //int varNum = 0; + bool ok; + int textvariNum=0; + + int textColdot=0; + //textColdot = (int)picText->document()->size().width(); + textColdot = picText->boundingRect().width(); + //qDebug()<<"textColdot:"< (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + textColdot = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int maxTextHeight = MAX_PRINT_ROW_NUM + 12; + //int maxTextHeight = picText->document()->size().height(); + if(maxTextHeight > MAX_PRINT_ROW_NUM + 12) + { + //maxTextHeight = MAX_PRINT_ROW_NUM + 12; + } + QSize textSize(textColdot, maxTextHeight); + QImage textImage(textSize,QImage::Format_ARGB32); + textImage.fill(0x00ffffff);//填充白色 + //image.fill(0x00f0f000);//填充白色 + QPainter textPainter(&textImage); + //textImage.save("./textImage.jpg"); + + //QRectF validtextRectF(picText->pos().x(),picText->pos().y(),textColdot,maxTextHeight); + QRectF validtextRectF(picText->pos().x(),picText->pos().y(),textColdot,picText->document()->size().height()); + pPicScene->render(&textPainter,QRectF(),validtextRectF); + //qDebug()<<"validtextRectF:"<pos().x() - pPicScene->itemsBoundingRect().x(); + textItemPosY = picText->pos().y() - pPicScene->itemsBoundingRect().y(); + + //qDebug()<<"textItemPosX:"<SpecialConditions) + { + //SpecialVarPrint specialVarPrint; + sysPara->status.specialVarPrint.SpecialVarEnable = picText->SpecialConditions; + sysPara->status.specialVarPrint.SpecialVarCountStart = picText->CatchCnt1StartValue ; + sysPara->status.specialVarPrint.SpecialVarCountEnd = picText->CatchCnt1CurrValue; + sysPara->status.specialVarPrint.SpecialVarColStart = 3 + picText->pos().x() - pPicScene->itemsBoundingRect().x(); + sysPara->status.specialVarPrint.SpecialVarColEnd = 3 + picText->pos().x() - pPicScene->itemsBoundingRect().x()+ picText->boundingRect().width(); + sysPara->status.specialVarPrint.SpecialVarRowStart = picText->pos().y() - pPicScene->itemsBoundingRect().y(); + sysPara->status.specialVarPrint.SpecialVarRowEnd = picText->pos().y() - pPicScene->itemsBoundingRect().y()+ picText->boundingRect().height(); + sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&sysPara->status.specialVarPrint,sizeof(SpecialVarPrint)); // Send specialVarPrint 2022-8-6 +// LogInfo::setRunStatusText(tr("发送特殊变量内容:")); +// LogInfo::setRunStatusText(tr("SpecialVarEnable:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarEnable))); +// LogInfo::setRunStatusText(tr("SpecialVarCountStart:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarCountStart))); +// LogInfo::setRunStatusText(tr("SpecialVarCountEnd:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarCountEnd))); +// LogInfo::setRunStatusText(tr("SpecialVarColStart:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarColStart))); +// LogInfo::setRunStatusText(tr("SpecialVarColEnd:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarColEnd))); +// LogInfo::setRunStatusText(tr("SpecialVarRowStart:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarRowStart))); +// LogInfo::setRunStatusText(tr("SpecialVarRowEnd:%1").arg(QString().sprintf("%02X",sysPara->status.specialVarPrint.SpecialVarRowEnd))); +// int BoundingRectY = pPicScene->itemsBoundingRect().y(); +// int BoundingRectX = pPicScene->itemsBoundingRect().x(); +// LogInfo::setRunStatusText(tr("itemsBoundingRect().y():%1").arg(QString().sprintf("%02X",BoundingRectY))); +// LogInfo::setRunStatusText(tr("itemsBoundingRect().x():%1").arg(QString().sprintf("%02X",BoundingRectX))); + } + + //接下来就是要把打印到数据data填充以及确认变量的个数,变量对应的开始列和结束行 + for(int j = 0; j < textLastRow - textFirstRow; j++){ // Y + for(int i = 0; i < textColdot; i++){ // + QRgb rgb = textImage.pixel(i,j + textFirstRow); + if((rgb&0x80000000)){ //判断alpha +#ifdef MMVAR + if((rgb & 0xf0f0ff) == 0xf0f000){ //处理变量, 查找左下角,因为同一行的左下角是对齐的 看起来这个颜色是黄色 + + bool textfoundvar = 0; + if(j>0){ + QRgb r_rgb = textImage.pixel(i,j + textFirstRow+1); + if((r_rgb & 0xf0f0ff) != 0xf0f000 ) + { + textfoundvar =1; + } + + } + if(textfoundvar){ + //qDebug()<<"general variable"; + if(sysPara->status.variNum < MAX_VARI_NUM){ + sysPara->status.vars[sysPara->status.variNum].startColPos = i+(sysPara->status.addSpace?i:0)+textItemPosX; + sysPara->status.vars[sysPara->status.variNum].endRowPos = j+textItemPosY; + //qDebug()<<"sysPara->status.variNum:"<status.variNum; + //qDebug()<<"startColPos:"<status.vars[sysPara->status.variNum].startColPos; + //qDebug()<<"endRowPos:"<status.vars[sysPara->status.variNum].endRowPos; + if(varLastRowstatus.variNum ++; + textvariNum++; + i+=5;//scene 每一行可能都包含变量 + //qDebug()<<"VARr:"<itemAt(i,j+firstRow); + //picText_var[i]= (PicTextItem*) gItem; + //picText_var_hash.insert(picText_var[i],i); + } + else + { + textvariNum++; + } + } + } +#endif + else if( ((rgb & 0xfffff0) == 0x00ff10) || ((rgb & 0xfffff0) == 0x00ff20) ||((rgb & 0xfffff0) == 0x00ff30) ){ + // 0xff00ff01(DMT) 0xff00ff02(QR) 0xff00ff03(BAR) + //qDebug()<<"FLAG:"<status.QRvariNum>=4)continue; + if((rgb & 0x00ffff0) == 0x00ff10) { //MDT + sysPara->print.QRvars[sysPara->status.QRvariNum].type=MDT; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0)+textItemPosX; + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1+textItemPosY; + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00ffff0) == 0x00ff20) { //QR + sysPara->print.QRvars[sysPara->status.QRvariNum].type=QR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0)+textItemPosX; + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1+textItemPosY; + if(varLastRowstatus.QRvariNum++; + } + else if((rgb & 0x00fffff0) == 0x00ff30) { //BAR + sysPara->print.QRvars[sysPara->status.QRvariNum].type=BAR; + sysPara->print.QRvars[sysPara->status.QRvariNum].countEn=1; + sysPara->print.QRvars[sysPara->status.QRvariNum].Counter=sysPara->status.productCnt; + + sysPara->print.QRvars[sysPara->status.QRvariNum].startColPos=i+(sysPara->status.addSpace?i:0)+textItemPosX; + + sysPara->print.QRvars[sysPara->status.QRvariNum].endRowPos=j+1+textItemPosY; + + if(varLastRowstatus.QRvariNum++; + + } + if(sysPara->status.QRvariNum>=4)sysPara->status.QRvariNum=4; + + } + //else if((rgb & 0xfffff0)==0xff00f0) + else if((rgb & 0x0000ffff)==EXPIRY_VARI_RECONISE) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + //qDebug()<<"found EXPIRY_VARI_RECONISE"; + bool foundExVar=0; + if(j>0){ + QRgb r_rgb = textImage.pixel(i,j + firstRow+1); + if(((r_rgb & 0x0000ffff) != EXPIRY_VARI_RECONISE )){foundExVar =1;} + } + if(foundExVar) + { + //if(sysPara->status.ExpiryVarNum <2) + { + //if(sysPara->print.ExpiryVar.endRowPos==0) + if(sysPara->status.ExpiryVarNum == 0) + { + sysPara->status.ExpiryVarNum ++; + } + sysPara->print.ExpiryVar.startColPos = i+(sysPara->status.addSpace?i:0)+textItemPosX; + sysPara->print.ExpiryVar.endRowPos = j+textItemPosY; + if(varLastRowprint.ExpiryVar.endRowPos:"<print.ExpiryVar.endRowPos; + } + //else TempVarNum++; + //dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 + } + } + else if((rgb & 0xfffff0)==0xff0cf0) + { // 有效期变量 : 处理变量, 查找左下角,因为同一行的左下角是对齐的 + + bool foundExVar=0; + if(j>0){ + QRgb r_rgb = textImage.pixel(i,j + firstRow+1); + if((r_rgb & 0xfffff0) != 0xff0cf0 ){foundExVar =1;} + } + if(foundExVar) + { + //qDebug()<<"found CurDateVar"; + //if(sysPara->status.ExpiryVarNum <2) + { + //if(sysPara->print.CurDateVar.endRowPos==0) + if(sysPara->status.CurrDateVariNum == 0) + { + sysPara->status.CurrDateVariNum ++; + //setRunStatus(QString("CurrDateVariNum(%1)").arg(sysPara->status.CurrDateVariNum)); + } + sysPara->print.CurDateVar.startColPos = i+(sysPara->status.addSpace?i:0)+textItemPosX; + sysPara->print.CurDateVar.endRowPos = j + textItemPosY; + //qDebug()<<"CurDateVar ixj:"<print.CurDateVar.endRowPos:"<print.CurDateVar.endRowPos; + if(varLastRow>8)&0xff)*587 + ((rgb>>16)&0xff)*114))/1000; + //qDebug()<<"y:"<status.addSpace?i:0)) + j/8] |= 1 << (j%8); //画黑点 +#else + dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] |= 1 << (j%8); //画黑点 +#endif + } +#endif + } + + if(j > sysPara->status.currPrintRow) { + sysPara->status.currPrintRow = j+textItemPosY; + qDebug()<<"sysPara->status.currPrintRow:"<status.currPrintRow; + } + }/*判断alpha end*/ + } + } + //qDebug()<<"ExpiryVarNum:"<status.ExpiryVarNum; +//===================一般变量===================== + //myvariNum = 0; + QString textVariPattern = ""; + QRegExp textrx(textVariPattern); + QString textHtml = picText->toHtml(); + int from = 0; + //int myvariNum=0; + while(from < textHtml.size() && from != -1){ + from = textHtml.indexOf(textrx,from); + + if(from != -1){//找到匹配的 + //qDebug()<<"found variable"; + from ++; + //if(myvariNum < textvariNum) + if(myvariNum < sysPara->status.variNum) + { + sysPara->status.vars[myvariNum].digitalNum = textrx.cap(3).toInt(&ok);//第二个匹配,数字到个数 + sysPara->status.vars[myvariNum].bold = (sysPara->status.vars[myvariNum].digitalNum%100) == 75; + if(sysPara->status.vars[myvariNum].bold) + sysPara->status.vars[myvariNum].digitalNum = sysPara->status.vars[myvariNum].digitalNum/100; + + sysPara->status.vars[myvariNum].type = textrx.cap(2).toInt(&ok);//第一个匹配 + + sysPara->status.vars[myvariNum].width = textrx.cap(4).toInt(&ok)*(sysPara->status.addSpace?2:1); + sysPara->status.vars[myvariNum].height = textrx.cap(5).toInt(&ok); + //qDebug()<<"myvariNum endRowPos:"<status.vars[myvariNum].endRowPos; + //qDebug()<<"myvariNum height:"<status.vars[myvariNum].height; + sysPara->status.vars[myvariNum].startRowPos = sysPara->status.vars[myvariNum].endRowPos - sysPara->status.vars[myvariNum].height+1; + //sysPara->status.vars[myvariNum].startRowPos = sysPara->status.vars[myvariNum].endRowPos - sysPara->status.vars[myvariNum].height; + //qDebug()<<"start row:"<status.vars[myvariNum].startRowPos; + if(sysPara->status.vars[myvariNum].startRowPos<0) + sysPara->status.vars[myvariNum].startRowPos=0; + + int item_x_start_pos = sysPara->status.vars[myvariNum].startColPos; + int item_x_end_pos = item_x_start_pos + sysPara->status.vars[myvariNum].width ; + if(item_x_end_pos > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)) + item_x_end_pos = MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide; + int item_y_start_pos = sysPara->status.vars[myvariNum].startRowPos; + int item_y_end_pos = sysPara->status.vars[myvariNum].endRowPos+1 ; + if(item_y_start_pos < 0) + item_y_start_pos = 0; + for(int i = item_x_start_pos; i < item_x_end_pos; i++){ + for(int j = item_y_start_pos; j < item_y_end_pos; j++){ + dat[MAX_PRINT_ROW_BYTE_NUM*(i+(sysPara->status.addSpace?0:0)) + j/8] &= ~(1 << (j%8)); //将画点取消掉 + } + } + sysPara->status.vars[myvariNum].height = textrx.cap(5).toInt(&ok)-1; + if(sysPara->status.vars[myvariNum].height>16 ){ + if(sysPara->status.vars[myvariNum].height==24) + ; + else { + if(sysPara->status.vars[myvariNum].startRowPos) + { + sysPara->status.vars[myvariNum].endRowPos--; + sysPara->status.vars[myvariNum].startRowPos--; + } + + } + + } + + if(sysPara->status.vars[myvariNum].type == RANDOMNUM) + { + //qDebug()<<"RAND:"<status.vars[myvariNum].type<< sysPara->status.vars[myvariNum].digitalNum; + sysPara->status.RandomDigitNum = sysPara->status.vars[myvariNum].digitalNum; + } + int pixelSize = Public::derivePixelSizeFromHeight(sysPara->status.vars[myvariNum].height); + + //qDebug()<<"MainWindows"<status.vars[myvariNum].height<status.vars[myvariNum].letterSpace = 0; + if(sysPara->status.vars[myvariNum].digitalNum){ //算出letterspace + QFont font; + //font.setFamily(Public::getFontFamily(pixelSize)); + font.setFamily(Public::getFontFamily(pixelSize,sysPara->status.vars[myvariNum].type )); // 20160812 + //pixelSize==7? font.setFamily(ui->textEditOption->getLabelFontFamily()->text()):font.setFamily(Public::getFontFamily(pixelSize, 0)); + font.setPixelSize(pixelSize); + font.setWeight(sysPara->status.vars[myvariNum].bold?QFont::Bold:QFont::Normal); + //font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + QFontMetrics fontMetrics(font); + int charWidth = (fontMetrics.width("0123456789"))/10 ; + sysPara->status.vars[myvariNum].letterSpace = sysPara->para.textEditCharSpace; + //sysPara->status.vars[myvariNum].letterSpace = + //sysPara->status.vars[myvariNum].width/sysPara->status.vars[myvariNum].digitalNum/(sysPara->status.addSpace?2:1) - charWidth; + } + myvariNum++; + } + } + } +//==========================一般变量结束======================= + +//=========================有效期/生产日期变量 开始================== + //qDebug()<<"sysPara->status.ExpiryVarNum"; + if(sysPara->status.ExpiryVarNum || sysPara->status.CurrDateVariNum) + { + QString expiryPattern = ""; + // 1 type ,2 name,3 width,4 height + //

+ QRegExp expiryRx(expiryPattern); + QString expiryHtml = picText->toHtml(); + int from = 0; + + while(from < expiryHtml.size() && from != -1){ + from = expiryHtml.indexOf(expiryRx,from); + bool ok; + //qDebug()<print.ExpiryVar.endRowPos:"<print.ExpiryVar.endRowPos; + sysPara->print.ExpiryVar.type = type; + sysPara->print.ExpiryVar.width = expiryRx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + sysPara->print.ExpiryVar.height = expiryRx.cap(4).toInt(&ok); + //sysPara->print.ExpiryVar.startRowPos = sysPara->print.ExpiryVar.endRowPos-sysPara->print.ExpiryVar.height; + sysPara->print.ExpiryVar.startRowPos = sysPara->print.ExpiryVar.endRowPos-(sysPara->print.ExpiryVar.height-1); + qDebug()<<"endRow:"<print.ExpiryVar.endRowPos; + qDebug()<<"startRow:"<print.ExpiryVar.startRowPos; + qDebug()<<"height:"<print.ExpiryVar.height; + if(expiryRx.cap(2).contains("875")) + { + //qDebug()<<"ExpiryVar:Bold"; + sysPara->print.ExpiryVar.bold = 1; + } + else + { + //qDebug()<<"ExpiryVar:normal"; + sysPara->print.ExpiryVar.bold = 0; + } + // 直接更新有效期,并退出? + ExpiryDotUpdate(1); + expiryVarNum++; + } + else if(type==CURDATE || type==CURDATE + 10 || type==CURDATE + 20) + { //currDate + //qDebug()<<"CurDateVar:"<print.CurDateVar.type = type; + sysPara->print.CurDateVar.width = expiryRx.cap(3).toInt(&ok);// *(sysPara->status.addSpace && type==9 ?2:1) ; + sysPara->print.CurDateVar.height = expiryRx.cap(4).toInt(&ok); + //sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-sysPara->print.CurDateVar.height; + sysPara->print.CurDateVar.startRowPos = sysPara->print.CurDateVar.endRowPos-(sysPara->print.CurDateVar.height-1); + //qDebug()<<"CurDateVar:startRowPos"<print.CurDateVar.startRowPos<<" height"<print.CurDateVar.height; + // 生产日期即当前日期 + if(expiryRx.cap(2).contains("875")) + { + //qDebug()<<"CurDateVar:Bold"; + sysPara->print.CurDateVar.bold = 1; + } + else + { + //qDebug()<<"CurDateVar:normal"; + sysPara->print.CurDateVar.bold = 0; + } + ExpiryDotUpdate(2); + expiryVarNum++; + } + + } + else break; + } + } + } +//=========================有效期/生产日期变量 结束================== + + } + + + + +#endif + + //if(sysPara->status.variNum) qDebug()<< sysPara->status.vars[0].startColPos<status.vars[0].endRowPos ; + + /*--------------------------------------------------------------------------*/ + generateCharRamData(); + + //qDebug()<<"1"<status.currPrintRow; + /*---------------------------------------------------------------------------*/ + //sysPara->status.currPrintRow ++;//总的行数,从1~n,而不是从0~n, + //if(sysPara->status.currPrintRow>39)sysPara->status.currPrintRow=39; + if(sysPara->status.currPrintRow>MAX_PRINT_ROW_NUM-1)sysPara->status.currPrintRow=MAX_PRINT_ROW_NUM-1; + bool found=0; + + lastRow = sysPara->status.currPrintRow; + //qDebug()<<"lastRow:"<status.currPrintRow; j >2 ; j--){ //计算首行位置 + for(int i = 0; i < coldot; i++){ + if(dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] & (1 << (j%8))){ + lastRow = j+1; + found=1;//qDebug()<<"fOUND:"<status.currPrintRow; + break; + } + } + if(found) + break; + } + if(lastRow>MAX_PRINT_ROW_NUM-1)lastRow = MAX_PRINT_ROW_NUM-1; + if(lastRow20 &&lastRow<=25) lastRow =24; + + sysPara->status.currPrintRow =lastRow; + //sysPara->status.currPrintRow =(lastRow > varLastRow) ? lastRow : varLastRow; //配合賴工省点打印少行問题 + //qDebug()<<"lastRow:"<status.currPrintRow; +#endif + + } + + #ifdef SPACEFLAG + //sysPara->status.currPrintCol + #else + + #endif + + #ifdef _2DCODE_ + if(sysPara->status.QRvariNum) { + onUpdateDispQRCode(1); + } + #endif + //if(sysPara->status.currPrintRow==11) sysPara->status.currPrintRow=12; + int wmax = sysPara->status.currPrintRow; + sysPara->status.currAlterPrintRow = sysPara->status.currPrintRow/2; + if(sysPara->para.alterPrint.enable<1) sysPara->para.AlterMode=0; + else { + if(sysPara->para.AlterMode==0)sysPara->para.AlterMode=1; + wmax = sysPara->status.currAlterPrintRow; + } + /*-------------------------------切换到显示窗口-----------------------------------*/ + if(sysPara->status.addSpace) + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol/2,sysPara->status.currPrintRow); + else ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->status.currPrintRow); + + ui->widgetPrintTextDisplay->setDisplaySize(sysPara->status.currPrintCol,sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow); + ui->stackedWidgetText->setCurrentWidget(ui->pagePrintTextDisplay); + ui->stackedWidgetOption->setCurrentWidget(ui->pageOption); + ui->labelTextWidthHeight->setText(tr("[ %1行 x %2列 ]").arg(wmax).arg(sysPara->status.currPrintCol)); + ui->widgetPrintTextDisplay->update(); + //qDebug()<<"3"<status.currPrintRow; + } + previewFlag=0; +} + + +int MainWindow::calculateMaxSpeed(int backup) +{ + float stroke; + int valid_array; + int rongdian = 0; + int mm; + int oscfreq = 0; + +// QSizeF size = ui->textEdit->document()->size(); + + switch (sysPara->para.oscillatoFreq) { + case CRYS_64K: + oscfreq = 64000; + break; + case CRYS_76K: + oscfreq = 76000; + break; +// case CRYS_83K: +// oscfreq = 83000; +// break; + case CRYS_96K: + oscfreq = 96000; + break; + case CRYS_128K: + oscfreq = 128000; + break; + default: + break; + } + stroke = sysPara->para.printColDelay/sysPara->para.synPulseNumPerMm; +// stroke = stroke * 0.001; //unit is m + +// qDebug()<< "[Info] stroke" << stroke; +// qDebug()<< "[Info] oscfreq" << oscfreq; +// qDebug()<< "[Info] sysPara->status.currPrintRow" << sysPara->status.currPrintRow; +// qDebug()<< "[Info] reducedPixelNumRatio" << sysPara->para.reducedPixelNumRatio; + +// if(sysPara->para.currPrintMode == FAST_PRINT && (sysPara->status.currPrintRow < 10) && (sysPara->para.reducedPixelNumRatio == 0) ){ + +// mm = (float)(stroke * oscfreq /(sysPara->status.currPrintRow +1)); +//// qDebug()<< "[Info] FAST_PRINT mm" << mm; +// return mm; +// }else if(sysPara->para.currPrintMode == STANDARD_PRINT){ + +// valid_array = sysPara->status.currPrintRow * (1- (float)sysPara->para.reducedPixelNumRatio/100); +//// qDebug()<< "[Info] sysPara->para.reducedPixelNumRatio" << sysPara->para.reducedPixelNumRatio; +//// qDebug()<< "[Info] valid_array " << valid_array; +// mm = (float)( (stroke * oscfreq) / (valid_array * 2)); + +//// qDebug()<< "[Info] STANDARD_PRINT mm" << mm; + +// return mm; +// }else +// { +// mm = backup/sysPara->para.synPulseNumPerMm; +//// qDebug()<< "[Info]calculateMaxSpeed OLD COUNT mm" << mm; +// return mm; // 列的最大间距 +// } + + rongdian = sysPara->status.currPrintRow * (float)sysPara->para.reducedPixelNumRatio/100; + //rongdian = sysPara->status.currPrintRow * 0.3; //冗点30%计算 + valid_array = sysPara->status.currPrintRow - rongdian; + +// valid_array = sysPara->status.currPrintRow * (1- (float)sysPara->para.reducedPixelNumRatio/100); + + switch (sysPara->para.currPrintMode) { + case FAST_PRINT: + mm = (float)(stroke * oscfreq /(sysPara->status.currPrintRow +1)); + break; + case STANDARD_PRINT: + mm = (float)( (stroke * oscfreq) / (valid_array * 2)); + break; + case SLOW_PRINT_ONE: + mm = (float)( (stroke * oscfreq) / (valid_array * 3)); + break; + case SLOW_PRINT_TWO: + mm = (float)( (stroke * oscfreq) / (valid_array * 4)); + break; + case SLOW_PRINT_THR: + mm = (float)( (stroke * oscfreq) / (valid_array * 5)); + break; + case SLOW_PRINT_FOR: + mm = (float)( (stroke * oscfreq) / (valid_array * 6)); + break; + case SLOW_PRINT_FIV: + mm = (float)( (stroke * oscfreq) / (valid_array * 7)); + break; + case SLOW_PRINT_SIX: + mm = (float)( (stroke * oscfreq) / (valid_array * 8)); + break; + case SLOW_PRINT_SEV: + mm = (float)( (stroke * oscfreq) / (valid_array * 9)); + break; + case SLOW_PRINT_EIG: + mm = (float)( (stroke * oscfreq) / (valid_array * 10)); + break; + case SLOW_PRINT_NIE: + mm = (float)( (stroke * oscfreq) / (valid_array * 11)); + break; + default: + mm = backup/sysPara->para.synPulseNumPerMm; + break; + } + + return mm; + +} + +void MainWindow::Test_Start_Stop() +{ + if(test_flag <=0) return; + if(test_flag >= RECICLARNUMBER){ + LogInfo::setRunStatusText(tr("回收槽开关检测完成!")); + test_flag = 0; + return; + } + if((test_flag%2) == 1){ + if(!open_close){ + on_pushButtonReclaimTanOpen_pressed(); + open_close = 1; + } + } + else if(test_flag%2 == 0){ + if(open_close){ + on_pushButtonReclaimTankClose_pressed(); + open_close = 0; + } + } +} + +void MainWindow::UpdateDateTimeQRCode(QString strContent) +{ + if(!printintFlag || !sysPara->para.isCheckInsertTime) + //if(!sysPara->para.isCheckInsertTime) + { + return ; + } + + QLabel *labelFontSize = ui->textEditOption->getLabelFontSize(); + bool ok; + int font_size = labelFontSize->text().toInt(&ok,10); + QString font_family = Public::getFontFamily(font_size); + if(sysPara->para.EditMode == TXTFILE) + { + QFile file("/home/plg/doc/modbusQR.bmp"); + if(file.exists()) + { + file.remove(); + } + if(dlgqrcode->barCodeFlag == 1) + { + //barcode->extSetText(QString::fromUtf8(strContent.toStdString().c_str())); + barcode->extSetText(""); + barcode->GetOption((bcOption_t*)&sysPara->para.bcOption); + } + else + { + QString receiveContent = QString::fromUtf8(strContent.toStdString().c_str()); + dlgqrcode->extSetText(receiveContent,sysPara->para.qrOption.type); + // dlgqrcode->extSetText("asbasb"); + dlgqrcode->GetOption((qrOption_t *)&sysPara->para.qrOption); + } + + QString txt_fomart = ""; + txt_fomart = QString::fromUtf8("").arg(font_family).arg(font_size) + .arg(ui->textEditOption->getCheckBoxBold()->isChecked()? 600:400); + txt_fomart += barcode->getLabe_TxtString().toUtf8(); + txt_fomart += " "; +// ui->textEditOption->modbus_insert_pic("/home/plg/doc/QR_aa.bmp"); + //ui->textEditOption->textEdit->clear();//插入之前先清空 + //ui->textEditOption->modbus_insert_pic("/home/plg/doc/modbusQR.bmp"); + txt_fomart += ""; + ui->textEditOption->textEdit->setHtml(txt_fomart); + ui->textEditOption->textEdit->moveCursor(QTextCursor::EndOfLine); + //sysPara->status.oneCodePrintOnce = true; + on_pushButtonStartPrint_pressed();//开始打印 + } + +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..cce6a95 --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,295 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include "ParaSettingUI.h" +#include "PrintSetting.h" +#include +#include "QBarCode.h" +#include "dlgQrCode.h" +#include "dlgmywarring.h" +//#define RETANKACK // 改回收 +#include +#ifdef PICSCENE +#include "scene/picscene.h" +class PicScene; +QT_BEGIN_NAMESPACE +class QAction; +class QToolBox; +class QSpinBox; +class QComboBox; +class QFontComboBox; +class QButtonGroup; +class QLineEdit; +class QGraphicsTextItem; +class QFont; +class QToolButton; +class QAbstractButton; +class QGraphicsView; +QT_END_NAMESPACE +#endif +#define CLEARCNTNOW + + + +#include +#include +#include +namespace Ui { + class MainWindow; +} + +class MainWindow : public QWidget,public ParaSettingUI +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + void bindSysPara(SysPara *SysPara);//重载 + void updateSysParaToUI(); //重载 + void updateSysStatusToUI(); //重载 + void applyUIPara(); //重载 + bool updatePhaseIndicatorLight(); + void showPrintBitImage(); + int calculateMaxSpeed(int backup); + + void enablePrintButton(bool enable); + void enableReclaimCtrlButton(bool enable); + void resetReclaimCtrlButtonText(); + void enablePushButtonStart(bool enable); + + void PreviewPressed(); + int getCurrPrintStatus(); + TextEditOption* getTexteditOption(); + + void SetEditMode(int mode); + bool fileChange; + bool pushButtonFlag; + + int getVarStarRow(int x, int y, int h, int w,char *dat); + + void testPrint(); + int searchQrVar(); + PicScene* getPicScene(); + //void pushOnlyCNT1Clear_Hide(); + + DlgMyWarring dlgMyWarring; + QString strWarring,strTitle; + QMessageBox *msgtest; + void updateTotalCnt(int en); + bool m_2sFlag; + QTimer *timerShowItem; + void UpdateDateTimeQRCode(QString strContent); + +public slots: + void OnFinished(int event); + void onQRCodeClose(); + void onEditQRCode(); + void onEditBarCode(); + void onBarCodeClose(); + void on_pushButtonCleanUP_pressed(); + //void on_pushOnlyCNT1Clear_pressed(); + void onPushButtonCNTResetNowPressed(); + void changeEditMode(int editMode); + void SetMainTabEdit(int n); + void changeTxtMode(QString str); + // void openPngFile(QString filePath); + void openPicFIleOpen(QString filePath, bool insertFlag); + void onReclainTankPositionChanged(int value); + void checkForPowerOff(); + void on_pushButtonStart_pressed(); + + void setRunStatus(QString str); + + void setRunStatus(QPixmap pixMap); + + void _on_pushButtonPowerOff_pressed(bool notice); + + void on_pushButtonReclaimTankClose_pressed(); + + void alterDataPrint(unsigned char); + void showDat(unsigned char * Dat); + void SendPrintDataToFpga(unsigned char alterEnable); + void on_pushButtonStopPrint_pressed(); + void on_pushButtonPausePrint_pressed(); + void RefreshStatusLight(); + void onInitQRCode(); + void onUpdateDispQRCode(int type); // 更新二维码显示 + void modbusUpdateQRCode(); + //void onUpdateDispBcCode(int type); // 更新条形码显示 + void CheckStatus(int Flag); + void ShowWarnningText1(QString strTitle, QString strWarring); + void onStatusHighVoltageFault(); + void onStatusInkLeak(); + void onStatusInkSwint(); + void onStatusInkWaterLevel(); + void onStatusRecycleWarn(); + void onStatusSolvLevelWarn(); + void onStatusViscosityWarn(); + void onStatusChargefault(); + + void onPreviewScene(); + + void update_scroll(); + + void JSON_UpdateDATA(); + void on_pushButtonStartPrint_pressed(); + void onGenerateQRCode(QString strData); + void onShowAndHideItem(); + void onSwitchTimerShowItem(bool flag); + void onLabelFaultRusumePressed(); + void onEnableReclaimCtrlButton(bool flag); + +private slots: + // void on_pushButtonTXTOpen_pressed(); + void on_pushButtonGetData_pressed(); + void onPushButtonPreviewPressed(); + + void on_pushButtonReclaimTanOpen_pressed(); + void on_pushButtonPowerOff_pressed(); + void ontextEdittextChanged(); + void onTextEditCursorPositionChanged(); + //void onLabelFaultRusumePressed(); + + + void onLabelProductCntPressed(); + void onLabelTotalProductCntPressed(); + void displayTime(); + void airPushingProcess(); + + void on_bottonEditText_pressed(); + + void on_pushButtonReduceTextDisplay_pressed(); + void on_pushButtonEnlargeTextDisplay_pressed(); + +Q_SIGNALS: + void openFileChange(); + void openCurrFile(QString); + void saveJmFile(); + void setMainTabNow(int); // 切换到主窗口 + void InkjetCleanUP(); + void ShowWarnningText(QString , QString ); + void editItemMode(); + void CloseJd(); + void pushButtonStartPressed(bool); + void repeatInitedPid(); + void setCNT1Select(bool); + void setCNT2Select(bool); + void setCNT3Select(bool); + void getJSONData(); + void scenefileOpen(QString,bool); + void setDisableAll(); + void clearPressureFault(); + +private: + Ui::MainWindow *ui; + + int dlgMyWarringShowDlyCnt; + void generateCharRamData(); + void updatePrintDisplayLabel(); + void reclaimTanOpen(); + + QBarCode *barcode; + dlgQrCode *dlgqrcode; + + QThread ShowThead; + QTimer *timer; + QTimer *airPushTimer; + bool printintFlag; //判断当前是否在打印 + bool startPrintingFlag; + bool previewFlag; + + int searchExpiryVar();//检索有效期变量 + void ExpiryDotUpdate(char Mode); + int r_ExpiryDay; + void Test_Start_Stop(); +#ifdef PICSCENE + PicScene *pPicScene; + QGraphicsView *view; + QHBoxLayout *pSceneHBoxLayout; + QWidget *pSceneEditOptional; + + QPushButton *pOpenSceneButton; + QPushButton *pNewSceneButton; + QPushButton *pImportSceneButton; + QPushButton *pSaveSceneButton; + QPushButton *pSaveAsSceneButton; + QPushButton *pEditSceneButton; + PicTextItem *textItem; +#endif + +#if 0 +private slots: + void deleteItem(); + void bringToFront(); + void sendToBack(); + void itemInserted(DiagramItem *item); + void textInserted(QGraphicsTextItem *item); + void currentFontChanged(const QFont &font); + void fontSizeChanged(const QString &size); + void sceneScaleChanged(const QString &scale); + void textColorChanged(); + void itemColorChanged(); + void lineColorChanged(); + void textButtonTriggered(); + void fillButtonTriggered(); + void lineButtonTriggered(); + void handleFontChange(); + void itemSelected(QGraphicsItem *item); + void about(); + + private: + void createToolBox(); + void createActions(); + void createMenus(); + void createToolbars(); + QWidget *createBackgroundCellWidget(const QString &text, + const QString &image); + QWidget *createCellWidget(const QString &text, + DiagramItem::DiagramType type); + QMenu *createColorMenu(const char *slot, QColor defaultColor); + QIcon createColorToolButtonIcon(const QString &image, QColor color); + QIcon createColorIcon(QColor color); + + DiagramScene *scene; + QGraphicsView *view; + + QAction *exitAction; + QAction *addAction; + QAction *deleteAction; + + QAction *toFrontAction; + QAction *sendBackAction; + + QMenu *fileMenu; + QMenu *itemMenu; + + QToolBar *textToolBar; + QToolBar *editToolBar; + QToolBar *colorToolBar; + QToolBar *pointerToolbar; + + QComboBox *sceneScaleCombo; + QComboBox *itemColorCombo; + QComboBox *textColorCombo; + QComboBox *fontSizeCombo; + QFontComboBox *fontCombo; + + QToolBox *toolBox; + QButtonGroup *buttonGroup; + QButtonGroup *pointerTypeGroup; + QToolButton *fontColorToolButton; + QToolButton *fillColorToolButton; + QToolButton *lineColorToolButton; + QAction *boldAction; + QAction *underlineAction; + QAction *italicAction; + QAction *textAction; + QAction *fillAction; + QAction *lineAction; +#endif +}; + +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..e4f850b --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,3934 @@ + + + MainWindow + + + true + + + + 0 + 0 + 777 + 448 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 448 + + + + + 5 + 5 + + + + Qt::StrongFocus + + + InkJet + + + + 0 + + + + + 0 + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + 2 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + + + + 0 + 50 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + 0 + 45 + + + + 编辑 + + + + :/icon/edit.png:/icon/edit.png + + + + + + + + 0 + 45 + + + + 打开文件 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + + 0 + 45 + + + + 二维码 + + + + :/icon/bypm.png:/icon/bypm.png + + + + + + + + 0 + 45 + + + + 条形码 + + + + :/icon/BarCode1.png:/icon/BarCode1.png + + + + + + + + 0 + 45 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + 0 + 45 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + false + + + + 0 + 45 + + + + 获取数据 + + + + + + + 交替打印文件名 + + + + + + + + + + + + + 0 + + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + 最大:[40行x 2048列] + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 140 + 18 + + + + + 140 + 18 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + 同步器速度 + + + QFrame::NoFrame + + + QFrame::Sunken + + + + + + + + + + + 16777215 + 18 + + + + Qt::Vertical + + + + + + + + 0 + 18 + + + + + 100 + 18 + + + + 当前时间 + + + + + + + + + + + + + 640 + 107 + + + + 3 + + + + + + + + 610 + 95 + + + + + 620 + 96 + + + + + Monospace + 9 + 50 + false + false + + + + BlankCursor + + + QFrame::StyledPanel + + + 0 + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + + + + + + 5 + 5 + 620 + 100 + + + + + 0 + 0 + + + + + 620 + 100 + + + + + 16777215 + 80 + + + + false + + + + + 0 + 0 + 500 + 53 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + 0 + 0 + 621 + 100 + + + + + 0 + 0 + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + + + :/image/ALARMGreen.PNG + + + + + + + + 0 + 60 + + + + + 60 + 16777215 + + + + + + + :/image/reset.png + + + + + + + + + 0 + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨线开关 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 喷头盖开 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水缸满 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 墨水液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 溶剂液位 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 回收故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 粘度故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 相位故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 高压故障 + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + 159 + 158 + 158 + + + + + + + + 故障恢复 + + + + + + + + + 0 + + + 4 + + + + + 2 + + + 0 + + + 0 + + + 2 + + + + + + 110 + 0 + + + + + 110 + 16777215 + + + + 立即重新计米 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Sunken + + + 产品总计数 + + + + + + + + 110 + 20 + + + + + 110 + 16777215 + + + + QFrame::WinPanel + + + QFrame::Sunken + + + + + + + + + + + 110 + 33 + + + + + 110 + 16777215 + + + + Qt::LeftToRight + + + false + + + 关机 + + + + :/icon/poweroff.png:/icon/poweroff.png + + + + + + + + + 3 + + + 5 + + + 0 + + + + + 0 + + + 3 + + + 0 + + + 0 + + + 0 + + + + + 3 + + + 3 + + + 3 + + + 3 + + + 1 + + + + + 3 + + + + + + 300 + 0 + + + + + 300 + 16777215 + + + + + + + true + + + + + + + + 160 + 0 + + + + + 180 + 20 + + + + 2014-08-23 + + + Qt::AlignCenter + + + + + + + + + + + 0 + + + 4 + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 110 + 20 + + + + + 500 + 16777215 + + + + QFrame::NoFrame + + + + + + + + + + + 70 + 0 + + + + + 64 + 20 + + + + + + + + + + + + 150 + 20 + + + + 隔膜位置 + + + + + + + + 150 + 20 + + + + 压力 + + + + + + + + 88 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + + 150 + 20 + + + + 粘度 + + + + + + + + 150 + 20 + + + + 高压包 + + + + + + + + 64 + 0 + + + + + 16777215 + 20 + + + + + + + + + + + TextLabel + + + + + + + + + + 0 + 55 + + + + + 80 + 16777215 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 60 + 60 + 60 + + + + + + + + + 147 + 146 + 146 + + + + + + + + 开 + + + + :/icon/openreclaimtanl.png:/icon/openreclaimtanl.png + + + + + + + + 60 + 0 + + + + + 70 + 60 + + + + + + + + + + + + 0 + 55 + + + + + 80 + 16777215 + + + + 关 + + + + :/icon/closereclaimtanl.png:/icon/closereclaimtanl.png + + + + + + + + + + + + + 1 + + + 0 + + + + + + 0 + 50 + + + + + 98 + 63 + + + + + + + + + 0 + 170 + 0 + + + + + + + 85 + 170 + 127 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 85 + 170 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 127 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 186 + 188 + 185 + + + + + + + 242 + 241 + 240 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 186 + 188 + 185 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/startprint2.png + :/icon/startprint1.png + :/icon/startprint1.png + :/icon/startprint.png:/icon/startprint2.png + + + + 92 + 60 + + + + false + + + + + + + + 0 + 50 + + + + + 98 + 63 + + + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 170 + 0 + 0 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 193 + 121 + 121 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 241 + 176 + 165 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 199 + 189 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 227 + 97 + 75 + + + + + + + 227 + 97 + 75 + + + + + + + 0 + 0 + 0 + + + + + + + 227 + 97 + 75 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + :/icon/stopprint2.png + :/icon/stopprint1.png + :/icon/stopprint1.png + :/icon/stopprint.png:/icon/stopprint2.png + + + + 92 + 60 + + + + + + + + + 0 + 50 + + + + + 98 + 63 + + + + + + + + + 255 + 170 + 0 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 206 + 186 + 124 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 212 + 127 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 209 + 206 + 203 + + + + + + + 242 + 241 + 240 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 209 + 199 + 189 + + + + + + + 159 + 158 + 158 + + + + + + + 255 + 255 + 255 + + + + + + + 147 + 146 + 146 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + background-image:url(:/icon/pauseprint2.png) + + + 暂停打印 +停止高压 + + + + 92 + 60 + + + + + + + + + 0 + 50 + + + + + 98 + 63 + + + + 喷嘴逆清洗 + + + + 92 + 16 + + + + + + + + + 0 + 50 + + + + + 98 + 63 + + + + background-color: rgb(0, 255, 0); + + + 紧急停机 + + + + + + + + + + + + + + + + + ClickLabel + QLabel +
ClickLabel.h
+
+ + PicWidget + QWidget +
PicWidget.h
+ 1 +
+ + TextEditOption + QWidget +
TextEditOption.h
+ 1 +
+ + PrintTextDisplay + QWidget +
PrintTextDisplay.h
+ 1 +
+ + MyTextEdit + QTextEdit +
MyTextEdit.h
+
+ + SceneEditOption + QWidget +
scene/SceneEditOption.h
+ 1 +
+ + SceneViewWidget + QWidget +
scene/sceneviewwidget.h
+ 1 +
+ + MyView + QGraphicsView +
scene/myview.h
+
+
+ + + + +
diff --git a/memdisplayandedit.ui b/memdisplayandedit.ui new file mode 100644 index 0000000..804785c --- /dev/null +++ b/memdisplayandedit.ui @@ -0,0 +1,430 @@ + + + MemDisplayAndEdit + + + + 0 + 0 + 605 + 140 + + + + Qt::StrongFocus + + + Form + + + + + 10 + 0 + 597 + 131 + + + + + 6 + + + + + 0 + + + 1 + + + + + + 40 + 0 + + + + + + + + + + + 07 + + + + + + + 02 + + + + + + + + 40 + 0 + + + + + + + + + + + 06 + + + + + + + 0D + + + + + + + 09 + + + + + + + 03 + + + + + + + 01 + + + + + + + 04 + + + + + + + 0C + + + + + + + 0A + + + + + + + 0F + + + + + + + + 40 + 0 + + + + + + + + + + + 05 + + + + + + + 00 + + + + + + + 08 + + + + + + + 0B + + + + + + + + 40 + 0 + + + + + + + + + + + 0E + + + + + + + + 40 + 0 + + + + + + + + + + + + 40 + 0 + + + + + + + + + + + + + 3 + + + + + 3 + + + + + + 45 + 16777215 + + + + 基地址: + + + + + + + + 90 + 16777215 + + + + true + + + true + + + + 0x0000 + + + + + 0xb100 + + + + + 0xb200 + + + + + 0xa400 + + + + + 0xe000 + + + + + + + + + + 3 + + + + + + 70 + 16777215 + + + + 读空间 + + + + + + + + 70 + 16777215 + + + + 写空间 + + + + + + + + + 3 + + + + + + 50 + 16777215 + + + + + + + + + + + + 60 + 16777215 + + + + 进制转换 + + + + + + + + 50 + 16777215 + + + + + + + + + + + + + 3 + + + + + + 50 + 16777215 + + + + 编辑 + + + + + + + + 50 + 16777215 + + + + 上一页 + + + + + + + + 50 + 16777215 + + + + 下一页 + + + + + + + + + + + + + diff --git a/modbus/demo.c b/modbus/demo.c new file mode 100644 index 0000000..bae6fde --- /dev/null +++ b/modbus/demo.c @@ -0,0 +1,284 @@ +/* + * FreeModbus Libary: Linux Demo Application + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: demo.c,v 1.2 2006/10/12 08:12:06 wolti Exp $ + */ + +/* ----------------------- Standard includes --------------------------------*/ +#include +#include +#include +#include +#include +#include +#include + +#include "demo.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define PROG "freemodbus" + +#define REG_INPUT_START 1000 +#define REG_INPUT_NREGS 10 +#define REG_HOLDING_START 2000 +#define REG_HOLDING_NREGS 130 + +/* ----------------------- Static variables ---------------------------------*/ +static USHORT usRegInputStart = REG_INPUT_START; +USHORT* usRegInputBuf; +static USHORT usRegHoldingStart = REG_HOLDING_START; +USHORT* usRegHoldingBuf; + +static pthread_mutex_t xLock = PTHREAD_MUTEX_INITIALIZER; +static BOOL bDoExit; + +/* ----------------------- Static functions ---------------------------------*/ +static BOOL bCreatePollingThread( void ); +//static enum ThreadState eGetPollingThreadState( void ); +//static void vSetPollingThreadState( enum ThreadState eNewState ); +static void *pvPollingThread( void *pvParameter ); + +/* ----------------------- Start implementation -----------------------------*/ +BOOL +bSetSignal( int iSignalNr, void ( *pSigHandler ) ( int ) ) +{ + BOOL bResult; + struct sigaction xNewSig, xOldSig; + + xNewSig.sa_handler = pSigHandler; + sigemptyset( &xNewSig.sa_mask ); + xNewSig.sa_flags = 0; + if( sigaction( iSignalNr, &xNewSig, &xOldSig ) != 0 ) + { + bResult = FALSE; + } + else + { + bResult = TRUE; + } + return bResult; +} + +void +vSigShutdown( int xSigNr ) +{ + switch ( xSigNr ) + { + case SIGQUIT: + case SIGINT: + case SIGTERM: + vSetPollingThreadState( SHUTDOWN ); + bDoExit = TRUE; + } +} + +BOOL +active_modbus( USHORT* mPara, USHORT* mStatus, USHORT port_num) +{ + int iExitCode = EXIT_SUCCESS; +// CHAR cCh; + + const UCHAR ucSlaveID[] = { 0xAA, 0xBB, 0xCC }; + usRegHoldingBuf = mPara; + usRegInputBuf = mStatus; + if( !bSetSignal( SIGQUIT, vSigShutdown ) || + !bSetSignal( SIGINT, vSigShutdown ) || !bSetSignal( SIGTERM, vSigShutdown ) ) + { + fprintf( stderr, "%s: can't install signal handlers: %s!\n", PROG, strerror( errno ) ); + iExitCode = EXIT_FAILURE; + } + else if( eMBInit( MB_RTU, 0x0A, port_num, 38400, MB_PAR_EVEN ) != MB_ENOERR ) + { + fprintf( stderr, "%s: can't initialize modbus stack!\n", PROG ); + iExitCode = EXIT_FAILURE; + } + else if( eMBSetSlaveID( 0x34, TRUE, ucSlaveID, 3 ) != MB_ENOERR ) + { + fprintf( stderr, "%s: can't set slave id!\n", PROG ); + iExitCode = EXIT_FAILURE; + } + else + { + vSetPollingThreadState( STOPPED ); + + if( bCreatePollingThread( ) != TRUE ) + { + iExitCode = EXIT_FAILURE; + vMBPortLog( MB_LOG_DEBUG, "active_modbus", "Can't start protocol stack! Already running?\n"); + } + } + + return iExitCode; +} + +BOOL +bCreatePollingThread( void ) +{ + BOOL bResult; + pthread_t xThread; + + if( eGetPollingThreadState( ) == STOPPED ) + { + if( pthread_create( &xThread, NULL, pvPollingThread, NULL ) != 0 ) + { + bResult = FALSE; + } + else + { + bResult = TRUE; + } + } + else + { + bResult = FALSE; + } + + return bResult; +} + +void * +pvPollingThread( void *pvParameter ) +{ + vSetPollingThreadState( RUNNING ); + + if( eMBEnable( ) == MB_ENOERR ) + { + do + { +// vMBPortLog( MB_LOG_DEBUG, "usRegInputBuf[0]", "%d\n", usRegInputBuf[0]); + if( eMBPoll( ) != MB_ENOERR ) + break; +// usRegInputBuf[0] = ( USHORT ) rand( ); + } + while( eGetPollingThreadState( ) != SHUTDOWN ); + } + + ( void )eMBDisable( ); + + vSetPollingThreadState( STOPPED ); + + return 0; +} + +enum ThreadState +eGetPollingThreadState( ) +{ + enum ThreadState eCurState; + + ( void )pthread_mutex_lock( &xLock ); + eCurState = ePollThreadState; + ( void )pthread_mutex_unlock( &xLock ); + + return eCurState; +} + +void +vSetPollingThreadState( enum ThreadState eNewState ) +{ + ( void )pthread_mutex_lock( &xLock ); + ePollThreadState = eNewState; + ( void )pthread_mutex_unlock( &xLock ); +} + +eMBErrorCode +eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs ) +{ + eMBErrorCode eStatus = MB_ENOERR; + int iRegIndex; + + vMBPortLog( MB_LOG_DEBUG, "eMBRegInputCB", "exe\n"); + if( ( usAddress >= REG_INPUT_START ) + && ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) ) + { + iRegIndex = ( int )( usAddress - usRegInputStart ); + while( usNRegs > 0 ) + { + *pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] >> 8 ); + *pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF ); + iRegIndex++; + usNRegs--; + } + } + else + { + eStatus = MB_ENOREG; + } + + return eStatus; +} + +void CallProcessCommands(int index); + +eMBErrorCode +eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode ) +{ + eMBErrorCode eStatus = MB_ENOERR; + int iRegIndex; + + vMBPortLog( MB_LOG_DEBUG, "eMBRegHoldingCB", "exe\n"); + if( ( usAddress >= REG_HOLDING_START ) && + ( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) ) + { + iRegIndex = ( int )( usAddress - usRegHoldingStart ); + switch ( eMode ) + { + /* Pass current register values to the protocol stack. */ + case MB_REG_READ: + while( usNRegs > 0 ) + { + *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] >> 8 ); + *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] & 0xFF ); + iRegIndex++; + usNRegs--; + } + break; + + /* Update current register values with new values from the + * protocol stack. */ + case MB_REG_WRITE: + while( usNRegs > 0 ) + { + usRegHoldingBuf[iRegIndex - 1] = *pucRegBuffer++ << 8; + usRegHoldingBuf[iRegIndex - 1] |= *pucRegBuffer++; + vMBPortLog( MB_LOG_DEBUG, "eMBRegHoldingCB", "usRegHoldingBuf[%d] %d\n",iRegIndex - 1, usRegHoldingBuf[iRegIndex - 1]); + CallProcessCommands(iRegIndex); + iRegIndex++; + usNRegs--; + + } + } + } + else + { + eStatus = MB_ENOREG; + } + return eStatus; +} + + +eMBErrorCode +eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode ) +{ + return MB_ENOREG; +} + +eMBErrorCode +eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete ) +{ + return MB_ENOREG; +} diff --git a/modbus/demo.h b/modbus/demo.h new file mode 100644 index 0000000..87edf02 --- /dev/null +++ b/modbus/demo.h @@ -0,0 +1,27 @@ +#ifndef _DEMO_H +#define _DEMO_H + + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +static enum ThreadState +{ + STOPPED, + RUNNING, + SHUTDOWN +} ePollThreadState; + +BOOL active_modbus( USHORT* mPara, USHORT* mStatus,USHORT port_num); +void vSetPollingThreadState( enum ThreadState eNewState ); +enum ThreadState eGetPollingThreadState( void ); +#ifdef __cplusplus +PR_END_EXTERN_C +#endif + +#endif diff --git a/modbus/modbus/ascii/mbascii.c b/modbus/modbus/ascii/mbascii.c new file mode 100644 index 0000000..c513457 --- /dev/null +++ b/modbus/modbus/ascii/mbascii.c @@ -0,0 +1,486 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbascii.c,v 1.17 2010/06/06 13:47:07 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbconfig.h" +#include "mbascii.h" +#include "mbframe.h" + +#include "mbcrc.h" +#include "mbport.h" + +#if MB_ASCII_ENABLED > 0 + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_ASCII_DEFAULT_CR '\r' /*!< Default CR character for Modbus ASCII. */ +#define MB_ASCII_DEFAULT_LF '\n' /*!< Default LF character for Modbus ASCII. */ +#define MB_SER_PDU_SIZE_MIN 3 /*!< Minimum size of a Modbus ASCII frame. */ +#define MB_SER_PDU_SIZE_MAX 256 /*!< Maximum size of a Modbus ASCII frame. */ +#define MB_SER_PDU_SIZE_LRC 1 /*!< Size of LRC field in PDU. */ +#define MB_SER_PDU_ADDR_OFF 0 /*!< Offset of slave address in Ser-PDU. */ +#define MB_SER_PDU_PDU_OFF 1 /*!< Offset of Modbus-PDU in Ser-PDU. */ + +/* ----------------------- Type definitions ---------------------------------*/ +typedef enum +{ + STATE_RX_IDLE, /*!< Receiver is in idle state. */ + STATE_RX_RCV, /*!< Frame is beeing received. */ + STATE_RX_WAIT_EOF /*!< Wait for End of Frame. */ +} eMBRcvState; + +typedef enum +{ + STATE_TX_IDLE, /*!< Transmitter is in idle state. */ + STATE_TX_START, /*!< Starting transmission (':' sent). */ + STATE_TX_DATA, /*!< Sending of data (Address, Data, LRC). */ + STATE_TX_END, /*!< End of transmission. */ + STATE_TX_NOTIFY /*!< Notify sender that the frame has been sent. */ +} eMBSndState; + +typedef enum +{ + BYTE_HIGH_NIBBLE, /*!< Character for high nibble of byte. */ + BYTE_LOW_NIBBLE /*!< Character for low nibble of byte. */ +} eMBBytePos; + +/* ----------------------- Static functions ---------------------------------*/ +static UCHAR prvucMBCHAR2BIN( UCHAR ucCharacter ); + +static UCHAR prvucMBBIN2CHAR( UCHAR ucByte ); + +static UCHAR prvucMBLRC( UCHAR * pucFrame, USHORT usLen ); + +/* ----------------------- Static variables ---------------------------------*/ +static volatile eMBSndState eSndState; +static volatile eMBRcvState eRcvState; + +/* We reuse the Modbus RTU buffer because only one buffer is needed and the + * RTU buffer is bigger. */ +extern volatile UCHAR ucRTUBuf[]; +static volatile UCHAR *ucASCIIBuf = ucRTUBuf; + +static volatile USHORT usRcvBufferPos; +static volatile eMBBytePos eBytePos; + +static volatile UCHAR *pucSndBufferCur; +static volatile USHORT usSndBufferCount; + +static volatile UCHAR ucLRC; +static volatile UCHAR ucMBLFCharacter; + +/* ----------------------- Start implementation -----------------------------*/ +eMBErrorCode +eMBASCIIInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ) +{ + eMBErrorCode eStatus = MB_ENOERR; + ( void )ucSlaveAddress; + + ENTER_CRITICAL_SECTION( ); + ucMBLFCharacter = MB_ASCII_DEFAULT_LF; + + if( xMBPortSerialInit( ucPort, ulBaudRate, 7, eParity ) != TRUE ) + { + eStatus = MB_EPORTERR; + } + else if( xMBPortTimersInit( MB_ASCII_TIMEOUT_SEC * 20000UL ) != TRUE ) + { + eStatus = MB_EPORTERR; + } + + EXIT_CRITICAL_SECTION( ); + + return eStatus; +} + +void +eMBASCIIStart( void ) +{ + ENTER_CRITICAL_SECTION( ); + vMBPortSerialEnable( TRUE, FALSE ); + eRcvState = STATE_RX_IDLE; + EXIT_CRITICAL_SECTION( ); + + /* No special startup required for ASCII. */ + ( void )xMBPortEventPost( EV_READY ); +} + +void +eMBASCIIStop( void ) +{ + ENTER_CRITICAL_SECTION( ); + vMBPortSerialEnable( FALSE, FALSE ); + vMBPortTimersDisable( ); + EXIT_CRITICAL_SECTION( ); +} + +eMBErrorCode +eMBASCIIReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + ENTER_CRITICAL_SECTION( ); + assert( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ); + + /* Length and CRC check */ + if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN ) + && ( prvucMBLRC( ( UCHAR * ) ucASCIIBuf, usRcvBufferPos ) == 0 ) ) + { + /* Save the address field. All frames are passed to the upper layed + * and the decision if a frame is used is done there. + */ + *pucRcvAddress = ucASCIIBuf[MB_SER_PDU_ADDR_OFF]; + + /* Total length of Modbus-PDU is Modbus-Serial-Line-PDU minus + * size of address field and CRC checksum. + */ + *pusLength = ( USHORT )( usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_LRC ); + + /* Return the start of the Modbus PDU to the caller. */ + *pucFrame = ( UCHAR * ) & ucASCIIBuf[MB_SER_PDU_PDU_OFF]; + } + else + { + eStatus = MB_EIO; + } + EXIT_CRITICAL_SECTION( ); + return eStatus; +} + +eMBErrorCode +eMBASCIISend( UCHAR ucSlaveAddress, const UCHAR * pucFrame, USHORT usLength ) +{ + eMBErrorCode eStatus = MB_ENOERR; + UCHAR usLRC; + + ENTER_CRITICAL_SECTION( ); + /* Check if the receiver is still in idle state. If not we where too + * slow with processing the received frame and the master sent another + * frame on the network. We have to abort sending the frame. + */ + if( eRcvState == STATE_RX_IDLE ) + { + /* First byte before the Modbus-PDU is the slave address. */ + pucSndBufferCur = ( UCHAR * ) pucFrame - 1; + usSndBufferCount = 1; + + /* Now copy the Modbus-PDU into the Modbus-Serial-Line-PDU. */ + pucSndBufferCur[MB_SER_PDU_ADDR_OFF] = ucSlaveAddress; + usSndBufferCount += usLength; + + /* Calculate LRC checksum for Modbus-Serial-Line-PDU. */ + usLRC = prvucMBLRC( ( UCHAR * ) pucSndBufferCur, usSndBufferCount ); + ucASCIIBuf[usSndBufferCount++] = usLRC; + + /* Activate the transmitter. */ + eSndState = STATE_TX_START; + vMBPortSerialEnable( FALSE, TRUE ); + } + else + { + eStatus = MB_EIO; + } + EXIT_CRITICAL_SECTION( ); + return eStatus; +} + +BOOL +xMBASCIIReceiveFSM( void ) +{ + BOOL xNeedPoll = FALSE; + UCHAR ucByte; + UCHAR ucResult; + + assert( eSndState == STATE_TX_IDLE ); + + ( void )xMBPortSerialGetByte( ( CHAR * ) & ucByte ); + switch ( eRcvState ) + { + /* A new character is received. If the character is a ':' the input + * buffer is cleared. A CR-character signals the end of the data + * block. Other characters are part of the data block and their + * ASCII value is converted back to a binary representation. + */ + case STATE_RX_RCV: + /* Enable timer for character timeout. */ + vMBPortTimersEnable( ); + if( ucByte == ':' ) + { + /* Empty receive buffer. */ + eBytePos = BYTE_HIGH_NIBBLE; + usRcvBufferPos = 0; + } + else if( ucByte == MB_ASCII_DEFAULT_CR ) + { + eRcvState = STATE_RX_WAIT_EOF; + } + else + { + ucResult = prvucMBCHAR2BIN( ucByte ); + switch ( eBytePos ) + { + /* High nibble of the byte comes first. We check for + * a buffer overflow here. */ + case BYTE_HIGH_NIBBLE: + if( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ) + { + ucASCIIBuf[usRcvBufferPos] = ( UCHAR )( ucResult << 4 ); + eBytePos = BYTE_LOW_NIBBLE; + break; + } + else + { + /* not handled in Modbus specification but seems + * a resonable implementation. */ + eRcvState = STATE_RX_IDLE; + /* Disable previously activated timer because of error state. */ + vMBPortTimersDisable( ); + } + break; + + case BYTE_LOW_NIBBLE: + ucASCIIBuf[usRcvBufferPos] |= ucResult; + usRcvBufferPos++; + eBytePos = BYTE_HIGH_NIBBLE; + break; + } + } + break; + + case STATE_RX_WAIT_EOF: + if( ucByte == ucMBLFCharacter ) + { + /* Disable character timeout timer because all characters are + * received. */ + vMBPortTimersDisable( ); + /* Receiver is again in idle state. */ + eRcvState = STATE_RX_IDLE; + + /* Notify the caller of eMBASCIIReceive that a new frame + * was received. */ + xNeedPoll = xMBPortEventPost( EV_FRAME_RECEIVED ); + } + else if( ucByte == ':' ) + { + /* Empty receive buffer and back to receive state. */ + eBytePos = BYTE_HIGH_NIBBLE; + usRcvBufferPos = 0; + eRcvState = STATE_RX_RCV; + + /* Enable timer for character timeout. */ + vMBPortTimersEnable( ); + } + else + { + /* Frame is not okay. Delete entire frame. */ + eRcvState = STATE_RX_IDLE; + } + break; + + case STATE_RX_IDLE: + if( ucByte == ':' ) + { + /* Enable timer for character timeout. */ + vMBPortTimersEnable( ); + /* Reset the input buffers to store the frame. */ + usRcvBufferPos = 0;; + eBytePos = BYTE_HIGH_NIBBLE; + eRcvState = STATE_RX_RCV; + } + break; + } + + return xNeedPoll; +} + +BOOL +xMBASCIITransmitFSM( void ) +{ + BOOL xNeedPoll = FALSE; + UCHAR ucByte; + + assert( eRcvState == STATE_RX_IDLE ); + switch ( eSndState ) + { + /* Start of transmission. The start of a frame is defined by sending + * the character ':'. */ + case STATE_TX_START: + ucByte = ':'; + xMBPortSerialPutByte( ( CHAR )ucByte ); + eSndState = STATE_TX_DATA; + eBytePos = BYTE_HIGH_NIBBLE; + break; + + /* Send the data block. Each data byte is encoded as a character hex + * stream with the high nibble sent first and the low nibble sent + * last. If all data bytes are exhausted we send a '\r' character + * to end the transmission. */ + case STATE_TX_DATA: + if( usSndBufferCount > 0 ) + { + switch ( eBytePos ) + { + case BYTE_HIGH_NIBBLE: + ucByte = prvucMBBIN2CHAR( ( UCHAR )( *pucSndBufferCur >> 4 ) ); + xMBPortSerialPutByte( ( CHAR ) ucByte ); + eBytePos = BYTE_LOW_NIBBLE; + break; + + case BYTE_LOW_NIBBLE: + ucByte = prvucMBBIN2CHAR( ( UCHAR )( *pucSndBufferCur & 0x0F ) ); + xMBPortSerialPutByte( ( CHAR )ucByte ); + pucSndBufferCur++; + eBytePos = BYTE_HIGH_NIBBLE; + usSndBufferCount--; + break; + } + } + else + { + xMBPortSerialPutByte( MB_ASCII_DEFAULT_CR ); + eSndState = STATE_TX_END; + } + break; + + /* Finish the frame by sending a LF character. */ + case STATE_TX_END: + xMBPortSerialPutByte( ( CHAR )ucMBLFCharacter ); + /* We need another state to make sure that the CR character has + * been sent. */ + eSndState = STATE_TX_NOTIFY; + break; + + /* Notify the task which called eMBASCIISend that the frame has + * been sent. */ + case STATE_TX_NOTIFY: + eSndState = STATE_TX_IDLE; + xNeedPoll = xMBPortEventPost( EV_FRAME_SENT ); + + /* Disable transmitter. This prevents another transmit buffer + * empty interrupt. */ + vMBPortSerialEnable( TRUE, FALSE ); + eSndState = STATE_TX_IDLE; + break; + + /* We should not get a transmitter event if the transmitter is in + * idle state. */ + case STATE_TX_IDLE: + /* enable receiver/disable transmitter. */ + vMBPortSerialEnable( TRUE, FALSE ); + break; + } + + return xNeedPoll; +} + +BOOL +xMBASCIITimerT1SExpired( void ) +{ + switch ( eRcvState ) + { + /* If we have a timeout we go back to the idle state and wait for + * the next frame. + */ + case STATE_RX_RCV: + case STATE_RX_WAIT_EOF: + eRcvState = STATE_RX_IDLE; + break; + + default: + assert( ( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_WAIT_EOF ) ); + break; + } + vMBPortTimersDisable( ); + + /* no context switch required. */ + return FALSE; +} + + +static UCHAR +prvucMBCHAR2BIN( UCHAR ucCharacter ) +{ + if( ( ucCharacter >= '0' ) && ( ucCharacter <= '9' ) ) + { + return ( UCHAR )( ucCharacter - '0' ); + } + else if( ( ucCharacter >= 'A' ) && ( ucCharacter <= 'F' ) ) + { + return ( UCHAR )( ucCharacter - 'A' + 0x0A ); + } + else + { + return 0xFF; + } +} + +static UCHAR +prvucMBBIN2CHAR( UCHAR ucByte ) +{ + if( ucByte <= 0x09 ) + { + return ( UCHAR )( '0' + ucByte ); + } + else if( ( ucByte >= 0x0A ) && ( ucByte <= 0x0F ) ) + { + return ( UCHAR )( ucByte - 0x0A + 'A' ); + } + else + { + /* Programming error. */ + assert( 0 ); + } + return '0'; +} + + +static UCHAR +prvucMBLRC( UCHAR * pucFrame, USHORT usLen ) +{ + UCHAR ucLRC = 0; /* LRC char initialized */ + + while( usLen-- ) + { + ucLRC += *pucFrame++; /* Add buffer byte without carry */ + } + + /* Return twos complement */ + ucLRC = ( UCHAR ) ( -( ( CHAR ) ucLRC ) ); + return ucLRC; +} + +#endif diff --git a/modbus/modbus/ascii/mbascii.h b/modbus/modbus/ascii/mbascii.h new file mode 100644 index 0000000..47846dd --- /dev/null +++ b/modbus/modbus/ascii/mbascii.h @@ -0,0 +1,56 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbascii.h,v 1.8 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_ASCII_H +#define _MB_ASCII_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +#if MB_ASCII_ENABLED > 0 +eMBErrorCode eMBASCIIInit( UCHAR slaveAddress, UCHAR ucPort, + ULONG ulBaudRate, eMBParity eParity ); +void eMBASCIIStart( void ); +void eMBASCIIStop( void ); + +eMBErrorCode eMBASCIIReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, + USHORT * pusLength ); +eMBErrorCode eMBASCIISend( UCHAR slaveAddress, const UCHAR * pucFrame, + USHORT usLength ); +BOOL xMBASCIIReceiveFSM( void ); +BOOL xMBASCIITransmitFSM( void ); +BOOL xMBASCIITimerT1SExpired( void ); +#endif + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/functions/mbfunccoils.c b/modbus/modbus/functions/mbfunccoils.c new file mode 100644 index 0000000..54227b3 --- /dev/null +++ b/modbus/modbus/functions/mbfunccoils.c @@ -0,0 +1,270 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfunccoils.c,v 1.8 2007/02/18 23:47:16 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbconfig.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) +#define MB_PDU_FUNC_READ_COILCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_READ_SIZE ( 4 ) +#define MB_PDU_FUNC_READ_COILCNT_MAX ( 0x07D0 ) + +#define MB_PDU_FUNC_WRITE_ADDR_OFF ( MB_PDU_DATA_OFF ) +#define MB_PDU_FUNC_WRITE_VALUE_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_WRITE_SIZE ( 4 ) + +#define MB_PDU_FUNC_WRITE_MUL_ADDR_OFF ( MB_PDU_DATA_OFF ) +#define MB_PDU_FUNC_WRITE_MUL_COILCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF ( MB_PDU_DATA_OFF + 4 ) +#define MB_PDU_FUNC_WRITE_MUL_VALUES_OFF ( MB_PDU_DATA_OFF + 5 ) +#define MB_PDU_FUNC_WRITE_MUL_SIZE_MIN ( 5 ) +#define MB_PDU_FUNC_WRITE_MUL_COILCNT_MAX ( 0x07B0 ) + +/* ----------------------- Static functions ---------------------------------*/ +eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); + +/* ----------------------- Start implementation -----------------------------*/ + +#if MB_FUNC_READ_COILS_ENABLED > 0 + +eMBException +eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usCoilCount; + UCHAR ucNBytes; + UCHAR *pucFrameCur; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_READ_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF + 1] ); + usRegAddress++; + + usCoilCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_COILCNT_OFF] << 8 ); + usCoilCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_COILCNT_OFF + 1] ); + + /* Check if the number of registers to read is valid. If not + * return Modbus illegal data value exception. + */ + if( ( usCoilCount >= 1 ) && + ( usCoilCount < MB_PDU_FUNC_READ_COILCNT_MAX ) ) + { + /* Set the current PDU data pointer to the beginning. */ + pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF]; + *usLen = MB_PDU_FUNC_OFF; + + /* First byte contains the function code. */ + *pucFrameCur++ = MB_FUNC_READ_COILS; + *usLen += 1; + + /* Test if the quantity of coils is a multiple of 8. If not last + * byte is only partially field with unused coils set to zero. */ + if( ( usCoilCount & 0x0007 ) != 0 ) + { + ucNBytes = ( UCHAR )( usCoilCount / 8 + 1 ); + } + else + { + ucNBytes = ( UCHAR )( usCoilCount / 8 ); + } + *pucFrameCur++ = ucNBytes; + *usLen += 1; + + eRegStatus = + eMBRegCoilsCB( pucFrameCur, usRegAddress, usCoilCount, + MB_REG_READ ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + /* The response contains the function code, the starting address + * and the quantity of registers. We reuse the old values in the + * buffer because they are still valid. */ + *usLen += ucNBytes;; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid read coil register request because the length + * is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#if MB_FUNC_WRITE_COIL_ENABLED > 0 +eMBException +eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + UCHAR ucBuf[2]; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_WRITE_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_ADDR_OFF + 1] ); + usRegAddress++; + + if( ( pucFrame[MB_PDU_FUNC_WRITE_VALUE_OFF + 1] == 0x00 ) && + ( ( pucFrame[MB_PDU_FUNC_WRITE_VALUE_OFF] == 0xFF ) || + ( pucFrame[MB_PDU_FUNC_WRITE_VALUE_OFF] == 0x00 ) ) ) + { + ucBuf[1] = 0; + if( pucFrame[MB_PDU_FUNC_WRITE_VALUE_OFF] == 0xFF ) + { + ucBuf[0] = 1; + } + else + { + ucBuf[0] = 0; + } + eRegStatus = + eMBRegCoilsCB( &ucBuf[0], usRegAddress, 1, MB_REG_WRITE ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid write coil register request because the length + * is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#endif + +#if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 +eMBException +eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usCoilCnt; + UCHAR ucByteCount; + UCHAR ucByteCountVerify; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen > ( MB_PDU_FUNC_WRITE_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_ADDR_OFF + 1] ); + usRegAddress++; + + usCoilCnt = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_COILCNT_OFF] << 8 ); + usCoilCnt |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_COILCNT_OFF + 1] ); + + ucByteCount = pucFrame[MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF]; + + /* Compute the number of expected bytes in the request. */ + if( ( usCoilCnt & 0x0007 ) != 0 ) + { + ucByteCountVerify = ( UCHAR )( usCoilCnt / 8 + 1 ); + } + else + { + ucByteCountVerify = ( UCHAR )( usCoilCnt / 8 ); + } + + if( ( usCoilCnt >= 1 ) && + ( usCoilCnt <= MB_PDU_FUNC_WRITE_MUL_COILCNT_MAX ) && + ( ucByteCountVerify == ucByteCount ) ) + { + eRegStatus = + eMBRegCoilsCB( &pucFrame[MB_PDU_FUNC_WRITE_MUL_VALUES_OFF], + usRegAddress, usCoilCnt, MB_REG_WRITE ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + /* The response contains the function code, the starting address + * and the quantity of registers. We reuse the old values in the + * buffer because they are still valid. */ + *usLen = MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid write coil register request because the length + * is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#endif + +#endif diff --git a/modbus/modbus/functions/mbfuncdiag.c b/modbus/modbus/functions/mbfuncdiag.c new file mode 100644 index 0000000..d75ffc0 --- /dev/null +++ b/modbus/modbus/functions/mbfuncdiag.c @@ -0,0 +1,29 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfuncdiag.c,v 1.3 2006/12/07 22:10:34 wolti Exp $ + */ diff --git a/modbus/modbus/functions/mbfuncdisc.c b/modbus/modbus/functions/mbfuncdisc.c new file mode 100644 index 0000000..fb37844 --- /dev/null +++ b/modbus/modbus/functions/mbfuncdisc.c @@ -0,0 +1,125 @@ + /* + * FreeRTOS Modbus Libary: A Modbus serial implementation for FreeRTOS + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbconfig.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) +#define MB_PDU_FUNC_READ_DISCCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_READ_SIZE ( 4 ) +#define MB_PDU_FUNC_READ_DISCCNT_MAX ( 0x07D0 ) + +/* ----------------------- Static functions ---------------------------------*/ +eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); + +/* ----------------------- Start implementation -----------------------------*/ + +#if MB_FUNC_READ_COILS_ENABLED > 0 + +eMBException +eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usDiscreteCnt; + UCHAR ucNBytes; + UCHAR *pucFrameCur; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_READ_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF + 1] ); + usRegAddress++; + + usDiscreteCnt = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_DISCCNT_OFF] << 8 ); + usDiscreteCnt |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_DISCCNT_OFF + 1] ); + + /* Check if the number of registers to read is valid. If not + * return Modbus illegal data value exception. + */ + if( ( usDiscreteCnt >= 1 ) && + ( usDiscreteCnt < MB_PDU_FUNC_READ_DISCCNT_MAX ) ) + { + /* Set the current PDU data pointer to the beginning. */ + pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF]; + *usLen = MB_PDU_FUNC_OFF; + + /* First byte contains the function code. */ + *pucFrameCur++ = MB_FUNC_READ_DISCRETE_INPUTS; + *usLen += 1; + + /* Test if the quantity of coils is a multiple of 8. If not last + * byte is only partially field with unused coils set to zero. */ + if( ( usDiscreteCnt & 0x0007 ) != 0 ) + { + ucNBytes = ( UCHAR ) ( usDiscreteCnt / 8 + 1 ); + } + else + { + ucNBytes = ( UCHAR ) ( usDiscreteCnt / 8 ); + } + *pucFrameCur++ = ucNBytes; + *usLen += 1; + + eRegStatus = + eMBRegDiscreteCB( pucFrameCur, usRegAddress, usDiscreteCnt ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + /* The response contains the function code, the starting address + * and the quantity of registers. We reuse the old values in the + * buffer because they are still valid. */ + *usLen += ucNBytes;; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid read coil register request because the length + * is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#endif diff --git a/modbus/modbus/functions/mbfuncholding.c b/modbus/modbus/functions/mbfuncholding.c new file mode 100644 index 0000000..e74a062 --- /dev/null +++ b/modbus/modbus/functions/mbfuncholding.c @@ -0,0 +1,308 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfuncholding.c,v 1.12 2007/02/18 23:48:22 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbconfig.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF + 0) +#define MB_PDU_FUNC_READ_REGCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_READ_SIZE ( 4 ) +#define MB_PDU_FUNC_READ_REGCNT_MAX ( 0x007D ) + +#define MB_PDU_FUNC_WRITE_ADDR_OFF ( MB_PDU_DATA_OFF + 0) +#define MB_PDU_FUNC_WRITE_VALUE_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_WRITE_SIZE ( 4 ) + +#define MB_PDU_FUNC_WRITE_MUL_ADDR_OFF ( MB_PDU_DATA_OFF + 0 ) +#define MB_PDU_FUNC_WRITE_MUL_REGCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF ( MB_PDU_DATA_OFF + 4 ) +#define MB_PDU_FUNC_WRITE_MUL_VALUES_OFF ( MB_PDU_DATA_OFF + 5 ) +#define MB_PDU_FUNC_WRITE_MUL_SIZE_MIN ( 5 ) +#define MB_PDU_FUNC_WRITE_MUL_REGCNT_MAX ( 0x0078 ) + +#define MB_PDU_FUNC_READWRITE_READ_ADDR_OFF ( MB_PDU_DATA_OFF + 0 ) +#define MB_PDU_FUNC_READWRITE_READ_REGCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_READWRITE_WRITE_ADDR_OFF ( MB_PDU_DATA_OFF + 4 ) +#define MB_PDU_FUNC_READWRITE_WRITE_REGCNT_OFF ( MB_PDU_DATA_OFF + 6 ) +#define MB_PDU_FUNC_READWRITE_BYTECNT_OFF ( MB_PDU_DATA_OFF + 8 ) +#define MB_PDU_FUNC_READWRITE_WRITE_VALUES_OFF ( MB_PDU_DATA_OFF + 9 ) +#define MB_PDU_FUNC_READWRITE_SIZE_MIN ( 9 ) + +/* ----------------------- Static functions ---------------------------------*/ +eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); + +/* ----------------------- Start implementation -----------------------------*/ + +#if MB_FUNC_WRITE_HOLDING_ENABLED > 0 + +eMBException +eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_WRITE_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_ADDR_OFF + 1] ); + usRegAddress++; + + /* Make callback to update the value. */ + eRegStatus = eMBRegHoldingCB( &pucFrame[MB_PDU_FUNC_WRITE_VALUE_OFF], + usRegAddress, 1, MB_REG_WRITE ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + } + else + { + /* Can't be a valid request because the length is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} +#endif + +#if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 +eMBException +eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usRegCount; + UCHAR ucRegByteCount; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen >= ( MB_PDU_FUNC_WRITE_MUL_SIZE_MIN + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_ADDR_OFF + 1] ); + usRegAddress++; + + usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_REGCNT_OFF] << 8 ); + usRegCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_WRITE_MUL_REGCNT_OFF + 1] ); + + ucRegByteCount = pucFrame[MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF]; + + if( ( usRegCount >= 1 ) && + ( usRegCount <= MB_PDU_FUNC_WRITE_MUL_REGCNT_MAX ) && + ( ucRegByteCount == ( UCHAR ) ( 2 * usRegCount ) ) ) + { + /* Make callback to update the register values. */ + eRegStatus = + eMBRegHoldingCB( &pucFrame[MB_PDU_FUNC_WRITE_MUL_VALUES_OFF], + usRegAddress, usRegCount, MB_REG_WRITE ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + /* The response contains the function code, the starting + * address and the quantity of registers. We reuse the + * old values in the buffer because they are still valid. + */ + *usLen = MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid request because the length is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} +#endif + +#if MB_FUNC_READ_HOLDING_ENABLED > 0 + +eMBException +eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usRegCount; + UCHAR *pucFrameCur; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_READ_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF + 1] ); + usRegAddress++; + + usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF] << 8 ); + usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] ); + + /* Check if the number of registers to read is valid. If not + * return Modbus illegal data value exception. + */ + if( ( usRegCount >= 1 ) && ( usRegCount <= MB_PDU_FUNC_READ_REGCNT_MAX ) ) + { + /* Set the current PDU data pointer to the beginning. */ + pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF]; + *usLen = MB_PDU_FUNC_OFF; + + /* First byte contains the function code. */ + *pucFrameCur++ = MB_FUNC_READ_HOLDING_REGISTER; + *usLen += 1; + + /* Second byte in the response contain the number of bytes. */ + *pucFrameCur++ = ( UCHAR ) ( usRegCount * 2 ); + *usLen += 1; + + /* Make callback to fill the buffer. */ + eRegStatus = eMBRegHoldingCB( pucFrameCur, usRegAddress, usRegCount, MB_REG_READ ); + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + *usLen += usRegCount * 2; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid request because the length is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#endif + +#if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 + +eMBException +eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegReadAddress; + USHORT usRegReadCount; + USHORT usRegWriteAddress; + USHORT usRegWriteCount; + UCHAR ucRegWriteByteCount; + UCHAR *pucFrameCur; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen >= ( MB_PDU_FUNC_READWRITE_SIZE_MIN + MB_PDU_SIZE_MIN ) ) + { + usRegReadAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_READ_ADDR_OFF] << 8U ); + usRegReadAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_READ_ADDR_OFF + 1] ); + usRegReadAddress++; + + usRegReadCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_READ_REGCNT_OFF] << 8U ); + usRegReadCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_READ_REGCNT_OFF + 1] ); + + usRegWriteAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_WRITE_ADDR_OFF] << 8U ); + usRegWriteAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_WRITE_ADDR_OFF + 1] ); + usRegWriteAddress++; + + usRegWriteCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_WRITE_REGCNT_OFF] << 8U ); + usRegWriteCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_READWRITE_WRITE_REGCNT_OFF + 1] ); + + ucRegWriteByteCount = pucFrame[MB_PDU_FUNC_READWRITE_BYTECNT_OFF]; + + if( ( usRegReadCount >= 1 ) && ( usRegReadCount <= 0x7D ) && + ( usRegWriteCount >= 1 ) && ( usRegWriteCount <= 0x79 ) && + ( ( 2 * usRegWriteCount ) == ucRegWriteByteCount ) ) + { + /* Make callback to update the register values. */ + eRegStatus = eMBRegHoldingCB( &pucFrame[MB_PDU_FUNC_READWRITE_WRITE_VALUES_OFF], + usRegWriteAddress, usRegWriteCount, MB_REG_WRITE ); + + if( eRegStatus == MB_ENOERR ) + { + /* Set the current PDU data pointer to the beginning. */ + pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF]; + *usLen = MB_PDU_FUNC_OFF; + + /* First byte contains the function code. */ + *pucFrameCur++ = MB_FUNC_READWRITE_MULTIPLE_REGISTERS; + *usLen += 1; + + /* Second byte in the response contain the number of bytes. */ + *pucFrameCur++ = ( UCHAR ) ( usRegReadCount * 2 ); + *usLen += 1; + + /* Make the read callback. */ + eRegStatus = + eMBRegHoldingCB( pucFrameCur, usRegReadAddress, usRegReadCount, MB_REG_READ ); + if( eRegStatus == MB_ENOERR ) + { + *usLen += 2 * usRegReadCount; + } + } + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + return eStatus; +} + +#endif diff --git a/modbus/modbus/functions/mbfuncinput.c b/modbus/modbus/functions/mbfuncinput.c new file mode 100644 index 0000000..cceedba --- /dev/null +++ b/modbus/modbus/functions/mbfuncinput.c @@ -0,0 +1,122 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfuncinput.c,v 1.10 2007/09/12 10:15:56 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbconfig.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) +#define MB_PDU_FUNC_READ_REGCNT_OFF ( MB_PDU_DATA_OFF + 2 ) +#define MB_PDU_FUNC_READ_SIZE ( 4 ) +#define MB_PDU_FUNC_READ_REGCNT_MAX ( 0x007D ) + +#define MB_PDU_FUNC_READ_RSP_BYTECNT_OFF ( MB_PDU_DATA_OFF ) + +/* ----------------------- Static functions ---------------------------------*/ +eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); + +/* ----------------------- Start implementation -----------------------------*/ +#if MB_FUNC_READ_INPUT_ENABLED > 0 + +eMBException +eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ) +{ + USHORT usRegAddress; + USHORT usRegCount; + UCHAR *pucFrameCur; + + eMBException eStatus = MB_EX_NONE; + eMBErrorCode eRegStatus; + + if( *usLen == ( MB_PDU_FUNC_READ_SIZE + MB_PDU_SIZE_MIN ) ) + { + usRegAddress = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF] << 8 ); + usRegAddress |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_ADDR_OFF + 1] ); + usRegAddress++; + + usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF] << 8 ); + usRegCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] ); + + /* Check if the number of registers to read is valid. If not + * return Modbus illegal data value exception. + */ + if( ( usRegCount >= 1 ) + && ( usRegCount < MB_PDU_FUNC_READ_REGCNT_MAX ) ) + { + /* Set the current PDU data pointer to the beginning. */ + pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF]; + *usLen = MB_PDU_FUNC_OFF; + + /* First byte contains the function code. */ + *pucFrameCur++ = MB_FUNC_READ_INPUT_REGISTER; + *usLen += 1; + + /* Second byte in the response contain the number of bytes. */ + *pucFrameCur++ = ( UCHAR )( usRegCount * 2 ); + *usLen += 1; + + eRegStatus = + eMBRegInputCB( pucFrameCur, usRegAddress, usRegCount ); + + /* If an error occured convert it into a Modbus exception. */ + if( eRegStatus != MB_ENOERR ) + { + eStatus = prveMBError2Exception( eRegStatus ); + } + else + { + *usLen += usRegCount * 2; + } + } + else + { + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + } + else + { + /* Can't be a valid read input register request because the length + * is incorrect. */ + eStatus = MB_EX_ILLEGAL_DATA_VALUE; + } + return eStatus; +} + +#endif diff --git a/modbus/modbus/functions/mbfuncother.c b/modbus/modbus/functions/mbfuncother.c new file mode 100644 index 0000000..fcee972 --- /dev/null +++ b/modbus/modbus/functions/mbfuncother.c @@ -0,0 +1,88 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfuncother.c,v 1.8 2006/12/07 22:10:34 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbconfig.h" + +#if MB_FUNC_OTHER_REP_SLAVEID_ENABLED > 0 + +/* ----------------------- Static variables ---------------------------------*/ +static UCHAR ucMBSlaveID[MB_FUNC_OTHER_REP_SLAVEID_BUF]; +static USHORT usMBSlaveIDLen; + +/* ----------------------- Start implementation -----------------------------*/ + +eMBErrorCode +eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, + UCHAR const *pucAdditional, USHORT usAdditionalLen ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + /* the first byte and second byte in the buffer is reserved for + * the parameter ucSlaveID and the running flag. The rest of + * the buffer is available for additional data. */ + if( usAdditionalLen + 2 < MB_FUNC_OTHER_REP_SLAVEID_BUF ) + { + usMBSlaveIDLen = 0; + ucMBSlaveID[usMBSlaveIDLen++] = ucSlaveID; + ucMBSlaveID[usMBSlaveIDLen++] = ( UCHAR )( xIsRunning ? 0xFF : 0x00 ); + if( usAdditionalLen > 0 ) + { + memcpy( &ucMBSlaveID[usMBSlaveIDLen], pucAdditional, + ( size_t )usAdditionalLen ); + usMBSlaveIDLen += usAdditionalLen; + } + } + else + { + eStatus = MB_ENORES; + } + return eStatus; +} + +eMBException +eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen ) +{ + memcpy( &pucFrame[MB_PDU_DATA_OFF], &ucMBSlaveID[0], ( size_t )usMBSlaveIDLen ); + *usLen = ( USHORT )( MB_PDU_DATA_OFF + usMBSlaveIDLen ); + return MB_EX_NONE; +} + +#endif diff --git a/modbus/modbus/functions/mbutils.c b/modbus/modbus/functions/mbutils.c new file mode 100644 index 0000000..6a72570 --- /dev/null +++ b/modbus/modbus/functions/mbutils.c @@ -0,0 +1,141 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbutils.c,v 1.6 2007/02/18 23:49:07 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbproto.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define BITS_UCHAR 8U + +/* ----------------------- Start implementation -----------------------------*/ +void +xMBUtilSetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits, + UCHAR ucValue ) +{ + USHORT usWordBuf; + USHORT usMask; + USHORT usByteOffset; + USHORT usNPreBits; + USHORT usValue = ucValue; + + assert( ucNBits <= 8 ); + assert( ( size_t )BITS_UCHAR == sizeof( UCHAR ) * 8 ); + + /* Calculate byte offset for first byte containing the bit values starting + * at usBitOffset. */ + usByteOffset = ( USHORT )( ( usBitOffset ) / BITS_UCHAR ); + + /* How many bits precede our bits to set. */ + usNPreBits = ( USHORT )( usBitOffset - usByteOffset * BITS_UCHAR ); + + /* Move bit field into position over bits to set */ + usValue <<= usNPreBits; + + /* Prepare a mask for setting the new bits. */ + usMask = ( USHORT )( ( 1 << ( USHORT ) ucNBits ) - 1 ); + usMask <<= usBitOffset - usByteOffset * BITS_UCHAR; + + /* copy bits into temporary storage. */ + usWordBuf = ucByteBuf[usByteOffset]; + usWordBuf |= ucByteBuf[usByteOffset + 1] << BITS_UCHAR; + + /* Zero out bit field bits and then or value bits into them. */ + usWordBuf = ( USHORT )( ( usWordBuf & ( ~usMask ) ) | usValue ); + + /* move bits back into storage */ + ucByteBuf[usByteOffset] = ( UCHAR )( usWordBuf & 0xFF ); + ucByteBuf[usByteOffset + 1] = ( UCHAR )( usWordBuf >> BITS_UCHAR ); +} + +UCHAR +xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits ) +{ + USHORT usWordBuf; + USHORT usMask; + USHORT usByteOffset; + USHORT usNPreBits; + + /* Calculate byte offset for first byte containing the bit values starting + * at usBitOffset. */ + usByteOffset = ( USHORT )( ( usBitOffset ) / BITS_UCHAR ); + + /* How many bits precede our bits to set. */ + usNPreBits = ( USHORT )( usBitOffset - usByteOffset * BITS_UCHAR ); + + /* Prepare a mask for setting the new bits. */ + usMask = ( USHORT )( ( 1 << ( USHORT ) ucNBits ) - 1 ); + + /* copy bits into temporary storage. */ + usWordBuf = ucByteBuf[usByteOffset]; + usWordBuf |= ucByteBuf[usByteOffset + 1] << BITS_UCHAR; + + /* throw away unneeded bits. */ + usWordBuf >>= usNPreBits; + + /* mask away bits above the requested bitfield. */ + usWordBuf &= usMask; + + return ( UCHAR ) usWordBuf; +} + +eMBException +prveMBError2Exception( eMBErrorCode eErrorCode ) +{ + eMBException eStatus; + + switch ( eErrorCode ) + { + case MB_ENOERR: + eStatus = MB_EX_NONE; + break; + + case MB_ENOREG: + eStatus = MB_EX_ILLEGAL_DATA_ADDRESS; + break; + + case MB_ETIMEDOUT: + eStatus = MB_EX_SLAVE_BUSY; + break; + + default: + eStatus = MB_EX_SLAVE_DEVICE_FAILURE; + break; + } + + return eStatus; +} diff --git a/modbus/modbus/include/mb.h b/modbus/modbus/include/mb.h new file mode 100644 index 0000000..4c75de5 --- /dev/null +++ b/modbus/modbus/include/mb.h @@ -0,0 +1,417 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mb.h,v 1.17 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_H +#define _MB_H + +#include "port.h" + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +#include "mbport.h" +#include "mbproto.h" + +/*! \defgroup modbus Modbus + * \code #include "mb.h" \endcode + * + * This module defines the interface for the application. It contains + * the basic functions and types required to use the Modbus protocol stack. + * A typical application will want to call eMBInit() first. If the device + * is ready to answer network requests it must then call eMBEnable() to activate + * the protocol stack. In the main loop the function eMBPoll() must be called + * periodically. The time interval between pooling depends on the configured + * Modbus timeout. If an RTOS is available a separate task should be created + * and the task should always call the function eMBPoll(). + * + * \code + * // Initialize protocol stack in RTU mode for a slave with address 10 = 0x0A + * eMBInit( MB_RTU, 0x0A, 38400, MB_PAR_EVEN ); + * // Enable the Modbus Protocol Stack. + * eMBEnable( ); + * for( ;; ) + * { + * // Call the main polling loop of the Modbus protocol stack. + * eMBPoll( ); + * ... + * } + * \endcode + */ + +/* ----------------------- Defines ------------------------------------------*/ + +/*! \ingroup modbus + * \brief Use the default Modbus TCP port (502) + */ +#define MB_TCP_PORT_USE_DEFAULT 0 + +/* ----------------------- Type definitions ---------------------------------*/ + +/*! \ingroup modbus + * \brief Modbus serial transmission modes (RTU/ASCII). + * + * Modbus serial supports two transmission modes. Either ASCII or RTU. RTU + * is faster but has more hardware requirements and requires a network with + * a low jitter. ASCII is slower and more reliable on slower links (E.g. modems) + */ + typedef enum +{ + MB_RTU, /*!< RTU transmission mode. */ + MB_ASCII, /*!< ASCII transmission mode. */ + MB_TCP /*!< TCP mode. */ +} eMBMode; + +/*! \ingroup modbus + * \brief If register should be written or read. + * + * This value is passed to the callback functions which support either + * reading or writing register values. Writing means that the application + * registers should be updated and reading means that the modbus protocol + * stack needs to know the current register values. + * + * \see eMBRegHoldingCB( ), eMBRegCoilsCB( ), eMBRegDiscreteCB( ) and + * eMBRegInputCB( ). + */ +typedef enum +{ + MB_REG_READ, /*!< Read register values and pass to protocol stack. */ + MB_REG_WRITE /*!< Update register values. */ +} eMBRegisterMode; + +/*! \ingroup modbus + * \brief Errorcodes used by all function in the protocol stack. + */ +typedef enum +{ + MB_ENOERR, /*!< no error. */ + MB_ENOREG, /*!< illegal register address. */ + MB_EINVAL, /*!< illegal argument. */ + MB_EPORTERR, /*!< porting layer error. */ + MB_ENORES, /*!< insufficient resources. */ + MB_EIO, /*!< I/O error. */ + MB_EILLSTATE, /*!< protocol stack in illegal state. */ + MB_ETIMEDOUT /*!< timeout error occurred. */ +} eMBErrorCode; + + +/* ----------------------- Function prototypes ------------------------------*/ +/*! \ingroup modbus + * \brief Initialize the Modbus protocol stack. + * + * This functions initializes the ASCII or RTU module and calls the + * init functions of the porting layer to prepare the hardware. Please + * note that the receiver is still disabled and no Modbus frames are + * processed until eMBEnable( ) has been called. + * + * \param eMode If ASCII or RTU mode should be used. + * \param ucSlaveAddress The slave address. Only frames sent to this + * address or to the broadcast address are processed. + * \param ucPort The port to use. E.g. 1 for COM1 on windows. This value + * is platform dependent and some ports simply choose to ignore it. + * \param ulBaudRate The baudrate. E.g. 19200. Supported baudrates depend + * on the porting layer. + * \param eParity Parity used for serial transmission. + * + * \return If no error occurs the function returns eMBErrorCode::MB_ENOERR. + * The protocol is then in the disabled state and ready for activation + * by calling eMBEnable( ). Otherwise one of the following error codes + * is returned: + * - eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid + * slave addresses are in the range 1 - 247. + * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. + */ +extern eMBErrorCode eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, + UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ); + +/*! \ingroup modbus + * \brief Initialize the Modbus protocol stack for Modbus TCP. + * + * This function initializes the Modbus TCP Module. Please note that + * frame processing is still disabled until eMBEnable( ) is called. + * + * \param usTCPPort The TCP port to listen on. + * \return If the protocol stack has been initialized correctly the function + * returns eMBErrorCode::MB_ENOERR. Otherwise one of the following error + * codes is returned: + * - eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid + * slave addresses are in the range 1 - 247. + * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. + */ +extern eMBErrorCode eMBTCPInit( USHORT usTCPPort ); + +/*! \ingroup modbus + * \brief Release resources used by the protocol stack. + * + * This function disables the Modbus protocol stack and release all + * hardware resources. It must only be called when the protocol stack + * is disabled. + * + * \note Note all ports implement this function. A port which wants to + * get an callback must define the macro MB_PORT_HAS_CLOSE to 1. + * + * \return If the resources where released it return eMBErrorCode::MB_ENOERR. + * If the protocol stack is not in the disabled state it returns + * eMBErrorCode::MB_EILLSTATE. + */ +extern eMBErrorCode eMBClose( void ); + +/*! \ingroup modbus + * \brief Enable the Modbus protocol stack. + * + * This function enables processing of Modbus frames. Enabling the protocol + * stack is only possible if it is in the disabled state. + * + * \return If the protocol stack is now in the state enabled it returns + * eMBErrorCode::MB_ENOERR. If it was not in the disabled state it + * return eMBErrorCode::MB_EILLSTATE. + */ +eMBErrorCode eMBEnable( void ); + +/*! \ingroup modbus + * \brief Disable the Modbus protocol stack. + * + * This function disables processing of Modbus frames. + * + * \return If the protocol stack has been disabled it returns + * eMBErrorCode::MB_ENOERR. If it was not in the enabled state it returns + * eMBErrorCode::MB_EILLSTATE. + */ +extern eMBErrorCode eMBDisable( void ); + +/*! \ingroup modbus + * \brief The main pooling loop of the Modbus protocol stack. + * + * This function must be called periodically. The timer interval required + * is given by the application dependent Modbus slave timeout. Internally the + * function calls xMBPortEventGet() and waits for an event from the receiver or + * transmitter state machines. + * + * \return If the protocol stack is not in the enabled state the function + * returns eMBErrorCode::MB_EILLSTATE. Otherwise it returns + * eMBErrorCode::MB_ENOERR. + */ +extern eMBErrorCode eMBPoll( void ); + +/*! \ingroup modbus + * \brief Configure the slave id of the device. + * + * This function should be called when the Modbus function Report Slave ID + * is enabled ( By defining MB_FUNC_OTHER_REP_SLAVEID_ENABLED in mbconfig.h ). + * + * \param ucSlaveID Values is returned in the Slave ID byte of the + * Report Slave ID response. + * \param xIsRunning If TRUE the Run Indicator Status byte is set to 0xFF. + * otherwise the Run Indicator Status is 0x00. + * \param pucAdditional Values which should be returned in the Additional + * bytes of the Report Slave ID response. + * \param usAdditionalLen Length of the buffer pucAdditonal. + * + * \return If the static buffer defined by MB_FUNC_OTHER_REP_SLAVEID_BUF in + * mbconfig.h is to small it returns eMBErrorCode::MB_ENORES. Otherwise + * it returns eMBErrorCode::MB_ENOERR. + */ +extern eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, + UCHAR const *pucAdditional, + USHORT usAdditionalLen ); + +/*! \ingroup modbus + * \brief Registers a callback handler for a given function code. + * + * This function registers a new callback handler for a given function code. + * The callback handler supplied is responsible for interpreting the Modbus PDU and + * the creation of an appropriate response. In case of an error it should return + * one of the possible Modbus exceptions which results in a Modbus exception frame + * sent by the protocol stack. + * + * \param ucFunctionCode The Modbus function code for which this handler should + * be registers. Valid function codes are in the range 1 to 127. + * \param pxHandler The function handler which should be called in case + * such a frame is received. If \c NULL a previously registered function handler + * for this function code is removed. + * + * \return eMBErrorCode::MB_ENOERR if the handler has been installed. If no + * more resources are available it returns eMBErrorCode::MB_ENORES. In this + * case the values in mbconfig.h should be adjusted. If the argument was not + * valid it returns eMBErrorCode::MB_EINVAL. + */ +extern eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, + pxMBFunctionHandler pxHandler ); + +/* ----------------------- Callback -----------------------------------------*/ + +/*! \defgroup modbus_registers Modbus Registers + * \code #include "mb.h" \endcode + * The protocol stack does not internally allocate any memory for the + * registers. This makes the protocol stack very small and also usable on + * low end targets. In addition the values don't have to be in the memory + * and could for example be stored in a flash.
+ * Whenever the protocol stack requires a value it calls one of the callback + * function with the register address and the number of registers to read + * as an argument. The application should then read the actual register values + * (for example the ADC voltage) and should store the result in the supplied + * buffer.
+ * If the protocol stack wants to update a register value because a write + * register function was received a buffer with the new register values is + * passed to the callback function. The function should then use these values + * to update the application register values. + */ + +/*! \ingroup modbus_registers + * \brief Callback function used if the value of a Input Register + * is required by the protocol stack. The starting register address is given + * by \c usAddress and the last register is given by usAddress + + * usNRegs - 1. + * + * \param pucRegBuffer A buffer where the callback function should write + * the current value of the modbus registers to. + * \param usAddress The starting address of the register. Input registers + * are in the range 1 - 65535. + * \param usNRegs Number of registers the callback function must supply. + * + * \return The function must return one of the following error codes: + * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal + * Modbus response is sent. + * - eMBErrorCode::MB_ENOREG If the application can not supply values + * for registers within this range. In this case a + * ILLEGAL DATA ADDRESS exception frame is sent as a response. + * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is + * currently not available and the application dependent response + * timeout would be violated. In this case a SLAVE DEVICE BUSY + * exception is sent as a response. + * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case + * a SLAVE DEVICE FAILURE exception is sent as a response. + */ +extern eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, + USHORT usNRegs ); + +/*! \ingroup modbus_registers + * \brief Callback function used if a Holding Register value is + * read or written by the protocol stack. The starting register address + * is given by \c usAddress and the last register is given by + * usAddress + usNRegs - 1. + * + * \param pucRegBuffer If the application registers values should be updated the + * buffer points to the new registers values. If the protocol stack needs + * to now the current values the callback function should write them into + * this buffer. + * \param usAddress The starting address of the register. + * \param usNRegs Number of registers to read or write. + * \param eMode If eMBRegisterMode::MB_REG_WRITE the application register + * values should be updated from the values in the buffer. For example + * this would be the case when the Modbus master has issued an + * WRITE SINGLE REGISTER command. + * If the value eMBRegisterMode::MB_REG_READ the application should copy + * the current values into the buffer \c pucRegBuffer. + * + * \return The function must return one of the following error codes: + * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal + * Modbus response is sent. + * - eMBErrorCode::MB_ENOREG If the application can not supply values + * for registers within this range. In this case a + * ILLEGAL DATA ADDRESS exception frame is sent as a response. + * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is + * currently not available and the application dependent response + * timeout would be violated. In this case a SLAVE DEVICE BUSY + * exception is sent as a response. + * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case + * a SLAVE DEVICE FAILURE exception is sent as a response. + */ +extern eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, + USHORT usNRegs, eMBRegisterMode eMode ); + +/*! \ingroup modbus_registers + * \brief Callback function used if a Coil Register value is + * read or written by the protocol stack. If you are going to use + * this function you might use the functions xMBUtilSetBits( ) and + * xMBUtilGetBits( ) for working with bitfields. + * + * \param pucRegBuffer The bits are packed in bytes where the first coil + * starting at address \c usAddress is stored in the LSB of the + * first byte in the buffer pucRegBuffer. + * If the buffer should be written by the callback function unused + * coil values (I.e. if not a multiple of eight coils is used) should be set + * to zero. + * \param usAddress The first coil number. + * \param usNCoils Number of coil values requested. + * \param eMode If eMBRegisterMode::MB_REG_WRITE the application values should + * be updated from the values supplied in the buffer \c pucRegBuffer. + * If eMBRegisterMode::MB_REG_READ the application should store the current + * values in the buffer \c pucRegBuffer. + * + * \return The function must return one of the following error codes: + * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal + * Modbus response is sent. + * - eMBErrorCode::MB_ENOREG If the application does not map an coils + * within the requested address range. In this case a + * ILLEGAL DATA ADDRESS is sent as a response. + * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is + * currently not available and the application dependent response + * timeout would be violated. In this case a SLAVE DEVICE BUSY + * exception is sent as a response. + * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case + * a SLAVE DEVICE FAILURE exception is sent as a response. + */ +extern eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, + USHORT usNCoils, eMBRegisterMode eMode ); + +/*! \ingroup modbus_registers + * \brief Callback function used if a Input Discrete Register value is + * read by the protocol stack. + * + * If you are going to use his function you might use the functions + * xMBUtilSetBits( ) and xMBUtilGetBits( ) for working with bitfields. + * + * \param pucRegBuffer The buffer should be updated with the current + * coil values. The first discrete input starting at \c usAddress must be + * stored at the LSB of the first byte in the buffer. If the requested number + * is not a multiple of eight the remaining bits should be set to zero. + * \param usAddress The starting address of the first discrete input. + * \param usNDiscrete Number of discrete input values. + * \return The function must return one of the following error codes: + * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal + * Modbus response is sent. + * - eMBErrorCode::MB_ENOREG If no such discrete inputs exists. + * In this case a ILLEGAL DATA ADDRESS exception frame is sent + * as a response. + * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is + * currently not available and the application dependent response + * timeout would be violated. In this case a SLAVE DEVICE BUSY + * exception is sent as a response. + * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case + * a SLAVE DEVICE FAILURE exception is sent as a response. + */ +extern eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, + USHORT usNDiscrete ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbconfig.h b/modbus/modbus/include/mbconfig.h new file mode 100644 index 0000000..7912143 --- /dev/null +++ b/modbus/modbus/include/mbconfig.h @@ -0,0 +1,132 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbconfig.h,v 1.15 2010/06/06 13:54:40 wolti Exp $ + */ + +#ifndef _MB_CONFIG_H +#define _MB_CONFIG_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif +/* ----------------------- Defines ------------------------------------------*/ +/*! \defgroup modbus_cfg Modbus Configuration + * + * Most modules in the protocol stack are completly optional and can be + * excluded. This is specially important if target resources are very small + * and program memory space should be saved.
+ * + * All of these settings are available in the file mbconfig.h + */ +/*! \addtogroup modbus_cfg + * @{ + */ +/*! \brief If Modbus ASCII support is enabled. */ +#define MB_ASCII_ENABLED ( 0 ) + +/*! \brief If Modbus RTU support is enabled. */ +#define MB_RTU_ENABLED ( 0 ) + +/*! \brief If Modbus TCP support is enabled. */ +#define MB_TCP_ENABLED ( 1 ) + +/*! \brief The character timeout value for Modbus ASCII. + * + * The character timeout value is not fixed for Modbus ASCII and is therefore + * a configuration option. It should be set to the maximum expected delay + * time of the network. + */ +#define MB_ASCII_TIMEOUT_SEC ( 1 ) + +/*! \brief Timeout to wait in ASCII prior to enabling transmitter. + * + * If defined the function calls vMBPortSerialDelay with the argument + * MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS to allow for a delay before + * the serial transmitter is enabled. This is required because some + * targets are so fast that there is no time between receiving and + * transmitting the frame. If the master is to slow with enabling its + * receiver then he will not receive the response correctly. + */ +#ifndef MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS +#define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( 0 ) +#endif + +/*! \brief Maximum number of Modbus functions codes the protocol stack + * should support. + * + * The maximum number of supported Modbus functions must be greater than + * the sum of all enabled functions in this file and custom function + * handlers. If set to small adding more functions will fail. + */ +#define MB_FUNC_HANDLERS_MAX ( 16 ) + +/*! \brief Number of bytes which should be allocated for the Report Slave ID + * command. + * + * This number limits the maximum size of the additional segment in the + * report slave id function. See eMBSetSlaveID( ) for more information on + * how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED + * is set to 1. + */ +#define MB_FUNC_OTHER_REP_SLAVEID_BUF ( 32 ) + +/*! \brief If the Report Slave ID function should be enabled. */ +#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED ( 1 ) + +/*! \brief If the Read Input Registers function should be enabled. */ +#define MB_FUNC_READ_INPUT_ENABLED ( 1 ) + +/*! \brief If the Read Holding Registers function should be enabled. */ +#define MB_FUNC_READ_HOLDING_ENABLED ( 1 ) + +/*! \brief If the Write Single Register function should be enabled. */ +#define MB_FUNC_WRITE_HOLDING_ENABLED ( 1 ) + +/*! \brief If the Write Multiple registers function should be enabled. */ +#define MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED ( 1 ) + +/*! \brief If the Read Coils function should be enabled. */ +#define MB_FUNC_READ_COILS_ENABLED ( 0 ) + +/*! \brief If the Write Coils function should be enabled. */ +#define MB_FUNC_WRITE_COIL_ENABLED ( 0 ) + +/*! \brief If the Write Multiple Coils function should be enabled. */ +#define MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED ( 0 ) + +/*! \brief If the Read Discrete Inputs function should be enabled. */ +#define MB_FUNC_READ_DISCRETE_INPUTS_ENABLED ( 0 ) + +/*! \brief If the Read/Write Multiple Registers function should be enabled. */ +#define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 ) + +/*! @} */ +#ifdef __cplusplus + PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbframe.h b/modbus/modbus/include/mbframe.h new file mode 100644 index 0000000..99d59c6 --- /dev/null +++ b/modbus/modbus/include/mbframe.h @@ -0,0 +1,87 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbframe.h,v 1.9 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_FRAME_H +#define _MB_FRAME_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +/*! + * Constants which defines the format of a modbus frame. The example is + * shown for a Modbus RTU/ASCII frame. Note that the Modbus PDU is not + * dependent on the underlying transport. + * + * + * <------------------------ MODBUS SERIAL LINE PDU (1) -------------------> + * <----------- MODBUS PDU (1') ----------------> + * +-----------+---------------+----------------------------+-------------+ + * | Address | Function Code | Data | CRC/LRC | + * +-----------+---------------+----------------------------+-------------+ + * | | | | + * (2) (3/2') (3') (4) + * + * (1) ... MB_SER_PDU_SIZE_MAX = 256 + * (2) ... MB_SER_PDU_ADDR_OFF = 0 + * (3) ... MB_SER_PDU_PDU_OFF = 1 + * (4) ... MB_SER_PDU_SIZE_CRC = 2 + * + * (1') ... MB_PDU_SIZE_MAX = 253 + * (2') ... MB_PDU_FUNC_OFF = 0 + * (3') ... MB_PDU_DATA_OFF = 1 + * + */ + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_PDU_SIZE_MAX 253 /*!< Maximum size of a PDU. */ +#define MB_PDU_SIZE_MIN 1 /*!< Function Code */ +#define MB_PDU_FUNC_OFF 0 /*!< Offset of function code in PDU. */ +#define MB_PDU_DATA_OFF 1 /*!< Offset for response data in PDU. */ + +/* ----------------------- Prototypes 0-------------------------------------*/ +typedef void ( *pvMBFrameStart ) ( void ); + +typedef void ( *pvMBFrameStop ) ( void ); + +typedef eMBErrorCode( *peMBFrameReceive ) ( UCHAR * pucRcvAddress, + UCHAR ** pucFrame, + USHORT * pusLength ); + +typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress, + const UCHAR * pucFrame, + USHORT usLength ); + +typedef void( *pvMBFrameClose ) ( void ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbfunc.h b/modbus/modbus/include/mbfunc.h new file mode 100644 index 0000000..aea14f7 --- /dev/null +++ b/modbus/modbus/include/mbfunc.h @@ -0,0 +1,80 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbfunc.h,v 1.12 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_FUNC_H +#define _MB_FUNC_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif +#if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0 + eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_READ_INPUT_ENABLED > 0 +eMBException eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_READ_HOLDING_ENABLED > 0 +eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_WRITE_HOLDING_ENABLED > 0 +eMBException eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 +eMBException eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_READ_COILS_ENABLED > 0 +eMBException eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_WRITE_COIL_ENABLED > 0 +eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 +eMBException eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0 +eMBException eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 +eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); +#endif + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbport.h b/modbus/modbus/include/mbport.h new file mode 100644 index 0000000..4f25a96 --- /dev/null +++ b/modbus/modbus/include/mbport.h @@ -0,0 +1,129 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbport.h,v 1.19 2010/06/06 13:54:40 wolti Exp $ + */ + +#ifndef _MB_PORT_H +#define _MB_PORT_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +/* ----------------------- Type definitions ---------------------------------*/ + +typedef enum +{ + EV_READY, /*!< Startup finished. */ + EV_FRAME_RECEIVED, /*!< Frame received. */ + EV_EXECUTE, /*!< Execute function. */ + EV_FRAME_SENT /*!< Frame sent. */ +} eMBEventType; + +/*! \ingroup modbus + * \brief Parity used for characters in serial mode. + * + * The parity which should be applied to the characters sent over the serial + * link. Please note that this values are actually passed to the porting + * layer and therefore not all parity modes might be available. + */ +typedef enum +{ + MB_PAR_NONE, /*!< No parity. */ + MB_PAR_ODD, /*!< Odd parity. */ + MB_PAR_EVEN /*!< Even parity. */ +} eMBParity; + +/* ----------------------- Supporting functions -----------------------------*/ +BOOL xMBPortEventInit( void ); + +BOOL xMBPortEventPost( eMBEventType eEvent ); + +BOOL xMBPortEventGet( /*@out@ */ eMBEventType * eEvent ); + +/* ----------------------- Serial port functions ----------------------------*/ + +BOOL xMBPortSerialInit( UCHAR ucPort, ULONG ulBaudRate, + UCHAR ucDataBits, eMBParity eParity ); + +void vMBPortClose( void ); + +void xMBPortSerialClose( void ); + +void vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable ); + +BOOL xMBPortSerialGetByte( CHAR * pucByte ); + +BOOL xMBPortSerialPutByte( CHAR ucByte ); + +/* ----------------------- Timers functions ---------------------------------*/ +BOOL xMBPortTimersInit( USHORT usTimeOut50us ); + +void xMBPortTimersClose( void ); + +void vMBPortTimersEnable( void ); + +void vMBPortTimersDisable( void ); + +void vMBPortTimersDelay( USHORT usTimeOutMS ); + +/* ----------------------- Callback for the protocol stack ------------------*/ + +/*! + * \brief Callback function for the porting layer when a new byte is + * available. + * + * Depending upon the mode this callback function is used by the RTU or + * ASCII transmission layers. In any case a call to xMBPortSerialGetByte() + * must immediately return a new character. + * + * \return TRUE if a event was posted to the queue because + * a new byte was received. The port implementation should wake up the + * tasks which are currently blocked on the eventqueue. + */ +extern BOOL( *pxMBFrameCBByteReceived ) ( void ); + +extern BOOL( *pxMBFrameCBTransmitterEmpty ) ( void ); + +extern BOOL( *pxMBPortCBTimerExpired ) ( void ); + +/* ----------------------- TCP port functions -------------------------------*/ +BOOL xMBTCPPortInit( USHORT usTCPPort ); + +void vMBTCPPortClose( void ); + +void vMBTCPPortDisable( void ); + +BOOL xMBTCPPortGetRequest( UCHAR **ppucMBTCPFrame, USHORT * usTCPLength ); + +BOOL xMBTCPPortSendResponse( const UCHAR *pucMBTCPFrame, USHORT usTCPLength ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbproto.h b/modbus/modbus/include/mbproto.h new file mode 100644 index 0000000..786aaf4 --- /dev/null +++ b/modbus/modbus/include/mbproto.h @@ -0,0 +1,83 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbproto.h,v 1.14 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_PROTO_H +#define _MB_PROTO_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif +/* ----------------------- Defines ------------------------------------------*/ +#define MB_ADDRESS_BROADCAST ( 0 ) /*! Modbus broadcast address. */ +#define MB_ADDRESS_MIN ( 1 ) /*! Smallest possible slave address. */ +#define MB_ADDRESS_MAX ( 247 ) /*! Biggest possible slave address. */ +#define MB_FUNC_NONE ( 0 ) +#define MB_FUNC_READ_COILS ( 1 ) +#define MB_FUNC_READ_DISCRETE_INPUTS ( 2 ) +#define MB_FUNC_WRITE_SINGLE_COIL ( 5 ) +#define MB_FUNC_WRITE_MULTIPLE_COILS ( 15 ) +#define MB_FUNC_READ_HOLDING_REGISTER ( 3 ) +#define MB_FUNC_READ_INPUT_REGISTER ( 4 ) +#define MB_FUNC_WRITE_REGISTER ( 6 ) +#define MB_FUNC_WRITE_MULTIPLE_REGISTERS ( 16 ) +#define MB_FUNC_READWRITE_MULTIPLE_REGISTERS ( 23 ) +#define MB_FUNC_DIAG_READ_EXCEPTION ( 7 ) +#define MB_FUNC_DIAG_DIAGNOSTIC ( 8 ) +#define MB_FUNC_DIAG_GET_COM_EVENT_CNT ( 11 ) +#define MB_FUNC_DIAG_GET_COM_EVENT_LOG ( 12 ) +#define MB_FUNC_OTHER_REPORT_SLAVEID ( 17 ) +#define MB_FUNC_ERROR ( 128 ) +/* ----------------------- Type definitions ---------------------------------*/ + typedef enum +{ + MB_EX_NONE = 0x00, + MB_EX_ILLEGAL_FUNCTION = 0x01, + MB_EX_ILLEGAL_DATA_ADDRESS = 0x02, + MB_EX_ILLEGAL_DATA_VALUE = 0x03, + MB_EX_SLAVE_DEVICE_FAILURE = 0x04, + MB_EX_ACKNOWLEDGE = 0x05, + MB_EX_SLAVE_BUSY = 0x06, + MB_EX_MEMORY_PARITY_ERROR = 0x08, + MB_EX_GATEWAY_PATH_FAILED = 0x0A, + MB_EX_GATEWAY_TGT_FAILED = 0x0B +} eMBException; + +typedef eMBException( *pxMBFunctionHandler ) ( UCHAR * pucFrame, USHORT * pusLength ); + +typedef struct +{ + UCHAR ucFunctionCode; + pxMBFunctionHandler pxHandler; +} xMBFunctionHandler; + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/include/mbutils.h b/modbus/modbus/include/mbutils.h new file mode 100644 index 0000000..6149575 --- /dev/null +++ b/modbus/modbus/include/mbutils.h @@ -0,0 +1,108 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbutils.h,v 1.5 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_UTILS_H +#define _MB_UTILS_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif +/*! \defgroup modbus_utils Utilities + * + * This module contains some utility functions which can be used by + * the application. It includes some special functions for working with + * bitfields backed by a character array buffer. + * + */ +/*! \addtogroup modbus_utils + * @{ + */ +/*! \brief Function to set bits in a byte buffer. + * + * This function allows the efficient use of an array to implement bitfields. + * The array used for storing the bits must always be a multiple of two + * bytes. Up to eight bits can be set or cleared in one operation. + * + * \param ucByteBuf A buffer where the bit values are stored. Must be a + * multiple of 2 bytes. No length checking is performed and if + * usBitOffset / 8 is greater than the size of the buffer memory contents + * is overwritten. + * \param usBitOffset The starting address of the bits to set. The first + * bit has the offset 0. + * \param ucNBits Number of bits to modify. The value must always be smaller + * than 8. + * \param ucValues Thew new values for the bits. The value for the first bit + * starting at usBitOffset is the LSB of the value + * ucValues + * + * \code + * ucBits[2] = {0, 0}; + * + * // Set bit 4 to 1 (read: set 1 bit starting at bit offset 4 to value 1) + * xMBUtilSetBits( ucBits, 4, 1, 1 ); + * + * // Set bit 7 to 1 and bit 8 to 0. + * xMBUtilSetBits( ucBits, 7, 2, 0x01 ); + * + * // Set bits 8 - 11 to 0x05 and bits 12 - 15 to 0x0A; + * xMBUtilSetBits( ucBits, 8, 8, 0x5A); + * \endcode + */ +void xMBUtilSetBits( UCHAR * ucByteBuf, USHORT usBitOffset, + UCHAR ucNBits, UCHAR ucValues ); + +/*! \brief Function to read bits in a byte buffer. + * + * This function is used to extract up bit values from an array. Up to eight + * bit values can be extracted in one step. + * + * \param ucByteBuf A buffer where the bit values are stored. + * \param usBitOffset The starting address of the bits to set. The first + * bit has the offset 0. + * \param ucNBits Number of bits to modify. The value must always be smaller + * than 8. + * + * \code + * UCHAR ucBits[2] = {0, 0}; + * UCHAR ucResult; + * + * // Extract the bits 3 - 10. + * ucResult = xMBUtilGetBits( ucBits, 3, 8 ); + * \endcode + */ +UCHAR xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset, + UCHAR ucNBits ); + +/*! @} */ + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/mb.c b/modbus/modbus/mb.c new file mode 100644 index 0000000..ea06ddb --- /dev/null +++ b/modbus/modbus/mb.c @@ -0,0 +1,413 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mb.c,v 1.28 2010/06/06 13:54:40 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbconfig.h" +#include "mbframe.h" +#include "mbproto.h" +#include "mbfunc.h" + +#include "mbport.h" +#if MB_RTU_ENABLED == 1 +#include "mbrtu.h" +#endif +#if MB_ASCII_ENABLED == 1 +#include "mbascii.h" +#endif +#if MB_TCP_ENABLED == 1 +#include "mbtcp.h" +#endif + +#ifndef MB_PORT_HAS_CLOSE +#define MB_PORT_HAS_CLOSE 0 +#endif + +/* ----------------------- Static variables ---------------------------------*/ + +static UCHAR ucMBAddress; +static eMBMode eMBCurrentMode; + +static enum +{ + STATE_ENABLED, + STATE_DISABLED, + STATE_NOT_INITIALIZED +} eMBState = STATE_NOT_INITIALIZED; + +/* Functions pointer which are initialized in eMBInit( ). Depending on the + * mode (RTU or ASCII) the are set to the correct implementations. + */ +static peMBFrameSend peMBFrameSendCur; +static pvMBFrameStart pvMBFrameStartCur; +static pvMBFrameStop pvMBFrameStopCur; +static peMBFrameReceive peMBFrameReceiveCur; +static pvMBFrameClose pvMBFrameCloseCur; + +/* Callback functions required by the porting layer. They are called when + * an external event has happend which includes a timeout or the reception + * or transmission of a character. + */ +BOOL( *pxMBFrameCBByteReceived ) ( void ); +BOOL( *pxMBFrameCBTransmitterEmpty ) ( void ); +BOOL( *pxMBPortCBTimerExpired ) ( void ); + +BOOL( *pxMBFrameCBReceiveFSMCur ) ( void ); +BOOL( *pxMBFrameCBTransmitFSMCur ) ( void ); + +/* An array of Modbus functions handlers which associates Modbus function + * codes with implementing functions. + */ +static xMBFunctionHandler xFuncHandlers[MB_FUNC_HANDLERS_MAX] = { +#if MB_FUNC_OTHER_REP_SLAVEID_ENABLED > 0 + {MB_FUNC_OTHER_REPORT_SLAVEID, eMBFuncReportSlaveID}, +#endif +#if MB_FUNC_READ_INPUT_ENABLED > 0 + {MB_FUNC_READ_INPUT_REGISTER, eMBFuncReadInputRegister}, +#endif +#if MB_FUNC_READ_HOLDING_ENABLED > 0 + {MB_FUNC_READ_HOLDING_REGISTER, eMBFuncReadHoldingRegister}, +#endif +#if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 + {MB_FUNC_WRITE_MULTIPLE_REGISTERS, eMBFuncWriteMultipleHoldingRegister}, +#endif +#if MB_FUNC_WRITE_HOLDING_ENABLED > 0 + {MB_FUNC_WRITE_REGISTER, eMBFuncWriteHoldingRegister}, +#endif +#if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 + {MB_FUNC_READWRITE_MULTIPLE_REGISTERS, eMBFuncReadWriteMultipleHoldingRegister}, +#endif +#if MB_FUNC_READ_COILS_ENABLED > 0 + {MB_FUNC_READ_COILS, eMBFuncReadCoils}, +#endif +#if MB_FUNC_WRITE_COIL_ENABLED > 0 + {MB_FUNC_WRITE_SINGLE_COIL, eMBFuncWriteCoil}, +#endif +#if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 + {MB_FUNC_WRITE_MULTIPLE_COILS, eMBFuncWriteMultipleCoils}, +#endif +#if MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0 + {MB_FUNC_READ_DISCRETE_INPUTS, eMBFuncReadDiscreteInputs}, +#endif +}; + +/* ----------------------- Start implementation -----------------------------*/ +eMBErrorCode +eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + /* check preconditions */ + if( ( ucSlaveAddress == MB_ADDRESS_BROADCAST ) || + ( ucSlaveAddress < MB_ADDRESS_MIN ) || ( ucSlaveAddress > MB_ADDRESS_MAX ) ) + { + eStatus = MB_EINVAL; + } + else + { + ucMBAddress = ucSlaveAddress; + + switch ( eMode ) + { +#if MB_RTU_ENABLED > 0 + case MB_RTU: + pvMBFrameStartCur = eMBRTUStart; + pvMBFrameStopCur = eMBRTUStop; + peMBFrameSendCur = eMBRTUSend; + peMBFrameReceiveCur = eMBRTUReceive; + pvMBFrameCloseCur = MB_PORT_HAS_CLOSE ? vMBPortClose : NULL; + pxMBFrameCBByteReceived = xMBRTUReceiveFSM; + pxMBFrameCBTransmitterEmpty = xMBRTUTransmitFSM; + pxMBPortCBTimerExpired = xMBRTUTimerT35Expired; + + eStatus = eMBRTUInit( ucMBAddress, ucPort, ulBaudRate, eParity ); + break; +#endif +#if MB_ASCII_ENABLED > 0 + case MB_ASCII: + pvMBFrameStartCur = eMBASCIIStart; + pvMBFrameStopCur = eMBASCIIStop; + peMBFrameSendCur = eMBASCIISend; + peMBFrameReceiveCur = eMBASCIIReceive; + pvMBFrameCloseCur = MB_PORT_HAS_CLOSE ? vMBPortClose : NULL; + pxMBFrameCBByteReceived = xMBASCIIReceiveFSM; + pxMBFrameCBTransmitterEmpty = xMBASCIITransmitFSM; + pxMBPortCBTimerExpired = xMBASCIITimerT1SExpired; + + eStatus = eMBASCIIInit( ucMBAddress, ucPort, ulBaudRate, eParity ); + break; +#endif + default: + eStatus = MB_EINVAL; + } + + if( eStatus == MB_ENOERR ) + { + if( !xMBPortEventInit( ) ) + { + /* port dependent event module initalization failed. */ + eStatus = MB_EPORTERR; + } + else + { + eMBCurrentMode = eMode; + eMBState = STATE_DISABLED; + } + } + } + return eStatus; +} + +#if MB_TCP_ENABLED > 0 +eMBErrorCode +eMBTCPInit( USHORT ucTCPPort ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + if( ( eStatus = eMBTCPDoInit( ucTCPPort ) ) != MB_ENOERR ) + { + eMBState = STATE_DISABLED; + } + else if( !xMBPortEventInit( ) ) + { + + /* Port dependent event module initalization failed. */ + eStatus = MB_EPORTERR; + } + else + { + pvMBFrameStartCur = eMBTCPStart; + pvMBFrameStopCur = eMBTCPStop; + peMBFrameReceiveCur = eMBTCPReceive; + peMBFrameSendCur = eMBTCPSend; + pvMBFrameCloseCur = MB_PORT_HAS_CLOSE ? vMBTCPPortClose : NULL; + ucMBAddress = MB_TCP_PSEUDO_ADDRESS; + eMBCurrentMode = MB_TCP; + eMBState = STATE_DISABLED; + } + return eStatus; +} +#endif + +eMBErrorCode +eMBRegisterCB( UCHAR ucFunctionCode, pxMBFunctionHandler pxHandler ) +{ + int i; + eMBErrorCode eStatus; + + if( ( 0 < ucFunctionCode ) && ( ucFunctionCode <= 127 ) ) + { + ENTER_CRITICAL_SECTION( ); + if( pxHandler != NULL ) + { + for( i = 0; i < MB_FUNC_HANDLERS_MAX; i++ ) + { + if( ( xFuncHandlers[i].pxHandler == NULL ) || + ( xFuncHandlers[i].pxHandler == pxHandler ) ) + { + xFuncHandlers[i].ucFunctionCode = ucFunctionCode; + xFuncHandlers[i].pxHandler = pxHandler; + break; + } + } + eStatus = ( i != MB_FUNC_HANDLERS_MAX ) ? MB_ENOERR : MB_ENORES; + } + else + { + for( i = 0; i < MB_FUNC_HANDLERS_MAX; i++ ) + { + if( xFuncHandlers[i].ucFunctionCode == ucFunctionCode ) + { + xFuncHandlers[i].ucFunctionCode = 0; + xFuncHandlers[i].pxHandler = NULL; + break; + } + } + /* Remove can't fail. */ + eStatus = MB_ENOERR; + } + EXIT_CRITICAL_SECTION( ); + } + else + { + eStatus = MB_EINVAL; + } + return eStatus; +} + + +eMBErrorCode +eMBClose( void ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + if( eMBState == STATE_DISABLED ) + { + if( pvMBFrameCloseCur != NULL ) + { + pvMBFrameCloseCur( ); + } + } + else + { + eStatus = MB_EILLSTATE; + } + return eStatus; +} + +eMBErrorCode +eMBEnable( void ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + if( eMBState == STATE_DISABLED ) + { + /* Activate the protocol stack. */ + pvMBFrameStartCur( ); + eMBState = STATE_ENABLED; + } + else + { + eStatus = MB_EILLSTATE; + } + return eStatus; +} + +eMBErrorCode +eMBDisable( void ) +{ + eMBErrorCode eStatus; + + if( eMBState == STATE_ENABLED ) + { + pvMBFrameStopCur( ); + eMBState = STATE_DISABLED; + eStatus = MB_ENOERR; + } + else if( eMBState == STATE_DISABLED ) + { + eStatus = MB_ENOERR; + } + else + { + eStatus = MB_EILLSTATE; + } + return eStatus; +} + +eMBErrorCode +eMBPoll( void ) +{ + static UCHAR *ucMBFrame; + static UCHAR ucRcvAddress; + static UCHAR ucFunctionCode; + static USHORT usLength; + static eMBException eException; + + int i; + eMBErrorCode eStatus = MB_ENOERR; + eMBEventType eEvent; + + /* Check if the protocol stack is ready. */ + if( eMBState != STATE_ENABLED ) + { + return MB_EILLSTATE; + } + + /* Check if there is a event available. If not return control to caller. + * Otherwise we will handle the event. */ + if( xMBPortEventGet( &eEvent ) == TRUE ) + { + switch ( eEvent ) + { + case EV_READY: + break; + + case EV_FRAME_RECEIVED: + eStatus = peMBFrameReceiveCur( &ucRcvAddress, &ucMBFrame, &usLength ); + if( eStatus == MB_ENOERR ) + { + /* Check if the frame is for us. If not ignore the frame. */ + if( ( ucRcvAddress == ucMBAddress ) || ( ucRcvAddress == MB_ADDRESS_BROADCAST ) ) + { + ( void )xMBPortEventPost( EV_EXECUTE ); + } + } + break; + + case EV_EXECUTE: + ucFunctionCode = ucMBFrame[MB_PDU_FUNC_OFF]; + eException = MB_EX_ILLEGAL_FUNCTION; + for( i = 0; i < MB_FUNC_HANDLERS_MAX; i++ ) + { + /* No more function handlers registered. Abort. */ + if( xFuncHandlers[i].ucFunctionCode == 0 ) + { + break; + } + else if( xFuncHandlers[i].ucFunctionCode == ucFunctionCode ) + { + eException = xFuncHandlers[i].pxHandler( ucMBFrame, &usLength ); + break; + } + } + + /* If the request was not sent to the broadcast address we + * return a reply. */ + if( ucRcvAddress != MB_ADDRESS_BROADCAST ) + { + if( eException != MB_EX_NONE ) + { + /* An exception occured. Build an error frame. */ + usLength = 0; + ucMBFrame[usLength++] = ( UCHAR )( ucFunctionCode | MB_FUNC_ERROR ); + ucMBFrame[usLength++] = eException; + } + if( ( eMBCurrentMode == MB_ASCII ) && MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ) + { + vMBPortTimersDelay( MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ); + } + eStatus = peMBFrameSendCur( ucMBAddress, ucMBFrame, usLength ); + } + break; + + case EV_FRAME_SENT: + break; + } + } + return MB_ENOERR; +} diff --git a/modbus/modbus/rtu/mbcrc.c b/modbus/modbus/rtu/mbcrc.c new file mode 100644 index 0000000..29b9ea7 --- /dev/null +++ b/modbus/modbus/rtu/mbcrc.c @@ -0,0 +1,98 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbcrc.c,v 1.7 2007/02/18 23:50:27 wolti Exp $ + */ + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +static const UCHAR aucCRCHi[] = { + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, + 0x00, 0xC1, 0x81, 0x40 +}; + +static const UCHAR aucCRCLo[] = { + 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, + 0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, + 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, + 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, + 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3, + 0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, + 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D, + 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A, 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, + 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF, + 0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26, + 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1, + 0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, + 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, + 0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA, + 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5, + 0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, + 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, + 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C, 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, + 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89, + 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C, + 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, + 0x41, 0x81, 0x80, 0x40 +}; + +USHORT +usMBCRC16( UCHAR * pucFrame, USHORT usLen ) +{ + UCHAR ucCRCHi = 0xFF; + UCHAR ucCRCLo = 0xFF; + int iIndex; + + while( usLen-- ) + { + iIndex = ucCRCLo ^ *( pucFrame++ ); + ucCRCLo = ( UCHAR )( ucCRCHi ^ aucCRCHi[iIndex] ); + ucCRCHi = aucCRCLo[iIndex]; + } + return ( USHORT )( ucCRCHi << 8 | ucCRCLo ); +} diff --git a/modbus/modbus/rtu/mbcrc.h b/modbus/modbus/rtu/mbcrc.h new file mode 100644 index 0000000..db22776 --- /dev/null +++ b/modbus/modbus/rtu/mbcrc.h @@ -0,0 +1,36 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbcrc.h,v 1.5 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_CRC_H +#define _MB_CRC_H + +USHORT usMBCRC16( UCHAR * pucFrame, USHORT usLen ); + +#endif diff --git a/modbus/modbus/rtu/mbrtu.c b/modbus/modbus/rtu/mbrtu.c new file mode 100644 index 0000000..fc9b854 --- /dev/null +++ b/modbus/modbus/rtu/mbrtu.c @@ -0,0 +1,355 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbrtu.c,v 1.18 2007/09/12 10:15:56 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbrtu.h" +#include "mbframe.h" + +#include "mbcrc.h" +#include "mbport.h" + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_SER_PDU_SIZE_MIN 4 /*!< Minimum size of a Modbus RTU frame. */ +#define MB_SER_PDU_SIZE_MAX 256 /*!< Maximum size of a Modbus RTU frame. */ +#define MB_SER_PDU_SIZE_CRC 2 /*!< Size of CRC field in PDU. */ +#define MB_SER_PDU_ADDR_OFF 0 /*!< Offset of slave address in Ser-PDU. */ +#define MB_SER_PDU_PDU_OFF 1 /*!< Offset of Modbus-PDU in Ser-PDU. */ + +/* ----------------------- Type definitions ---------------------------------*/ +typedef enum +{ + STATE_RX_INIT, /*!< Receiver is in initial state. */ + STATE_RX_IDLE, /*!< Receiver is in idle state. */ + STATE_RX_RCV, /*!< Frame is beeing received. */ + STATE_RX_ERROR /*!< If the frame is invalid. */ +} eMBRcvState; + +typedef enum +{ + STATE_TX_IDLE, /*!< Transmitter is in idle state. */ + STATE_TX_XMIT /*!< Transmitter is in transfer state. */ +} eMBSndState; + +/* ----------------------- Static variables ---------------------------------*/ +static volatile eMBSndState eSndState; +static volatile eMBRcvState eRcvState; + +volatile UCHAR ucRTUBuf[MB_SER_PDU_SIZE_MAX]; + +static volatile UCHAR *pucSndBufferCur; +static volatile USHORT usSndBufferCount; + +static volatile USHORT usRcvBufferPos; + +/* ----------------------- Start implementation -----------------------------*/ +eMBErrorCode +eMBRTUInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ) +{ + eMBErrorCode eStatus = MB_ENOERR; + ULONG usTimerT35_50us; + + ( void )ucSlaveAddress; + ENTER_CRITICAL_SECTION( ); + + /* Modbus RTU uses 8 Databits. */ + if( xMBPortSerialInit( ucPort, ulBaudRate, 8, eParity ) != TRUE ) + { + eStatus = MB_EPORTERR; + } + else + { + /* If baudrate > 19200 then we should use the fixed timer values + * t35 = 1750us. Otherwise t35 must be 3.5 times the character time. + */ + if( ulBaudRate > 19200 ) + { + usTimerT35_50us = 35; /* 1800us. */ + } + else + { + /* The timer reload value for a character is given by: + * + * ChTimeValue = Ticks_per_1s / ( Baudrate / 11 ) + * = 11 * Ticks_per_1s / Baudrate + * = 220000 / Baudrate + * The reload for t3.5 is 1.5 times this value and similary + * for t3.5. + */ + usTimerT35_50us = ( 7UL * 220000UL ) / ( 2UL * ulBaudRate ); + } + if( xMBPortTimersInit( ( USHORT ) usTimerT35_50us ) != TRUE ) + { + eStatus = MB_EPORTERR; + } + } + EXIT_CRITICAL_SECTION( ); + + return eStatus; +} + +void +eMBRTUStart( void ) +{ + ENTER_CRITICAL_SECTION( ); + /* Initially the receiver is in the state STATE_RX_INIT. we start + * the timer and if no character is received within t3.5 we change + * to STATE_RX_IDLE. This makes sure that we delay startup of the + * modbus protocol stack until the bus is free. + */ + eRcvState = STATE_RX_INIT; + vMBPortSerialEnable( TRUE, FALSE ); + vMBPortTimersEnable( ); + + EXIT_CRITICAL_SECTION( ); +} + +void +eMBRTUStop( void ) +{ + ENTER_CRITICAL_SECTION( ); + vMBPortSerialEnable( FALSE, FALSE ); + vMBPortTimersDisable( ); + EXIT_CRITICAL_SECTION( ); +} + +eMBErrorCode +eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ) +{ + BOOL xFrameReceived = FALSE; + eMBErrorCode eStatus = MB_ENOERR; + + ENTER_CRITICAL_SECTION( ); + assert( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ); + + /* Length and CRC check */ + if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN ) + && ( usMBCRC16( ( UCHAR * ) ucRTUBuf, usRcvBufferPos ) == 0 ) ) + { + /* Save the address field. All frames are passed to the upper layed + * and the decision if a frame is used is done there. + */ + *pucRcvAddress = ucRTUBuf[MB_SER_PDU_ADDR_OFF]; + + /* Total length of Modbus-PDU is Modbus-Serial-Line-PDU minus + * size of address field and CRC checksum. + */ + *pusLength = ( USHORT )( usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_CRC ); + + /* Return the start of the Modbus PDU to the caller. */ + *pucFrame = ( UCHAR * ) & ucRTUBuf[MB_SER_PDU_PDU_OFF]; + xFrameReceived = TRUE; + } + else + { + eStatus = MB_EIO; + } + + EXIT_CRITICAL_SECTION( ); + return eStatus; +} + +eMBErrorCode +eMBRTUSend( UCHAR ucSlaveAddress, const UCHAR * pucFrame, USHORT usLength ) +{ + eMBErrorCode eStatus = MB_ENOERR; + USHORT usCRC16; + + ENTER_CRITICAL_SECTION( ); + + /* Check if the receiver is still in idle state. If not we where to + * slow with processing the received frame and the master sent another + * frame on the network. We have to abort sending the frame. + */ + if( eRcvState == STATE_RX_IDLE ) + { + /* First byte before the Modbus-PDU is the slave address. */ + pucSndBufferCur = ( UCHAR * ) pucFrame - 1; + usSndBufferCount = 1; + + /* Now copy the Modbus-PDU into the Modbus-Serial-Line-PDU. */ + pucSndBufferCur[MB_SER_PDU_ADDR_OFF] = ucSlaveAddress; + usSndBufferCount += usLength; + + /* Calculate CRC16 checksum for Modbus-Serial-Line-PDU. */ + usCRC16 = usMBCRC16( ( UCHAR * ) pucSndBufferCur, usSndBufferCount ); + ucRTUBuf[usSndBufferCount++] = ( UCHAR )( usCRC16 & 0xFF ); + ucRTUBuf[usSndBufferCount++] = ( UCHAR )( usCRC16 >> 8 ); + + /* Activate the transmitter. */ + eSndState = STATE_TX_XMIT; + vMBPortSerialEnable( FALSE, TRUE ); + } + else + { + eStatus = MB_EIO; + } + EXIT_CRITICAL_SECTION( ); + return eStatus; +} + +BOOL +xMBRTUReceiveFSM( void ) +{ + BOOL xTaskNeedSwitch = FALSE; + UCHAR ucByte; + + assert( eSndState == STATE_TX_IDLE ); + + /* Always read the character. */ + ( void )xMBPortSerialGetByte( ( CHAR * ) & ucByte ); + + switch ( eRcvState ) + { + /* If we have received a character in the init state we have to + * wait until the frame is finished. + */ + case STATE_RX_INIT: + vMBPortTimersEnable( ); + break; + + /* In the error state we wait until all characters in the + * damaged frame are transmitted. + */ + case STATE_RX_ERROR: + vMBPortTimersEnable( ); + break; + + /* In the idle state we wait for a new character. If a character + * is received the t1.5 and t3.5 timers are started and the + * receiver is in the state STATE_RX_RECEIVCE. + */ + case STATE_RX_IDLE: + usRcvBufferPos = 0; + ucRTUBuf[usRcvBufferPos++] = ucByte; + eRcvState = STATE_RX_RCV; + + /* Enable t3.5 timers. */ + vMBPortTimersEnable( ); + break; + + /* We are currently receiving a frame. Reset the timer after + * every character received. If more than the maximum possible + * number of bytes in a modbus frame is received the frame is + * ignored. + */ + case STATE_RX_RCV: + if( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ) + { + ucRTUBuf[usRcvBufferPos++] = ucByte; + } + else + { + eRcvState = STATE_RX_ERROR; + } + vMBPortTimersEnable( ); + break; + } + return xTaskNeedSwitch; +} + +BOOL +xMBRTUTransmitFSM( void ) +{ + BOOL xNeedPoll = FALSE; + + assert( eRcvState == STATE_RX_IDLE ); + + switch ( eSndState ) + { + /* We should not get a transmitter event if the transmitter is in + * idle state. */ + case STATE_TX_IDLE: + /* enable receiver/disable transmitter. */ + vMBPortSerialEnable( TRUE, FALSE ); + break; + + case STATE_TX_XMIT: + /* check if we are finished. */ + if( usSndBufferCount != 0 ) + { + xMBPortSerialPutByte( ( CHAR )*pucSndBufferCur ); + pucSndBufferCur++; /* next byte in sendbuffer. */ + usSndBufferCount--; + } + else + { + xNeedPoll = xMBPortEventPost( EV_FRAME_SENT ); + /* Disable transmitter. This prevents another transmit buffer + * empty interrupt. */ + vMBPortSerialEnable( TRUE, FALSE ); + eSndState = STATE_TX_IDLE; + } + break; + } + + return xNeedPoll; +} + +BOOL +xMBRTUTimerT35Expired( void ) +{ + BOOL xNeedPoll = FALSE; + + switch ( eRcvState ) + { + /* Timer t35 expired. Startup phase is finished. */ + case STATE_RX_INIT: + xNeedPoll = xMBPortEventPost( EV_READY ); + break; + + /* A frame was received and t35 expired. Notify the listener that + * a new frame was received. */ + case STATE_RX_RCV: + xNeedPoll = xMBPortEventPost( EV_FRAME_RECEIVED ); + break; + + /* An error occured while receiving the frame. */ + case STATE_RX_ERROR: + break; + + /* Function called in an illegal state. */ + default: + assert( ( eRcvState == STATE_RX_INIT ) || + ( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_ERROR ) ); + } + + vMBPortTimersDisable( ); + eRcvState = STATE_RX_IDLE; + + return xNeedPoll; +} diff --git a/modbus/modbus/rtu/mbrtu.h b/modbus/modbus/rtu/mbrtu.h new file mode 100644 index 0000000..8d8bd1f --- /dev/null +++ b/modbus/modbus/rtu/mbrtu.h @@ -0,0 +1,51 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbrtu.h,v 1.9 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_RTU_H +#define _MB_RTU_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + eMBErrorCode eMBRTUInit( UCHAR slaveAddress, UCHAR ucPort, ULONG ulBaudRate, + eMBParity eParity ); +void eMBRTUStart( void ); +void eMBRTUStop( void ); +eMBErrorCode eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ); +eMBErrorCode eMBRTUSend( UCHAR slaveAddress, const UCHAR * pucFrame, USHORT usLength ); +BOOL xMBRTUReceiveFSM( void ); +BOOL xMBRTUTransmitFSM( void ); +BOOL xMBRTUTimerT15Expired( void ); +BOOL xMBRTUTimerT35Expired( void ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbus/tcp/mbtcp.c b/modbus/modbus/tcp/mbtcp.c new file mode 100644 index 0000000..fb06144 --- /dev/null +++ b/modbus/modbus/tcp/mbtcp.c @@ -0,0 +1,158 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbtcp.c,v 1.3 2006/12/07 22:10:34 wolti Exp $ + */ + +/* ----------------------- System includes ----------------------------------*/ +#include "stdlib.h" +#include "string.h" + +/* ----------------------- Platform includes --------------------------------*/ +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbconfig.h" +#include "mbtcp.h" +#include "mbframe.h" +#include "mbport.h" + +#if MB_TCP_ENABLED > 0 + +/* ----------------------- Defines ------------------------------------------*/ + +/* ----------------------- MBAP Header --------------------------------------*/ +/* + * + * <------------------------ MODBUS TCP/IP ADU(1) -------------------------> + * <----------- MODBUS PDU (1') ----------------> + * +-----------+---------------+------------------------------------------+ + * | TID | PID | Length | UID |Code | Data | + * +-----------+---------------+------------------------------------------+ + * | | | | | + * (2) (3) (4) (5) (6) + * + * (2) ... MB_TCP_TID = 0 (Transaction Identifier - 2 Byte) + * (3) ... MB_TCP_PID = 2 (Protocol Identifier - 2 Byte) + * (4) ... MB_TCP_LEN = 4 (Number of bytes - 2 Byte) + * (5) ... MB_TCP_UID = 6 (Unit Identifier - 1 Byte) + * (6) ... MB_TCP_FUNC = 7 (Modbus Function Code) + * + * (1) ... Modbus TCP/IP Application Data Unit + * (1') ... Modbus Protocol Data Unit + */ + +#define MB_TCP_TID 0 +#define MB_TCP_PID 2 +#define MB_TCP_LEN 4 +#define MB_TCP_UID 6 +#define MB_TCP_FUNC 7 + +#define MB_TCP_PROTOCOL_ID 0 /* 0 = Modbus Protocol */ + + +/* ----------------------- Start implementation -----------------------------*/ +eMBErrorCode +eMBTCPDoInit( USHORT ucTCPPort ) +{ + eMBErrorCode eStatus = MB_ENOERR; + + if( xMBTCPPortInit( ucTCPPort ) == FALSE ) + { + eStatus = MB_EPORTERR; + } + return eStatus; +} + +void +eMBTCPStart( void ) +{ +} + +void +eMBTCPStop( void ) +{ + /* Make sure that no more clients are connected. */ + vMBTCPPortDisable( ); +} + +eMBErrorCode +eMBTCPReceive( UCHAR * pucRcvAddress, UCHAR ** ppucFrame, USHORT * pusLength ) +{ + eMBErrorCode eStatus = MB_EIO; + UCHAR *pucMBTCPFrame; + USHORT usLength; + USHORT usPID; + + if( xMBTCPPortGetRequest( &pucMBTCPFrame, &usLength ) != FALSE ) + { + usPID = pucMBTCPFrame[MB_TCP_PID] << 8U; + usPID |= pucMBTCPFrame[MB_TCP_PID + 1]; + + if( usPID == MB_TCP_PROTOCOL_ID ) + { + *ppucFrame = &pucMBTCPFrame[MB_TCP_FUNC]; + *pusLength = usLength - MB_TCP_FUNC; + eStatus = MB_ENOERR; + + /* Modbus TCP does not use any addresses. Fake the source address such + * that the processing part deals with this frame. + */ + *pucRcvAddress = MB_TCP_PSEUDO_ADDRESS; + } + } + else + { + eStatus = MB_EIO; + } + return eStatus; +} + +eMBErrorCode +eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame, USHORT usLength ) +{ + eMBErrorCode eStatus = MB_ENOERR; + UCHAR *pucMBTCPFrame = ( UCHAR * ) pucFrame - MB_TCP_FUNC; + USHORT usTCPLength = usLength + MB_TCP_FUNC; + + /* The MBAP header is already initialized because the caller calls this + * function with the buffer returned by the previous call. Therefore we + * only have to update the length in the header. Note that the length + * header includes the size of the Modbus PDU and the UID Byte. Therefore + * the length is usLength plus one. + */ + pucMBTCPFrame[MB_TCP_LEN] = ( usLength + 1 ) >> 8U; + pucMBTCPFrame[MB_TCP_LEN + 1] = ( usLength + 1 ) & 0xFF; + if( xMBTCPPortSendResponse( pucMBTCPFrame, usTCPLength ) == FALSE ) + { + eStatus = MB_EIO; + } + return eStatus; +} + +#endif diff --git a/modbus/modbus/tcp/mbtcp.h b/modbus/modbus/tcp/mbtcp.h new file mode 100644 index 0000000..905d113 --- /dev/null +++ b/modbus/modbus/tcp/mbtcp.h @@ -0,0 +1,53 @@ +/* + * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. + * Copyright (c) 2006 Christian Walter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * File: $Id: mbtcp.h,v 1.2 2006/12/07 22:10:34 wolti Exp $ + */ + +#ifndef _MB_TCP_H +#define _MB_TCP_H + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif + +/* ----------------------- Defines ------------------------------------------*/ +#define MB_TCP_PSEUDO_ADDRESS 255 + +/* ----------------------- Function prototypes ------------------------------*/ + eMBErrorCode eMBTCPDoInit( USHORT ucTCPPort ); +void eMBTCPStart( void ); +void eMBTCPStop( void ); +eMBErrorCode eMBTCPReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, + USHORT * pusLength ); +eMBErrorCode eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame, + USHORT usLength ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/modbusserial.cpp b/modbus/modbusserial.cpp new file mode 100644 index 0000000..4475be3 --- /dev/null +++ b/modbus/modbusserial.cpp @@ -0,0 +1,469 @@ +#include "modbusserial.h" +#include "InkJetPrinter.h" +#include +#include +#include "LogInfo.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" +#include "demo.h" + +/* ----------------------- Defines ------------------------------------------*/ + +//#define REG_INPUT_START 1 +//#define REG_INPUT_NREGS 400 +//#define REG_HOLDING_START 40001 +//#define REG_HOLDING_NREGS 400 +//#define REG_INPUT_START 1000 +//#define REG_INPUT_NREGS 4 +//#define REG_HOLDING_START 2000 +//#define REG_HOLDING_NREGS 130 + +/* ----------------------- Static variables ---------------------------------*/ +//static USHORT usRegInputStart = REG_INPUT_START; +//USHORT* usRegInputBuf; +//static USHORT usRegHoldingStart = REG_HOLDING_START; +//USHORT* usRegHoldingBuf; +void *uart_receive_thread(void *arg); + +ModbusSerial::ModbusSerial(ModbusPrintParas *mPara, const ModbusPrintStatus* mStatus) +{ +#ifdef MODBUS +// const UCHAR ucSlaveID[] = { 0xAA, 0xBB, 0xCC }; +// qDebug()<< "modbusserial class\r\n"; + modbus_status = 0; + modbus_up_QRCODE = 0; + port_num = 0; + input_registers = (uint16_t*) mStatus; + holding_registers = (uint16_t*) mPara; + + QProcess process; + process.start("find /dev -name ttyUSB*"); + process.waitForFinished(); + QByteArray output = process.readAllStandardOutput(); + QString str_output = output; + + QString str_tmp; + for(int j = 0; j < str_output.length(); j++) + { + if(str_output[j] > '0' && str_output[j] < '9') + str_tmp.append(str_output[j]); + } + + port_num = str_tmp.toInt(false, 10); + qDebug()<<"port_num="<start(100); +#endif +} + +ModbusSerial::~ModbusSerial(void) +{ +//#ifdef MODBUS +// disconnect(&serial_thread, SIGNAL(started()), this, SLOT(vPollingThread())); +// if (serial_thread.isRunning()) { +// serial_thread.quit(); +// serial_thread.wait(); +// } + ( void )eMBDisable( ); + vSetPollingThreadState( STOPPED ); + ( void )eMBClose(); +//#endif + if(modbus_timer) + { + delete modbus_timer; + } +} + +extern InkJetPrinter *pInkJectPrinter; + +//void ModbusSerial::vPollingThread() +//{ +// Serial_SetPollingThreadState( RUNNING ); +// +// if (modbus_status != 1) { +//// char fileName[100]; +//// memset(fileName, 0, 100); +//// snprintf(fileName, 100, "/home/plg/doc/104.html"); +//// qDebug()<<"fileName:"< '0' && str_output[j] < '9') + str_tmp.append(str_output[j]); + } + port_num = str_tmp.toInt(false, 10); + + if(0 == active_modbus(holding_registers, input_registers, port_num)) + { +// qDebug() << "updateQRcode"; +// modbus_up_QRCODE = true; +// emit updateQRcode(); + qDebug()<< "active_modbus success!\r\n"; + modbus_status = 1; + }else + { + modbus_status = 0; +// qDebug()<< "active_modbus ENOERR!\r\n"; + } + } +// qDebug()<<"ModbusStatus: "<< modbus_status; +// qDebug()<<"PollingThreadState:"<< eGetPollingThreadState( ); + + if(modbus_status == 1) + { + if(holding_registers[0] == PRINT_START_COMMAND) { + holding_registers[0] = NULL_COMMAND; + LogInfo::setRunStatusText(tr("接收到开始打印命令")); + emit startPrint(); + } + else if(holding_registers[0] == PRINT_PAUSE_COMMAND) { + holding_registers[0] = NULL_COMMAND; + LogInfo::setRunStatusText(tr("接收到暂停打印命令")); + emit pausePrint(); + } + else if(holding_registers[0] == PRINT_STOP_COMMAND) { + holding_registers[0] = NULL_COMMAND; + LogInfo::setRunStatusText(tr("接收到停止打印命令")); + emit stopPrint(); + }else if(holding_registers[0] == UPDATE_QRCODE) { + //else if(holding_registers[0] == 34) { + holding_registers[0] = NULL_COMMAND; + input_registers[0] = 0;//sysPara->modbusStatus.printFinishFlag = 0;//置打印标志 + LogInfo::setRunStatusText(tr("接收到DM码数据命令")); + qDebug() << "updateQRcode"; + modbus_up_QRCODE = true; + emit updateQRcode(); + } + } + +} +#endif + +#ifdef __com_485_ +class DevOp; +UCHAR revdata[100]; + +void ModbusSerial::processCommands() +{ + if(revdata[0] == 10) + { + if(revdata[5] == PRINT_START_COMMAND) { + revdata[5] = NULL_COMMAND; + emit startPrint(); + } + else if(revdata[5] == PRINT_PAUSE_COMMAND) { + revdata[5] = NULL_COMMAND; + emit pausePrint(); + } + else if(revdata[5] == PRINT_STOP_COMMAND) { + revdata[5] = NULL_COMMAND; + emit stopPrint(); + }else if(revdata[5] == UPDATE_QRCODE) { + //else if(holding_registers[0] == 34) { + revdata[5] = NULL_COMMAND; + qDebug() << "updateQRcode"; + modbus_up_QRCODE = true; + emit updateQRcode(); + } + } +} + + +void *uart_receive_thread(void *arg) +{ + QByteArray temp; + QByteArray recResponse; + while(1) + { + if(DevOp::comForRFID->isOpen()) + { + //int n = DevOp::comForRFID->write(temp); + //qDebug()<<"power com send "<bytesAvailable(); + if(n>0) + { + //recResponse.append(DevOp::comForRFID->read(n)); + recResponse.clear(); + recResponse = DevOp::comForRFID->read(n); + QString str; + str.sprintf("%d - %d - %d- %d", recResponse.at(0),recResponse.at(1),recResponse.at(2),recResponse.at(5)); + qDebug()<write(temp); + qDebug()<<"write response data"; + } + } + } + //return n; + +} + +#endif + +qint32 ModbusSerial::processCommands(qint32 index) +{ + qint32 rc = 0; + // 打印机指令 + if(index == ((offsetof(ModbusPrintParas, printCommand) + sizeof(uint16_t))/2 - 1)) { // 打印控制 + if(holding_registers[index] == PRINT_START_COMMAND) { + emit startPrint(); + } + else if(holding_registers[index] == PRINT_PAUSE_COMMAND) { + emit pausePrint(); + } + else if(holding_registers[index] == PRINT_STOP_COMMAND) { + emit stopPrint(); + } + } + else if(index == ((offsetof(ModbusPrintParas, QRcode_buf) + 110)/2 - 1)) { // 传送DM码数据 + qDebug() << "updateQRcode"; + modbus_up_QRCODE = true; + emit updateQRcode(); + } + else if(index == ((offsetof(ModbusPrintParas, selectFileName) + 100)/2 - 1)) { // 打开文件 + char fileName[100]; + int fileIndex = offsetof(ModbusPrintParas, selectFileName)/2; + memcpy(fileName, &holding_registers[fileIndex], 100); + //qDebug()<<"oopen file: "<modbus->processCommands(index); +} + +// +//eMBErrorCode +//eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs ) +//{ +// eMBErrorCode eStatus = MB_ENOERR; +// int iRegIndex; +// +// if( ( usAddress >= REG_INPUT_START ) +// && ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) ) +// { +// usRegInputBuf = (USHORT*) pInkJectPrinter->modbus->input_registers; +// iRegIndex = ( int )( usAddress - usRegInputStart ); +// while( usNRegs > 0 ) +// { +// *pucRegBuffer++ = ( unsigned char )(( usRegInputBuf[iRegIndex] >> 8 )& 0xFF); +// *pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF ); +// iRegIndex++; +// usNRegs--; +// } +// } +// else +// { +// eStatus = MB_ENOREG; +// } +// +// return eStatus; +//} +// +//eMBErrorCode +//eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode ) +//{ +// eMBErrorCode eStatus = MB_ENOERR; +// int iRegIndex; +// +// if( ( usAddress >= REG_HOLDING_START ) && +// ( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) ) +// { +// +// usRegHoldingBuf = (USHORT*) pInkJectPrinter->modbus->holding_registers; +// iRegIndex = ( int )( usAddress - usRegHoldingStart ); +// switch ( eMode ) +// { +// /* Pass current register values to the protocol stack. */ +// case MB_REG_READ: +// while( usNRegs > 0 ) +// { +// *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] >> 8 ); +// *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] & 0xFF ); +// iRegIndex++; +// usNRegs--; +// } +// break; +// +// /* Update current register values with new values from the +// * protocol stack. */ +// case MB_REG_WRITE: +// while( usNRegs > 0 ) +// { +// usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8; +// usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++; +// pInkJectPrinter->modbus->processCommands(iRegIndex); +// iRegIndex++; +// usNRegs--; +// } +// } +// } +// else +// { +// eStatus = MB_ENOREG; +// } +// return eStatus; +//} +// +// +//eMBErrorCode +//eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode ) +//{ +// Q_UNUSED(pucRegBuffer); +// Q_UNUSED(usAddress); +// Q_UNUSED(usNCoils); +// Q_UNUSED(eMode); +// return MB_ENOREG; +//} +// +//eMBErrorCode +//eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete ) +//{ +// Q_UNUSED(pucRegBuffer); +// Q_UNUSED(usAddress); +// Q_UNUSED(usNDiscrete); +// return MB_ENOREG; +//} + + + diff --git a/modbus/modbusserial.h b/modbus/modbusserial.h new file mode 100644 index 0000000..ba10057 --- /dev/null +++ b/modbus/modbusserial.h @@ -0,0 +1,69 @@ +#ifndef MODBUSSERIAL_H +#define MODBUSSERIAL_H +#include +//#include +#include "../SysPara.h" +#include +#include +#include +//#include + +#define PRINT_START_COMMAND 0x01 +#define PRINT_PAUSE_COMMAND 0x02 +#define PRINT_STOP_COMMAND 0x03 +#define UPDATE_QRCODE 0x04 +#define NULL_COMMAND 0x00 +//enum { +// TCP, +// TCP_PI, +// RTU +//}; +//enum ThreadState +//{ +// STOPPED, +// RUNNING, +// SHUTDOWN +//}; + +class ModbusSerial:public QObject +{ + Q_OBJECT +public: + ModbusSerial(ModbusPrintParas *mPara, const ModbusPrintStatus* mStatus); + ~ModbusSerial(); + + uint16_t* input_registers; + uint16_t* holding_registers; + uint8_t modbus_up_QRCODE; +// QThread serial_thread; + +// enum ThreadState Serial_PollThreadState; +// enum ThreadState Serial_GetPollingThreadState(); +// void Serial_SetPollingThreadState( enum ThreadState eNewState ); + qint32 getModbusStatus(); + + +Q_SIGNALS: + void updateQRcode(); + void startPrint(); + void pausePrint(); + void stopPrint(); + void openFile(QString,bool); + void faultResume(); + void writeCalendar(); + void mbLineAndCharSpace(int lineSpace, int charSpace); + +public slots: + //void processCommands(); + qint32 processCommands(qint32 index); +// void vPollingThread(); + +private: + QTimer* modbus_timer; + qint32 modbus_status; + uint16_t port_num; +// QMutex modbusThreadMutex; + +}; +#endif + diff --git a/modbus/modbustcp.cpp b/modbus/modbustcp.cpp new file mode 100644 index 0000000..afea9d4 --- /dev/null +++ b/modbus/modbustcp.cpp @@ -0,0 +1,327 @@ +#include "modbustcp.h" +#include "InkJetPrinter.h" +#include +#include +#include "../../LogInfo.h" +#include +#include +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" + +/* ----------------------- Defines ------------------------------------------*/ + + +#define REG_INPUT_START 1 +#define REG_INPUT_NREGS 400 +#define REG_HOLDING_START 1//40001 //40001 +#define REG_HOLDING_NREGS 400 + +/* ----------------------- Static variables ---------------------------------*/ +static USHORT usRegInputStart = REG_INPUT_START; +//static USHORT usRegInputBuf[REG_INPUT_NREGS]; +static USHORT usRegHoldingStart = REG_HOLDING_START; +//static USHORT usRegHoldingBuf[REG_HOLDING_NREGS]; +USHORT* usRegInputBuf; +USHORT* usRegHoldingBuf; + +extern InkJetPrinter *pInkJectPrinter; + +ModbusTcp::ModbusTcp(ModbusPrintParas *mPara, const ModbusPrintStatus* mStatus) +{ +#ifdef MODBUS + mPara_t = mPara; + mStatus_t = mStatus; + modbus_status = 0; + modbus_up_QRCODE = 0; +// modbus_Port = pInkJectPrinter->getModbusPort(); +// std::cout<<"port1: "<start(1000); + +// if( eMBTCPInit(modbus_Port) != MB_ENOERR ) +// { +// qDebug()<< "can't initialize modbus stack!\r\n"; +// modbus_status = -1; +// } +// else +// { +// eSetPollingThreadState( STOPPED ); +// /* CLI interface. */ +// //bDoExit = FALSE; +// } +// input_registers = (uint16_t*) mStatus_t; +// holding_registers = (uint16_t*) mPara_t; +// moveToThread(&m_thread); +//// m_thread.start(); +// if (modbus_status != -1) { +// connect(&m_thread, SIGNAL(started()), this, SLOT(pvPollingThread())); +// modbus_status = 1; +// } +#endif +} + +ModbusTcp::~ModbusTcp(void) +{ +#ifdef MODBUS + disconnect(&m_thread, SIGNAL(started()), this, SLOT(pvPollingThread())); + if (m_thread.isRunning()) { + m_thread.quit(); + m_thread.wait(); + } + ( void )eMBClose( ); +#endif +} + +void ModbusTcp::initModbus(){ + timer->stop(); + modbus_Port = pInkJectPrinter->getModbusPort(); + LogInfo::setRunStatusText(tr("Modbus Port: %1").arg(modbus_Port)); + if( eMBTCPInit(modbus_Port) != MB_ENOERR ) + { + qDebug()<< "can't initialize modbus stack!\r\n"; + modbus_status = -1; + } + else + { + eSetPollingThreadState( STOPPED ); + /* CLI interface. */ + //bDoExit = FALSE; + } + input_registers = (uint16_t*) mStatus_t; + holding_registers = (uint16_t*) mPara_t; + moveToThread(&m_thread); +// m_thread.start(); + if (modbus_status != -1) { + connect(&m_thread, SIGNAL(started()), this, SLOT(pvPollingThread())); + modbus_status = 1; + } +} + +void ModbusTcp::getModbusPort(unsigned int port){ + modbus_Port = port; +} + +void ModbusTcp::pvPollingThread() +{ +#ifdef MODBUS + eSetPollingThreadState( RUNNING ); + if (modbus_status != 1) { + return; + } + if( eMBEnable( ) == MB_ENOERR ) + { + do + { + if( eMBPoll( ) != MB_ENOERR ) { + qDebug()<<"modbus poll error"; + break; + } + } + while( eGetPollingThreadState( ) != SHUTDOWN ); + } + if( eMBEnable( ) == MB_ENOERR ) + ( void )eMBDisable( ); + + eSetPollingThreadState( STOPPED ); +#endif + return; +} + +enum ThreadState +ModbusTcp::eGetPollingThreadState( ) +{ + enum ThreadState eCurState; + + modbusThreadMutex.lock(); + eCurState = ePollThreadState; + modbusThreadMutex.unlock(); + + return eCurState; +} + +void +ModbusTcp::eSetPollingThreadState( enum ThreadState eNewState ) +{ + modbusThreadMutex.lock(); + ePollThreadState = eNewState; + modbusThreadMutex.unlock(); +} + +qint32 ModbusTcp::getModbusStatus() +{ + return modbus_status; +} + +qint32 ModbusTcp::processCommands(qint32 index) +{ + qint32 rc = 0; + // 打印机指令 + if(index == ((offsetof(ModbusPrintParas, printCommand) + sizeof(uint16_t))/2 - 1)) { // 打印控制 + if(holding_registers[index] == PRINT_START_COMMAND) { + emit startPrint(); + } + else if(holding_registers[index] == PRINT_PAUSE_COMMAND) { + emit pausePrint(); + } + else if(holding_registers[index] == PRINT_STOP_COMMAND) { + emit stopPrint(); + } + } + else if(index == ((offsetof(ModbusPrintParas, QRcode_buf) + 240)/2 - 1)) { // 传送DM码数据 + qDebug() << "updateQRcode"; + modbus_up_QRCODE = true; + + emit updateQRcode(); + } + else if(index == ((offsetof(ModbusPrintParas, selectFileName) + 100)/2 - 1)) { // 打开文件 + char fileName[100]; + int fileIndex = offsetof(ModbusPrintParas, selectFileName)/2; + memcpy(fileName, &holding_registers[fileIndex], 100); + //qDebug()<<"oopen file: "<= REG_INPUT_START ) + && ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) ) + { + usRegInputBuf = (USHORT*) pInkJectPrinter->modbus->input_registers; + iRegIndex = ( int )( usAddress - usRegInputStart ); + while( usNRegs > 0 ) + { + *pucRegBuffer++ = ( unsigned char )(( usRegInputBuf[iRegIndex] >> 8 )& 0xFF); + *pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF ); + iRegIndex++; + usNRegs--; + } + } + else + { + eStatus = MB_ENOREG; + } + + return eStatus; +} + +eMBErrorCode +eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode ) +{ + eMBErrorCode eStatus = MB_ENOERR; + int iRegIndex; + + if( ( usAddress >= REG_HOLDING_START ) && + ( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) ) + { + + usRegHoldingBuf = (USHORT*) pInkJectPrinter->modbus->holding_registers; + iRegIndex = ( int )( usAddress - usRegHoldingStart ); + + switch ( eMode ) + { + /* Pass current register values to the protocol stack. */ + case MB_REG_READ: + while( usNRegs > 0 ) + { + *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] >> 8 ); + *pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] & 0xFF ); + iRegIndex++; + usNRegs--; + } + break; + + /* Update current register values with new values from the + * protocol stack. */ + case MB_REG_WRITE: + while( usNRegs > 0 ) + { + usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8; + usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++; + pInkJectPrinter->modbus->processCommands(iRegIndex); + iRegIndex++; + usNRegs--; + } + + } + } + else + { + eStatus = MB_ENOREG; + } + return eStatus; +} + + +eMBErrorCode +eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode ) +{ + Q_UNUSED(pucRegBuffer); + Q_UNUSED(usAddress); + Q_UNUSED(usNCoils); + Q_UNUSED(eMode); + return MB_ENOREG; +} + +eMBErrorCode +eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete ) +{ + Q_UNUSED(pucRegBuffer); + Q_UNUSED(usAddress); + Q_UNUSED(usNDiscrete); + return MB_ENOREG; +} diff --git a/modbus/modbustcp.h b/modbus/modbustcp.h new file mode 100644 index 0000000..c4734c9 --- /dev/null +++ b/modbus/modbustcp.h @@ -0,0 +1,73 @@ +#ifndef MODBUSTCP_H +#define MODBUSTCP_H +#include +//#include +#include "../SysPara.h" +#include +#include +#include +#include "myinclude.h" +#include + +#define PRINT_START_COMMAND 0x01 +#define PRINT_PAUSE_COMMAND 0x02 +#define PRINT_STOP_COMMAND 0x03 +enum { + TCP, + TCP_PI, + RTU +}; +enum ThreadState +{ + STOPPED, + RUNNING, + SHUTDOWN +}; +class ModbusTcp:public QObject +{ + Q_OBJECT +public: + ModbusTcp(ModbusPrintParas *mPara, const ModbusPrintStatus* mStatus); + ~ModbusTcp(); + ModbusPrintParas *mPara_t; + const ModbusPrintStatus *mStatus_t; + + uint16_t* input_registers; + uint16_t* holding_registers; + uint8_t modbus_up_QRCODE; + unsigned int modbus_Port; + QThread m_thread; + QTimer *timer; + enum ThreadState ePollThreadState; + enum ThreadState eGetPollingThreadState(); + void eSetPollingThreadState( enum ThreadState eNewState ); + qint32 getModbusStatus(); + qint32 processCommands(qint32 index); + void getModbusPort(unsigned int); + +Q_SIGNALS: + void startPrint(); + void pausePrint(); + void stopPrint(); + void openFile(QString,bool); + void receivedPrintContent(int); + void faultResume(); + void writeCalendar(); + void mbLineAndCharSpace(int lineSpace, int charSpace); + void updateQRcode(); + void writeCalendar1(); + void writeCalendar1EndValue(); + void writeCalendar2EndValue(); + void writeCalendar2RepeatValue(); + void writeCalendar2InitValue(); + void CNTResetNow(); + +public slots: + void pvPollingThread(); + void initModbus(); +private: + qint32 modbus_status; + QMutex modbusThreadMutex; +}; + +#endif // MODBUSTCP_H diff --git a/modbus/port/port.h b/modbus/port/port.h new file mode 100644 index 0000000..9eca4c4 --- /dev/null +++ b/modbus/port/port.h @@ -0,0 +1,81 @@ +/* + * FreeModbus Libary: BSD Socket Library Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: port.h,v 1.1 2007/09/12 10:15:56 wolti Exp $ + */ + + /********************************************************** + * Linux TCP support. + * Based on Walter's project. + * Modified by Steven Guo + ***********************************************************/ + +#ifndef _PORT_H +#define _PORT_H + + +#include + +#define INLINE +#define PR_BEGIN_EXTERN_C extern "C" { +#define PR_END_EXTERN_C } + +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif +/* ----------------------- Defines ------------------------------------------*/ +#define ENTER_CRITICAL_SECTION( ) +#define EXIT_CRITICAL_SECTION( ) +#define MB_PORT_HAS_CLOSE 1 +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif +/* ----------------------- Type definitions ---------------------------------*/ +typedef int SOCKET; + +#define SOCKET_ERROR (-1) +#define INVALID_SOCKET (~0) +typedef char BOOL; +typedef unsigned char UCHAR; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short USHORT; +typedef short SHORT; + +typedef unsigned long ULONG; +typedef long LONG; +typedef enum +{ + MB_LOG_DEBUG, + MB_LOG_INFO, + MB_LOG_WARN, + MB_LOG_ERROR +} eMBPortLogLevel; + +/* ----------------------- Function prototypes ------------------------------*/ + +void TcpvMBPortLog( eMBPortLogLevel eLevel, const CHAR * szModule, const CHAR * szFmt, + ... ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif +#endif diff --git a/modbus/port/portevent.c b/modbus/port/portevent.c new file mode 100644 index 0000000..ea1acfc --- /dev/null +++ b/modbus/port/portevent.c @@ -0,0 +1,72 @@ +/* + * FreeModbus Libary: Win32 Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: portevent.c,v 1.1 2007/09/12 10:15:56 wolti Exp $ + */ + + /********************************************************** + * Linux TCP support. + * Based on Walter's project. + * Modified by Steven Guo + ***********************************************************/ + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" + +/* ----------------------- Variables ----------------------------------------*/ +static eMBEventType eQueuedEvent; +static BOOL xEventInQueue; + +/* ----------------------- Function prototypes ------------------------------*/ +BOOL xMBPortTCPPool( void ); + +/* ----------------------- Start implementation -----------------------------*/ +BOOL +xMBPortEventInit( void ) +{ + xEventInQueue = FALSE; + return TRUE; +} + +BOOL +xMBPortEventPost( eMBEventType eEvent ) +{ + xEventInQueue = TRUE; + eQueuedEvent = eEvent; + return TRUE; +} + +BOOL +xMBPortEventGet( eMBEventType * eEvent ) +{ + BOOL xEventHappened = FALSE; + + if( xEventInQueue ) + { + *eEvent = eQueuedEvent; + xEventInQueue = FALSE; + xEventHappened = TRUE; + } + else + { + /* We can't do anything with errors from the pooling module. */ + ( void )xMBPortTCPPool( ); + } + return xEventHappened; +} diff --git a/modbus/port/portother.c b/modbus/port/portother.c new file mode 100644 index 0000000..94898e8 --- /dev/null +++ b/modbus/port/portother.c @@ -0,0 +1,69 @@ +/* + * FreeModbus Libary: Win32 Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: portother.c,v 1.1 2007/09/12 10:15:56 wolti Exp $ + */ + + /********************************************************** + * Linux TCP support. + * Based on Walter's project. + * Modified by Steven Guo + ***********************************************************/ + +#include +#include +#include + +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" +#include "mbconfig.h" + + +BOOL +prvMBTCPPortAddressToString( SOCKET xSocket, CHAR * szAddr, USHORT usBufSize ) +{ + return TRUE; +} + +CHAR * +prvMBTCPPortFrameToString( UCHAR * pucFrame, USHORT usFrameLen ) +{ + return NULL; +} + +CHAR * +WsaError2String( int iError ) +{ + return NULL; +} + +void +vMBPortLog( eMBPortLogLevel eLevel, const CHAR * szModule, const CHAR * szFmt, ... ) +{ + va_list args; + static const CHAR *arszLevel2Str[] = { "DEBUG", "INFO", "WARN", "ERROR" }; + + fprintf( stderr, "%s: %s: ", arszLevel2Str[eLevel], szModule ); + + va_start( args, szFmt ); + fprintf( stderr, szFmt, args ); + va_end( args ); +} diff --git a/modbus/port/portserial.c b/modbus/port/portserial.c new file mode 100644 index 0000000..2c2399d --- /dev/null +++ b/modbus/port/portserial.c @@ -0,0 +1,364 @@ +/* + * FreeModbus Libary: Linux Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: portserial.c,v 1.3 2006/10/12 08:35:34 wolti Exp $ + */ + +/* ----------------------- Standard includes --------------------------------*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" +#include "mbconfig.h" + +/* ----------------------- Defines -----------------------------------------*/ +#if MB_ASCII_ENABLED == 1 +#define BUF_SIZE 513 /* must hold a complete ASCII frame. */ +#else +#define BUF_SIZE 256 /* must hold a complete RTU frame. */ +#endif + +/* ----------------------- Static variables ---------------------------------*/ +static int iSerialFd = -1; +static BOOL bRxEnabled; +static BOOL bTxEnabled; + +static ULONG ulTimeoutMs; +static UCHAR ucBuffer[BUF_SIZE]; +static int uiRxBufferPos; +static int uiTxBufferPos; + +static struct termios xOldTIO; + +/* ----------------------- Function prototypes ------------------------------*/ +static BOOL prvbMBPortSerialRead( UCHAR * pucBuffer, USHORT usNBytes, USHORT * usNBytesRead ); +static BOOL prvbMBPortSerialWrite( UCHAR * pucBuffer, USHORT usNBytes ); + +/* ----------------------- Begin implementation -----------------------------*/ +void +vMBPortSerialEnable( BOOL bEnableRx, BOOL bEnableTx ) +{ + /* it is not allowed that both receiver and transmitter are enabled. */ + assert( !bEnableRx || !bEnableTx ); + + if( bEnableRx ) + { + ( void )tcflush( iSerialFd, TCIFLUSH ); + uiRxBufferPos = 0; + bRxEnabled = TRUE; + } + else + { + bRxEnabled = FALSE; + } + if( bEnableTx ) + { + bTxEnabled = TRUE; + uiTxBufferPos = 0; + } + else + { + bTxEnabled = FALSE; + } +} + +BOOL +xMBPortSerialInit( UCHAR ucPort, ULONG ulBaudRate, UCHAR ucDataBits, eMBParity eParity ) +{ + CHAR szDevice[16]; + BOOL bStatus = TRUE; + + struct termios xNewTIO; + speed_t xNewSpeed; + + //snprintf( szDevice, 16, "/dev/ttyUSB%d", ucPort ); + snprintf( szDevice, 16, "/dev/ttyO1"); + + if( ( iSerialFd = open( szDevice, O_RDWR | O_NOCTTY ) ) < 0 ) + { + vMBPortLog( MB_LOG_ERROR, "SER-INIT", "Can't open serial port %s: %s\n", szDevice, + strerror( errno ) ); + bStatus = FALSE; + return bStatus; + } + else if( tcgetattr( iSerialFd, &xOldTIO ) != 0 ) + { + vMBPortLog( MB_LOG_ERROR, "SER-INIT", "Can't get settings from port %s: %s\n", szDevice, + strerror( errno ) ); + } + else + { + bzero( &xNewTIO, sizeof( struct termios ) ); + + xNewTIO.c_iflag |= IGNBRK | INPCK; + xNewTIO.c_cflag |= CREAD | CLOCAL; + switch ( eParity ) + { + case MB_PAR_NONE: + break; + case MB_PAR_EVEN: + xNewTIO.c_cflag |= PARENB; + break; + case MB_PAR_ODD: + xNewTIO.c_cflag |= PARENB | PARODD; + break; + default: + bStatus = FALSE; + } + switch ( ucDataBits ) + { + case 8: + xNewTIO.c_cflag |= CS8; + break; + case 7: + xNewTIO.c_cflag |= CS7; + break; + default: + bStatus = FALSE; + } + switch ( ulBaudRate ) + { + case 9600: + xNewSpeed = B9600; + break; + case 19200: + xNewSpeed = B19200; + break; + case 38400: + xNewSpeed = B38400; + break; + case 57600: + xNewSpeed = B57600; + break; + case 115200: + xNewSpeed = B115200; + break; + default: + bStatus = FALSE; + } + /*设置等待时间和最小接收字符*/ + xNewTIO.c_cc[VTIME] = 0; + xNewTIO.c_cc[VMIN] = 0; + /*处理未接收字符*/ + tcflush(iSerialFd,TCIFLUSH); //lch add + if( bStatus ) + { + if( cfsetispeed( &xNewTIO, xNewSpeed ) != 0 ) + { + vMBPortLog( MB_LOG_ERROR, "SER-INIT", "Can't set baud rate %ld for port %s: %s\n", + ulBaudRate, strerror( errno ) ); + } + else if( cfsetospeed( &xNewTIO, xNewSpeed ) != 0 ) + { + vMBPortLog( MB_LOG_ERROR, "SER-INIT", "Can't set baud rate %ld for port %s: %s\n", + ulBaudRate, szDevice, strerror( errno ) ); + } + else if( tcsetattr( iSerialFd, TCSANOW, &xNewTIO ) != 0 ) + //else if( tcsetattr( iSerialFd, TCSAFLUSH, &xNewTIO ) != 0 ) //lch fix + { + vMBPortLog( MB_LOG_ERROR, "SER-INIT", "Can't set settings for port %s: %s\n", + szDevice, strerror( errno ) ); + } + else + { + vMBPortSerialEnable( FALSE, FALSE ); + bStatus = TRUE; + } + } + } + return bStatus; +} + +BOOL +xMBPortSerialSetTimeout( ULONG ulNewTimeoutMs ) +{ + if( ulNewTimeoutMs > 0 ) + { + ulTimeoutMs = ulNewTimeoutMs; + } + else + { + ulTimeoutMs = 1; + } + return TRUE; +} + +void +vMBPortClose( void ) +{ + if( iSerialFd != -1 ) + { + ( void )tcsetattr( iSerialFd, TCSANOW, &xOldTIO ); + ( void )close( iSerialFd ); + iSerialFd = -1; + } +} + +BOOL +prvbMBPortSerialRead( UCHAR * pucBuffer, USHORT usNBytes, USHORT * usNBytesRead ) +{ + BOOL bResult = TRUE; + ssize_t res; + fd_set rfds; + struct timeval tv; + +// tv.tv_sec = 1; +// tv.tv_usec = 60000; + tv.tv_sec = 0; + tv.tv_usec = 10000; //lch fix + + FD_ZERO( &rfds ); + FD_SET( iSerialFd, &rfds ); + + /* Wait until character received or timeout. Recover in case of an + * interrupted read system call. */ + do + { + if( select( iSerialFd + 1, &rfds, NULL, NULL, &tv ) == -1 ) + { + if( errno != EINTR ) + { + bResult = FALSE; + } + } + else if( FD_ISSET( iSerialFd, &rfds ) ) + { + if( ( res = read( iSerialFd, pucBuffer, usNBytes ) ) == -1 ) + { + bResult = FALSE; + } + else + { + *usNBytesRead = ( USHORT ) res; + break; + } + } + else + { + *usNBytesRead = 0; + break; + } + } + while( bResult == TRUE ); + return bResult; +} + +BOOL +prvbMBPortSerialWrite( UCHAR * pucBuffer, USHORT usNBytes ) +{ + ssize_t res; + size_t left = ( size_t ) usNBytes; + size_t done = 0; + + while( left > 0 ) + { + if( ( res = write( iSerialFd, pucBuffer + done, left ) ) == -1 ) + { + if( errno != EINTR ) + { + break; + } + /* call write again because of interrupted system call. */ + continue; + } + done += res; + left -= res; + } + return left == 0 ? TRUE : FALSE; +} + +BOOL +xMBPortSerialPoll( ) +{ + BOOL bStatus = TRUE; + USHORT usBytesRead; + int i; + + while( bRxEnabled ) + { + if( prvbMBPortSerialRead( &ucBuffer[0], BUF_SIZE, &usBytesRead ) ) + { + if( usBytesRead == 0 ) + { + /* timeout with no bytes. */ + break; + } + else if( usBytesRead > 0 ) + { + for( i = 0; i < usBytesRead; i++ ) + { + /* Call the modbus stack and let him fill the buffers. */ + ( void )pxMBFrameCBByteReceived( ); + } + uiRxBufferPos = 0; + } + } + else + { + vMBPortLog( MB_LOG_ERROR, "SER-POLL", "read failed on serial device: %s\n", + strerror( errno ) ); + bStatus = FALSE; + } + } + if( bTxEnabled ) + { + while( bTxEnabled ) + { + ( void )pxMBFrameCBTransmitterEmpty( ); + /* Call the modbus stack to let him fill the buffer. */ + } + if( !prvbMBPortSerialWrite( &ucBuffer[0], uiTxBufferPos ) ) + { + vMBPortLog( MB_LOG_ERROR, "SER-POLL", "write failed on serial device: %s\n", + strerror( errno ) ); + bStatus = FALSE; + } + } + + return bStatus; +} + +BOOL +xMBPortSerialPutByte( CHAR ucByte ) +{ + assert( uiTxBufferPos < BUF_SIZE ); + ucBuffer[uiTxBufferPos] = ucByte; + uiTxBufferPos++; + return TRUE; +} + +BOOL +xMBPortSerialGetByte( CHAR * pucByte ) +{ + assert( uiRxBufferPos < BUF_SIZE ); + *pucByte = ucBuffer[uiRxBufferPos]; + uiRxBufferPos++; + return TRUE; +} diff --git a/modbus/port/porttcp.c b/modbus/port/porttcp.c new file mode 100644 index 0000000..c193e07 --- /dev/null +++ b/modbus/port/porttcp.c @@ -0,0 +1,385 @@ +/* + * FreeModbus Libary: Win32 Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: porttcp.c,v 1.1 2007/09/12 10:15:56 wolti Exp $ + */ + +/* + * Design Notes: + * + * The xMBPortTCPInit function allocates a socket and binds the socket to + * all available interfaces ( bind with INADDR_ANY ). In addition it + * creates an array of event objects which is used to check the state of + * the clients. On event object is used to handle new connections or + * closed ones. The other objects are used on a per client basis for + * processing. + */ + + /********************************************************** + * Linux TCP support. + * Based on Walter's project. + * Modified by Steven Guo + ***********************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" + +//#include + +/* ----------------------- MBAP Header --------------------------------------*/ +#define MB_TCP_UID 6 +#define MB_TCP_LEN 4 +#define MB_TCP_FUNC 7 + +/* ----------------------- Defines -----------------------------------------*/ +#define MB_TCP_DEFAULT_PORT 5022//5022 /* TCP listening port. */ +#define MB_TCP_POOL_TIMEOUT 50 /* pool timeout for event waiting. */ +#define MB_TCP_READ_TIMEOUT 1000 /* Maximum timeout to wait for packets. */ +#define MB_TCP_READ_CYCLE 100 /* Time between checking for new data. */ + +#define MB_TCP_DEBUG 1 /* Set to 1 for additional debug output. */ + +#define MB_TCP_BUF_SIZE ( 256 + 7 ) /* Must hold a complete Modbus TCP frame. */ + +#define EV_CONNECTION 0 +#define EV_CLIENT 1 +#define EV_NEVENTS EV_CLIENT + 1 + +/* ----------------------- Static variables ---------------------------------*/ +SOCKET xListenSocket; +SOCKET xClientSocket = INVALID_SOCKET; +static fd_set allset; + +static UCHAR aucTCPBuf[MB_TCP_BUF_SIZE]; +static USHORT usTCPBufPos; +static USHORT usTCPFrameBytesLeft; + +/* ----------------------- External functions -------------------------------*/ +CHAR *WsaError2String( int dwError ); + +/* ----------------------- Static functions ---------------------------------*/ +BOOL prvMBTCPPortAddressToString( SOCKET xSocket, CHAR * szAddr, USHORT usBufSize ); +CHAR *prvMBTCPPortFrameToString( UCHAR * pucFrame, USHORT usFrameLen ); +static BOOL prvbMBPortAcceptClient( void ); +static void prvvMBPortReleaseClient( void ); +//static QTcpServer qListenSocket; + +/* ----------------------- Begin implementation -----------------------------*/ + +BOOL +xMBTCPPortInit( USHORT usTCPPort ) +{ + USHORT usPort; + struct sockaddr_in serveraddr; + int tmp = 1; + + if( usTCPPort == 0 ) + { + usPort = MB_TCP_DEFAULT_PORT; + } + else + { + usPort = ( USHORT ) usTCPPort; + } + memset( &serveraddr, 0, sizeof( serveraddr ) ); + serveraddr.sin_family = AF_INET; + serveraddr.sin_addr.s_addr = htonl( INADDR_ANY ); + serveraddr.sin_port = htons( usPort ); + if( ( xListenSocket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ) == -1 ) + { + fprintf( stderr, "Create socket failed.\r\n" ); + return FALSE; + } + if(setsockopt(xListenSocket, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(int))<0) + { + fprintf( stderr, "setsockopt socket failed.\r\n" ); + return FALSE; + } + if( bind( xListenSocket, ( struct sockaddr * )&serveraddr, sizeof( serveraddr ) ) == -1 ) + { + fprintf( stderr, "Bind socket failed.\r\n" ); + return FALSE; + } + else if( listen( xListenSocket, 1 ) == -1 ) + { + fprintf( stderr, "Listen socket failed.\r\n" ); + return FALSE; + } + FD_ZERO( &allset ); + FD_SET( xListenSocket, &allset ); + return TRUE; +} + +void +vMBTCPPortClose( ) +{ + // Close all client sockets. + if( xClientSocket != SOCKET_ERROR ) + { + prvvMBPortReleaseClient( ); + } + // Close the listener socket. + if( xListenSocket != SOCKET_ERROR ) + { + close( xListenSocket ); + } +} + +void +vMBTCPPortDisable( void ) +{ + /* Close all client sockets. */ + if( xClientSocket != SOCKET_ERROR ) + { + prvvMBPortReleaseClient( ); + } +} + +/*! \ingroup port_win32tcp + * + * \brief Pool the listening socket and currently connected Modbus TCP clients + * for new events. + * \internal + * + * This function checks if new clients want to connect or if already connected + * clients are sending requests. If a new client is connected and there are + * still client slots left (The current implementation supports only one) + * then the connection is accepted and an event object for the new client + * socket is activated (See prvbMBPortAcceptClient() ). + * Events for already existing clients in \c FD_READ and \c FD_CLOSE. In case of + * an \c FD_CLOSE the client connection is released (See prvvMBPortReleaseClient() ). + * In case of an \c FD_READ command the existing data is read from the client + * and if a complete frame has been received the Modbus Stack is notified. + * + * \return FALSE in case of an internal I/O error. For example if the internal + * event objects are in an invalid state. Note that this does not include any + * client errors. In all other cases returns TRUE. + */ +int errorCount = 0; + +BOOL +xMBPortTCPPool( void ) +{ + int n; + fd_set fread; + struct timeval tval; + + tval.tv_sec = 1; + tval.tv_usec = 60000; + int ret; + USHORT usLength; + + if( xClientSocket == INVALID_SOCKET ) + { + /* Accept to client */ + if( ( n = select( xListenSocket + 1, &allset, NULL, NULL, NULL ) ) < 0 ) + { + if( errno == EINTR ) + { + ; + } + else + { + ; + } + } + if( FD_ISSET( xListenSocket, &allset ) ) + { + ( void )prvbMBPortAcceptClient( ); + } + } + + while( TRUE ) + { + FD_ZERO( &fread ); + FD_SET( xClientSocket, &fread ); + if( ( ( ret = select( xClientSocket + 1, &fread, NULL, NULL, &tval ) ) == SOCKET_ERROR ) + || !ret ) + { + sleep(1); + errorCount++; + if(errorCount > 10) + { + errorCount = 0; + close( xClientSocket ); + xClientSocket = INVALID_SOCKET; + return TRUE; + } + continue; + } + if( ret > 0 ) + { + if( FD_ISSET( xClientSocket, &fread ) ) + { + if( ( ( ret = + recv( xClientSocket, &aucTCPBuf[usTCPBufPos], usTCPFrameBytesLeft, + 0 ) ) == SOCKET_ERROR ) || ( !ret ) ) + { + close( xClientSocket ); + xClientSocket = INVALID_SOCKET; + return TRUE; + } + usTCPBufPos += ret; + usTCPFrameBytesLeft -= ret; + if( usTCPBufPos >= MB_TCP_FUNC ) + { + /* Length is a byte count of Modbus PDU (function code + data) and the + * unit identifier. */ + usLength = aucTCPBuf[MB_TCP_LEN] << 8U; + usLength |= aucTCPBuf[MB_TCP_LEN + 1]; + + /* Is the frame already complete. */ + if( usTCPBufPos < ( MB_TCP_UID + usLength ) ) + { + usTCPFrameBytesLeft = usLength + MB_TCP_UID - usTCPBufPos; + } + /* The frame is complete. */ + else if( usTCPBufPos == ( MB_TCP_UID + usLength ) ) + { + ( void )xMBPortEventPost( EV_FRAME_RECEIVED ); + return TRUE; + } + /* This can not happend because we always calculate the number of bytes + * to receive. */ + else + { + assert( usTCPBufPos <= ( MB_TCP_UID + usLength ) ); + } + } + } + } + } + return TRUE; +} + +/*! + * \ingroup port_win32tcp + * \brief Receives parts of a Modbus TCP frame and if complete notifies + * the protocol stack. + * \internal + * + * This function reads a complete Modbus TCP frame from the protocol stack. + * It starts by reading the header with an initial request size for + * usTCPFrameBytesLeft = MB_TCP_FUNC. If the header is complete the + * number of bytes left can be calculated from it (See Length in MBAP header). + * Further read calls are issued until the frame is complete. + * + * \return \c TRUE if part of a Modbus TCP frame could be processed. In case + * of a communication error the function returns \c FALSE. + */ + +BOOL +xMBTCPPortGetRequest( UCHAR ** ppucMBTCPFrame, USHORT * usTCPLength ) +{ + *ppucMBTCPFrame = &aucTCPBuf[0]; + *usTCPLength = usTCPBufPos; + + /* Reset the buffer. */ + usTCPBufPos = 0; + usTCPFrameBytesLeft = MB_TCP_FUNC; + return TRUE; +} + +BOOL +xMBTCPPortSendResponse( const UCHAR * pucMBTCPFrame, USHORT usTCPLength ) +{ + BOOL bFrameSent = FALSE; + BOOL bAbort = FALSE; + int res; + int iBytesSent = 0; + int iTimeOut = MB_TCP_READ_TIMEOUT; + + do + { + res = send( xClientSocket, &pucMBTCPFrame[iBytesSent], usTCPLength - iBytesSent, 0 ); + switch ( res ) + { + case -1: + if( iTimeOut > 0 ) + { + iTimeOut -= MB_TCP_READ_CYCLE; + usleep( MB_TCP_READ_CYCLE ); + } + else + { + bAbort = TRUE; + } + break; + case 0: + prvvMBPortReleaseClient( ); + bAbort = TRUE; + break; + default: + iBytesSent += res; + break; + } + } + while( ( iBytesSent != usTCPLength ) && !bAbort ); + + bFrameSent = iBytesSent == usTCPLength ? TRUE : FALSE; + + return bFrameSent; +} + +void +prvvMBPortReleaseClient( ) +{ + ( void )recv( xClientSocket, &aucTCPBuf[0], MB_TCP_BUF_SIZE, 0 ); + + ( void )close( xClientSocket ); + xClientSocket = INVALID_SOCKET; +} + +BOOL +prvbMBPortAcceptClient( ) +{ + SOCKET xNewSocket; + BOOL bOkay; + + /* Check if we can handle a new connection. */ + + if( xClientSocket != INVALID_SOCKET ) + { + fprintf( stderr, "can't accept new client. all connections in use.\n" ); + bOkay = FALSE; + } + else if( ( xNewSocket = accept( xListenSocket, NULL, NULL ) ) == INVALID_SOCKET ) + { + bOkay = FALSE; + } + else + { + xClientSocket = xNewSocket; + usTCPBufPos = 0; + usTCPFrameBytesLeft = MB_TCP_FUNC; + bOkay = TRUE; + } + return bOkay; +} diff --git a/modbus/port/porttimer.c b/modbus/port/porttimer.c new file mode 100644 index 0000000..c2cf0f2 --- /dev/null +++ b/modbus/port/porttimer.c @@ -0,0 +1,97 @@ +/* + * FreeModbus Libary: Linux Port + * Copyright (C) 2006 Christian Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * File: $Id: porttimer.c,v 1.1 2006/08/01 20:58:50 wolti Exp $ + */ + +/* ----------------------- Standard includes --------------------------------*/ +#include +#include + +#include "port.h" + +/* ----------------------- Modbus includes ----------------------------------*/ +#include "mb.h" +#include "mbport.h" + +/* ----------------------- Defines ------------------------------------------*/ + +/* ----------------------- Static variables ---------------------------------*/ +ULONG ulTimeOut; +BOOL bTimeoutEnable; + +static struct timeval xTimeLast; + +/* ----------------------- Start implementation -----------------------------*/ +BOOL +xMBPortTimersInit( USHORT usTim1Timerout50us ) +{ + ulTimeOut = usTim1Timerout50us / 20U; + if( ulTimeOut == 0 ) + ulTimeOut = 1; + + return xMBPortSerialSetTimeout( ulTimeOut ); +} + +void +xMBPortTimersClose( ) +{ + /* Does not use any hardware resources. */ +} + +void +vMBPortTimerPoll( ) +{ + ULONG ulDeltaMS; + struct timeval xTimeCur; + + /* Timers are called from the serial layer because we have no high + * res timer in Win32. */ + if( bTimeoutEnable ) + { + if( gettimeofday( &xTimeCur, NULL ) != 0 ) + { + /* gettimeofday failed - retry next time. */ + } + else + { + ulDeltaMS = ( xTimeCur.tv_sec - xTimeLast.tv_sec ) * 1000L + + ( xTimeCur.tv_usec - xTimeLast.tv_usec ) * 1000L; + if( ulDeltaMS > ulTimeOut ) + { + bTimeoutEnable = FALSE; + ( void )pxMBPortCBTimerExpired( ); + } + } + } +} + +void +vMBPortTimersEnable( ) +{ + int res = gettimeofday( &xTimeLast, NULL ); + + assert( res == 0 ); + bTimeoutEnable = TRUE; +} + +void +vMBPortTimersDisable( ) +{ + bTimeoutEnable = FALSE; +} diff --git a/moveinput.cpp b/moveinput.cpp new file mode 100644 index 0000000..15e7ca9 --- /dev/null +++ b/moveinput.cpp @@ -0,0 +1,43 @@ +#include "moveinput.h" +#include "ui_moveinput.h" +#include + +MoveInput::MoveInput(QWidget *parent) : + QWidget(parent,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)), + ui(new Ui::MoveInput) +{ + ui->setupUi(this); + + connect(ui->Key_left,SIGNAL(pressed()),this,SLOT(onKeyLeftPressed())); + connect(ui->Key_right,SIGNAL(pressed()),this,SLOT(onKeyRightPressed())); + connect(ui->Key_up,SIGNAL(pressed()),this,SLOT(onKeyUpPressed())); + connect(ui->Key_down,SIGNAL(pressed()),this,SLOT(onKeyDownPressed())); +} + +MoveInput::~MoveInput() +{ + delete ui; +} + + +void MoveInput::onKeyLeftPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Left,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} + +void MoveInput::onKeyRightPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Right,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} +void MoveInput::onKeyUpPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Up,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} +void MoveInput::onKeyDownPressed(){ +#ifndef Q_OS_WIN32 + QWSServer::sendKeyEvent(0,Qt::Key_Down,Qt::NoModifier,true,false); //向系统发送键盘事件 +#endif +} diff --git a/moveinput.h b/moveinput.h new file mode 100644 index 0000000..0361e9a --- /dev/null +++ b/moveinput.h @@ -0,0 +1,28 @@ +#ifndef MOVEINPUT_H +#define MOVEINPUT_H + +#include + +namespace Ui { +class MoveInput; +} + +class MoveInput : public QWidget +{ + Q_OBJECT + +public: + explicit MoveInput(QWidget *parent = 0); + ~MoveInput(); + +private slots: + void onKeyLeftPressed(); + void onKeyRightPressed(); + void onKeyUpPressed(); + void onKeyDownPressed(); + +private: + Ui::MoveInput *ui; +}; + +#endif // MOVEINPUT_H diff --git a/moveinput.ui b/moveinput.ui new file mode 100644 index 0000000..3eee85e --- /dev/null +++ b/moveinput.ui @@ -0,0 +1,181 @@ + + + MoveInput + + + + 0 + 0 + 323 + 230 + + + + + + + + + 255 + 255 + 255 + + + + + + + 202 + 201 + 201 + + + + + + + + + 255 + 255 + 255 + + + + + + + 202 + 201 + 201 + + + + + + + + + 202 + 201 + 201 + + + + + + + 202 + 201 + 201 + + + + + + + + + + + + + 19 + 9 + 290 + 211 + + + + + + + + 0 + 50 + + + + + + + + :/icon/keyleft.png:/icon/keyleft.png + + + + + + + + 0 + 50 + + + + + + + + :/icon/keyup.png:/icon/keyup.png + + + + + + + false + + + + 0 + 50 + + + + + + + + + + + + 0 + 50 + + + + + + + + :/icon/keydown.png:/icon/keydown.png + + + + + + + + 0 + 50 + + + + + + + + :/icon/keyright.png:/icon/keyright.png + + + + + + + + + + + diff --git a/mycom.cpp b/mycom.cpp new file mode 100644 index 0000000..45d8b3e --- /dev/null +++ b/mycom.cpp @@ -0,0 +1,198 @@ +#include "mycom.h" +#define TTY_DEV "/dev/ttyUSB" //端口路径 如果是在电脑端选择ttyUSB,在mini2440端则选择ttySAC +//#define TTY_DEV "/dev/ttySAC" +#define TIMEOUT_SEC(buflen,baud) (buflen*20/baud+2)//接收超时 +#define TIMEOUT_USEC 0 +/************************************************* +fuction: char *get_ptty(pportinfo_t pportinfo) +description: get thd uart name +return: ptty +**************************************************/ +static char *get_ptty(pportinfo_t pportinfo) +{ + char *ptty=NULL; + switch(pportinfo->tty) + { + case '0': + ptty=TTY_DEV"0"; + break; + case '1': + ptty=TTY_DEV"1"; + break; + case '2': + ptty=TTY_DEV"2"; + break; + } + return ptty; +} +/************************************************* +fuction: convbaud(unsigned long int baudrate) +description: baud change +return: ptty +**************************************************/ +static int convbaud(unsigned long int baudrate) +{ + switch(baudrate){ + case 2400: + return B2400; + case 4800: + return B4800; + case 9600: + return B9600; + case 19200: + return B19200; + case 38400: + return B38400; + case 57600: + return B57600; + case 115200: + return B115200; + default: + return B9600; + } +} +/**************************************************************** +fuction: convbaud(unsigned long int baudrate) +description: set the uart +parameters: fdcom: 串口文件描述符, + pportinfo: 待设置的串口信息 +return: tmp +******************************************************************/ +int PortSet(int fdcom, const pportinfo_t pportinfo) +{ + struct termios termios_old, termios_new; + int baudrate, tmp; + char databit, stopbit, parity, fctl; + bzero(&termios_old, sizeof(termios_old));//置字符串前sizeof个字节为零 + bzero(&termios_new, sizeof(termios_new)); + cfmakeraw(&termios_new);//设置终端属性 + tcgetattr(fdcom, &termios_old);//get the serial port attributions + /*------------设置端口属性----------------*/ + //baudrates + baudrate = convbaud(pportinfo -> baudrate);//得到波特率 + cfsetospeed(&termios_new, baudrate);//填入串口输出端的波特率 + termios_new.c_cflag |= CLOCAL;//控制模式,保证程序不会成为端口的占有者 + // 控制模式,flow control + fctl = pportinfo-> fctl; + switch(fctl){ + case '0':{ + termios_new.c_cflag &= ~CRTSCTS;//no flow control + }break; + case '1':{ + termios_new.c_cflag |= CRTSCTS;//hardware flow control + }break; + case '2':{ + termios_new.c_iflag |= IXON | IXOFF |IXANY; //software flow control + }break; + } + //控制模式,data bits + termios_new.c_cflag &= ~CSIZE;//控制模式,屏蔽字符大小位 + databit = pportinfo -> databit; + switch(databit){ + case '5': + termios_new.c_cflag |= CS5; + case '6': + termios_new.c_cflag |= CS6; + case '7': + termios_new.c_cflag |= CS7; + default: + termios_new.c_cflag |= CS8; + } + //控制模式 parity check + parity = pportinfo -> parity; + switch(parity){ + case '0':{ + termios_new.c_cflag &= ~PARENB;//no parity check + }break; + case '1':{ + termios_new.c_cflag |= PARENB;//odd check + termios_new.c_cflag &= ~PARODD; + }break; + case '2':{ + termios_new.c_cflag |= PARENB;//even check + termios_new.c_cflag |= PARODD; + }break; + } + //控制模式,stop bits + stopbit = pportinfo -> stopbit; + if(stopbit == '2'){ + termios_new.c_cflag |= CSTOPB;//2 stop bits + } + else{ + termios_new.c_cflag &= ~CSTOPB;//1 stop bits + } + //other attributions default + termios_new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);//输入模式,原始数据输入 + tcflush(fdcom, TCIFLUSH);//溢出的数据可以接收,但不读 + tmp = tcsetattr(fdcom, TCSANOW, &termios_new);//设置新属性,TCSANOW:所有改变立即生效 tcgetattr(fdcom, &termios_old); + return(tmp); +} +/**************************************************************** +fuction: PortOpen(pportinfo_t pportinfo) +description: open serial port +parameters: pportinfo: 待设置的串口信息 +return: fdcom:文件描述符 +******************************************************************/ +int PortOpen(pportinfo_t pportinfo) +{ + int fdcom; //串口文件描述符 + char *ptty; + ptty = get_ptty(pportinfo); + //fdcom = open(ptty, O_RDWR | O_NOCTTY | O_NONBLOCK | O_NDELAY); + fdcom = open(ptty, O_RDWR | O_NOCTTY | O_NONBLOCK); + return (fdcom); +} +/**************************************************************** +fuction: PortClose(int fdcom) +description: close serial port +parameters: fdcom:文件描述符 +return: NONE +******************************************************************/ +void PortClose(int fdcom) +{ + close(fdcom); +} +/**************************************************************** +fuction: PortSend(int fdcom, char *data, int datalen) +description: close serial port +parameters: fdcom: 串口描述符,data: 待发送数据,datalen: 数据长度 +return: len:实际长度 +******************************************************************/ +int PortSend(int fdcom, char *data, int datalen) +{ + int len = 0; + len = write(fdcom, data, datalen);//实际写入的长度 + if(len == datalen){ + return (len); + } + else{ + tcflush(fdcom, TCOFLUSH); + return -1; + } +} +/**************************************************************** +fuction: PortRecv(int fdcom, char *data, int datalen, int baudrate) +description: receive the datas +parameters: fdcom:串口描述符, data:接收缓冲区, datalen:接收长度, + baudrate:波特率 +return: readlen:实际读入的字节数 +******************************************************************/ +int PortRecv(int fdcom, char *data, int datalen, int baudrate) +{ + int readlen, fs_sel; + fd_set fs_read; + struct timeval tv_timeout; + FD_ZERO(&fs_read); + FD_SET(fdcom, &fs_read); + tv_timeout.tv_sec = TIMEOUT_SEC(datalen, baudrate); + tv_timeout.tv_usec = TIMEOUT_USEC; + fs_sel = select(fdcom+1, &fs_read, NULL, NULL, &tv_timeout); + if(fs_sel){ + readlen = read(fdcom, data, datalen); + return(readlen); + } + else{ + return(-1); + } + return (readlen); +} diff --git a/mycom.h b/mycom.h new file mode 100644 index 0000000..857bc31 --- /dev/null +++ b/mycom.h @@ -0,0 +1,33 @@ +#ifndef MYCOM_H +#define MYCOM_H +#include //printf等用到 +#include //file control +#include //bzero等用到 +#include //exit(0)等用到 +#include //sleep等用到 +#include //串口应用程序必须添加的头文件 +#include //定义pid_t,size等 +#include //read,write,getpid等等 +#include //ioctl +typedef struct //define the uart value struct +{ + char prompt; //prompt after reciving data + int baudrate; //baudrate + char databit; //data bits, 5, 6, 7, 8 + char debug; //debug mode, 0: none, 1: debug + char echo; //echo mode, 0: none, 1: echo + char fctl; //flow control, 0: none, 1: hardware, 2: software + char tty; //tty: 0, 1, 2, 3, 4, 5, 6, 7 + char parity; //parity 0: none, 1: odd, 2: even + char stopbit; //stop bits, 1, 2 + //const int reserved; //reserved, must be zero + int reserved; //reserved, must be zero +}portinfo_t; +typedef portinfo_t *pportinfo_t; //redefine the portinfo_t +/**************** declaration the fuction to set the uart *******************/ +int PortOpen(pportinfo_t pportinfo); //open the uart +int PortSet(int fdcom, const pportinfo_t pportinfo); //set the uart +void PortClose(int fdcom); //close the uart +int PortSend(int fdcom, char *data, int datalen); //send the datas +int PortRecv(int fdcom, char *data, int datalen, int baudrate);//receive the datas +#endif // MYCOM_H diff --git a/myinclude.h b/myinclude.h new file mode 100644 index 0000000..ea086e7 --- /dev/null +++ b/myinclude.h @@ -0,0 +1,116 @@ + +#ifndef MYINCLUDE_H +#define MYINCLUDE_H +#define FXCHG // FPGA 交替打印 +#define VARBOLD // 变量加粗 +#define SYS_LINUX 1 +#define TXTFILE 0 +#define PICFILE 1 +#define SCENE 2 +//#define _VX_ 1 + +#ifdef SYS_LINUX +#define SYS_ROOT_DIR "/home/plg/" +#else +#define SYS_ROOT_DIR "./" +#endif +#include "qnamespace.h" + +#define RANDDEBUG // 随机码导出功能 +#define SYNLENFLOAT // 支持小数喷印间隔 + +#define MIMA // 使用密码功能 +// #define VARCOLOR // 设置变量为字符型 +// +#define CABLEUSER // 20140426 电缆用户 + +//#define UART1 // 手持机see namespace.h + +//#define UART2 // 手持机see namespace.h + +#ifdef UART2 + #define SOFTWARE_VER_NUM "R3.09" //支持16位ALT , 支持 UART2 +#else + #define SOFTWARE_VER_NUM "A3.09" +#endif + +#ifdef CABLEUSER + #define TST " Cables" + #define FPAG_INIT_MAGIC_NUM 0x58 //用来判断是否读fpga成功 +#else + #define TST " 管材行业" + #define FPAG_INIT_MAGIC_NUM 0x53 //用来判断是否读fpga成功 +#endif + +//#define DEBUG1 +//#define DEBUG2 // show maxMM +#define MYSAVEFILEDLG // 定义自己的保存文件对话框,解决系统对话框按键不弹起问题 + +#ifdef __VX__ +#define __STC_POWER__ //使用STC 单片机当作电源管理 +#define __ADC_INPUT__ //使用AIN接口检测机箱温度/墨水温度 +#define __NETWORKMANAGER__ //使用网络功能 +#define __VX_OSC_VOL__ //使用网络功能 +#define LANINTERFACE_NAME "eth0" +//#define __RFID_CARD +//#define __com_485_ +#endif + +#define TEST_MODE 0 //测试模式 +#define SIMULATE_PRINTING_MODE 0 //模拟打印模式 + +#ifdef __CONVERTERWIFI__ +#define __NETWORKMANAGER__ //使用网络功能 +#define LANINTERFACE_NAME "eth0" +#endif + +#ifdef __2451WIFI__ +#define LANINTERFACE_NAME "eth0" +#endif +#define __HV_FOR_WANG_DEBUG__ + +#define __FPGA_DEBUG__ // FPGA调试界面 +// 打开:使用的是旧管路 关闭:使用新管路 +//#define __AIR_RELEASE_OLD__ + +#define __DAC_ADJ_FUNCTION__ // 使用电压调整功能 +//#define __DAC_FOR_5DOT__ // 确定5点阵的电压 +//#define __DAC_FOR_7DOT__ // 确定7点阵的电压,机器一致性不解决,确定固定的电压无意义 +//#define __2_LINE_DAC_ // 使用2行 7x5 点阵,总共16点阵 +#define __2_LINE_DAC_FOR_DENG // 等总两行, 怡宝, 说第二行的第一个点电压降低 + +//#define ENCRYPT_VOL +enum CRYS_FREQ{ + CRYS_64K, + CRYS_76K, + CRYS_96K, + CRYS_128K +}; + +//#define CRYS_64K 0 +//#define CRYS_76K 1 +//#define CRYS_83K 2 +//#define CRYS_96K 3 +//#define CRYS_128K 4 +enum PRINT_MODE{ + FAST_PRINT, + STANDARD_PRINT, + SLOW_PRINT_ONE, + SLOW_PRINT_TWO, + SLOW_PRINT_THR, + SLOW_PRINT_FOR, + SLOW_PRINT_FIV, + SLOW_PRINT_SIX, + SLOW_PRINT_SEV, + SLOW_PRINT_EIG, + SLOW_PRINT_NIE +}; + +#endif +// MYINCLUDE_H +/* +20140627: + 再改这功能,同步器状态下,不打印走米打钩时一直计米,取消打钩时按停止打印按钮不计米,按打印按钮一直计米与故障无关。 + 目前1-都计米,2-高压故障时不计米,其它计米。 + */ + diff --git a/otherinfo.ui b/otherinfo.ui new file mode 100644 index 0000000..86203e2 --- /dev/null +++ b/otherinfo.ui @@ -0,0 +1,448 @@ + + + OtherInfo + + + + 0 + 0 + 627 + 437 + + + + Qt::StrongFocus + + + Form + + + + + 10 + 10 + 667 + 457 + + + + + 2 + + + + + 2 + + + + + + + + + + + + 相位位置: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + true + + + 1 + + + 100 + + + 40 + + + + + + + 相位偏移: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + -1560 + + + 1560 + + + 0 + + + + + + + true + + + 1 + + + 64000 + + + 7 + + + + + + + + 16777215 + 30 + + + + + + + + + + + + 16777215 + 30 + + + + 飞行时间: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 20 + + + + DetectDelay + + + + + + + true + + + 30 + + + 100 + + + 5 + + + 55 + + + + + + + Qt::LeftToRight + + + 相检: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 20 + + + + FullTimeEn + + + + + + + + 16777215 + 20 + + + + DetectVol + + + + + + + + 16777215 + 20 + + + + HighLowRatio + + + + + + + Qt::LeftToRight + + + 充电占空比100% + + + + + + + + 16777215 + 20 + + + + detect_num + + + + + + + false + + + 锁定相位 + + + + :/icon/lockphase.png:/icon/lockphase.png + + + + + + + 相位检测电压: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 频闪灯周期: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 检测点数量: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + + + + 检测延迟 : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + + + + + + + + 605 + 120 + + + + + 16777215 + 16777215 + + + + + + + + + 605 + 140 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 40 + + + + + 250 + 16777215 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + Qt::LeftToRight + + + 应用当前配置 + + + + :/icon/apply.png:/icon/apply.png + + + + + + + + + + + PhaseGraphic + QWidget +
PhaseGraphic.h
+ 1 +
+ + MemDisplayAndEdit + QWidget +
MemDisplayAndEdit.h
+ 1 +
+
+ + + + +
diff --git a/picedit.ui b/picedit.ui new file mode 100644 index 0000000..b56a019 --- /dev/null +++ b/picedit.ui @@ -0,0 +1,832 @@ + + + PicEdit + + + + 0 + 0 + 642 + 442 + + + + Qt::StrongFocus + + + Form + + + + + + + + + + + 0 + 40 + + + + + 72 + 16777215 + + + + 开启软键盘 + + + + + + + + 63 + 40 + + + + 插入变量 + + + + :/icon/vari.png:/icon/vari.png + + + + + + + + 50 + 40 + + + + 保存/打印 + + + + :/icon/filesave.png:/icon/filesave.png + + + + + + + + 55 + 40 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + 55 + 40 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + + 74 + 40 + + + + + 74 + 16777215 + + + + Qt::ImhNone + + + 0 + + + + 5点阵 + + + + + 7点阵 + + + + + 9点阵 + + + + + 12点阵宋体 + + + + + 16点阵宋体 + + + + + 16点阵黑体 + + + + + 24点阵宋体 + + + + + 24点阵黑体 + + + + + + + + + 16777215 + 20 + + + + 列高 + + + Qt::AlignCenter + + + + + + + + 40 + 40 + + + + + 40 + 16777215 + + + + + 0 + 0 + + + + 1 + + + 256 + + + 40 + + + + + + + + 0 + 40 + + + + + 62 + 16777215 + + + + + 无加粗 + + + + + 加粗1倍 + + + + + 加粗2倍 + + + + + + + + + 10 + 25 + + + + + true + + + + false + + + Qt::StrongFocus + + + false + + + Qt::ImhDigitsOnly|Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase + + + + + + + + + + + + 0 + 145 + + + + + 16777215 + 145 + + + + Qt::ImhNone + + + false + + + Qt::AlignCenter + + + + + 159 + 21 + 300 + 100 + + + + Qt::RightToLeft + + + Qt::ImhDigitsOnly + + + + + + + + + + 0 + + + 6 + + + + + + 80 + 0 + + + + + 130 + 16777215 + + + + 光栅[X:Y] + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 放大比例 + + + Qt::AlignCenter + + + + + + + + 52 + 16777215 + + + + 插入模式 + + + Qt::AlignCenter + + + + + + + + 0 + 16 + + + + + 200 + 16777215 + + + + 文件名 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + 130 + 16777215 + + + + CURR[X,Y] + + + + + + + + + Qt::Horizontal + + + + + + + 5 + + + + + + 90 + 50 + + + + 新建信息 + + + + :/icon/filenew.png:/icon/filenew.png + + + + + + + + 90 + 50 + + + + 打开文件 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + + 90 + 50 + + + + 字符间距 + + + + :/icon/linespace.png:/icon/linespace.png + + + + + + + + 90 + 50 + + + + 插入/修改 + + + + + + + + 90 + 50 + + + + 删除字符 + + + + :/icon/keydelete.png:/icon/keydelete.png + + + + + + + true + + + + 90 + 50 + + + + 插入图片 + + + + :/icon/insert.png:/icon/insert.png + + + + + + + + 90 + 50 + + + + 保存为 + + + + :/icon/filesaveas.png:/icon/filesaveas.png + + + + + + + true + + + + 90 + 50 + + + + 字库编辑 + + + + + + + 网格 + + + true + + + + + + + Qt::NoFocus + + + Qt::LeftToRight + + + 粗体 + + + + + + + 显示控制符 + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + 行首 + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + + + + + :/icon/arrowleft.png:/icon/arrowleft.png + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + + + + + :/icon/arrowup.png:/icon/arrowup.png + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + + + + + :/icon/arrowdown.png:/icon/arrowdown.png + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + + + + + :/icon/arrowright.png:/icon/arrowright.png + + + + + + + + 50 + 50 + + + + + 70 + 50 + + + + 行尾 + + + + + + + 字符光标 + + + + + + + 像素光标 + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + + + + + + 编辑现有的多字体 + + + + + + + + 300 + 16777215 + + + + 点击光栅可打开键盘,点击空白处关闭 + + + Qt::AlignCenter + + + + + + + + + + + + PicWidget + QWidget +
PicWidget.h
+ 1 +
+
+ + + + +
diff --git a/posix_qextserialport.cpp b/posix_qextserialport.cpp new file mode 100644 index 0000000..4f53abc --- /dev/null +++ b/posix_qextserialport.cpp @@ -0,0 +1,1128 @@ + +/*! +\class Posix_QextSerialPort +\version 1.0.0 +\author Stefan Sander +\author Michal Policht + +A cross-platform serial port class. +This class encapsulates the POSIX portion of QextSerialPort. The user will be notified of errors +and possible portability conflicts at run-time by default - this behavior can be turned off by +defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off portability +warnings) in the project. Note that _TTY_NOWARN_ will also turn off portability warnings. +*/ + +#include +#include "posix_qextserialport.h" + +/*! +\fn Posix_QextSerialPort::Posix_QextSerialPort() +Default constructor. Note that the name of the device used by a QextSerialPort constructed with +this constructor will be determined by #defined constants, or lack thereof - the default behavior +is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are: + +\verbatim + +Constant Used By Naming Convention +---------- ------------- ------------------------ +_TTY_WIN_ Windows COM1, COM2 +_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2 +_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0 +_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb +_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02 +_TTY_FREEBSD_ FreeBSD /dev/ttyd0, /dev/ttyd1 +_TTY_LINUX_ Linux /dev/ttySAC0, /dev/ttySAC1 + Linux /dev/ttyS0, /dev/ttyS1 +\endverbatim + +This constructor assigns the device name to the name of the first port on the specified system. +See the other constructors if you need to open a different port. +*/ +Posix_QextSerialPort::Posix_QextSerialPort() +: QextSerialBase() +{ + Posix_File=new QFile(); +} + +/*! +\fn Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort&) +Copy constructor. +*/ +Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort& s) + : QextSerialBase(s.port) +{ + setOpenMode(s.openMode()); + port = s.port; + Settings.BaudRate=s.Settings.BaudRate; + Settings.DataBits=s.Settings.DataBits; + Settings.Parity=s.Settings.Parity; + Settings.StopBits=s.Settings.StopBits; + Settings.FlowControl=s.Settings.FlowControl; + lastErr=s.lastErr; + + Posix_File=new QFile(); + Posix_File=s.Posix_File; + memcpy(&Posix_Timeout, &s.Posix_Timeout, sizeof(struct timeval)); + memcpy(&Posix_Copy_Timeout, &s.Posix_Copy_Timeout, sizeof(struct timeval)); + memcpy(&Posix_CommConfig, &s.Posix_CommConfig, sizeof(struct termios)); +} + +/*! +\fn Posix_QextSerialPort::Posix_QextSerialPort(const QString & name) +Constructs a serial port attached to the port specified by name. +name is the name of the device, which is windowsystem-specific, +e.g."COM1" or "/dev/ttyS0". +*/ +Posix_QextSerialPort::Posix_QextSerialPort(const QString & name, QextSerialBase::QueryMode mode) + : QextSerialBase(name) +{ + Posix_File=new QFile(); + setQueryMode(mode); + init(); +} + +/*! +\fn Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings) +Constructs a port with default name and specified settings. +*/ +Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings, QextSerialBase::QueryMode mode) + : QextSerialBase() +{ + setBaudRate(settings.BaudRate); + setDataBits(settings.DataBits); + setParity(settings.Parity); + setStopBits(settings.StopBits); + setFlowControl(settings.FlowControl); + + Posix_File=new QFile(); + setTimeout(settings.Timeout_Millisec); + setQueryMode(mode); + init(); +} + +/*! +\fn Posix_QextSerialPort::Posix_QextSerialPort(const QString & name, const PortSettings& settings) +Constructs a port with specified name and settings. +*/ +Posix_QextSerialPort::Posix_QextSerialPort(const QString & name, const PortSettings& settings, QextSerialBase::QueryMode mode) + : QextSerialBase(name) +{ + setBaudRate(settings.BaudRate); + setDataBits(settings.DataBits); + setParity(settings.Parity); + setStopBits(settings.StopBits); + setFlowControl(settings.FlowControl); + + Posix_File=new QFile(); + setTimeout(settings.Timeout_Millisec); + setQueryMode(mode); + init(); +} + +/*! +\fn Posix_QextSerialPort& Posix_QextSerialPort::operator=(const Posix_QextSerialPort& s) +Override the = operator. +*/ +Posix_QextSerialPort& Posix_QextSerialPort::operator=(const Posix_QextSerialPort& s) +{ + setOpenMode(s.openMode()); + port = s.port; + Settings.BaudRate=s.Settings.BaudRate; + Settings.DataBits=s.Settings.DataBits; + Settings.Parity=s.Settings.Parity; + Settings.StopBits=s.Settings.StopBits; + Settings.FlowControl=s.Settings.FlowControl; + lastErr=s.lastErr; + + Posix_File=s.Posix_File; + memcpy(&Posix_Timeout, &(s.Posix_Timeout), sizeof(struct timeval)); + memcpy(&Posix_Copy_Timeout, &(s.Posix_Copy_Timeout), sizeof(struct timeval)); + memcpy(&Posix_CommConfig, &(s.Posix_CommConfig), sizeof(struct termios)); + return *this; +} + +void Posix_QextSerialPort::init() +{ + if (queryMode() == QextSerialBase::EventDriven) + qWarning("POSIX doesn't have event driven mechanism implemented yet"); +} + +/*! +\fn Posix_QextSerialPort::~Posix_QextSerialPort() +Standard destructor. +*/ +Posix_QextSerialPort::~Posix_QextSerialPort() +{ + if (isOpen()) { + close(); + } + Posix_File->close(); + delete Posix_File; +} + +/*! +\fn void Posix_QextSerialPort::setBaudRate(BaudRateType baudRate) +Sets the baud rate of the serial port. Note that not all rates are applicable on +all platforms. The following table shows translations of the various baud rate +constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an * +are speeds that are usable on both Windows and POSIX. + +\note +BAUD76800 may not be supported on all POSIX systems. SGI/IRIX systems do not support +BAUD1800. + +\verbatim + + RATE Windows Speed POSIX Speed + ----------- ------------- ----------- + BAUD50 110 50 + BAUD75 110 75 + *BAUD110 110 110 + BAUD134 110 134.5 + BAUD150 110 150 + BAUD200 110 200 + *BAUD300 300 300 + *BAUD600 600 600 + *BAUD1200 1200 1200 + BAUD1800 1200 1800 + *BAUD2400 2400 2400 + *BAUD4800 4800 4800 + *BAUD9600 9600 9600 + BAUD14400 14400 9600 + *BAUD19200 19200 19200 + *BAUD38400 38400 38400 + BAUD56000 56000 38400 + *BAUD57600 57600 57600 + BAUD76800 57600 76800 + *BAUD115200 115200 115200 + BAUD128000 128000 115200 + BAUD256000 256000 115200 +\endverbatim +*/ +void Posix_QextSerialPort::setBaudRate(BaudRateType baudRate) +{ + LOCK_MUTEX(); + if (Settings.BaudRate!=baudRate) { + switch (baudRate) { + case BAUD14400: + Settings.BaudRate=BAUD9600; + break; + + case BAUD56000: + Settings.BaudRate=BAUD38400; + break; + + case BAUD76800: + +#ifndef B76800 + Settings.BaudRate=BAUD57600; +#else + Settings.BaudRate=baudRate; +#endif + break; + + case BAUD128000: + case BAUD256000: + Settings.BaudRate=BAUD115200; + break; + + default: + Settings.BaudRate=baudRate; + break; + } + } + if (isOpen()) { + switch (baudRate) { + + /*50 baud*/ + case BAUD50: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 50 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B50; +#else + cfsetispeed(&Posix_CommConfig, B50); + cfsetospeed(&Posix_CommConfig, B50); +#endif + break; + + /*75 baud*/ + case BAUD75: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 75 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B75; +#else + cfsetispeed(&Posix_CommConfig, B75); + cfsetospeed(&Posix_CommConfig, B75); +#endif + break; + + /*110 baud*/ + case BAUD110: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B110; +#else + cfsetispeed(&Posix_CommConfig, B110); + cfsetospeed(&Posix_CommConfig, B110); +#endif + break; + + /*134.5 baud*/ + case BAUD134: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 134.5 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B134; +#else + cfsetispeed(&Posix_CommConfig, B134); + cfsetospeed(&Posix_CommConfig, B134); +#endif + break; + + /*150 baud*/ + case BAUD150: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 150 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B150; +#else + cfsetispeed(&Posix_CommConfig, B150); + cfsetospeed(&Posix_CommConfig, B150); +#endif + break; + + /*200 baud*/ + case BAUD200: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 200 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B200; +#else + cfsetispeed(&Posix_CommConfig, B200); + cfsetospeed(&Posix_CommConfig, B200); +#endif + break; + + /*300 baud*/ + case BAUD300: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B300; +#else + cfsetispeed(&Posix_CommConfig, B300); + cfsetospeed(&Posix_CommConfig, B300); +#endif + break; + + /*600 baud*/ + case BAUD600: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B600; +#else + cfsetispeed(&Posix_CommConfig, B600); + cfsetospeed(&Posix_CommConfig, B600); +#endif + break; + + /*1200 baud*/ + case BAUD1200: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B1200; +#else + cfsetispeed(&Posix_CommConfig, B1200); + cfsetospeed(&Posix_CommConfig, B1200); +#endif + break; + + /*1800 baud*/ + case BAUD1800: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows and IRIX do not support 1800 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B1800; +#else + cfsetispeed(&Posix_CommConfig, B1800); + cfsetospeed(&Posix_CommConfig, B1800); +#endif + break; + + /*2400 baud*/ + case BAUD2400: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B2400; +#else + cfsetispeed(&Posix_CommConfig, B2400); + cfsetospeed(&Posix_CommConfig, B2400); +#endif + break; + + /*4800 baud*/ + case BAUD4800: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B4800; +#else + cfsetispeed(&Posix_CommConfig, B4800); + cfsetospeed(&Posix_CommConfig, B4800); +#endif + break; + + /*9600 baud*/ + case BAUD9600: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B9600; +#else + cfsetispeed(&Posix_CommConfig, B9600); + cfsetospeed(&Posix_CommConfig, B9600); +#endif + break; + + /*14400 baud*/ + case BAUD14400: + TTY_WARNING("Posix_QextSerialPort: POSIX does not support 14400 baud operation. Switching to 9600 baud."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B9600; +#else + cfsetispeed(&Posix_CommConfig, B9600); + cfsetospeed(&Posix_CommConfig, B9600); +#endif + break; + + /*19200 baud*/ + case BAUD19200: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B19200; +#else + cfsetispeed(&Posix_CommConfig, B19200); + cfsetospeed(&Posix_CommConfig, B19200); +#endif + break; + + /*38400 baud*/ + case BAUD38400: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B38400; +#else + cfsetispeed(&Posix_CommConfig, B38400); + cfsetospeed(&Posix_CommConfig, B38400); +#endif + break; + + /*56000 baud*/ + case BAUD56000: + TTY_WARNING("Posix_QextSerialPort: POSIX does not support 56000 baud operation. Switching to 38400 baud."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B38400; +#else + cfsetispeed(&Posix_CommConfig, B38400); + cfsetospeed(&Posix_CommConfig, B38400); +#endif + break; + + /*57600 baud*/ + case BAUD57600: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B57600; +#else + cfsetispeed(&Posix_CommConfig, B57600); + cfsetospeed(&Posix_CommConfig, B57600); +#endif + break; + + /*76800 baud*/ + case BAUD76800: + TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows and some POSIX systems do not support 76800 baud operation."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + +#ifdef B76800 + Posix_CommConfig.c_cflag|=B76800; +#else + TTY_WARNING("Posix_QextSerialPort: Posix_QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud."); + Posix_CommConfig.c_cflag|=B57600; +#endif //B76800 +#else //CBAUD +#ifdef B76800 + cfsetispeed(&Posix_CommConfig, B76800); + cfsetospeed(&Posix_CommConfig, B76800); +#else + TTY_WARNING("Posix_QextSerialPort: Posix_QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud."); + cfsetispeed(&Posix_CommConfig, B57600); + cfsetospeed(&Posix_CommConfig, B57600); +#endif //B76800 +#endif //CBAUD + break; + + /*115200 baud*/ + case BAUD115200: +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B115200; +#else + cfsetispeed(&Posix_CommConfig, B115200); + cfsetospeed(&Posix_CommConfig, B115200); +#endif + break; + + /*128000 baud*/ + case BAUD128000: + TTY_WARNING("Posix_QextSerialPort: POSIX does not support 128000 baud operation. Switching to 115200 baud."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B115200; +#else + cfsetispeed(&Posix_CommConfig, B115200); + cfsetospeed(&Posix_CommConfig, B115200); +#endif + break; + + /*256000 baud*/ + case BAUD256000: + TTY_WARNING("Posix_QextSerialPort: POSIX does not support 256000 baud operation. Switching to 115200 baud."); +#ifdef CBAUD + Posix_CommConfig.c_cflag&=(~CBAUD); + Posix_CommConfig.c_cflag|=B115200; +#else + cfsetispeed(&Posix_CommConfig, B115200); + cfsetospeed(&Posix_CommConfig, B115200); +#endif + break; + } + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setDataBits(DataBitsType dataBits) +Sets the number of data bits used by the serial port. Possible values of dataBits are: +\verbatim + DATA_5 5 data bits + DATA_6 6 data bits + DATA_7 7 data bits + DATA_8 8 data bits +\endverbatim + +\note +This function is subject to the following restrictions: +\par + 5 data bits cannot be used with 2 stop bits. +\par + 8 data bits cannot be used with space parity on POSIX systems. + +*/ +void Posix_QextSerialPort::setDataBits(DataBitsType dataBits) +{ + LOCK_MUTEX(); + if (Settings.DataBits!=dataBits) { + if ((Settings.StopBits==STOP_2 && dataBits==DATA_5) || + (Settings.StopBits==STOP_1_5 && dataBits!=DATA_5) || + (Settings.Parity==PAR_SPACE && dataBits==DATA_8)) { + } + else { + Settings.DataBits=dataBits; + } + } + if (isOpen()) { + switch(dataBits) { + + /*5 data bits*/ + case DATA_5: + if (Settings.StopBits==STOP_2) { + TTY_WARNING("Posix_QextSerialPort: 5 Data bits cannot be used with 2 stop bits."); + } + else { + Settings.DataBits=dataBits; + Posix_CommConfig.c_cflag&=(~CSIZE); + Posix_CommConfig.c_cflag|=CS5; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + + /*6 data bits*/ + case DATA_6: + if (Settings.StopBits==STOP_1_5) { + TTY_WARNING("Posix_QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits."); + } + else { + Settings.DataBits=dataBits; + Posix_CommConfig.c_cflag&=(~CSIZE); + Posix_CommConfig.c_cflag|=CS6; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + + /*7 data bits*/ + case DATA_7: + if (Settings.StopBits==STOP_1_5) { + TTY_WARNING("Posix_QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits."); + } + else { + Settings.DataBits=dataBits; + Posix_CommConfig.c_cflag&=(~CSIZE); + Posix_CommConfig.c_cflag|=CS7; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + + /*8 data bits*/ + case DATA_8: + if (Settings.StopBits==STOP_1_5) { + TTY_WARNING("Posix_QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits."); + } + else { + Settings.DataBits=dataBits; + Posix_CommConfig.c_cflag&=(~CSIZE); + Posix_CommConfig.c_cflag|=CS8; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + } + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setParity(ParityType parity) +Sets the parity associated with the serial port. The possible values of parity are: +\verbatim + PAR_SPACE Space Parity + PAR_MARK Mark Parity + PAR_NONE No Parity + PAR_EVEN Even Parity + PAR_ODD Odd Parity +\endverbatim + +\note +This function is subject to the following limitations: +\par +POSIX systems do not support mark parity. +\par +POSIX systems support space parity only if tricked into doing so, and only with + fewer than 8 data bits. Use space parity very carefully with POSIX systems. + +*/ +void Posix_QextSerialPort::setParity(ParityType parity) +{ + LOCK_MUTEX(); + if (Settings.Parity!=parity) { + if (parity==PAR_MARK || (parity==PAR_SPACE && Settings.DataBits==DATA_8)) { + } + else { + Settings.Parity=parity; + } + } + if (isOpen()) { + switch (parity) { + + /*space parity*/ + case PAR_SPACE: + if (Settings.DataBits==DATA_8) { + TTY_PORTABILITY_WARNING("Posix_QextSerialPort: Space parity is only supported in POSIX with 7 or fewer data bits"); + } + else { + + /*space parity not directly supported - add an extra data bit to simulate it*/ + Posix_CommConfig.c_cflag&=~(PARENB|CSIZE); + switch(Settings.DataBits) { + case DATA_5: + Settings.DataBits=DATA_6; + Posix_CommConfig.c_cflag|=CS6; + break; + + case DATA_6: + Settings.DataBits=DATA_7; + Posix_CommConfig.c_cflag|=CS7; + break; + + case DATA_7: + Settings.DataBits=DATA_8; + Posix_CommConfig.c_cflag|=CS8; + break; + + case DATA_8: + break; + } + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + + /*mark parity - WINDOWS ONLY*/ + case PAR_MARK: + TTY_WARNING("Posix_QextSerialPort: Mark parity is not supported by POSIX."); + break; + + /*no parity*/ + case PAR_NONE: + Posix_CommConfig.c_cflag&=(~PARENB); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + + /*even parity*/ + case PAR_EVEN: + Posix_CommConfig.c_cflag&=(~PARODD); + Posix_CommConfig.c_cflag|=PARENB; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + + /*odd parity*/ + case PAR_ODD: + Posix_CommConfig.c_cflag|=(PARENB|PARODD); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + } + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setStopBits(StopBitsType stopBits) +Sets the number of stop bits used by the serial port. Possible values of stopBits are: +\verbatim + STOP_1 1 stop bit + STOP_1_5 1.5 stop bits + STOP_2 2 stop bits +\endverbatim +\note +This function is subject to the following restrictions: +\par + 2 stop bits cannot be used with 5 data bits. +\par + POSIX does not support 1.5 stop bits. + +*/ +void Posix_QextSerialPort::setStopBits(StopBitsType stopBits) +{ + LOCK_MUTEX(); + if (Settings.StopBits!=stopBits) { + if ((Settings.DataBits==DATA_5 && stopBits==STOP_2) || stopBits==STOP_1_5) {} + else { + Settings.StopBits=stopBits; + } + } + if (isOpen()) { + switch (stopBits) { + + /*one stop bit*/ + case STOP_1: + Settings.StopBits=stopBits; + Posix_CommConfig.c_cflag&=(~CSTOPB); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + + /*1.5 stop bits*/ + case STOP_1_5: + TTY_WARNING("Posix_QextSerialPort: 1.5 stop bit operation is not supported by POSIX."); + break; + + /*two stop bits*/ + case STOP_2: + if (Settings.DataBits==DATA_5) { + TTY_WARNING("Posix_QextSerialPort: 2 stop bits cannot be used with 5 data bits"); + } + else { + Settings.StopBits=stopBits; + Posix_CommConfig.c_cflag|=CSTOPB; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + break; + } + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setFlowControl(FlowType flow) +Sets the flow control used by the port. Possible values of flow are: +\verbatim + FLOW_OFF No flow control + FLOW_HARDWARE Hardware (RTS/CTS) flow control + FLOW_XONXOFF Software (XON/XOFF) flow control +\endverbatim +\note +FLOW_HARDWARE may not be supported on all versions of UNIX. In cases where it is +unsupported, FLOW_HARDWARE is the same as FLOW_OFF. + +*/ +void Posix_QextSerialPort::setFlowControl(FlowType flow) +{ + LOCK_MUTEX(); + if (Settings.FlowControl!=flow) { + Settings.FlowControl=flow; + } + if (isOpen()) { + switch(flow) { + + /*no flow control*/ + case FLOW_OFF: + Posix_CommConfig.c_cflag&=(~CRTSCTS); + Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY)); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + + /*software (XON/XOFF) flow control*/ + case FLOW_XONXOFF: + Posix_CommConfig.c_cflag&=(~CRTSCTS); + Posix_CommConfig.c_iflag|=(IXON|IXOFF|IXANY); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + + case FLOW_HARDWARE: + Posix_CommConfig.c_cflag|=CRTSCTS; + Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY)); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + break; + } + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setTimeout(ulong sec); +Sets the read and write timeouts for the port to millisec milliseconds. +Note that this is a per-character timeout, i.e. the port will wait this long for each +individual character, not for the whole read operation. This timeout also applies to the +bytesWaiting() function. + +\note +POSIX does not support millisecond-level control for I/O timeout values. Any +timeout set using this function will be set to the next lowest tenth of a second for +the purposes of detecting read or write timeouts. For example a timeout of 550 milliseconds +will be seen by the class as a timeout of 500 milliseconds for the purposes of reading and +writing the port. However millisecond-level control is allowed by the select() system call, +so for example a 550-millisecond timeout will be seen as 550 milliseconds on POSIX systems for +the purpose of detecting available bytes in the read buffer. + +*/ +void Posix_QextSerialPort::setTimeout(long millisec) +{ + LOCK_MUTEX(); + Settings.Timeout_Millisec = millisec; + Posix_Copy_Timeout.tv_sec = millisec / 1000; + Posix_Copy_Timeout.tv_usec = millisec % 1000; + if (isOpen()) { + tcgetattr(Posix_File->handle(), &Posix_CommConfig); + Posix_CommConfig.c_cc[VTIME] = millisec/100; + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } + UNLOCK_MUTEX(); +} + +/*! +\fn bool Posix_QextSerialPort::open(OpenMode mode) +Opens the serial port associated to this class. +This function has no effect if the port associated with the class is already open. +The port is also configured to the current settings, as stored in the Settings structure. +*/ +bool Posix_QextSerialPort::open(OpenMode mode) +{ + LOCK_MUTEX(); + if (mode == QIODevice::NotOpen) + return isOpen(); + if (!isOpen()) { + /*open the port*/ + Posix_File->setFileName(port); + // qDebug("Trying to open File"); + if (Posix_File->open(QIODevice::ReadWrite|QIODevice::Unbuffered)) { + // qDebug("Opened File succesfully"); + /*set open mode*/ + QIODevice::open(mode); + + /*configure port settings*/ + tcgetattr(Posix_File->handle(), &Posix_CommConfig); + + /*set up other port settings*/ + Posix_CommConfig.c_cflag|=CREAD|CLOCAL; + Posix_CommConfig.c_lflag&=(~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|ISIG)); + Posix_CommConfig.c_iflag&=(~(INPCK|IGNPAR|PARMRK|ISTRIP|ICRNL|IXANY)); + Posix_CommConfig.c_oflag&=(~OPOST); + Posix_CommConfig.c_cc[VMIN]=0; + Posix_CommConfig.c_cc[VINTR] = _POSIX_VDISABLE; + Posix_CommConfig.c_cc[VQUIT] = _POSIX_VDISABLE; + Posix_CommConfig.c_cc[VSTART] = _POSIX_VDISABLE; + Posix_CommConfig.c_cc[VSTOP] = _POSIX_VDISABLE; + Posix_CommConfig.c_cc[VSUSP] = _POSIX_VDISABLE; + setBaudRate(Settings.BaudRate); + setDataBits(Settings.DataBits); + setParity(Settings.Parity); + setStopBits(Settings.StopBits); + setFlowControl(Settings.FlowControl); + setTimeout(Settings.Timeout_Millisec); + tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig); + } else { + qDebug("Could not open File! Error code : %d", Posix_File->error()); + } + } + UNLOCK_MUTEX(); + return isOpen(); +} + +/*! +\fn void Posix_QextSerialPort::close() +Closes a serial port. This function has no effect if the serial port associated with the class +is not currently open. +*/ +void Posix_QextSerialPort::close() +{ + LOCK_MUTEX(); + Posix_File->close(); + QIODevice::close(); + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::flush() +Flushes all pending I/O to the serial port. This function has no effect if the serial port +associated with the class is not currently open. +*/ +void Posix_QextSerialPort::flush() +{ + LOCK_MUTEX(); + if (isOpen()) { + Posix_File->flush(); + } + UNLOCK_MUTEX(); +} + +/*! +\fn qint64 Posix_QextSerialPort::size() const +This function will return the number of bytes waiting in the receive queue of the serial port. +It is included primarily to provide a complete QIODevice interface, and will not record errors +in the lastErr member (because it is const). This function is also not thread-safe - in +multithreading situations, use Posix_QextSerialPort::bytesWaiting() instead. +*/ +qint64 Posix_QextSerialPort::size() const +{ + int numBytes; + if (ioctl(Posix_File->handle(), FIONREAD, &numBytes)<0) { + numBytes=0; + } + return (qint64)numBytes; +} + +/*! +\fn qint64 Posix_QextSerialPort::bytesAvailable() +Returns the number of bytes waiting in the port's receive queue. This function will return 0 if +the port is not currently open, or -1 on error. Error information can be retrieved by calling +Posix_QextSerialPort::getLastError(). +*/ +qint64 Posix_QextSerialPort::bytesAvailable() +{ + LOCK_MUTEX(); + if (isOpen()) { + int bytesQueued; + fd_set fileSet; + FD_ZERO(&fileSet); + FD_SET(Posix_File->handle(), &fileSet); + + /*on Linux systems the Posix_Timeout structure will be altered by the select() call. + Make sure we use the right timeout values*/ + //memcpy(&Posix_Timeout, &Posix_Copy_Timeout, sizeof(struct timeval)); + Posix_Timeout = Posix_Copy_Timeout; + int n=select(Posix_File->handle()+1, &fileSet, NULL, &fileSet, &Posix_Timeout); + if (!n) { + lastErr=E_PORT_TIMEOUT; + UNLOCK_MUTEX(); + return -1; + } + if (n==-1 || ioctl(Posix_File->handle(), FIONREAD, &bytesQueued)==-1) { + translateError(errno); + UNLOCK_MUTEX(); + return -1; + } + lastErr=E_NO_ERROR; + UNLOCK_MUTEX(); + return bytesQueued + QIODevice::bytesAvailable(); + } + UNLOCK_MUTEX(); + return 0; +} + +/*! +\fn void Posix_QextSerialPort::ungetChar(char) +This function is included to implement the full QIODevice interface, and currently has no +purpose within this class. This function is meaningless on an unbuffered device and currently +only prints a warning message to that effect. +*/ +void Posix_QextSerialPort::ungetChar(char) +{ + /*meaningless on unbuffered sequential device - return error and print a warning*/ + TTY_WARNING("Posix_QextSerialPort: ungetChar() called on an unbuffered sequential device - operation is meaningless"); +} + +/*! +\fn void Posix_QextSerialPort::translateError(ulong error) +Translates a system-specific error code to a QextSerialPort error code. Used internally. +*/ +void Posix_QextSerialPort::translateError(ulong error) +{ + switch (error) { + case EBADF: + case ENOTTY: + lastErr=E_INVALID_FD; + break; + + case EINTR: + lastErr=E_CAUGHT_NON_BLOCKED_SIGNAL; + break; + + case ENOMEM: + lastErr=E_NO_MEMORY; + break; + } +} + +/*! +\fn void Posix_QextSerialPort::setDtr(bool set) +Sets DTR line to the requested state (high by default). This function will have no effect if +the port associated with the class is not currently open. +*/ +void Posix_QextSerialPort::setDtr(bool set) +{ + LOCK_MUTEX(); + if (isOpen()) { + int status; + ioctl(Posix_File->handle(), TIOCMGET, &status); + if (set) { + status|=TIOCM_DTR; + } + else { + status&=~TIOCM_DTR; + } + ioctl(Posix_File->handle(), TIOCMSET, &status); + } + UNLOCK_MUTEX(); +} + +/*! +\fn void Posix_QextSerialPort::setRts(bool set) +Sets RTS line to the requested state (high by default). This function will have no effect if +the port associated with the class is not currently open. +*/ +void Posix_QextSerialPort::setRts(bool set) +{ + LOCK_MUTEX(); + if (isOpen()) { + int status; + ioctl(Posix_File->handle(), TIOCMGET, &status); + if (set) { + status|=TIOCM_RTS; + } + else { + status&=~TIOCM_RTS; + } + ioctl(Posix_File->handle(), TIOCMSET, &status); + } + UNLOCK_MUTEX(); +} + +/*! +\fn unsigned long Posix_QextSerialPort::lineStatus() +returns the line status as stored by the port function. This function will retrieve the states +of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines +can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned +long with specific bits indicating which lines are high. The following constants should be used +to examine the states of individual lines: + +\verbatim +Mask Line +------ ---- +LS_CTS CTS +LS_DSR DSR +LS_DCD DCD +LS_RI RI +LS_RTS RTS (POSIX only) +LS_DTR DTR (POSIX only) +LS_ST Secondary TXD (POSIX only) +LS_SR Secondary RXD (POSIX only) +\endverbatim + +This function will return 0 if the port associated with the class is not currently open. +*/ +unsigned long Posix_QextSerialPort::lineStatus() +{ + unsigned long Status=0, Temp=0; + LOCK_MUTEX(); + if (isOpen()) { + ioctl(Posix_File->handle(), TIOCMGET, &Temp); + if (Temp&TIOCM_CTS) { + Status|=LS_CTS; + } + if (Temp&TIOCM_DSR) { + Status|=LS_DSR; + } + if (Temp&TIOCM_RI) { + Status|=LS_RI; + } + if (Temp&TIOCM_CD) { + Status|=LS_DCD; + } + if (Temp&TIOCM_DTR) { + Status|=LS_DTR; + } + if (Temp&TIOCM_RTS) { + Status|=LS_RTS; + } + if (Temp&TIOCM_ST) { + Status|=LS_ST; + } + if (Temp&TIOCM_SR) { + Status|=LS_SR; + } + } + UNLOCK_MUTEX(); + return Status; +} + +/*! +\fn qint64 Posix_QextSerialPort::readData(char * data, qint64 maxSize) +Reads a block of data from the serial port. This function will read at most maxSize bytes from +the serial port and place them in the buffer pointed to by data. Return value is the number of +bytes actually read, or -1 on error. + +\warning before calling this function ensure that serial port associated with this class +is currently open (use isOpen() function to check if port is open). +*/ +qint64 Posix_QextSerialPort::readData(char * data, qint64 maxSize) +{ + LOCK_MUTEX(); + int retVal=0; + retVal=Posix_File->read(data, maxSize); + if (retVal==-1) + lastErr=E_READ_FAILED; + UNLOCK_MUTEX(); + + return retVal; +} + +/*! +\fn qint64 Posix_QextSerialPort::writeData(const char * data, qint64 maxSize) +Writes a block of data to the serial port. This function will write maxSize bytes +from the buffer pointed to by data to the serial port. Return value is the number +of bytes actually written, or -1 on error. + +\warning before calling this function ensure that serial port associated with this class +is currently open (use isOpen() function to check if port is open). +*/ +qint64 Posix_QextSerialPort::writeData(const char * data, qint64 maxSize) +{ + LOCK_MUTEX(); + int retVal=0; + retVal=Posix_File->write(data, maxSize); + if (retVal==-1) + lastErr=E_WRITE_FAILED; + UNLOCK_MUTEX(); + + return retVal; +} diff --git a/posix_qextserialport.h b/posix_qextserialport.h new file mode 100644 index 0000000..2c0ebe8 --- /dev/null +++ b/posix_qextserialport.h @@ -0,0 +1,63 @@ +#ifndef _POSIX_QEXTSERIALPORT_H_ +#define _POSIX_QEXTSERIALPORT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include "qextserialbase.h" + +class Posix_QextSerialPort:public QextSerialBase +{ + private: + /*! + * This method is a part of constructor. + */ + void init(); + + protected: + QFile* Posix_File; + struct termios Posix_CommConfig; + struct timeval Posix_Timeout; + struct timeval Posix_Copy_Timeout; + + virtual qint64 readData(char * data, qint64 maxSize); + virtual qint64 writeData(const char * data, qint64 maxSize); + + public: + Posix_QextSerialPort(); + Posix_QextSerialPort(const Posix_QextSerialPort& s); + Posix_QextSerialPort(const QString & name, QextSerialBase::QueryMode mode = QextSerialBase::Polling); + Posix_QextSerialPort(const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling); + Posix_QextSerialPort(const QString & name, const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling); + Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s); + virtual ~Posix_QextSerialPort(); + + virtual void setBaudRate(BaudRateType); + virtual void setDataBits(DataBitsType); + virtual void setParity(ParityType); + virtual void setStopBits(StopBitsType); + virtual void setFlowControl(FlowType); + virtual void setTimeout(long); + + virtual bool open(OpenMode mode); + virtual void close(); + virtual void flush(); + + virtual qint64 size() const; + virtual qint64 bytesAvailable(); + + virtual void ungetChar(char c); + + virtual void translateError(ulong error); + + virtual void setDtr(bool set=true); + virtual void setRts(bool set=true); + virtual ulong lineStatus(); + +}; + +#endif diff --git a/print_net.cpp b/print_net.cpp new file mode 100644 index 0000000..f4f9b66 --- /dev/null +++ b/print_net.cpp @@ -0,0 +1,458 @@ +#include "print_net.h" +#include "QDebug" +#include +#include +#include "LogInfo.h" + +#define QT_NO_SSL + + +PrintNet::PrintNet() +{ + m_bShortNet = false; + // 创建网络管理器用于GET method + this->getManager = new QNetworkAccessManager(this); + connect(getManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(replyFinished(QNetworkReply *))); + // 创建网络管理器用于POST method + this->postManager = new QNetworkAccessManager(this); + connect(postManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(postPrintFinished(QNetworkReply *))); + + m_postmanager = new QNetworkAccessManager(this); + connect(m_postmanager, SIGNAL(finished(QNetworkReply *)), this, SLOT(postGetShortUrlFinished(QNetworkReply *))); +} + +PrintNet::~PrintNet() +{ + delete this->getManager; + delete this->postManager; +} + +// 初步实现 喷码机向服务器获取打印数据 以及 上报状态 接口 +// 未处理 网络条件不具备 / 访问超时 等异常 + +// 递归列出JSON所有层内容 +void PrintNet::traversJson(QJsonObject json_obj) +{ + foreach (const QString& key, json_obj.keys()) + { + QJsonValue value = json_obj.value(key); + if (!value.isObject()) + { +// qDebug()<<"[traversJson]key="<',">").replace('"',""").replace('\'',"'") + .replace('¥',"¥").replace('®',"®").replace('°',"°").replace('±',"±").replace('×',"x") + .replace('*',"*").replace('÷',"÷").replace('²',"²").replace('³',"³").replace('Ω',"Ω") + .replace('Φ',"Φ").replace('¥',"¥").replace('φ',"φ").replace('©',"©").replace('@',"@") + .replace('㎡',"㎡").replace('℃',"℃").replace('℉',"℉").replace('\r',' ').replace('\n',' ') ; +// const char *std_str = t_str.toStdString().data(); +// strcpy(Json_get_data.PrintingContent,std_str); + strncpy(Json_get_data.PrintingContent,t_str.toStdString().c_str(),sizeof(Json_get_data.PrintingContent)); + Json_get_data.PrintingContent[sizeof(Json_get_data.PrintingContent) -1] = '\0'; + }else + if(key == "ProductPlanQty"){ + Json_get_data.ProductPlanQty = value.toDouble(); + }else + if(key == "ProductUniqueCode"){ + QString t_str; + t_str = value.toString(); +// const char *std_str = t_str.toStdString().data(); +// strcpy(Json_get_data.ProductUniqueCode,std_str); + strncpy(Json_get_data.ProductUniqueCode,t_str.toStdString().c_str(),sizeof(Json_get_data.ProductUniqueCode)); + Json_get_data.ProductUniqueCode[sizeof(Json_get_data.ProductUniqueCode) -1] = '\0'; + LogInfo::setRunStatusText(tr("获取数字码:")); + LogInfo::setRunStatusText(QString(t_str.toStdString().c_str())); + }else + if(key == "ProductionTask"){ + Json_get_data.ProductionTask = value.toDouble(); + }else + if(key == "StartMetre"){ + Json_get_data.StartMetre = value.toDouble(); + }else + if(key == "TasdNeedConfirm"){ + Json_get_data.TasdNeedConfirm = value.toBool(); + }else + if(key == "TaskSwitchingMode"){ + Json_get_data.TaskSwitchingMode = value.toDouble(); + } + } + else + { + traversJson(value.toObject()); + } + } +} + +void PrintNet::postPrintFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError error; + error = reply->error(); // 应答无错误时为QNetworkReply::NoError(0) + if (error) + { // 非0值表示有错误发生 + switch(error) + { + case QNetworkReply::ConnectionRefusedError: + save_messege = "远程主机拒绝连接"; + break; + + case QNetworkReply::RemoteHostClosedError: + save_messege = "远程主机关闭连接"; + break; + + case QNetworkReply::HostNotFoundError: + save_messege = "远程主机未找到"; + break; + + case QNetworkReply::TimeoutError: + save_messege = "连接到远程主机超时"; + break; + + case QNetworkReply::ContentAccessDenied: + save_messege = "远程主机拒绝访问"; + break; + + case QNetworkReply::ContentNotFoundError: + save_messege = "内容未找到"; + break; + default: + save_messege = "通信失败"; + } + emit json_server_error(); + return; + } + + //未出错时获取响应信息 + QByteArray rsp_data = reply->readAll(); + //以下对获取的JSON数据进行解析 + QJsonDocument json = QJsonDocument::fromJson(rsp_data); + + QJsonObject obj = json.object(); + + traversJson(obj); // 递归列出JSON所有层内容 +// qDebug() << "[postPrintFinished]ResultCode: " << obj["ResultCode"]; +// qDebug() << "[postPrintFinished]ResultMessage: " << obj["ResultMessage"]; +// qDebug() << "[postPrintFinished]ResultData: " << obj["ResultData"]; + + save_messege = obj["ResultMessage"].toString(); + + reply->deleteLater(); +} + +QString PrintNet::getMessege() +{ + return save_messege; +} +// 处理HTTP请求的应答 +void PrintNet::replyFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError error; + error = reply->error(); // 应答无错误时为QNetworkReply::NoError(0) + if (error) + { // 非0值表示有错误发生 + switch(error) + { + case QNetworkReply::ConnectionRefusedError: + save_messege = "远程主机拒绝连接"; + break; + + case QNetworkReply::RemoteHostClosedError: + save_messege = "远程主机关闭连接"; + break; + + case QNetworkReply::HostNotFoundError: + save_messege = "远程主机未找到"; + break; + + case QNetworkReply::TimeoutError: + save_messege = "连接到远程主机超时"; + break; + + case QNetworkReply::ContentAccessDenied: + save_messege = "远程主机拒绝访问"; + break; + + case QNetworkReply::ContentNotFoundError: + save_messege = "内容未找到"; + break; + default: + save_messege = "通信失败"; + } + + emit json_server_error(); + return; + } + //未出错时获取响应信息 + QByteArray rsp_data = reply->readAll(); + //以下对获取的JSON数据进行解析 + QJsonDocument json = QJsonDocument::fromJson(rsp_data); + QJsonObject obj = json.object(); + traversJson(obj); // 递归列出JSON所有层内容 + +// qDebug() << "[replyFinished] ResultCode: " << obj["ResultCode"]; +// qDebug() << "[replyFinished] ResultMessage: " << obj["ResultMessage"]; +// qDebug() << "[replyFinished] ResultData: " << obj["ResultData"]; + + save_messege = obj["ResultMessage"].toString(); + + reply->deleteLater(); + save_messege = "JSON获取成功!"; + emit showMessege(); + if(m_bShortNet) + { + FromBaiDuGetShortUrl(Json_get_data.QRCodeContent); + } + else + { + emit receiveJSONDatafinish(); + } +} + +// 从服务器获取打印数据 +// url - 提供打印数据的服务器链接 +// equip_code - 喷码机编号 +void PrintNet::PrintNetGetData(QString url, const QString& equip_code) +{ + EquipmentCode = equip_code; + //设计本接口实现时,考虑输入的url为问号(?)之前那部分,不同的喷码机equip_code不同 + //QUrl qrl("http://47.111.170.144:8754/KLAPS/APSServer/ECode/GetProductUniqueCodeTest?EquipmentCode=1"); + QUrl qrl(url); + // 在访问服务器API的链接中添加喷码机编号 + //qrl.addQueryItem("EquipmentCode", QString::number(equip_code)); + qrl.addQueryItem("EquipmentCode", equip_code); + + //QUrlQuery query; + //query.addQueryItem("EquipmentCode", QString::number(equip_code)); + //qrl.setQuery(query); + + // 构造请求 + QNetworkRequest request; + request.setUrl(qrl); + + getManager->get(request); // HTTP GET +} + +// 向服务器上报打印完成状态 +// url - 上报打印完成状态的服务器链接 +void PrintNet::PrintNetPostFinish(QString url) +{ + QUrl qrl(url); + + + // 构造JSON对象数据 + QJsonObject json; + json.insert("ProductUniqueCode", QString(Json_get_data.ProductUniqueCode)); + json.insert("ProductionTask", QString::number(Json_get_data.ProductionTask)); + json.insert("PrintingContent", QString(Json_get_data.PrintingContent)); + //json.insert("EquipmentUniqueCode", QString::number(EquipmentCode) ); + json.insert("EquipmentUniqueCode", EquipmentCode ); + json.insert("StartingMeters", QString::number(Json_get_data.StartMetre)); + json.insert("ProductNumber", QString::number(Json_get_data.ProductPlanQty)); + json.insert("Coordinates", QString("北纬N31°51′15.36 东经E117°12′8.77")); +// qDebug() << json; + + QJsonDocument jsonDoc(json); +// qDebug() << jsonDoc; + + QByteArray jsonData = jsonDoc.toJson(); +// qDebug() << jsonData; + + QNetworkRequest request; + request.setUrl(qrl); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + postManager->post(request, jsonData); // HTTP POST +} + +// 向服务器上报设备运行状态 +// url - 上报设备运行状态的服务器链接 + +void PrintNet::PrintNetPostState(QString url) +{ + QUrl qrl(url); + + // 构造JSON对象数据 + QJsonObject json; + //json.insert("EquipmentUniqueCode", QString::number(EquipmentCode)); + json.insert("EquipmentUniqueCode", EquipmentCode ); + json.insert("CurrentMeter", QString("13.3")); + json.insert("CurrentEcode", QString(Json_get_data.ProductUniqueCode)); + json.insert("CurrentPrintingContent", QString(Json_get_data.PrintingContent)); +// qDebug() << json; + + QJsonDocument jsonDoc(json); +// qDebug() << jsonDoc; + + QByteArray jsonData = jsonDoc.toJson(); +// qDebug() << jsonData; + + QNetworkRequest request; + request.setUrl(qrl); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + postManager->post(request, jsonData); // HTTP POST +} + +// 向百度云获取转换的短网址 +//longUrl要转换的长url + +void PrintNet::FromBaiDuGetShortUrl(QString longUrl) +{ + QUrl qrl(QString("https://dwz.cn/api/v3/short-urls")); + + // 构造JSON对象数据 + QJsonObject json; + json.insert("LongUrl", longUrl); + json.insert("TermOfValidity", QString("long-term")); + //json.insert("CurrentEcode", QString(Json_get_data.ProductUniqueCode)); + //json.insert("CurrentPrintingContent", QString(Json_get_data.PrintingContent)); + //qDebug() << json; + + QJsonArray Arrjson; + Arrjson.append(json); + + QJsonDocument jsonDoc(Arrjson); + //qDebug() << jsonDoc; + + QByteArray jsonData = jsonDoc.toJson(); + //qDebug() << jsonData; + + + //LogInfo::setRunStatusText(tr("FromBaiDuGetShortUrl(): setSsl before")); + QNetworkRequest request; + request.setUrl(qrl); + //LogInfo::setRunStatusText(tr("defaultConfiguration new before")); + QSslConfiguration config = QSslConfiguration::defaultConfiguration(); + //LogInfo::setRunStatusText(tr("defaultConfiguration 1")); + config.setProtocol(QSsl::TlsV1); + //LogInfo::setRunStatusText(tr("defaultConfiguration 2")); + config.setPeerVerifyMode(QSslSocket::VerifyNone); + //LogInfo::setRunStatusText(tr("defaultConfiguration 3")); + request.setSslConfiguration(config); + //LogInfo::setRunStatusText(tr("FromBaiDuGetShortUrl(): setSsl after")); + + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json; charset=UTF-8"); + request.setRawHeader("Dwz-Token" ,"708e8736a533df553a8898699280bcf9"); + + //LogInfo::setRunStatusText(tr("FromBaiDuGetShortUrl(): <1>")); + //QNetworkAccessManager *post_manager = new QNetworkAccessManager(this); + //connect(post_manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(postGetShortUrlFinished(QNetworkReply *))); + m_postmanager->post(request, jsonData); // HTTP POST + //LogInfo::setRunStatusText(tr("FromBaiDuGetShortUrl(): <2>")); + //connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onNetReplyError(QNetworkReply::NetworkError))); + //connect(reply, SIGNAL(sslErrors(QList&)), this, SLOT(onNetReplySshErrors(QList&))); +#ifndef QT_NO_SSL + connect(post_manager, SIGNAL(sslErrors(QNetworkReply*,QList)), + this, SLOT(sslErrors(QNetworkReply*,QList))); +#endif + +} +#ifndef QT_NO_SSL +void PrintNet::sslErrors(QNetworkReply *reply,const QList &) +{ + reply->ignoreSslErrors(); +} +#endif + +void PrintNet::postGetShortUrlFinished(QNetworkReply *reply) +{ + //LogInfo::setRunStatusText(tr("postGetShortUrlFinished(): <3>")); + QNetworkReply::NetworkError error; + error = reply->error(); // 应答无错误时为QNetworkReply::NoError(0) + if (error) + { // 非0值表示有错误发生 + switch(error) + { + case QNetworkReply::ConnectionRefusedError: + save_messege = "远程主机拒绝连接"; + break; + + case QNetworkReply::RemoteHostClosedError: + save_messege = "远程主机关闭连接"; + break; + + case QNetworkReply::HostNotFoundError: + save_messege = "远程主机未找到"; + break; + + case QNetworkReply::TimeoutError: + save_messege = "连接到远程主机超时"; + break; + + case QNetworkReply::ContentAccessDenied: + save_messege = "远程主机拒绝访问"; + break; + + case QNetworkReply::ContentNotFoundError: + save_messege = "内容未找到"; + break; + default: + save_messege = "通信失败"; + } + //LogInfo::setRunStatusText(tr("postGetShortUrlFinished(): <4>")); + emit json_server_error(); + //emit receiveJSONDatafinish(); + return; + } + + //未出错时获取响应信息 + QByteArray rsp_data = reply->readAll(); + //以下对获取的JSON数据进行解析 + QJsonDocument json = QJsonDocument::fromJson(rsp_data); + //qDebug() << json; + + QJsonObject obj = json.object(); + // qDebug() << obj; + + QString strResultCode; + save_messege = strResultCode.number(obj["Code"].toDouble()); + if(save_messege != "0") + { + //LogInfo::setRunStatusText(tr("postGetShortUrlFinished(): <5>")); + //emit receiveJSONDatafinish(); + save_messege = "获取短网址出错,错误码:"+ save_messege; + return; + } + QJsonArray JsonArr = obj["ShortUrls"].toArray(); + QJsonValue value = JsonArr.at(0); + QJsonObject jsonObj = value.toObject(); +#if 1 + foreach (const QString& key, jsonObj.keys()) + { + QJsonValue value = jsonObj.value(key); + if (!value.isObject()) + { +// qDebug()<<"[traversJson]key="<")); + reply->deleteLater(); + emit receiveJSONDatafinish(); +} + + +void PrintNet::getJson_data(JSON_DATA *json_data) +{ + memcpy(json_data, &Json_get_data, sizeof(JSON_DATA)); +} diff --git a/print_net.h b/print_net.h new file mode 100644 index 0000000..d1fc790 --- /dev/null +++ b/print_net.h @@ -0,0 +1,56 @@ +#ifndef PRINT_NET_H +#define PRINT_NET_H + +#include + +#include +#include +#include +#include +#include + +#include "qjsonexport.h" +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsondocument.h" +#include "qjsonarray.h" +#include "../SysPara.h" + + +class PrintNet : public QObject +{ +Q_OBJECT + QNetworkAccessManager *manager; +private slots: + void replyFinished(QNetworkReply *); + void postPrintFinished(QNetworkReply *); + void postGetShortUrlFinished(QNetworkReply *); + // void sslErrors(QNetworkReply *reply,const QList &); + +Q_SIGNALS: + void receiveJSONDatafinish(); + void json_server_error(); + void showMessege(); +public: + PrintNet(); + ~PrintNet(); + void PrintNetGetData(QString url, const QString& equip_code); + void PrintNetPostFinish(QString url); + void PrintNetPostState(QString url); + void traversJson(QJsonObject json_obj); + void getJson_data(JSON_DATA *json_data); + QString getMessege(); + void FromBaiDuGetShortUrl(QString longUrl); + + JSON_DATA Json_get_data; + bool m_bShortNet; +private: + QNetworkAccessManager *getManager; + QNetworkAccessManager *postManager; + QNetworkAccessManager *m_postmanager; + QString EquipmentCode; + QString save_messege; + +}; + +#endif // PRINT_NET_H diff --git a/printsetting.ui b/printsetting.ui new file mode 100644 index 0000000..26ea045 --- /dev/null +++ b/printsetting.ui @@ -0,0 +1,3514 @@ + + + PrintSetting + + + true + + + + 0 + 0 + 708 + 440 + + + + + 0 + 90 + + + + Qt::ClickFocus + + + Form + + + + QLayout::SetDefaultConstraint + + + + + 6 + + + 0 + + + 0 + + + + + + 0 + 35 + + + + + 250 + 16777215 + + + + Qt::LeftToRight + + + 输入密码 + + + + + + + + 100 + 0 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 15 + 16777215 + + + + + false + + + + Qt::NoFocus + + + 墨线时间 + + + + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 16777215 + 16 + + + + 0 + + + Qt::AlignCenter + + + + + + + 墨线时间: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 开机次数: + + + + + + + + 120 + 0 + + + + + 16777215 + 16 + + + + 0 + + + Qt::AlignCenter + + + + + + + + + + 0 + 35 + + + + + 250 + 16777215 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + Qt::LeftToRight + + + 应用当前配置 + + + + :/icon/apply.png:/icon/apply.png + + + + + + + + + + 0 + 0 + + + + + 0 + 370 + + + + + 16777215 + 16777215 + + + + 6 + + + + 常用设置 + + + + + + QLayout::SetDefaultConstraint + + + + + TextLabel + + + + + + + + 0 + 37 + + + + + 16777215 + 25 + + + + 打印模式: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 25 + + + + 字体宽度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 25 + + + + 首行电压(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 25 + + + + 字体加粗: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 5 + + + 50 + + + + + + + + 0 + 37 + + + + 0 + + + 100 + + + 75 + + + + + + + + 0 + 37 + + + + QComboBox QAbstractItemView::item +{ min-height: 25px;} + + + + 快速 + + + + + 标准 + + + + + 慢速1 + + + + + 慢速2 + + + + + 慢速3 + + + + + 慢速4 + + + + + 慢速5 + + + + + 慢速6 + + + + + 慢速7 + + + + + 慢速8 + + + + + 慢速9 + + + + + + + + + 16777215 + 25 + + + + 字高设置(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 30 + + + 75 + + + + + + + + 0 + 37 + + + + 16777215 + + + + + + + + 16777215 + 25 + + + + 行末电压(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + Qt::ImhDigitsOnly + + + 0 + + + 20 + + + 1 + + + 0 + + + + + + + + 0 + 37 + + + + 修改授权 + + + + + + + + + 0 + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 回收故障处理 + + + false + + + false + + + false + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 超速暂停打印 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 自然数计米 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 信息上下颠倒 + + + + :/icon/updown.png:/icon/updown.png + + + + + + + + 0 + 37 + + + + + 120 + 16777215 + + + + Qt::RightToLeft + + + 相位故障关机 + + + + + + + + 0 + 37 + + + + + 120 + 16777215 + + + + Qt::RightToLeft + + + 相位故障不打印 + + + + + + + + 0 + 37 + + + + + 120 + 16777215 + + + + Qt::RightToLeft + + + 故障停止走米 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 信息左右颠倒 + + + + :/icon/leftright.png:/icon/leftright.png + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 不打印走米 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 省点 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 电眼误触禁止 + + + + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 高压故障关回收槽 + + + + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 调整电压 + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 字形优化 + + + + + + + + + + 高级设置 + + + + + 0 + 0 + 611 + 254 + + + + + + + false + + + + 0 + 37 + + + + 交替扫描隔点(默认为1): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + 冗点比例(默认为0%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + 点距调整值(默认为0): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + Qt::ImhDigitsOnly + + + 1 + + + 40 + + + 1 + + + 1 + + + + + + + false + + + + 0 + 37 + + + + 行末调整点模式: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 调整电压 + + + + + + + false + + + + 0 + 37 + + + + 行末调整点数(默认为0): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + + 快速 + + + + + 标准 + + + + + 慢速1 + + + + + 慢速2 + + + + + 慢速3 + + + + + 慢速4 + + + + + 慢速5 + + + + + 慢速6 + + + + + 慢速7 + + + + + 慢速8 + + + + + 慢速9 + + + + + + + + false + + + + 0 + 37 + + + + 行末点微调(‰): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + 点距调整电压位置: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + -2000 + + + 2000 + + + 0 + + + + + + + false + + + + 0 + 37 + + + + Qt::ImhDigitsOnly + + + 0 + + + 60 + + + 1 + + + 0 + + + + + + + false + + + + 0 + 37 + + + + Qt::RightToLeft + + + 扫描颠倒 + + + + + + + false + + + + 0 + 37 + + + + + 懒惰模式 + + + + + 贪婪模式 + + + + + 均衡模式 + + + + + + + + false + + + + 0 + 37 + + + + -200 + + + 200 + + + 0 + + + + + + + false + + + + 0 + 37 + + + + 去除冗点模式(默认懒惰): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + 0 + + + 50 + + + + + + + false + + + + 0 + 37 + + + + Qt::ImhDigitsOnly + + + 0 + + + 40 + + + 1 + + + 0 + + + + + + + + + 高级设置 + + + + + 9 + 103 + 668 + 16 + + + + Qt::Horizontal + + + + + + 9 + 325 + 668 + 16 + + + + Qt::Horizontal + + + + + + 0 + 0 + 410 + 82 + + + + + + + + 0 + 37 + + + + 使用推荐设置 + + + + + + + + 0 + 37 + + + + + 快 + + + + + 标准 + + + + + 慢速1 + + + + + 慢速2 + + + + + + + + + + + + + + + + 0 + 37 + + + + 锁定脉冲计数 + + + + + + + false + + + + 0 + 37 + + + + 每条信息只打印一次 + + + + + + + + 127 + 37 + + + + 高速模式 + + + + + + + + 0 + 37 + + + + + 电线电缆 + + + + + 制药/食品/电子 + + + + + 建筑管材 + + + + + 其他 + + + + + + + + + + 10 + 110 + 581 + 211 + + + + + + + + 0 + 37 + + + + 不检测喷头盖 + + + + + + + + 0 + 37 + + + + 非字宽 + + + true + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 使用齿轮泵 + + + + + + + + 0 + 37 + + + + 复位发送打印数据 + + + + + + + 齿轮泵转速预警值 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 高压阈值: + + + + + + + false + + + + 0 + 37 + + + + 300 + + + 5000 + + + 10 + + + + + + + + 0 + 37 + + + + 导出随机码文本 + + + + + + + + 0 + 37 + + + + 交替扫描隔点(默认为1): + + + + + + + + 0 + 37 + + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 扫描颠倒 + + + + + + + + 0 + 37 + + + + 冗点比例(默认为0%): + + + + + + + + 0 + 37 + + + + + + + + + 0 + 37 + + + + Qt::RightToLeft + + + 打印时绿灯常亮 + + + + + + + + 16777215 + 37 + + + + 1000 + + + 2000 + + + 10 + + + + + + + + 16777215 + 37 + + + + Qt::RightToLeft + + + 使用回收泵 + + + + + + + + + 计数器设置 + + + + + 0 + 0 + 681 + 201 + + + + + 0 + 0 + + + + + 0 + 100 + + + + + 16777215 + 350 + + + + 1 + + + + 计数器1设置 + + + + + 0 + 20 + 539 + 127 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 起始值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 9999999 + + + 1 + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 结束值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 80 + 37 + + + + 9999999 + + + 9999 + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 重复数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 1 + + + 65535 + + + + + + + + 0 + 37 + + + + 增量值: + + + + + + + + 0 + 37 + + + + Qt::ImhDigitsOnly + + + -49999999 + + + 49999999 + + + 1 + + + + + + + 当前值: + + + + + + + false + + + + 0 + 37 + + + + 0 + + + 99999999 + + + 1 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 重设值 + + + + + + + + + + 0 + 0 + + + + + 0 + 37 + + + + 可变长度 + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 37 + + + + 清零 + + + + + + + + + + Qt::AlignCenter + + + + + + + + + 540 + 30 + 71 + 111 + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + 计数器2设置 + + + + + 0 + 20 + 548 + 125 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 起始值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 999999 + + + 1 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 结束值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 80 + 37 + + + + 9999999 + + + 9999 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 重复数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 1 + + + 65535 + + + + + + + + 0 + 37 + + + + 增量值: + + + + + + + + 0 + 37 + + + + -49999999 + + + 49999999 + + + 1 + + + + + + + + 0 + 37 + + + + 当前值: + + + + + + + false + + + + 0 + 37 + + + + 0 + + + 999999999 + + + 1 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 重设值 + + + + + + + + 0 + 37 + + + + 清零 + + + + + + + true + + + + 11 + + + + Qt::LeftToRight + + + + + + Qt::AlignCenter + + + + + + + + + 计数器3设置 + + + + + 0 + 20 + 549 + 125 + + + + + + + + 0 + 37 + + + + QRadioButton::indicator { +width: 25px; +height: 25px; +} + + + 当前值: + + + + + + + Qt::LeftToRight + + + 重复数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::LeftToRight + + + 结束值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 增量值: + + + + + + + false + + + + 0 + 37 + + + + 0 + + + 999999999 + + + 1 + + + + + + + + 0 + 33 + + + + Qt::LeftToRight + + + + + + 重设值 + + + + + + + + 0 + 0 + + + + + 0 + 37 + + + + -49999999 + + + 49999999 + + + 1 + + + + + + + + 0 + 37 + + + + 1 + + + 65535 + + + + + + + + 0 + 37 + + + + 999999 + + + 1 + + + + + + + + 0 + 0 + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 起始值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 80 + 37 + + + + 9999999 + + + 9999 + + + + + + + + 0 + 37 + + + + 清零 + + + + + + + true + + + + 11 + + + + Qt::LeftToRight + + + + + + Qt::AlignCenter + + + + + + + + + 跳米设置 + + + + + 10 + 10 + 435 + 82 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 起始值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 105 + 37 + + + + 65535 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 结束值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 105 + 37 + + + + 65535 + + + 999 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 增量值: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 0 + + + 65535 + + + 1 + + + + + + + true + + + + 0 + 37 + + + + Qt::LeftToRight + + + 跳米数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + 0 + 37 + + + + 0 + + + 999999999 + + + 1 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 跳米打印 + + + + + + + + + + + 0 + 200 + 531 + 125 + + + + + + + true + + + + 100 + 0 + + + + 计数器2 + + + false + + + + + + + true + + + + 100 + 0 + + + + 计数器3 + + + false + + + + + + + true + + + + 100 + 37 + + + + 计数器1 + + + false + + + + + + + date time + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + QComboBox QAbstractItemView::item +{ min-height: 25px;} + + + QComboBox::AdjustToContents + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + + ddhhmm + + + + + dd MM yy + + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + + + + + 0 + 0 + + + + 复位到起始值 + + + + + + + Qt::LeftToRight + + + 有效期(天): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 9999 + + + 0 + + + + + + + + 0 + 0 + + + + 计数器保存关机值 + + + + + + + + + 交替打印设置 + + + + + 11 + 56 + 551 + 211 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 重复次数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 2 + + + 65535 + + + 100 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 起始位置: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 37 + + + + 1 + + + 65535 + + + 1 + + + + + + + 距离尾部(mm): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::LeftToRight + + + 特殊变量结束值: + + + Qt::AlignCenter + + + + + + + false + + + + 0 + 0 + + + + Qt::RightToLeft + + + 特殊条件计数 + + + + + + + + 0 + 37 + + + + + 无交替 + + + + + 普通交替 + + + + + 电眼触发交替 + + + + + 首尾交替 + + + + + + + + + 0 + 37 + + + + 1 + + + 65535 + + + 50 + + + + + + + + 0 + 37 + + + + Qt::LeftToRight + + + 交替间隔: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 37 + + + + 1 + + + 255 + + + + + + + false + + + + 0 + 0 + + + + + 0 + 37 + + + + + + + + 特殊变量起始值: + + + + + + + false + + + + 0 + 37 + + + + + + + + false + + + + 0 + 37 + + + + + 打印 + + + + + + + + + + 其它设置 + + + + + 322 + 10 + 16 + 16 + + + + + + + + + + 170 + 10 + 16 + 16 + + + + + + + + + + 10 + 10 + 186 + 84 + + + + + + + 更换信息文件时执行的动作: + + + + + + + Qt::LeftToRight + + + 产品计数器自动清0 + + + + + + + Qt::LeftToRight + + + 总产品计数器自动清0 + + + + + + + + + 10 + 90 + 206 + 71 + + + + + + + 外接显示屏: + + + + + + + + 无 + + + + + 小屏 + + + + + 大屏 + + + + + + + + + 总产品计数值 + + + + + 计数器1 + + + + + 计数器2 + + + + + + + + 显示屏显示: + + + + + + + + + 270 + 0 + 121 + 22 + + + + 分段计米 + + + + + + 220 + 50 + 321 + 164 + + + + true + + + 0 + + + 4 + + + false + + + 80 + + + true + + + 18 + + + true + + + 30 + + + + + + + + + + 310 + 20 + 85 + 27 + + + + 插 入 + + + + + + 220 + 20 + 85 + 27 + + + + 添 加 + + + + + + 490 + 20 + 85 + 27 + + + + 全部删除 + + + + + + 400 + 20 + 85 + 27 + + + + 删 除 + + + + + + 10 + 160 + 201 + 51 + + + + 米标显示 + + + + + + 550 + 60 + 51 + 51 + + + + 上移 + + + + + + 550 + 120 + 51 + 51 + + + + 下移 + + + + + + 打印电压缩放 + + + + + 20 + 30 + 155 + 39 + + + + + + + + 0 + 37 + + + + 整体缩放(%) : + + + + + + + + 0 + 37 + + + + 40 + + + 150 + + + 100 + + + + + + + + + + + + + + + diff --git a/pulsenumfix.ui b/pulsenumfix.ui new file mode 100644 index 0000000..17045f9 --- /dev/null +++ b/pulsenumfix.ui @@ -0,0 +1,231 @@ + + + PulseNumFix + + + + 0 + 0 + 481 + 228 + + + + Qt::StrongFocus + + + Dialog + + + + + 240 + 180 + 221 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 461 + 177 + + + + + 4 + + + 4 + + + 4 + + + + + + + 根据速度 + + + + + + + 根据喷印 + + + true + + + + + + + 根据脉冲数 + + + + + + + 根据同步器参数 + + + + + + + + + + + + + 实际皮带速度(毫米/秒): + + + + + + + Qt::ImhNone + + + + + + + + + + + 实际喷印间隔长度(毫米): + + + + + + + Qt::ImhNone + + + + + + + + + + + 长度(毫米): + + + + + + + Qt::ImhNone + + + + + + + 同步脉冲数 + + + + + + + Qt::ImhNone + + + + + + + + + + + 同步器直径(毫米): + + + + + + + Qt::ImhNone + + + + + + + 脉冲数/转: + + + + + + + Qt::ImhNone + + + + + + + + + + + + + + buttonBox + accepted() + PulseNumFix + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PulseNumFix + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/qextserialbase.cpp b/qextserialbase.cpp new file mode 100644 index 0000000..4c77fb7 --- /dev/null +++ b/qextserialbase.cpp @@ -0,0 +1,226 @@ +#include "qextserialbase.h" + +/*! +\fn QextSerialBase::QextSerialBase() +Default constructor. +*/ +QextSerialBase::QextSerialBase() + : QIODevice() +{ + +#ifdef _TTY_WIN_ + setPortName("COM1"); + +#elif defined(_TTY_IRIX_) + setPortName("/dev/ttyf1"); + +#elif defined(_TTY_HPUX_) + setPortName("/dev/tty1p0"); + +#elif defined(_TTY_SUN_) + setPortName("/dev/ttya"); + +#elif defined(_TTY_DIGITAL_) + setPortName("/dev/tty01"); + +#elif defined(_TTY_FREEBSD_) + setPortName("/dev/ttyd1"); + +#else + setPortName("/dev/ttyS0"); +#endif + + construct(); +} + +/*! +\fn QextSerialBase::QextSerialBase(const QString & name) +Construct a port and assign it to the device specified by the name parameter. +*/ +QextSerialBase::QextSerialBase(const QString & name) + : QIODevice() +{ + setPortName(name); + construct(); +} + +/*! +\fn QextSerialBase::~QextSerialBase() +Standard destructor. +*/ +QextSerialBase::~QextSerialBase() +{ + delete mutex; +} + +/*! +\fn void QextSerialBase::construct() +Common constructor function for setting up default port settings. +(115200 Baud, 8N1, Hardware flow control where supported, otherwise no flow control, and 0 ms timeout). +*/ +void QextSerialBase::construct() +{ + Settings.BaudRate=BAUD115200; + Settings.DataBits=DATA_8; + Settings.Parity=PAR_NONE; + Settings.StopBits=STOP_1; + Settings.FlowControl=FLOW_HARDWARE; + Settings.Timeout_Millisec=500; + mutex = new QMutex( QMutex::Recursive ); + setOpenMode(QIODevice::NotOpen); +} + +void QextSerialBase::setQueryMode(QueryMode mechanism) +{ + _queryMode = mechanism; +} + +/*! +\fn void QextSerialBase::setPortName(const QString & name) +Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0". +*/ +void QextSerialBase::setPortName(const QString & name) +{ + port = name; +} + +/*! +\fn QString QextSerialBase::portName() const +Returns the name set by setPortName(). +*/ +QString QextSerialBase::portName() const +{ + return port; +} + +/*! +\fn BaudRateType QextSerialBase::baudRate(void) const +Returns the baud rate of the serial port. For a list of possible return values see +the definition of the enum BaudRateType. +*/ +BaudRateType QextSerialBase::baudRate(void) const +{ + return Settings.BaudRate; +} + +/*! +\fn DataBitsType QextSerialBase::dataBits() const +Returns the number of data bits used by the port. For a list of possible values returned by +this function, see the definition of the enum DataBitsType. +*/ +DataBitsType QextSerialBase::dataBits() const +{ + return Settings.DataBits; +} + +/*! +\fn ParityType QextSerialBase::parity() const +Returns the type of parity used by the port. For a list of possible values returned by +this function, see the definition of the enum ParityType. +*/ +ParityType QextSerialBase::parity() const +{ + return Settings.Parity; +} + +/*! +\fn StopBitsType QextSerialBase::stopBits() const +Returns the number of stop bits used by the port. For a list of possible return values, see +the definition of the enum StopBitsType. +*/ +StopBitsType QextSerialBase::stopBits() const +{ + return Settings.StopBits; +} + +/*! +\fn FlowType QextSerialBase::flowControl() const +Returns the type of flow control used by the port. For a list of possible values returned +by this function, see the definition of the enum FlowType. +*/ +FlowType QextSerialBase::flowControl() const +{ + return Settings.FlowControl; +} + +/*! +\fn bool QextSerialBase::isSequential() const +Returns true if device is sequential, otherwise returns false. Serial port is sequential device +so this function always returns true. Check QIODevice::isSequential() documentation for more +information. +*/ +bool QextSerialBase::isSequential() const +{ + return true; +} + +/*! +\fn bool QextSerialBase::atEnd() const +This function will return true if the input buffer is empty (or on error), and false otherwise. +Call QextSerialBase::lastError() for error information. +*/ +bool QextSerialBase::atEnd() const +{ + if (size()) { + return true; + } + return false; +} + +/*! +\fn qint64 QextSerialBase::readLine(char * data, qint64 maxSize) +This function will read a line of buffered input from the port, stopping when either maxSize bytes +have been read, the port has no more data available, or a newline is encountered. +The value returned is the length of the string that was read. +*/ +qint64 QextSerialBase::readLine(char * data, qint64 maxSize) +{ + qint64 numBytes = bytesAvailable(); + char* pData = data; + + if (maxSize < 2) //maxSize must be larger than 1 + return -1; + + /*read a byte at a time for MIN(bytesAvail, maxSize - 1) iterations, or until a newline*/ + while (pData<(data+numBytes) && --maxSize) { + readData(pData, 1); + if (*pData++ == '\n') { + break; + } + } + *pData='\0'; + + /*return size of data read*/ + return (pData-data); +} + +/*! +\fn ulong QextSerialBase::lastError() const +Returns the code for the last error encountered by the port, or E_NO_ERROR if the last port +operation was successful. Possible error codes are: + +\verbatim +Error Explanation +--------------------------- ------------------------------------------------------------- +E_NO_ERROR No Error has occured +E_INVALID_FD Invalid file descriptor (port was not opened correctly) +E_NO_MEMORY Unable to allocate memory tables (POSIX) +E_CAUGHT_NON_BLOCKED_SIGNAL Caught a non-blocked signal (POSIX) +E_PORT_TIMEOUT Operation timed out (POSIX) +E_INVALID_DEVICE The file opened by the port is not a character device (POSIX) +E_BREAK_CONDITION The port detected a break condition +E_FRAMING_ERROR The port detected a framing error + (usually caused by incorrect baud rate settings) +E_IO_ERROR There was an I/O error while communicating with the port +E_BUFFER_OVERRUN Character buffer overrun +E_RECEIVE_OVERFLOW Receive buffer overflow +E_RECEIVE_PARITY_ERROR The port detected a parity error in the received data +E_TRANSMIT_OVERFLOW Transmit buffer overflow +E_READ_FAILED General read operation failure +E_WRITE_FAILED General write operation failure +\endverbatim +*/ +ulong QextSerialBase::lastError() const +{ + return lastErr; +} diff --git a/qextserialbase.h b/qextserialbase.h new file mode 100644 index 0000000..e1474e4 --- /dev/null +++ b/qextserialbase.h @@ -0,0 +1,258 @@ +#ifndef _QEXTSERIALBASE_H_ +#define _QEXTSERIALBASE_H_ + +#include +#include +#include +#include + +/*if all warning messages are turned off, flag portability warnings to be turned off as well*/ +#ifdef _TTY_NOWARN_ +#define _TTY_NOWARN_PORT_ +#endif + +/*macros for thread support*/ +#define LOCK_MUTEX() mutex->lock() +#define UNLOCK_MUTEX() mutex->unlock() + +/*macros for warning and debug messages*/ +#ifdef _TTY_NOWARN_PORT_ +#define TTY_PORTABILITY_WARNING(s) +#else +#define TTY_PORTABILITY_WARNING(s) qWarning(s) +#endif /*_TTY_NOWARN_PORT_*/ +#ifdef _TTY_NOWARN_ +#define TTY_WARNING(s) +#else +#define TTY_WARNING(s) qWarning(s) +#endif /*_TTY_NOWARN_*/ + + +/*line status constants*/ +#define LS_CTS 0x01 +#define LS_DSR 0x02 +#define LS_DCD 0x04 +#define LS_RI 0x08 +#define LS_RTS 0x10 +#define LS_DTR 0x20 +#define LS_ST 0x40 +#define LS_SR 0x80 + +/*error constants*/ +#define E_NO_ERROR 0 +#define E_INVALID_FD 1 +#define E_NO_MEMORY 2 +#define E_CAUGHT_NON_BLOCKED_SIGNAL 3 +#define E_PORT_TIMEOUT 4 +#define E_INVALID_DEVICE 5 +#define E_BREAK_CONDITION 6 +#define E_FRAMING_ERROR 7 +#define E_IO_ERROR 8 +#define E_BUFFER_OVERRUN 9 +#define E_RECEIVE_OVERFLOW 10 +#define E_RECEIVE_PARITY_ERROR 11 +#define E_TRANSMIT_OVERFLOW 12 +#define E_READ_FAILED 13 +#define E_WRITE_FAILED 14 + +/*! + * Enums for port settings. + */ +enum NamingConvention +{ + WIN_NAMES, + IRIX_NAMES, + HPUX_NAMES, + SUN_NAMES, + DIGITAL_NAMES, + FREEBSD_NAMES, + LINUX_NAMES +}; + +enum BaudRateType +{ + BAUD50, //POSIX ONLY + BAUD75, //POSIX ONLY + BAUD110, + BAUD134, //POSIX ONLY + BAUD150, //POSIX ONLY + BAUD200, //POSIX ONLY + BAUD300, + BAUD600, + BAUD1200, + BAUD1800, //POSIX ONLY + BAUD2400, + BAUD4800, + BAUD9600, + BAUD14400, //WINDOWS ONLY + BAUD19200, + BAUD38400, + BAUD56000, //WINDOWS ONLY + BAUD57600, + BAUD76800, //POSIX ONLY + BAUD115200, + BAUD128000, //WINDOWS ONLY + BAUD256000 //WINDOWS ONLY +}; + +enum DataBitsType +{ + DATA_5, + DATA_6, + DATA_7, + DATA_8 +}; + +enum ParityType +{ + PAR_NONE, + PAR_ODD, + PAR_EVEN, + PAR_MARK, //WINDOWS ONLY + PAR_SPACE +}; + +enum StopBitsType +{ + STOP_1, + STOP_1_5, //WINDOWS ONLY + STOP_2 +}; + +enum FlowType +{ + FLOW_OFF, + FLOW_HARDWARE, + FLOW_XONXOFF +}; + +/** + * structure to contain port settings + */ +struct PortSettings +{ + BaudRateType BaudRate; + DataBitsType DataBits; + ParityType Parity; + StopBitsType StopBits; + FlowType FlowControl; + long Timeout_Millisec; +}; + +/*! + * \author Stefan Sander + * \author Michal Policht + * + * A common base class for Win_QextSerialBase, Posix_QextSerialBase and QextSerialPort. + */ +class QextSerialBase : public QIODevice +{ + Q_OBJECT + + public: + enum QueryMode { + Polling, + EventDriven + }; + + protected: + QMutex* mutex; + QString port; + PortSettings Settings; + ulong lastErr; + QextSerialBase::QueryMode _queryMode; + + virtual qint64 readData(char * data, qint64 maxSize)=0; + virtual qint64 writeData(const char * data, qint64 maxSize)=0; + + public: + QextSerialBase(); + QextSerialBase(const QString & name); + virtual ~QextSerialBase(); + virtual void construct(); + virtual void setPortName(const QString & name); + virtual QString portName() const; + + /**! + * Get query mode. + * \return query mode. + */ + inline QextSerialBase::QueryMode queryMode() const { return _queryMode; }; + + /*! + * Set desired serial communication handling style. You may choose from polling + * or event driven approach. This function does nothing when port is open; to + * apply changes port must be reopened. + * + * In event driven approach read() and write() functions are acting + * asynchronously. They return immediately and the operation is performed in + * the background, so they doesn't freeze the calling thread. + * To determine when operation is finished, QextSerialPort runs separate thread + * and monitors serial port events. Whenever the event occurs, adequate signal + * is emitted. + * + * When polling is set, read() and write() are acting synchronously. Signals are + * not working in this mode and some functions may not be available. The advantage + * of polling is that it generates less overhead due to lack of signals emissions + * and it doesn't start separate thread to monitor events. + * + * Generally event driven approach is more capable and friendly, although some + * applications may need as low overhead as possible and then polling comes. + * + * \param mode query mode. + */ + virtual void setQueryMode(QueryMode mode); + +// virtual void setBlockingRead(bool block) = 0; ///< @todo implement. + + virtual void setBaudRate(BaudRateType)=0; + virtual BaudRateType baudRate() const; + virtual void setDataBits(DataBitsType)=0; + virtual DataBitsType dataBits() const; + virtual void setParity(ParityType)=0; + virtual ParityType parity() const; + virtual void setStopBits(StopBitsType)=0; + virtual StopBitsType stopBits() const; + virtual void setFlowControl(FlowType)=0; + virtual FlowType flowControl() const; + virtual void setTimeout(long)=0; + + virtual bool open(OpenMode mode)=0; + virtual bool isSequential() const; + virtual void close()=0; + virtual void flush()=0; + + virtual qint64 size() const=0; + virtual qint64 bytesAvailable()=0; + virtual bool atEnd() const; + + virtual void ungetChar(char c)=0; + virtual qint64 readLine(char * data, qint64 maxSize); + + virtual ulong lastError() const; + virtual void translateError(ulong error)=0; + + virtual void setDtr(bool set=true)=0; + virtual void setRts(bool set=true)=0; + virtual ulong lineStatus()=0; + + signals: + /** + * This signal is emitted whenever port settings are updated. + * \param valid \p true if settings are valid, \p false otherwise. + * + * @todo implement. + */ +// void validSettings(bool valid); + + /*! + * This signal is emitted whenever dsr line has changed its state. You may + * use this signal to check if device is connected. + * \param status \p true when DSR signal is on, \p false otherwise. + * + * \see lineStatus(). + */ + void dsrChanged(bool status); +}; + +#endif diff --git a/qjson/qjson-backport_global.h b/qjson/qjson-backport_global.h new file mode 100644 index 0000000..dcc7866 --- /dev/null +++ b/qjson/qjson-backport_global.h @@ -0,0 +1,12 @@ +#ifndef QJSONBACKPORT_GLOBAL_H +#define QJSONBACKPORT_GLOBAL_H + +#include + +#if defined(QJSONBACKPORT_LIBRARY) +# define QJSONBACKPORTSHARED_EXPORT Q_DECL_EXPORT +#else +# define QJSONBACKPORTSHARED_EXPORT Q_DECL_IMPORT +#endif + +#endif // QJSONBACKPORT_GLOBAL_H diff --git a/qjson/qjson.cpp b/qjson/qjson.cpp new file mode 100644 index 0000000..4f7372a --- /dev/null +++ b/qjson/qjson.cpp @@ -0,0 +1,427 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjson_p.h" +#include + +QT_BEGIN_NAMESPACE + +namespace QJsonPrivate +{ + +#ifdef Q_LITTLE_ENDIAN +#define Q_TO_LITTLE_ENDIAN(x) (x) +#else +#define Q_TO_LITTLE_ENDIAN(x) ( ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x & 0xff000000) >> 24) ) +#endif + +static const Base emptyArray = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } }; +static const Base emptyObject = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } }; + + +void Data::compact() +{ + Q_ASSERT(sizeof(Value) == sizeof(offset)); + + if (!compactionCounter) + return; + + Base *base = header->root(); + int reserve = 0; + if (base->is_object) { + Object *o = static_cast(base); + for (int i = 0; i < (int)o->length; ++i) + reserve += o->entryAt(i)->usedStorage(o); + } else { + Array *a = static_cast(base); + for (int i = 0; i < (int)a->length; ++i) + reserve += (*a)[i].usedStorage(a); + } + + int size = sizeof(Base) + reserve + base->length*sizeof(offset); + int alloc = sizeof(Header) + size; + Header *h = (Header *) malloc(alloc); + h->tag = QJsonDocument::BinaryFormatTag; + h->version = 1; + Base *b = h->root(); + b->size = size; + b->is_object = header->root()->is_object; + b->length = base->length; + b->tableOffset = reserve + sizeof(Array); + + int offset = sizeof(Base); + if (b->is_object) { + Object *o = static_cast(base); + Object *no = static_cast(b); + + for (int i = 0; i < (int)o->length; ++i) { + no->table()[i] = offset; + + const Entry *e = o->entryAt(i); + Entry *ne = no->entryAt(i); + int s = e->size(); + memcpy(ne, e, s); + offset += s; + int dataSize = e->value.usedStorage(o); + if (dataSize) { + memcpy((char *)no + offset, e->value.data(o), dataSize); + ne->value.value = offset; + offset += dataSize; + } + } + } else { + Array *a = static_cast(base); + Array *na = static_cast(b); + + for (int i = 0; i < (int)a->length; ++i) { + const Value &v = (*a)[i]; + Value &nv = (*na)[i]; + nv = v; + int dataSize = v.usedStorage(a); + if (dataSize) { + memcpy((char *)na + offset, v.data(a), dataSize); + nv.value = offset; + offset += dataSize; + } + } + } + Q_ASSERT(offset == (int)b->tableOffset); + + free(header); + header = h; + this->alloc = alloc; + compactionCounter = 0; +} + +bool Data::valid() const +{ + if (header->tag != QJsonDocument::BinaryFormatTag || header->version != 1u) + return false; + + bool res = false; + if (header->root()->is_object) + res = static_cast(header->root())->isValid(); + else + res = static_cast(header->root())->isValid(); + + return res; +} + + +int Base::reserveSpace(uint dataSize, int posInTable, uint numItems, bool replace) +{ + Q_ASSERT(posInTable >= 0 && posInTable <= (int)length); + + offset off = tableOffset; + // move table to new position + if (replace) { + memmove((char *)(table()) + dataSize, table(), length*sizeof(offset)); + } else { + memmove((char *)(table() + posInTable + numItems) + dataSize, table() + posInTable, (length - posInTable)*sizeof(offset)); + memmove((char *)(table()) + dataSize, table(), posInTable*sizeof(offset)); + } + tableOffset += dataSize; + for (int i = 0; i < (int)numItems; ++i) + table()[posInTable + i] = off; + size += dataSize; + if (!replace) { + length += numItems; + size += numItems * sizeof(offset); + } + return off; +} + +void Base::removeItems(int pos, int numItems) +{ + Q_ASSERT(pos >= 0 && pos <= (int)length); + if (pos + numItems < (int)length) + memmove(table() + pos, table() + pos + numItems, (length - pos - numItems)*sizeof(offset)); + length -= numItems; +} + +int Object::indexOf(const QString &key, bool *exists) +{ + int min = 0; + int n = length; + while (n > 0) { + int half = n >> 1; + int middle = min + half; + if (*entryAt(middle) >= key) { + n = half; + } else { + min = middle + 1; + n -= half + 1; + } + } + if (min < (int)length && *entryAt(min) == key) { + *exists = true; + return min; + } + *exists = false; + return min; +} + +bool Object::isValid() const +{ + if (tableOffset + length*sizeof(offset) > size) + return false; + + for (uint i = 0; i < length; ++i) { + offset entryOffset = table()[i]; + if (entryOffset + sizeof(Entry) >= tableOffset) + return false; + Entry *e = entryAt(i); + int s = e->size(); + if (table()[i] + s > tableOffset) + return false; + if (!e->value.isValid(this)) + return false; + } + return true; +} + + + +bool Array::isValid() const +{ + if (tableOffset + length*sizeof(offset) > size) + return false; + + for (uint i = 0; i < length; ++i) { + if (!at(i).isValid(this)) + return false; + } + return true; +} + + +bool Entry::operator ==(const QString &key) const +{ + if (value.latinKey) + return (shallowLatin1Key() == key); + else + return (shallowKey() == key); +} + +bool Entry::operator >=(const QString &key) const +{ + if (value.latinKey) + return (shallowLatin1Key() >= key); + else + return (shallowKey() >= key); +} + +bool Entry::operator ==(const Entry &other) const +{ + if (value.latinKey) { + if (other.value.latinKey) + return shallowLatin1Key() == other.shallowLatin1Key(); + return shallowLatin1Key() == other.shallowKey(); + } else if (other.value.latinKey) { + return shallowKey() == other.shallowLatin1Key(); + } + return shallowKey() == other.shallowKey(); +} + +bool Entry::operator >=(const Entry &other) const +{ + if (value.latinKey) { + if (other.value.latinKey) + return shallowLatin1Key() >= other.shallowLatin1Key(); + return shallowLatin1Key() >= other.shallowKey(); + } else if (other.value.latinKey) { + return shallowKey() >= other.shallowLatin1Key(); + } + return shallowKey() >= other.shallowKey(); +} + + +int Value::usedStorage(const Base *b) const +{ + int s = 0; + switch (type) { + case QJsonValue::Double: + if (latinOrIntValue) + break; + s = sizeof(double); + break; + case QJsonValue::String: { + char *d = data(b); + if (latinOrIntValue) + s = sizeof(ushort) + *(ushort *)d; + else + s = sizeof(int) + sizeof(ushort)*(*(int *)d); + break; + } + case QJsonValue::Array: + case QJsonValue::Object: + s = base(b)->size; + break; + case QJsonValue::Null: + case QJsonValue::Bool: + default: + break; + } + return alignedSize(s); +} + +bool Value::isValid(const Base *b) const +{ + int offset = 0; + switch (type) { + case QJsonValue::Double: + if (latinOrIntValue) + break; + // fall through + case QJsonValue::String: + case QJsonValue::Array: + case QJsonValue::Object: + offset = value; + break; + case QJsonValue::Null: + case QJsonValue::Bool: + default: + break; + } + + if (!offset) + return true; + if (offset + sizeof(uint) > b->tableOffset) + return false; + + int s = usedStorage(b); + if (!s) + return true; + if (s < 0 || offset + s > (int)b->tableOffset) + return false; + if (type == QJsonValue::Array) + return static_cast(base(b))->isValid(); + if (type == QJsonValue::Object) + return static_cast(base(b))->isValid(); + return true; +} + +/*! + \internal + */ +int Value::requiredStorage(const QJsonValue &v, bool *compressed) +{ + *compressed = false; + switch (v.t) { + case QJsonValue::Double: + if (QJsonPrivate::compressedNumber(v.dbl) != INT_MAX) { + *compressed = true; + return 0; + } + return sizeof(double); + case QJsonValue::String: { + QString s = v.toString(); + *compressed = QJsonPrivate::useCompressed(s); + return QJsonPrivate::qStringSize(s, *compressed); + } + case QJsonValue::Array: + case QJsonValue::Object: + return v.base ? v.base->size : sizeof(QJsonPrivate::Base); + case QJsonValue::Undefined: + case QJsonValue::Null: + case QJsonValue::Bool: + break; + } + return 0; +} + +/*! + \internal + */ +uint Value::valueToStore(const QJsonValue &v, uint offset) +{ + switch (v.t) { + case QJsonValue::Undefined: + case QJsonValue::Null: + break; + case QJsonValue::Bool: + return v.b; + case QJsonValue::Double: { + int c = QJsonPrivate::compressedNumber(v.dbl); + if (c != INT_MAX) + return c; + } + // fall through + case QJsonValue::String: + case QJsonValue::Array: + case QJsonValue::Object: + return offset; + } + return 0; +} + +/*! + \internal + */ +void Value::copyData(const QJsonValue &v, char *dest, bool compressed) +{ + switch (v.t) { + case QJsonValue::Double: + if (!compressed) { + qToLittleEndian(v.ui, (uchar *)dest); + } + break; + case QJsonValue::String: { + QString str = v.toString(); + QJsonPrivate::copyString(dest, str, compressed); + break; + } + case QJsonValue::Array: + case QJsonValue::Object: { + const QJsonPrivate::Base *b = v.base; + if (!b) + b = (v.t == QJsonValue::Array ? &emptyArray : &emptyObject); + memcpy(dest, b, b->size); + break; + } + default: + break; + } +} + +} // namespace QJsonPrivate + +QT_END_NAMESPACE diff --git a/qjson/qjson_p.h b/qjson/qjson_p.h new file mode 100644 index 0000000..d83db7e --- /dev/null +++ b/qjson/qjson_p.h @@ -0,0 +1,765 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSON_P_H +#define QJSON_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qjsonexport.h" +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsondocument.h" +#include "qjsonarray.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +/* + This defines a binary data structure for Json data. The data structure is optimised for fast reading + and minimum allocations. The whole data structure can be mmap'ed and used directly. + + In most cases the binary structure is not as space efficient as a utf8 encoded text representation, but + much faster to access. + + The size requirements are: + + String: + Latin1 data: 2 bytes header + string.length() + Full Unicode: 4 bytes header + 2*(string.length()) + + Values: 4 bytes + size of data (size can be 0 for some data) + bool: 0 bytes + double: 8 bytes (0 if integer with less than 27bits) + string: see above + array: size of array + object: size of object + Array: 12 bytes + 4*length + size of Value data + Object: 12 bytes + 8*length + size of Key Strings + size of Value data + + For an example such as + + { // object: 12 + 5*8 = 52 + "firstName": "John", // key 12, value 8 = 20 + "lastName" : "Smith", // key 12, value 8 = 20 + "age" : 25, // key 8, value 0 = 8 + "address" : // key 12, object below = 140 + { // object: 12 + 4*8 + "streetAddress": "21 2nd Street", // key 16, value 16 + "city" : "New York", // key 8, value 12 + "state" : "NY", // key 8, value 4 + "postalCode" : "10021" // key 12, value 8 + }, // object total: 128 + "phoneNumber": // key: 16, value array below = 172 + [ // array: 12 + 2*4 + values below: 156 + { // object 12 + 2*8 + "type" : "home", // key 8, value 8 + "number": "212 555-1234" // key 8, value 16 + }, // object total: 68 + { // object 12 + 2*8 + "type" : "fax", // key 8, value 8 + "number": "646 555-4567" // key 8, value 16 + } // object total: 68 + ] // array total: 156 + } // great total: 412 bytes + + The uncompressed text file used roughly 500 bytes, so in this case we end up using about + the same space as the text representation. + + Other measurements have shown a slightly bigger binary size than a compact text + representation where all possible whitespace was stripped out. +*/ +namespace QJsonPrivate { + +class Array; +class Object; +class Value; +class Entry; + +template +class q_littleendian +{ +public: + T val; + + q_littleendian &operator =(T i) { val = qToLittleEndian(i); return *this; } + operator T() const { return qFromLittleEndian(val); } + + bool operator ==(T i) { return qFromLittleEndian(val) == i; } + bool operator !=(T i) { return qFromLittleEndian(val) != i; } + bool operator ==(q_littleendian i) { return val == i.val; } + bool operator !=(q_littleendian i) { return val != i.val; } + bool operator <(T i) { return qFromLittleEndian(val) < i; } + bool operator >(T i) { return qFromLittleEndian(val) > i; } + bool operator <=(T i) { return qFromLittleEndian(val) <= i; } + bool operator >=(T i) { return qFromLittleEndian(val) >= i; } + q_littleendian &operator +=(T i) { + val = qToLittleEndian(qFromLittleEndian(val) + i); + return *this; + } +}; + +typedef q_littleendian qle_short; +typedef q_littleendian qle_ushort; +typedef q_littleendian qle_int; +typedef q_littleendian qle_uint; + +template +class qle_bitfield +{ +public: + uint val; + + enum { + mask = ((1u << width) - 1) << pos + }; + + void operator =(uint t) { + uint i = qFromLittleEndian(val); + i &= ~mask; + i |= t << pos; + val = qToLittleEndian(i); + } + operator uint() const { + uint t = qFromLittleEndian(val); + t &= mask; + t >>= pos; + return t; + } + bool operator !() const { + return !operator uint(); + } + + bool operator ==(uint t) { return uint(*this) == t; } + bool operator !=(uint t) { return uint(*this) != t; } + bool operator <(uint t) { return uint(*this) < t; } + bool operator >(uint t) { return uint(*this) > t; } + bool operator <=(uint t) { return uint(*this) <= t; } + bool operator >=(uint t) { return uint(*this) >= t; } + qle_bitfield &operator +=(uint i) { + *this = (uint(*this) + i); + return *this; + } + qle_bitfield &operator -=(uint i) { + *this = (uint(*this) - i); + return *this; + } +}; + +template +class qle_signedbitfield +{ +public: + uint val; + + enum { + mask = ((1u << width) - 1) << pos + }; + + void operator =(int t) { + uint i = qFromLittleEndian(val); + i &= ~mask; + i |= t << pos; + val = qToLittleEndian(i); + } + operator int() const { + uint i = qFromLittleEndian(val); + i <<= 32 - width - pos; + int t = (int) i; + t >>= pos; + return t; + } + bool operator !() const { + return !operator int(); + } + + bool operator ==(int t) { return int(*this) == t; } + bool operator !=(int t) { return int(*this) != t; } + bool operator <(int t) { return int(*this) < t; } + bool operator >(int t) { return int(*this) > t; } + bool operator <=(int t) { return int(*this) <= t; } + bool operator >=(int t) { return int(*this) >= t; } + qle_signedbitfield &operator +=(int i) { + *this = (int(*this) + i); + return *this; + } + qle_signedbitfield &operator -=(int i) { + *this = (int(*this) - i); + return *this; + } +}; + +typedef qle_uint offset; + +// round the size up to the next 4 byte boundary +inline int alignedSize(int size) { return (size + 3) & ~3; } + +static inline bool useCompressed(const QString &s) +{ + if (s.length() >= 0x8000) + return false; + const ushort *uc = (const ushort *)s.constData(); + const ushort *e = uc + s.length(); + while (uc < e) { + if (*uc > 0xff) + return false; + ++uc; + } + return true; +} + +static inline int qStringSize(const QString &string, bool compress) +{ + int l = 2 + string.length(); + if (!compress) + l *= 2; + return alignedSize(l); +} + +// returns INT_MAX if it can't compress it into 28 bits +static inline int compressedNumber(double d) +{ + // this relies on details of how ieee floats are represented + const int exponent_off = 52; + const quint64 fraction_mask = 0x000fffffffffffffull; + const quint64 exponent_mask = 0x7ff0000000000000ull; + + quint64 val; + memcpy (&val, &d, sizeof(double)); + int exp = (int)((val & exponent_mask) >> exponent_off) - 1023; + if (exp < 0 || exp > 25) + return INT_MAX; + + quint64 non_int = val & (fraction_mask >> exp); + if (non_int) + return INT_MAX; + + bool neg = (val >> 63); + val &= fraction_mask; + val |= ((quint64)1 << 52); + int res = (int)(val >> (52 - exp)); + return neg ? -res : res; +} + +class Latin1String; + +class String +{ +public: + String(const char *data) { d = (Data *)data; } + + struct Data { + qle_int length; + qle_ushort utf16[1]; + }; + + Data *d; + + inline String &operator=(const QString &str) + { + d->length = str.length(); +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + for (int i = 0; i < str.length(); ++i) + d->utf16[i] = uc[i]; +#else + memcpy(d->utf16, str.unicode(), str.length()*sizeof(ushort)); +#endif + if (str.length() & 1) + d->utf16[str.length()] = 0; + return *this; + } + + inline bool operator ==(const QString &str) const { + int slen = str.length(); + int l = d->length; + if (slen != l) + return false; + const ushort *s = (const ushort *)str.constData(); + const qle_ushort *a = d->utf16; + const ushort *b = s; + while (l-- && *a == *b) + a++,b++; + return (l == -1); + } + inline bool operator !=(const QString &str) const { + return !operator ==(str); + } + inline bool operator >=(const QString &str) const { + // ### + return toString() >= str; + } + + inline bool operator<(const Latin1String &str) const; + inline bool operator>=(const Latin1String &str) const { return !operator <(str); } + inline bool operator ==(const Latin1String &str) const; + + inline bool operator ==(const String &str) const { + if (d->length != str.d->length) + return false; + return !memcmp(d->utf16, str.d->utf16, d->length*sizeof(ushort)); + } + inline bool operator<(const String &other) const; + inline bool operator >=(const String &other) const { return other < *this; } + + inline QString toString() const { +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + return QString((QChar *)d->utf16, d->length); +#else + int l = d->length; + QString str(l, Qt::Uninitialized); + QChar *ch = str.data(); + for (int i = 0; i < l; ++i) + ch[i] = d->utf16[i]; + return str; +#endif + } + +}; + +class Latin1String +{ +public: + Latin1String(const char *data) { d = (Data *)data; } + + struct Data { + qle_short length; + char latin1[1]; + }; + Data *d; + + inline Latin1String &operator=(const QString &str) + { + d->length = str.length(); + uchar *l = (uchar *)d->latin1; + const ushort *uc = (const ushort *)str.unicode(); + for (int i = 0; i < str.length(); ++i) + *l++ = uc[i]; + while ((quintptr)l & 0x3) + *l++ = 0; + return *this; + } + + inline bool operator ==(const QString &str) const { +// return QLatin1String(d->latin1, d->length) == str; + return QString::fromLatin1(d->latin1, d->length) == str; + } + inline bool operator !=(const QString &str) const { + return !operator ==(str); + } + inline bool operator >=(const QString &str) const { +// return QLatin1String(d->latin1, d->length) >= str; + return QString::fromLatin1(d->latin1, d->length) >= str; + } + + inline bool operator ==(const Latin1String &str) const { + return d->length == str.d->length && !strcmp(d->latin1, str.d->latin1); + } + inline bool operator >=(const Latin1String &str) const { + int l = qMin(d->length, str.d->length); + int val = strncmp(d->latin1, str.d->latin1, l); + if (!val) + val = d->length - str.d->length; + return val >= 0; + } + + inline bool operator ==(const String &str) const { + return (str == *this); + } + inline bool operator >=(const String &str) const { + return (str < *this); + } + + inline QString toString() const { + return QString::fromLatin1(d->latin1, d->length); + } +}; + +inline bool String::operator ==(const Latin1String &str) const +{ + if ((int)d->length != (int)str.d->length) + return false; + const qle_ushort *uc = d->utf16; + const qle_ushort *e = uc + d->length; + const uchar *c = (uchar *)str.d->latin1; + + while (uc < e) { + if (*uc != *c) + return false; + ++uc; + ++c; + } + return true; +} + +inline bool String::operator <(const String &other) const +{ + int alen = d->length; + int blen = other.d->length; + int l = qMin(alen, blen); + qle_ushort *a = d->utf16; + qle_ushort *b = other.d->utf16; + + while (l-- && *a == *b) + a++,b++; + if (l==-1) + return (alen < blen); + return (ushort)*a - (ushort)*b; +} + +inline bool String::operator<(const Latin1String &str) const +{ + const uchar *c = (uchar *) str.d->latin1; + if (!c || *c == 0) + return false; + + const qle_ushort *uc = d->utf16; + const qle_ushort *e = uc + qMin((int)d->length, (int)str.d->length); + + while (uc < e) { + if (*uc != *c) + break; + ++uc; + ++c; + } + return (uc == e ? (int)d->length < (int)str.d->length : (ushort)*uc < *c); + +} + +static inline void copyString(char *dest, const QString &str, bool compress) +{ + if (compress) { + Latin1String string(dest); + string = str; + } else { + String string(dest); + string = str; + } +} + + +/* + Base is the base class for both Object and Array. Both classe work more or less the same way. + The class starts with a header (defined by the struct below), then followed by data (the data for + values in the Array case and Entry's (see below) for objects. + + After the data a table follows (tableOffset points to it) containing Value objects for Arrays, and + offsets from the beginning of the object to Entry's in the case of Object. + + Entry's in the Object's table are lexicographically sorted by key in the table(). This allows the usage + of a binary search over the keys in an Object. + */ +class Base +{ +public: + qle_uint size; + union { + uint _dummy; + qle_bitfield<0, 1> is_object; + qle_bitfield<1, 31> length; + }; + offset tableOffset; + // content follows here + + inline bool isObject() const { return is_object; } + inline bool isArray() const { return !isObject(); } + + inline offset *table() const { return (offset *) (((char *) this) + tableOffset); } + + int reserveSpace(uint dataSize, int posInTable, uint numItems, bool replace); + void removeItems(int pos, int numItems); +}; + +class Object : public Base +{ +public: + Entry *entryAt(int i) const { + return reinterpret_cast(((char *)this) + table()[i]); + } + int indexOf(const QString &key, bool *exists); + + bool isValid() const; +}; + + +class Array : public Base +{ +public: + inline Value at(int i) const; + inline Value &operator [](int i); + + bool isValid() const; +}; + + +class Value +{ +public: + union { + uint _dummy; + qle_bitfield<0, 3> type; + qle_bitfield<3, 1> latinOrIntValue; + qle_bitfield<4, 1> latinKey; + qle_bitfield<5, 27> value; + qle_signedbitfield<5, 27> int_value; + }; + + inline char *data(const Base *b) const { return ((char *)b) + value; } + int usedStorage(const Base *b) const; + + bool toBoolean() const; + double toDouble(const Base *b) const; + QString toString(const Base *b) const; + String asString(const Base *b) const; + Latin1String asLatin1String(const Base *b) const; + Base *base(const Base *b) const; + + bool isValid(const Base *b) const; + + static int requiredStorage(const QJsonValue &v, bool *compressed); + static uint valueToStore(const QJsonValue &v, uint offset); + static void copyData(const QJsonValue &v, char *dest, bool compressed); +}; + +inline Value Array::at(int i) const +{ + return *(Value *) (table() + i); +} + +inline Value &Array::operator [](int i) +{ + return *(Value *) (table() + i); +} + + + +class Entry { +public: + Value value; + // key + // value data follows key + + int size() const { + int s = sizeof(Entry); + if (value.latinKey) + s += sizeof(ushort) + *(ushort *) ((const char *)this + sizeof(Entry)); + else + s += sizeof(uint) + *(int *) ((const char *)this + sizeof(Entry)); + return alignedSize(s); + } + + int usedStorage(Base *b) const { + return size() + value.usedStorage(b); + } + + String shallowKey() const + { + Q_ASSERT(!value.latinKey); + return String((const char *)this + sizeof(Entry)); + } + Latin1String shallowLatin1Key() const + { + Q_ASSERT(value.latinKey); + return Latin1String((const char *)this + sizeof(Entry)); + } + QString key() const + { + if (value.latinKey) { + return shallowLatin1Key().toString(); + } + return shallowKey().toString(); + } + + bool operator ==(const QString &key) const; + inline bool operator !=(const QString &key) const { return !operator ==(key); } + bool operator >=(const QString &key) const; + + bool operator ==(const Entry &other) const; + bool operator >=(const Entry &other) const; +}; + +inline bool operator <(const QString &key, const Entry &e) +{ return e >= key; } + +class Header { +public: + qle_uint tag; // 'qbjs' + qle_uint version; // 1 + Base *root() { return (Base *)(this + 1); } +}; + + +inline bool Value::toBoolean() const +{ + Q_ASSERT(type == QJsonValue::Bool); + return value != 0; +} + +inline double Value::toDouble(const Base *b) const +{ + Q_ASSERT(type == QJsonValue::Double); + if (latinOrIntValue) + return int_value; + + quint64 i = qFromLittleEndian((const uchar *)b + value); + double d; + memcpy(&d, &i, sizeof(double)); + return d; +} + +inline String Value::asString(const Base *b) const +{ + Q_ASSERT(type == QJsonValue::String && !latinOrIntValue); + return String(data(b)); +} + +inline Latin1String Value::asLatin1String(const Base *b) const +{ + Q_ASSERT(type == QJsonValue::String && latinOrIntValue); + return Latin1String(data(b)); +} + +inline QString Value::toString(const Base *b) const +{ + if (latinOrIntValue) + return asLatin1String(b).toString(); + else + return asString(b).toString(); +} + +inline Base *Value::base(const Base *b) const +{ + Q_ASSERT(type == QJsonValue::Array || type == QJsonValue::Object); + return reinterpret_cast(data(b)); +} + +class Data { +public: + enum Validation { + Unchecked, + Validated, + Invalid + }; + + QAtomicInt ref; + int alloc; + union { + char *rawData; + Header *header; + }; + uint compactionCounter : 31; + uint ownsData : 1; + + inline Data(char *raw, int a) + : alloc(a), rawData(raw), compactionCounter(0), ownsData(true) + { + } + inline Data(int reserved, QJsonValue::Type valueType) + : rawData(0), compactionCounter(0), ownsData(true) + { + Q_ASSERT(valueType == QJsonValue::Array || valueType == QJsonValue::Object); + + alloc = sizeof(Header) + sizeof(Base) + reserved + sizeof(offset); + header = (Header *)malloc(alloc); + Q_CHECK_PTR(header); + header->tag = QJsonDocument::BinaryFormatTag; + header->version = 1; + Base *b = header->root(); + b->size = sizeof(Base); + b->is_object = (valueType == QJsonValue::Object); + b->tableOffset = sizeof(Base); + b->length = 0; + } + inline ~Data() + { if (ownsData) free(rawData); } + + uint offsetOf(const void *ptr) const { return (uint)(((char *)ptr - rawData)); } + + QJsonObject toObject(Object *o) const + { + return QJsonObject(const_cast(this), o); + } + + QJsonArray toArray(Array *a) const + { + return QJsonArray(const_cast(this), a); + } + + Data *clone(Base *b, int reserve = 0) + { + int size = sizeof(Header) + b->size + reserve; + char *raw = (char *)malloc(size); + Q_CHECK_PTR(raw); + memcpy(raw + sizeof(Header), b, b->size); + Header *h = (Header *)raw; + h->tag = QJsonDocument::BinaryFormatTag; + h->version = 1; + Data *d = new Data(raw, size); + d->compactionCounter = (b == header->root()) ? compactionCounter : 0; + return d; + } + + void compact(); + bool valid() const; + +private: + Q_DISABLE_COPY(Data) +}; + +} + +QT_END_NAMESPACE + +#endif // QJSON_P_H diff --git a/qjson/qjsonarray.cpp b/qjson/qjsonarray.cpp new file mode 100644 index 0000000..1b6f968 --- /dev/null +++ b/qjson/qjsonarray.cpp @@ -0,0 +1,1017 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsonarray.h" +#include +#include + +#include "qjsonwriter_p.h" +#include "qjson_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QJsonArray + \ingroup json + \reentrant + \since 5.0 + + \brief The QJsonArray class encapsulates a JSON array. + + A JSON array is a list of values. The list can be manipulated by inserting and + removing QJsonValue's from the array. + + A QJsonArray can be converted to and from a QVariantList. You can query the + number of entries with size(), insert(), and remove() entries from it + and iterate over its content using the standard C++ iterator pattern. + + QJsonArray is an implicitly shared class and shares the data with the document + it has been created from as long as it is not being modified. + + You can convert the array to and from text based JSON through QJsonDocument. +*/ + +/*! + Creates an empty array. + */ +QJsonArray::QJsonArray() + : d(0), a(0) +{ +} + +/*! + \internal + */ +QJsonArray::QJsonArray(QJsonPrivate::Data *data, QJsonPrivate::Array *array) + : d(data), a(array) +{ + d->ref.ref(); +} + +/*! + Deletes the array. + */ +QJsonArray::~QJsonArray() +{ + if (d && !d->ref.deref()) + delete d; +} + +/*! + Creates a copy of \a other. + + Since QJsonArray is implicitly shared, the copy is shallow + as long as the object doesn't get modified. + */ +QJsonArray::QJsonArray(const QJsonArray &other) +{ + d = other.d; + a = other.a; + if (d) + d->ref.ref(); +} + +/*! + Assigns \a other to this array. + */ +QJsonArray &QJsonArray::operator =(const QJsonArray &other) +{ + if (d != other.d) { + if (d && !d->ref.deref()) + delete d; + d = other.d; + if (d) + d->ref.ref(); + } + a = other.a; + + return *this; +} + +/*! + Converts the string list \a list to a QJsonArray. + + The values in \a list will be converted to JSON values. + + \sa toVariantList, QJsonValue::fromString + */ +QJsonArray QJsonArray::fromStringList(const QStringList &list) +{ + QJsonArray array; + for (QStringList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it) + array.append(QJsonValue(*it)); + return array; +} + +/*! + Converts the variant list \a list to a QJsonArray. + + The QVariant values in \a list will be converted to JSON values. + + \sa toVariantList, QJsonValue::fromVariant + */ +QJsonArray QJsonArray::fromVariantList(const QVariantList &list) +{ + QJsonArray array; + for (QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it) + array.append(QJsonValue::fromVariant(*it)); + return array; +} + +/*! + Converts this object to a QVariantList. + + Returns the created map. + */ +QVariantList QJsonArray::toVariantList() const +{ + QVariantList list; + + if (a) { + for (int i = 0; i < (int)a->length; ++i) + list.append(QJsonValue(d, a, a->at(i)).toVariant()); + } + return list; +} + + +/*! + Returns the number of values stored in the array. + */ +int QJsonArray::size() const +{ + if (!d) + return 0; + + return (int)a->length; +} + +/*! + Returns \c true if the object is empty. This is the same as size() == 0. + + \sa size + */ +bool QJsonArray::isEmpty() const +{ + if (!d) + return true; + + return !a->length; +} + +/*! + Returns a QJsonValue representing the value for index \a i. + + The returned QJsonValue is \c Undefined, if \a i is out of bounds. + + */ +QJsonValue QJsonArray::at(int i) const +{ + if (!a || i < 0 || i >= (int)a->length) + return QJsonValue(QJsonValue::Undefined); + + return QJsonValue(d, a, a->at(i)); +} + +/*! + Returns the first value stored in the array. + + Same as \c at(0). + + \sa at + */ +QJsonValue QJsonArray::first() const +{ + return at(0); +} + +/*! + Returns the last value stored in the array. + + Same as \c{at(size() - 1)}. + + \sa at + */ +QJsonValue QJsonArray::last() const +{ + return at(a ? (a->length - 1) : 0); +} + +/*! + Inserts \a value at the beginning of the array. + + This is the same as \c{insert(0, \a value)}. + + \sa append(), insert() + */ +void QJsonArray::prepend(const QJsonValue &value) +{ + insert(0, value); +} + +/*! + Inserts \a value at the end of the array. + + \sa prepend(), insert() + */ +void QJsonArray::append(const QJsonValue &value) +{ + insert(a ? (int)a->length : 0, value); +} + +/*! + Removes the value at index position \a i. \a i must be a valid + index position in the array (i.e., \c{0 <= \a i < size()}). + + \sa insert(), replace() + */ +void QJsonArray::removeAt(int i) +{ + if (!a || i < 0 || i >= (int)a->length) + return; + + detach(); + a->removeItems(i, 1); + ++d->compactionCounter; + if (d->compactionCounter > 32 && d->compactionCounter >= (int)a->length/2) + compact(); +} + +/*! \fn void QJsonArray::removeFirst() + + Removes the first item in the array. Calling this function is + equivalent to calling \c{removeAt(0)}. The array must not be empty. If + the array can be empty, call isEmpty() before calling this + function. + + \sa removeAt(), takeFirst() +*/ + +/*! \fn void QJsonArray::removeLast() + + Removes the last item in the array. Calling this function is + equivalent to calling \c{removeAt(size() - 1)}. The array must not be + empty. If the array can be empty, call isEmpty() before calling + this function. + + \sa removeAt(), takeLast() +*/ + +/*! + Removes the item at index position \a i and returns it. \a i must + be a valid index position in the array (i.e., \c{0 <= \a i < size()}). + + If you don't use the return value, removeAt() is more efficient. + + \sa removeAt() + */ +QJsonValue QJsonArray::takeAt(int i) +{ + if (!a || i < 0 || i >= (int)a->length) + return QJsonValue(QJsonValue::Undefined); + + detach(); + + QJsonValue v(d, a, a->at(i)); + v.detach(); + + removeAt(i); + + return v; +} + +/*! + Inserts \a value at index position \a i in the array. If \a i + is \c 0, the value is prepended to the array. If \a i is size(), the + value is appended to the array. + + \sa append(), prepend(), replace(), removeAt() + */ +void QJsonArray::insert(int i, const QJsonValue &value) +{ + Q_ASSERT (i >= 0 && i <= (a ? (int)a->length : 0)); + + bool compressed; + int valueSize = QJsonPrivate::Value::requiredStorage(value, &compressed); + + detach(valueSize + sizeof(QJsonPrivate::Value)); + + if (!a->length) + a->tableOffset = sizeof(QJsonPrivate::Array); + + int valueOffset = a->reserveSpace(valueSize, i, 1, false); + QJsonPrivate::Value &v = (*a)[i]; + v.type = (value.t == QJsonValue::Undefined ? QJsonValue::Null : value.t); + v.latinOrIntValue = compressed; + v.latinKey = false; + v.value = QJsonPrivate::Value::valueToStore(value, valueOffset); + if (valueSize) + QJsonPrivate::Value::copyData(value, (char *)a + valueOffset, compressed); +} + +/*! + Replaces the item at index position \a i with \a value. \a i must + be a valid index position in the array (i.e., \c{0 <= \a i < size()}). + + \sa operator[](), removeAt() + */ +void QJsonArray::replace(int i, const QJsonValue &value) +{ + Q_ASSERT (a && i >= 0 && i < (int)(a->length)); + + bool compressed; + int valueSize = QJsonPrivate::Value::requiredStorage(value, &compressed); + + detach(valueSize); + + if (!a->length) + a->tableOffset = sizeof(QJsonPrivate::Array); + + int valueOffset = a->reserveSpace(valueSize, i, 1, true); + QJsonPrivate::Value &v = (*a)[i]; + v.type = (value.t == QJsonValue::Undefined ? QJsonValue::Null : value.t); + v.latinOrIntValue = compressed; + v.latinKey = false; + v.value = QJsonPrivate::Value::valueToStore(value, valueOffset); + if (valueSize) + QJsonPrivate::Value::copyData(value, (char *)a + valueOffset, compressed); + + ++d->compactionCounter; + if (d->compactionCounter > 32 && d->compactionCounter >= (int)a->length/2) + compact(); +} + +/*! + Returns \c true if the array contains an occurrence of \a value, otherwise \c false. + + \sa count() + */ +bool QJsonArray::contains(const QJsonValue &value) const +{ + for (int i = 0; i < size(); i++) { + if (at(i) == value) + return true; + } + return false; +} + +/*! + Returns the value at index position \a i as a modifiable reference. + \a i must be a valid index position in the array (i.e., \c{0 <= \a i < + size()}). + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. + + \sa at(), value() + */ +QJsonValueRef QJsonArray::operator [](int i) +{ + Q_ASSERT(a && i >= 0 && i < (int)a->length); + return QJsonValueRef(this, i); +} + +/*! + \overload + + Same as at(). + */ +QJsonValue QJsonArray::operator[](int i) const +{ + return at(i); +} + +/*! + Returns \c true if this array is equal to \a other. + */ +bool QJsonArray::operator==(const QJsonArray &other) const +{ + if (a == other.a) + return true; + + if (!a) + return !other.a->length; + if (!other.a) + return !a->length; + if (a->length != other.a->length) + return false; + + for (int i = 0; i < (int)a->length; ++i) { + if (QJsonValue(d, a, a->at(i)) != QJsonValue(other.d, other.a, other.a->at(i))) + return false; + } + return true; +} + +/*! + Returns \c true if this array is not equal to \a other. + */ +bool QJsonArray::operator!=(const QJsonArray &other) const +{ + return !(*this == other); +} + +/*! \fn QJsonArray::iterator QJsonArray::begin() + + Returns an \l{STL-style iterator} pointing to the first item in + the array. + + \sa constBegin(), end() +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::begin() const + + \overload +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::constBegin() const + + Returns a const \l{STL-style iterator} pointing to the first item + in the array. + + \sa begin(), constEnd() +*/ + +/*! \fn QJsonArray::iterator QJsonArray::end() + + Returns an \l{STL-style iterator} pointing to the imaginary item + after the last item in the array. + + \sa begin(), constEnd() +*/ + +/*! \fn const_iterator QJsonArray::end() const + + \overload +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::constEnd() const + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the array. + + \sa constBegin(), end() +*/ + +/*! \fn void QJsonArray::push_back(const T &value) + + This function is provided for STL compatibility. It is equivalent + to \l{QJsonArray::append()}{append(\a value)}. +*/ + +/*! \fn void QJsonArray::push_front(const T &value) + + This function is provided for STL compatibility. It is equivalent + to \l{QJsonArray::prepend()}{prepend(\a value)}. +*/ + +/*! \fn void QJsonArray::pop_front() + + This function is provided for STL compatibility. It is equivalent + to removeFirst(). The array must not be empty. If the array can be + empty, call isEmpty() before calling this function. +*/ + +/*! \fn void QJsonArray::pop_back() + + This function is provided for STL compatibility. It is equivalent + to removeLast(). The array must not be empty. If the array can be + empty, call isEmpty() before calling this function. +*/ + +/*! \fn bool QJsonArray::empty() const + + This function is provided for STL compatibility. It is equivalent + to isEmpty() and returns \c true if the array is empty. +*/ + +/*! \class QJsonArray::iterator + \brief The QJsonArray::iterator class provides an STL-style non-const iterator for QJsonArray. + + QJsonArray::iterator allows you to iterate over a QJsonArray + and to modify the array item associated with the + iterator. If you want to iterate over a const QJsonArray, use + QJsonArray::const_iterator instead. It is generally a good practice to + use QJsonArray::const_iterator on a non-const QJsonArray as well, unless + you need to change the QJsonArray through the iterator. Const + iterators are slightly faster and improves code readability. + + The default QJsonArray::iterator constructor creates an uninitialized + iterator. You must initialize it using a QJsonArray function like + QJsonArray::begin(), QJsonArray::end(), or QJsonArray::insert() before you can + start iterating. + + Most QJsonArray functions accept an integer index rather than an + iterator. For that reason, iterators are rarely useful in + connection with QJsonArray. One place where STL-style iterators do + make sense is as arguments to \l{generic algorithms}. + + Multiple iterators can be used on the same array. However, be + aware that any non-const function call performed on the QJsonArray + will render all existing iterators undefined. + + \sa QJsonArray::const_iterator +*/ + +/*! \typedef QJsonArray::iterator::iterator_category + + A synonym for \i {std::random_access_iterator_tag} indicating + this iterator is a random access iterator. +*/ + +/*! \typedef QJsonArray::iterator::difference_type + + \internal +*/ + +/*! \typedef QJsonArray::iterator::value_type + + \internal +*/ + +/*! \typedef QJsonArray::iterator::reference + + \internal +*/ + +/*! \fn QJsonArray::iterator::iterator() + + Constructs an uninitialized iterator. + + Functions like operator*() and operator++() should not be called + on an uninitialized iterator. Use operator=() to assign a value + to it before using it. + + \sa QJsonArray::begin() QJsonArray::end() +*/ + +/*! \fn QJsonArray::iterator::iterator(const iterator &other) + + Constructs a copy of \a other. +*/ + +/*! \fn QJsonValueRef QJsonArray::iterator::operator*() const + + Returns a modifiable reference to the current item. + + You can change the value of an item by using operator*() on the + left side of an assignment. + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. +*/ + +/*! \fn QJsonValueRef QJsonArray::iterator::operator[](int j) const + + Returns a modifiable reference to the item at position \c{*this + j}. + + This function is provided to make QJsonArray iterators behave like C++ + pointers. + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. + + \sa operator+() +*/ + +/*! + \fn bool QJsonArray::iterator::operator==(const iterator &other) const + \fn bool QJsonArray::iterator::operator==(const const_iterator &other) const + + Returns \c true if \a other points to the same item as this + iterator; otherwise returns \c false. + + \sa operator!=() +*/ + +/*! + \fn bool QJsonArray::iterator::operator!=(const iterator &other) const + \fn bool QJsonArray::iterator::operator!=(const const_iterator &other) const + + Returns \c true if \a other points to a different item than this + iterator; otherwise returns \c false. + + \sa operator==() +*/ + +/*! + \fn bool QJsonArray::iterator::operator<(const iterator& other) const + \fn bool QJsonArray::iterator::operator<(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is less than + the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::iterator::operator<=(const iterator& other) const + \fn bool QJsonArray::iterator::operator<=(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is less than + or equal to the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::iterator::operator>(const iterator& other) const + \fn bool QJsonArray::iterator::operator>(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is greater + than the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::iterator::operator>=(const iterator& other) const + \fn bool QJsonArray::iterator::operator>=(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is greater + than or equal to the item pointed to by the \a other iterator. +*/ + +/*! \fn QJsonArray::iterator &QJsonArray::iterator::operator++() + + The prefix ++ operator, \c{++it}, advances the iterator to the + next item in the array and returns an iterator to the new current + item. + + Calling this function on QJsonArray::end() leads to undefined results. + + \sa operator--() +*/ + +/*! \fn QJsonArray::iterator QJsonArray::iterator::operator++(int) + + \overload + + The postfix ++ operator, \c{it++}, advances the iterator to the + next item in the array and returns an iterator to the previously + current item. +*/ + +/*! \fn QJsonArray::iterator &QJsonArray::iterator::operator--() + + The prefix -- operator, \c{--it}, makes the preceding item + current and returns an iterator to the new current item. + + Calling this function on QJsonArray::begin() leads to undefined results. + + \sa operator++() +*/ + +/*! \fn QJsonArray::iterator QJsonArray::iterator::operator--(int) + + \overload + + The postfix -- operator, \c{it--}, makes the preceding item + current and returns an iterator to the previously current item. +*/ + +/*! \fn QJsonArray::iterator &QJsonArray::iterator::operator+=(int j) + + Advances the iterator by \a j items. If \a j is negative, the + iterator goes backward. + + \sa operator-=(), operator+() +*/ + +/*! \fn QJsonArray::iterator &QJsonArray::iterator::operator-=(int j) + + Makes the iterator go back by \a j items. If \a j is negative, + the iterator goes forward. + + \sa operator+=(), operator-() +*/ + +/*! \fn QJsonArray::iterator QJsonArray::iterator::operator+(int j) const + + Returns an iterator to the item at \a j positions forward from + this iterator. If \a j is negative, the iterator goes backward. + + \sa operator-(), operator+=() +*/ + +/*! \fn QJsonArray::iterator QJsonArray::iterator::operator-(int j) const + + Returns an iterator to the item at \a j positions backward from + this iterator. If \a j is negative, the iterator goes forward. + + \sa operator+(), operator-=() +*/ + +/*! \fn int QJsonArray::iterator::operator-(iterator other) const + + Returns the number of items between the item pointed to by \a + other and the item pointed to by this iterator. +*/ + +/*! \class QJsonArray::const_iterator + \brief The QJsonArray::const_iterator class provides an STL-style const iterator for QJsonArray. + + QJsonArray::const_iterator allows you to iterate over a + QJsonArray. If you want to modify the QJsonArray as + you iterate over it, use QJsonArray::iterator instead. It is generally a + good practice to use QJsonArray::const_iterator on a non-const QJsonArray + as well, unless you need to change the QJsonArray through the + iterator. Const iterators are slightly faster and improves + code readability. + + The default QJsonArray::const_iterator constructor creates an + uninitialized iterator. You must initialize it using a QJsonArray + function like QJsonArray::constBegin(), QJsonArray::constEnd(), or + QJsonArray::insert() before you can start iterating. + + Most QJsonArray functions accept an integer index rather than an + iterator. For that reason, iterators are rarely useful in + connection with QJsonArray. One place where STL-style iterators do + make sense is as arguments to \l{generic algorithms}. + + Multiple iterators can be used on the same array. However, be + aware that any non-const function call performed on the QJsonArray + will render all existing iterators undefined. + + \sa QJsonArray::iterator, QJsonArrayIterator +*/ + +/*! \fn QJsonArray::const_iterator::const_iterator() + + Constructs an uninitialized iterator. + + Functions like operator*() and operator++() should not be called + on an uninitialized iterator. Use operator=() to assign a value + to it before using it. + + \sa QJsonArray::constBegin() QJsonArray::constEnd() +*/ + +/*! \typedef QJsonArray::const_iterator::iterator_category + + A synonym for \i {std::random_access_iterator_tag} indicating + this iterator is a random access iterator. +*/ + +/*! \typedef QJsonArray::const_iterator::difference_type + + \internal +*/ + +/*! \typedef QJsonArray::const_iterator::value_type + + \internal +*/ + +/*! \typedef QJsonArray::const_iterator::reference + + \internal +*/ + +/*! \fn QJsonArray::const_iterator::const_iterator(const const_iterator &other) + + Constructs a copy of \a other. +*/ + +/*! \fn QJsonArray::const_iterator::const_iterator(const iterator &other) + + Constructs a copy of \a other. +*/ + +/*! \fn QJsonValue QJsonArray::const_iterator::operator*() const + + Returns the current item. +*/ + +/*! \fn QJsonValue QJsonArray::const_iterator::operator[](int j) const + + Returns the item at position \c{*this + j}. + + This function is provided to make QJsonArray iterators behave like C++ + pointers. + + \sa operator+() +*/ + +/*! \fn bool QJsonArray::const_iterator::operator==(const const_iterator &other) const + + Returns \c true if \a other points to the same item as this + iterator; otherwise returns \c false. + + \sa operator!=() +*/ + +/*! \fn bool QJsonArray::const_iterator::operator!=(const const_iterator &other) const + + Returns \c true if \a other points to a different item than this + iterator; otherwise returns \c false. + + \sa operator==() +*/ + +/*! + \fn bool QJsonArray::const_iterator::operator<(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is less than + the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::const_iterator::operator<=(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is less than + or equal to the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::const_iterator::operator>(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is greater + than the item pointed to by the \a other iterator. +*/ + +/*! + \fn bool QJsonArray::const_iterator::operator>=(const const_iterator& other) const + + Returns \c true if the item pointed to by this iterator is greater + than or equal to the item pointed to by the \a other iterator. +*/ + +/*! \fn QJsonArray::const_iterator &QJsonArray::const_iterator::operator++() + + The prefix ++ operator, \c{++it}, advances the iterator to the + next item in the array and returns an iterator to the new current + item. + + Calling this function on QJsonArray::end() leads to undefined results. + + \sa operator--() +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::const_iterator::operator++(int) + + \overload + + The postfix ++ operator, \c{it++}, advances the iterator to the + next item in the array and returns an iterator to the previously + current item. +*/ + +/*! \fn QJsonArray::const_iterator &QJsonArray::const_iterator::operator--() + + The prefix -- operator, \c{--it}, makes the preceding item + current and returns an iterator to the new current item. + + Calling this function on QJsonArray::begin() leads to undefined results. + + \sa operator++() +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::const_iterator::operator--(int) + + \overload + + The postfix -- operator, \c{it--}, makes the preceding item + current and returns an iterator to the previously current item. +*/ + +/*! \fn QJsonArray::const_iterator &QJsonArray::const_iterator::operator+=(int j) + + Advances the iterator by \a j items. If \a j is negative, the + iterator goes backward. + + \sa operator-=(), operator+() +*/ + +/*! \fn QJsonArray::const_iterator &QJsonArray::const_iterator::operator-=(int j) + + Makes the iterator go back by \a j items. If \a j is negative, + the iterator goes forward. + + \sa operator+=(), operator-() +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::const_iterator::operator+(int j) const + + Returns an iterator to the item at \a j positions forward from + this iterator. If \a j is negative, the iterator goes backward. + + \sa operator-(), operator+=() +*/ + +/*! \fn QJsonArray::const_iterator QJsonArray::const_iterator::operator-(int j) const + + Returns an iterator to the item at \a j positions backward from + this iterator. If \a j is negative, the iterator goes forward. + + \sa operator+(), operator-=() +*/ + +/*! \fn int QJsonArray::const_iterator::operator-(const_iterator other) const + + Returns the number of items between the item pointed to by \a + other and the item pointed to by this iterator. +*/ + + +/*! + \internal + */ +void QJsonArray::detach(uint reserve) +{ + if (!d) { + d = new QJsonPrivate::Data(reserve, QJsonValue::Array); + a = static_cast(d->header->root()); + d->ref.ref(); + return; + } + /* + if (reserve == 0 && d->ref.load() == 1) + return; + */ + if (reserve == 0 && int(d->ref) == 1) + return; + + QJsonPrivate::Data *x = d->clone(a, reserve); + x->ref.ref(); + if (!d->ref.deref()) + delete d; + d = x; + a = static_cast(d->header->root()); +} + +/*! + \internal + */ +void QJsonArray::compact() +{ + if (!d || !d->compactionCounter) + return; + + detach(); + d->compact(); + a = static_cast(d->header->root()); +} + + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QJsonArray &a) +{ + if (!a.a) { + dbg << "QJsonArray()"; + return dbg; + } + QByteArray json; + QJsonPrivate::Writer::arrayToJson(a.a, json, 0, true); + dbg.nospace() << "QJsonArray(" + << json.constData() // print as utf-8 string without extra quotation marks + << ")"; + return dbg.space(); +} +#endif + +QT_END_NAMESPACE + diff --git a/qjson/qjsonarray.h b/qjson/qjsonarray.h new file mode 100644 index 0000000..9ed64e4 --- /dev/null +++ b/qjson/qjsonarray.h @@ -0,0 +1,224 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONARRAY_H +#define QJSONARRAY_H + +#include "qjsonvalue.h" +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QDebug; +class QStringList; +template class QList; +typedef QList QVariantList; + +class Q_JSONRPC_EXPORT QJsonArray +{ +public: + QJsonArray(); + ~QJsonArray(); + + QJsonArray(const QJsonArray &other); + QJsonArray &operator =(const QJsonArray &other); + + static QJsonArray fromStringList(const QStringList &list); + static QJsonArray fromVariantList(const QVariantList &list); + QVariantList toVariantList() const; + + int size() const; + inline int count() const { return size(); } + + bool isEmpty() const; + QJsonValue at(int i) const; + QJsonValue first() const; + QJsonValue last() const; + + void prepend(const QJsonValue &value); + void append(const QJsonValue &value); + void removeAt(int i); + QJsonValue takeAt(int i); + inline void removeFirst() { removeAt(0); } + inline void removeLast() { removeAt(size() - 1); } + + void insert(int i, const QJsonValue &value); + void replace(int i, const QJsonValue &value); + + bool contains(const QJsonValue &element) const; + QJsonValueRef operator[](int i); + QJsonValue operator[](int i) const; + + bool operator==(const QJsonArray &other) const; + bool operator!=(const QJsonArray &other) const; + + class const_iterator; + + class iterator { + public: + QJsonArray *a; + int i; + typedef std::random_access_iterator_tag iterator_category; + typedef int difference_type; + typedef QJsonValue value_type; + //typedef T *pointer; + typedef QJsonValueRef reference; + + inline iterator() : a(0), i(0) { } + explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { } + + inline QJsonValueRef operator*() const { return QJsonValueRef(a, i); } + //inline T *operator->() const { return &concrete(i)->value; } + inline QJsonValueRef operator[](int j) const { return QJsonValueRef(a, i + j); } + + inline bool operator==(const iterator &o) const { return i == o.i; } + inline bool operator!=(const iterator &o) const { return i != o.i; } + inline bool operator<(const iterator& other) const { return i < other.i; } + inline bool operator<=(const iterator& other) const { return i <= other.i; } + inline bool operator>(const iterator& other) const { return i > other.i; } + inline bool operator>=(const iterator& other) const { return i >= other.i; } + inline bool operator==(const const_iterator &o) const { return i == o.i; } + inline bool operator!=(const const_iterator &o) const { return i != o.i; } + inline bool operator<(const const_iterator& other) const { return i < other.i; } + inline bool operator<=(const const_iterator& other) const { return i <= other.i; } + inline bool operator>(const const_iterator& other) const { return i > other.i; } + inline bool operator>=(const const_iterator& other) const { return i >= other.i; } + inline iterator &operator++() { ++i; return *this; } + inline iterator operator++(int) { iterator n = *this; ++i; return n; } + inline iterator &operator--() { i--; return *this; } + inline iterator operator--(int) { iterator n = *this; i--; return n; } + inline iterator &operator+=(int j) { i+=j; return *this; } + inline iterator &operator-=(int j) { i-=j; return *this; } + inline iterator operator+(int j) const { return iterator(a, i+j); } + inline iterator operator-(int j) const { return iterator(a, i-j); } + inline int operator-(iterator j) const { return i - j.i; } + }; + friend class iterator; + + class const_iterator { + public: + const QJsonArray *a; + int i; + typedef std::random_access_iterator_tag iterator_category; + typedef qptrdiff difference_type; + typedef QJsonValue value_type; + //typedef const T *pointer; + typedef QJsonValue reference; + + inline const_iterator() : a(0), i(0) { } + explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { } + inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {} + inline const_iterator(const iterator &o) : a(o.a), i(o.i) {} + + inline QJsonValue operator*() const { return a->at(i); } + //inline T *operator->() const { return &concrete(i)->value; } + inline QJsonValue operator[](int j) const { return a->at(i+j); } + inline bool operator==(const const_iterator &o) const { return i == o.i; } + inline bool operator!=(const const_iterator &o) const { return i != o.i; } + inline bool operator<(const const_iterator& other) const { return i < other.i; } + inline bool operator<=(const const_iterator& other) const { return i <= other.i; } + inline bool operator>(const const_iterator& other) const { return i > other.i; } + inline bool operator>=(const const_iterator& other) const { return i >= other.i; } + inline const_iterator &operator++() { ++i; return *this; } + inline const_iterator operator++(int) { const_iterator n = *this; ++i; return n; } + inline const_iterator &operator--() { i--; return *this; } + inline const_iterator operator--(int) { const_iterator n = *this; i--; return n; } + inline const_iterator &operator+=(int j) { i+=j; return *this; } + inline const_iterator &operator-=(int j) { i-=j; return *this; } + inline const_iterator operator+(int j) const { return const_iterator(a, i+j); } + inline const_iterator operator-(int j) const { return const_iterator(a, i-j); } + inline int operator-(const_iterator j) const { return i - j.i; } + }; + friend class const_iterator; + + // stl style + inline iterator begin() { detach(); return iterator(this, 0); } + inline const_iterator begin() const { return const_iterator(this, 0); } + inline const_iterator constBegin() const { return const_iterator(this, 0); } + inline iterator end() { detach(); return iterator(this, size()); } + inline const_iterator end() const { return const_iterator(this, size()); } + inline const_iterator constEnd() const { return const_iterator(this, size()); } + iterator insert(iterator before, const QJsonValue &value) { insert(before.i, value); return before; } + iterator erase(iterator pos) { removeAt(pos.i); return pos; } + + // more Qt + typedef iterator Iterator; + typedef const_iterator ConstIterator; + + // stl compatibility + inline void push_back(const QJsonValue &t) { append(t); } + inline void push_front(const QJsonValue &t) { prepend(t); } + inline void pop_front() { removeFirst(); } + inline void pop_back() { removeLast(); } + inline bool empty() const { return isEmpty(); } + typedef int size_type; + typedef QJsonValue value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef QJsonValueRef reference; + typedef QJsonValue const_reference; + typedef int difference_type; + +private: + friend class QJsonPrivate::Data; + friend class QJsonValue; + friend class QJsonDocument; + friend Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonArray &); + + QJsonArray(QJsonPrivate::Data *data, QJsonPrivate::Array *array); + void compact(); + void detach(uint reserve = 0); + + QJsonPrivate::Data *d; + QJsonPrivate::Array *a; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonArray &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QJSONARRAY_H diff --git a/qjson/qjsondocument.cpp b/qjson/qjsondocument.cpp new file mode 100644 index 0000000..28f63e4 --- /dev/null +++ b/qjson/qjsondocument.cpp @@ -0,0 +1,537 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjsondocument.h" +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsonarray.h" +#include +#include +#include +#include "qjsonwriter_p.h" +#include "qjsonparser_p.h" +#include "qjson_p.h" + +QT_BEGIN_NAMESPACE + +/*! \class QJsonDocument + \ingroup json + \reentrant + \since 5.0 + + \brief The QJsonDocument class provides a way to read and write JSON documents. + + QJsonDocument is a class that wraps a complete JSON document and can read and + write this document both from a UTF-8 encoded text based representation as well + as Qt's own binary format. + + A JSON document can be converted from its text-based representation to a QJsonDocument + using QJsonDocument::fromJson(). toJson() converts it back to text. The parser is very + fast and efficient and converts the JSON to the binary representation used by Qt. + + Validity of the parsed document can be queried with !isNull() + + A document can be queried as to whether it contains an array or an object using isArray() + and isObject(). The array or object contained in the document can be retrieved using + array() or object() and then read or manipulated. + + A document can also be created from a stored binary representation using fromBinaryData() or + fromRawData(). +*/ + +/*! + * Constructs an empty and invalid document. + */ +QJsonDocument::QJsonDocument() + : d(0) +{ +} + +/*! + * Creates a QJsonDocument from \a object. + */ +QJsonDocument::QJsonDocument(const QJsonObject &object) + : d(0) +{ + setObject(object); +} + +/*! + * Constructs a QJsonDocument from \a array. + */ +QJsonDocument::QJsonDocument(const QJsonArray &array) + : d(0) +{ + setArray(array); +} + +/*! \internal + */ +QJsonDocument::QJsonDocument(QJsonPrivate::Data *data) + : d(data) +{ + Q_ASSERT(d); + d->ref.ref(); +} + +/*! + Deletes the document. + + Binary data set with fromRawData is not freed. + */ +QJsonDocument::~QJsonDocument() +{ + if (d && !d->ref.deref()) + delete d; +} + +/*! + * Creates a copy of the \a other document. + */ +QJsonDocument::QJsonDocument(const QJsonDocument &other) +{ + d = other.d; + if (d) + d->ref.ref(); +} + +/*! + * Assigns the \a other document to this QJsonDocument. + * Returns a reference to this object. + */ +QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other) +{ + if (d != other.d) { + if (d && !d->ref.deref()) + delete d; + d = other.d; + if (d) + d->ref.ref(); + } + + return *this; +} + +/*! \enum QJsonDocument::DataValidation + + This value is used to tell QJsonDocument whether to validate the binary data + when converting to a QJsonDocument using fromBinaryData() or fromRawData(). + + \value Validate Validate the data before using it. This is the default. + \value BypassValidation Bypasses data validation. Only use if you received the + data from a trusted place and know it's valid, as using of invalid data can crash + the application. + */ + +/*! + Creates a QJsonDocument that uses the first \a size bytes from + \a data. It assumes \a data contains a binary encoded JSON document. + The created document does not take ownership of \a data and the caller + has to guarantee that \a data will not be deleted or modified as long as + any QJsonDocument, QJsonObject or QJsonArray still references the data. + + \a data has to be aligned to a 4 byte boundary. + + \a validation decides whether the data is checked for validity before being used. + By default the data is validated. If the \a data is not valid, the method returns + a null document. + + Returns a QJsonDocument representing the data. + + \sa rawData fromBinaryData isNull DataValidation + */ +QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) +{ + if (quintptr(data) & 3) { + qWarning() <<"QJsonDocument::fromRawData: data has to have 4 byte alignment"; + return QJsonDocument(); + } + + QJsonPrivate::Data *d = new QJsonPrivate::Data((char *)data, size); + d->ownsData = false; + + if (validation != BypassValidation && !d->valid()) { + delete d; + return QJsonDocument(); + } + + return QJsonDocument(d); +} + +/*! + Returns the raw binary representation of the data + \a size will contain the size of the \a data. + + This method is useful to e.g. stream the JSON document + in it's binary form to a file. + */ +const char *QJsonDocument::rawData(int *size) const +{ + if (!d) { + *size = 0; + return 0; + } + *size = d->alloc; + return d->rawData; +} + +/*! + Creates a QJsonDocument from \a data. + + \a validation decides whether the data is checked for validity before being used. + By default the data is validated. If the \a data is not valid, the method returns + a null document. + + \sa toBinaryData fromRawData isNull DataValidation + */ +QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) +{ + QJsonPrivate::Header h; + memcpy(&h, data.constData(), sizeof(QJsonPrivate::Header)); + QJsonPrivate::Base root; + memcpy(&root, data.constData() + sizeof(QJsonPrivate::Header), sizeof(QJsonPrivate::Base)); + + // do basic checks here, so we don't try to allocate more memory than we can. + if (data.size() < (int)(sizeof(QJsonPrivate::Header) + sizeof(QJsonPrivate::Base)) || + h.tag != QJsonDocument::BinaryFormatTag || h.version != 1u || + sizeof(QJsonPrivate::Header) + root.size > (uint)data.size()) + return QJsonDocument(); + + char *raw = (char *)malloc(data.size()); + if (!raw) + return QJsonDocument(); + + memcpy(raw, data.constData(), data.size()); + QJsonPrivate::Data *d = new QJsonPrivate::Data(raw, data.size()); + + if (validation != BypassValidation && !d->valid()) { + delete d; + return QJsonDocument(); + } + + return QJsonDocument(d); +} + +/*! + Creates a QJsonDocument from the QVariant \a variant. + + If the \a variant contains any other type than a QVariant::Map, + QVariant::List or QVariant::StringList, the returned document + document is invalid. + + \sa toVariant + */ +QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) +{ + QJsonDocument doc; + if (variant.type() == QVariant::Map) { + doc.setObject(QJsonObject::fromVariantMap(variant.toMap())); + } else if (variant.type() == QVariant::List) { + doc.setArray(QJsonArray::fromVariantList(variant.toList())); + } else if (variant.type() == QVariant::StringList) { + doc.setArray(QJsonArray::fromStringList(variant.toStringList())); + } + return doc; +} + +/*! + Returns a QVariant representing the Json document. + + The returned variant will be a QVariantList if the document is + a QJsonArray and a QVariantMap if the document is a QJsonObject. + + \sa fromVariant, QJsonValue::toVariant() + */ +QVariant QJsonDocument::toVariant() const +{ + if (!d) + return QVariant(); + + if (d->header->root()->isArray()) + return QJsonArray(d, static_cast(d->header->root())).toVariantList(); + else + return QJsonObject(d, static_cast(d->header->root())).toVariantMap(); +} + +/*! + Converts the QJsonDocument to a UTF-8 encoded JSON document. + + \sa fromJson + */ +QByteArray QJsonDocument::toJson() const +{ + if (!d) + return QByteArray(); + + QByteArray json; + + if (d->header->root()->isArray()) + QJsonPrivate::Writer::arrayToJson(static_cast(d->header->root()), json, 0); + else + QJsonPrivate::Writer::objectToJson(static_cast(d->header->root()), json, 0); + + return json; +} + +/*! + Parses a UTF-8 encoded JSON document and creates a QJsonDocument + from it. isNull() will return \c false if no error was encountered during + parsing. + + \sa toJson + */ +QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) +{ + QJsonPrivate::Parser parser(json.constData(), json.length()); + return parser.parse(error); +} + +/*! + Returns true if the document doesn't contain any data. + */ +bool QJsonDocument::isEmpty() const +{ + if (!d) + return true; + + return false; +} + +/*! + Returns a binary representation of the document. + + The binary representation is also the native format used internally in Qt, + and is very efficient and fast to convert to and from. + + The binary format can be stored on disk and interchanged with other applications + or computers. fromBinaryData() can be used to convert it back into a + JSON document. + + \sa fromBinaryData + */ +QByteArray QJsonDocument::toBinaryData() const +{ + if (!d || !d->rawData) + return QByteArray(); + + return QByteArray(d->rawData, d->header->root()->size + sizeof(QJsonPrivate::Header)); +} + +/*! + Returns true if the document contains an array. + + \sa array() isObject() + */ +bool QJsonDocument::isArray() const +{ + if (!d) + return false; + + QJsonPrivate::Header *h = (QJsonPrivate::Header *)d->rawData; + return h->root()->isArray(); +} + +/*! + Returns true if the document contains an object. + + \sa object() isArray() + */ +bool QJsonDocument::isObject() const +{ + if (!d) + return false; + + QJsonPrivate::Header *h = (QJsonPrivate::Header *)d->rawData; + return h->root()->isObject(); +} + +/*! + Returns the QJsonObject contained in the document. + + Returns an empty object if the document contains an + array. + + \sa isObject array setObject + */ +QJsonObject QJsonDocument::object() const +{ + if (d) { + QJsonPrivate::Base *b = d->header->root(); + if (b->isObject()) + return QJsonObject(d, static_cast(b)); + } + return QJsonObject(); +} + +/*! + Returns the QJsonArray contained in the document. + + Returns an empty array if the document contains an + object. + + \sa isArray object setArray + */ +QJsonArray QJsonDocument::array() const +{ + if (d) { + QJsonPrivate::Base *b = d->header->root(); + if (b->isArray()) + return QJsonArray(d, static_cast(b)); + } + return QJsonArray(); +} + +/*! + Sets \a object as the main object of this document. + + \sa setArray object + */ +void QJsonDocument::setObject(const QJsonObject &object) +{ + if (d && !d->ref.deref()) + delete d; + + d = object.d; + + if (!d) { + d = new QJsonPrivate::Data(0, QJsonValue::Object); + } else if (d->compactionCounter || object.o != d->header->root()) { + QJsonObject o(object); + if (d->compactionCounter) + o.compact(); + else + o.detach(); + d = o.d; + d->ref.ref(); + return; + } + d->ref.ref(); +} + +/*! + Sets \a array as the main object of this document. + + \sa setObject array + */ +void QJsonDocument::setArray(const QJsonArray &array) +{ + if (d && !d->ref.deref()) + delete d; + + d = array.d; + + if (!d) { + d = new QJsonPrivate::Data(0, QJsonValue::Array); + } else if (d->compactionCounter || array.a != d->header->root()) { + QJsonArray a(array); + if (d->compactionCounter) + a.compact(); + else + a.detach(); + d = a.d; + d->ref.ref(); + return; + } + d->ref.ref(); +} + +/*! + Returns \c true if the \a other document is equal to this document. + */ +bool QJsonDocument::operator==(const QJsonDocument &other) const +{ + if (d == other.d) + return true; + + if (!d || !other.d) + return false; + + if (d->header->root()->isArray() != other.d->header->root()->isArray()) + return false; + + if (d->header->root()->isObject()) + return QJsonObject(d, static_cast(d->header->root())) + == QJsonObject(other.d, static_cast(other.d->header->root())); + else + return QJsonArray(d, static_cast(d->header->root())) + == QJsonArray(other.d, static_cast(other.d->header->root())); +} + +/*! + \fn bool QJsonDocument::operator!=(const QJsonDocument &other) const + + returns \c true if \a other is not equal to this document + */ + +/*! + returns true if this document is null. + + Null documents are documents created through the default constructor. + + Documents created from UTF-8 encoded text or the binary format are + validated during parsing. If validation fails, the returned document + will also be null. + */ +bool QJsonDocument::isNull() const +{ + return (d == 0); +} + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QJsonDocument &o) +{ + if (!o.d) { + dbg << "QJsonDocument()"; + return dbg; + } + QByteArray json; + if (o.d->header->root()->isArray()) + QJsonPrivate::Writer::arrayToJson(static_cast(o.d->header->root()), json, 0, true); + else + QJsonPrivate::Writer::objectToJson(static_cast(o.d->header->root()), json, 0, true); + dbg.nospace() << "QJsonDocument(" + << json.constData() // print as utf-8 string without extra quotation marks + << ")"; + return dbg.space(); +} +#endif + +QT_END_NAMESPACE diff --git a/qjson/qjsondocument.h b/qjson/qjsondocument.h new file mode 100644 index 0000000..cc14490 --- /dev/null +++ b/qjson/qjsondocument.h @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONDOCUMENT_H +#define QJSONDOCUMENT_H + +#include "qjsonvalue.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QDebug; + +namespace QJsonPrivate { + class Parser; +} + +struct Q_JSONRPC_EXPORT QJsonParseError +{ + enum ParseError { + NoError = 0, + UnterminatedObject, + MissingNameSeparator, + UnterminatedArray, + MissingValueSeparator, + IllegalValue, + EndOfNumber, + IllegalNumber, + StringEscapeSequence, + StringUTF8Scan, + EndOfString, + MissingObject + }; + + int offset; + ParseError error; +}; + +class Q_JSONRPC_EXPORT QJsonDocument +{ +public: +#ifdef Q_LITTLE_ENDIAN + static const uint BinaryFormatTag = ('q') | ('b' << 8) | ('j' << 16) | ('s' << 24); +#else + static const uint BinaryFormatTag = ('q' << 24) | ('b' << 16) | ('j' << 8) | ('s'); +#endif + + QJsonDocument(); + explicit QJsonDocument(const QJsonObject &object); + explicit QJsonDocument(const QJsonArray &array); + ~QJsonDocument(); + + QJsonDocument(const QJsonDocument &other); + QJsonDocument &operator =(const QJsonDocument &other); + + enum DataValidation { + Validate, + BypassValidation + }; + + static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate); + const char *rawData(int *size) const; + + static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate); + QByteArray toBinaryData() const; + + static QJsonDocument fromVariant(const QVariant &variant); + QVariant toVariant() const; + + static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0); + QByteArray toJson() const; + + bool isEmpty() const; + bool isArray() const; + bool isObject() const; + + QJsonObject object() const; + QJsonArray array() const; + + void setObject(const QJsonObject &object); + void setArray(const QJsonArray &array); + + bool operator==(const QJsonDocument &other) const; + bool operator!=(const QJsonDocument &other) const { return !(*this == other); } + + bool isNull() const; + +private: + friend class QJsonValue; + friend class QJsonPrivate::Data; + friend class QJsonPrivate::Parser; + friend Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonDocument &); + + QJsonDocument(QJsonPrivate::Data *data); + + QJsonPrivate::Data *d; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonDocument &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QJSONDOCUMENT_H diff --git a/qjson/qjsonexport.h b/qjson/qjsonexport.h new file mode 100644 index 0000000..f7e3c42 --- /dev/null +++ b/qjson/qjsonexport.h @@ -0,0 +1,16 @@ + +#ifndef QJSONEXPORT_H +#define QJSONEXPORT_H + + +#ifdef Q_JSONRPC_DLL +# ifdef Q_BUILD_JSONRPC // build qjsonrpc Dll +# define Q_JSONRPC_EXPORT Q_DECL_EXPORT +# else // use qjsonrpc as Dll +# define Q_JSONRPC_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_JSONRPC_EXPORT +#endif + +#endif diff --git a/qjson/qjsonobject.cpp b/qjson/qjsonobject.cpp new file mode 100644 index 0000000..a96195d --- /dev/null +++ b/qjson/qjsonobject.cpp @@ -0,0 +1,1022 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsonarray.h" +#include +#include +#include +#include "qjson_p.h" +#include "qjsonwriter_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QJsonObject + \ingroup json + \reentrant + \since 5.0 + + \brief The QJsonObject class encapsulates a JSON object. + + A JSON object is a list of key value pairs, where the keys are unique strings + and the values are represented by a QJsonValue. + + A QJsonObject can be converted to and from a QVariantMap. You can query the + number of (key, value) pairs with size(), insert(), and remove() entries from it + and iterate over its content using the standard C++ iterator pattern. + + QJsonObject is an implicitly shared class, and shares the data with the document + it has been created from as long as it is not being modified. + + You can convert the array to and from text based JSON through QJsonDocument. +*/ + +/*! + Constructs an empty JSON object + + \sa isEmpty + */ +QJsonObject::QJsonObject() + : d(0), o(0) +{ +} + +/*! + \internal + */ +QJsonObject::QJsonObject(QJsonPrivate::Data *data, QJsonPrivate::Object *object) + : d(data), o(object) +{ + Q_ASSERT(d); + Q_ASSERT(o); + d->ref.ref(); +} + + +/*! + Destroys the object. + */ +QJsonObject::~QJsonObject() +{ + if (d && !d->ref.deref()) + delete d; +} + +/*! + Creates a copy of \a other. + + Since QJsonObject is implicitly shared, the copy is shallow + as long as the object does not get modified. + */ +QJsonObject::QJsonObject(const QJsonObject &other) +{ + d = other.d; + o = other.o; + if (d) + d->ref.ref(); +} + +/*! + Assigns \a other to this object. + */ +QJsonObject &QJsonObject::operator =(const QJsonObject &other) +{ + if (d != other.d) { + if (d && !d->ref.deref()) + delete d; + d = other.d; + if (d) + d->ref.ref(); + } + o = other.o; + + return *this; +} + +/*! + Converts the variant map \a map to a QJsonObject. + + The keys in \a map will be used as the keys in the JSON object, + and the QVariant values will be converted to JSON values. + + \sa toVariantMap, QJsonValue::fromVariant + */ +QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map) +{ + // ### this is implemented the trivial way, not the most efficient way + + QJsonObject object; + for (QVariantMap::const_iterator it = map.constBegin(); it != map.constEnd(); ++it) + object.insert(it.key(), QJsonValue::fromVariant(it.value())); + return object; +} + +/*! + Converts this object to a QVariantMap. + + Returns the created map. + */ +QVariantMap QJsonObject::toVariantMap() const +{ + QVariantMap map; + if (o) { + for (uint i = 0; i < o->length; ++i) { + QJsonPrivate::Entry *e = o->entryAt(i); + map.insert(e->key(), QJsonValue(d, o, e->value).toVariant()); + } + } + return map; +} + +/*! + Returns a list of all keys in this object. + */ +QStringList QJsonObject::keys() const +{ + if (!d) + return QStringList(); + + QStringList keys; + + for (uint i = 0; i < o->length; ++i) { + QJsonPrivate::Entry *e = o->entryAt(i); + keys.append(e->key()); + } + + return keys; +} + +/*! + Returns the the number of (key, value) pairs stored in the object. + */ +int QJsonObject::size() const +{ + if (!d) + return 0; + + return o->length; +} + +/*! + Returns \c true if the object is empty. This is the same as size() == 0. + + \sa size + */ +bool QJsonObject::isEmpty() const +{ + if (!d) + return true; + + return !o->length; +} + +/*! + Returns a QJsonValue representing the value for the key \a key. + + The returned QJsonValue is \c Undefined, if the key does not exist. + + \sa setValue, QJsonValue, QJsonValue::isUndefined + */ +QJsonValue QJsonObject::value(const QString &key) const +{ + if (!d) + return QJsonValue(); + + bool keyExists; + int i = o->indexOf(key, &keyExists); + if (!keyExists) + return QJsonValue(QJsonValue::Undefined); + return QJsonValue(d, o, o->entryAt(i)->value); +} + +/*! + Returns a QJsonValue representing the value for the key \a key. + + This does the same as value(). + + The returned QJsonValue is \c Undefined, if the key does not exist. + + \sa value, setValue, QJsonValue, QJsonValue::isUndefined + */ +QJsonValue QJsonObject::operator [](const QString &key) const +{ + return value(key); +} + +/*! + Returns a reference to the value for \a key. + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. + + \sa setValue, value + */ +QJsonValueRef QJsonObject::operator [](const QString &key) +{ + // ### somewhat inefficient, as we lookup the key twice if it doesn't yet exist + bool keyExists = false; + int index = o ? o->indexOf(key, &keyExists) : -1; + if (!keyExists) { + iterator i = insert(key, QJsonValue()); + index = i.i; + } + return QJsonValueRef(this, index); +} + +/*! + Inserts a new item with the key \a key and a value of \a value. + + If there is already an item with the key \a key then that item's value + is replaced with \a value. + + Returns an iterator pointing to the inserted item. + + If the value is QJsonValue::Undefined, it will cause the key to get removed + from the object. The returned iterator will then point to end() + + \sa remove, take, QJsonObject::iterator, end + */ +QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &value) +{ + if (value.t == QJsonValue::Undefined) { + remove(key); + return end(); + } + + bool latinOrIntValue; + int valueSize = QJsonPrivate::Value::requiredStorage(value, &latinOrIntValue); + + bool latinKey = QJsonPrivate::useCompressed(key); + int valueOffset = sizeof(QJsonPrivate::Entry) + QJsonPrivate::qStringSize(key, latinKey); + int requiredSize = valueOffset + valueSize; + + detach(requiredSize + sizeof(QJsonPrivate::offset)); // offset for the new index entry + + if (!o->length) + o->tableOffset = sizeof(QJsonPrivate::Object); + + bool keyExists = false; + int pos = o->indexOf(key, &keyExists); + if (keyExists) + ++d->compactionCounter; + + o->reserveSpace(requiredSize, pos, 1, keyExists); + + QJsonPrivate::Entry *e = o->entryAt(pos); + e->value.type = value.t; + e->value.latinKey = latinKey; + e->value.latinOrIntValue = latinOrIntValue; + e->value.value = QJsonPrivate::Value::valueToStore(value, (char *)e - (char *)o + valueOffset); + QJsonPrivate::copyString((char *)(e + 1), key, latinKey); + if (valueSize) + QJsonPrivate::Value::copyData(value, (char *)e + valueOffset, latinOrIntValue); + + return iterator(this, pos); +} + +/*! + Removes \a key from the object. + + \sa insert, take + */ +void QJsonObject::remove(const QString &key) +{ + if (!d) + return; + + bool keyExists; + int index = o->indexOf(key, &keyExists); + if (!keyExists) + return; + + detach(); + o->removeItems(index, 1); + ++d->compactionCounter; + if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2) + compact(); +} + +/*! + Removes \a key from the object. + + Returns a QJsonValue containing the value referenced by \a key. + If \a key was not contained in the object, the returned QJsonValue + is Undefined. + + \sa insert, remove, QJsonValue + */ +QJsonValue QJsonObject::take(const QString &key) +{ + if (!o) + return QJsonValue(QJsonValue::Undefined); + + bool keyExists; + int index = o->indexOf(key, &keyExists); + if (!keyExists) + return QJsonValue(QJsonValue::Undefined); + + QJsonPrivate::Entry *e = o->entryAt(index); + o->removeItems(index, 1); + ++d->compactionCounter; + if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2) + compact(); + + return QJsonValue(d, o, e->value); +} + +/*! + Returns \c true if the object contains key \a key. + + \sa insert, remove, take + */ +bool QJsonObject::contains(const QString &key) const +{ + if (!o) + return false; + + bool keyExists; + o->indexOf(key, &keyExists); + return keyExists; +} + +/*! + Returns \c true if \a other is equal to this object + */ +bool QJsonObject::operator==(const QJsonObject &other) const +{ + if (o == other.o) + return true; + + if (!o) + return !other.o->length; + if (!other.o) + return !o->length; + if (o->length != other.o->length) + return false; + + for (uint i = 0; i < o->length; ++i) { + QJsonPrivate::Entry *e = o->entryAt(i); + QJsonValue v(d, o, e->value); + if (other.value(e->key()) != v) + return false; + } + + return true; +} + +/*! + Returns \c true if \a other is not equal to this object + */ +bool QJsonObject::operator!=(const QJsonObject &other) const +{ + return !(*this == other); +} + +/*! + Removes the (key, value) pair pointed to by the iterator \a it + from the map, and returns an iterator to the next item in the + map. + + \sa remove() + */ +QJsonObject::iterator QJsonObject::erase(QJsonObject::iterator it) +{ +// Q_ASSERT(d && d->ref.load() == 1); + Q_ASSERT(d && int(d->ref) == 1); + if (it.o != this || it.i < 0 || it.i >= (int)o->length) + return iterator(this, o->length); + + int index = it.i; + + o->removeItems(index, 1); + ++d->compactionCounter; + if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2) + compact(); + + // iterator hasn't changed + return it; +} + +/*! + Returns an iterator pointing to the item with key \a key in the + map. + + If the map contains no item with key \a key, the function + returns end(). + */ +QJsonObject::iterator QJsonObject::find(const QString &key) +{ + bool keyExists = false; + int index = o ? o->indexOf(key, &keyExists) : 0; + if (!keyExists) + return end(); + return iterator(this, index); +} + +/*! \fn QJsonObject::const_iterator QJsonObject::find(const Key &key) const + + \overload +*/ + +/*! + Returns an const iterator pointing to the item with key \a key in the + map. + + If the map contains no item with key \a key, the function + returns constEnd(). + */ +QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const +{ + bool keyExists = false; + int index = o ? o->indexOf(key, &keyExists) : 0; + if (!keyExists) + return end(); + return const_iterator(this, index); +} + +/*! \fn int QJsonObject::count() const + + \overload + + Same as size(). +*/ + +/*! \fn int QJsonObject::length() const + + \overload + + Same as size(). +*/ + +/*! \fn QJsonObject::iterator QJsonObject::begin() + + Returns an \l{STL-style iterator} pointing to the first item in + the object. + + \sa constBegin(), end() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::begin() const + + \overload +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::constBegin() const + + Returns a const \l{STL-style iterator} pointing to the first item + in the object. + + \sa begin(), constEnd() +*/ + +/*! \fn QJsonObject::iterator QJsonObject::end() + + Returns an \l{STL-style iterator} pointing to the imaginary item + after the last item in the object. + + \sa begin(), constEnd() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::end() const + + \overload +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::constEnd() const + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the object. + + \sa constBegin(), end() +*/ + +/*! + \fn bool QJsonObject::empty() const + + This function is provided for STL compatibility. It is equivalent + to isEmpty(), returning \c true if the object is empty; otherwise + returning \c false. +*/ + +/*! \class QJsonObject::iterator + \brief The QJsonObject::iterator class provides an STL-style non-const iterator for QJsonObject. + + QJsonObject::iterator allows you to iterate over a QJsonObject + and to modify the value (but not the key) stored under + a particular key. If you want to iterate over a const QJsonObject, you + should use QJsonObject::const_iterator. It is generally good practice to + use QJsonObject::const_iterator on a non-const QJsonObject as well, unless you + need to change the QJsonObject through the iterator. Const iterators are + slightly faster, and improves code readability. + + The default QJsonObject::iterator constructor creates an uninitialized + iterator. You must initialize it using a QJsonObject function like + QJsonObject::begin(), QJsonObject::end(), or QJsonObject::find() before you can + start iterating. + + Multiple iterators can be used on the same object. Existing iterators will however + become dangling once the object gets modified. + + \sa QJsonObject::const_iterator +*/ + +/*! \typedef QJsonObject::iterator::difference_type + + \internal +*/ + +/*! \typedef QJsonObject::iterator::iterator_category + + A synonym for \i {std::bidirectional_iterator_tag} indicating + this iterator is a bidirectional iterator. +*/ + +/*! \typedef QJsonObject::iterator::reference + + \internal +*/ + +/*! \typedef QJsonObject::iterator::value_type + + \internal +*/ + +/*! \fn QJsonObject::iterator::iterator() + + Constructs an uninitialized iterator. + + Functions like key(), value(), and operator++() must not be + called on an uninitialized iterator. Use operator=() to assign a + value to it before using it. + + \sa QJsonObject::begin() QJsonObject::end() +*/ + +/*! \fn QString QJsonObject::iterator::key() const + + Returns the current item's key. + + There is no direct way of changing an item's key through an + iterator, although it can be done by calling QJsonObject::erase() + followed by QJsonObject::insert(). + + \sa value() +*/ + +/*! \fn QJsonValueRef QJsonObject::iterator::value() const + + Returns a modifiable reference to the current item's value. + + You can change the value of an item by using value() on + the left side of an assignment. + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. + + \sa key(), operator*() +*/ + +/*! \fn QJsonValueRef QJsonObject::iterator::operator*() const + + Returns a modifiable reference to the current item's value. + + Same as value(). + + The return value is of type QJsonValueRef, a helper class for QJsonArray + and QJsonObject. When you get an object of type QJsonValueRef, you can + use it as if it were a reference to a QJsonValue. If you assign to it, + the assignment will apply to the character in the QJsonArray of QJsonObject + from which you got the reference. + + \sa key() +*/ + +/*! + \fn bool QJsonObject::iterator::operator==(const iterator &other) const + \fn bool QJsonObject::iterator::operator==(const const_iterator &other) const + + Returns \c true if \a other points to the same item as this + iterator; otherwise returns \c false. + + \sa operator!=() +*/ + +/*! + \fn bool QJsonObject::iterator::operator!=(const iterator &other) const + \fn bool QJsonObject::iterator::operator!=(const const_iterator &other) const + + Returns \c true if \a other points to a different item than this + iterator; otherwise returns \c false. + + \sa operator==() +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator++() + + The prefix ++ operator, \c{++i}, advances the iterator to the + next item in the object and returns an iterator to the new current + item. + + Calling this function on QJsonObject::end() leads to undefined results. + + \sa operator--() +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator++(int) + + \overload + + The postfix ++ operator, \c{i++}, advances the iterator to the + next item in the object and returns an iterator to the previously + current item. +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator--() + + The prefix -- operator, \c{--i}, makes the preceding item + current and returns an iterator pointing to the new current item. + + Calling this function on QJsonObject::begin() leads to undefined + results. + + \sa operator++() +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator--(int) + + \overload + + The postfix -- operator, \c{i--}, makes the preceding item + current and returns an iterator pointing to the previously + current item. +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator+(int j) const + + Returns an iterator to the item at \a j positions forward from + this iterator. If \a j is negative, the iterator goes backward. + + \sa operator-() + +*/ + +/*! \fn QJsonObject::iterator QJsonObject::iterator::operator-(int j) const + + Returns an iterator to the item at \a j positions backward from + this iterator. If \a j is negative, the iterator goes forward. + + \sa operator+() +*/ + +/*! \fn QJsonObject::iterator &QJsonObject::iterator::operator+=(int j) + + Advances the iterator by \a j items. If \a j is negative, the + iterator goes backward. + + \sa operator-=(), operator+() +*/ + +/*! \fn QJsonObject::iterator &QJsonObject::iterator::operator-=(int j) + + Makes the iterator go back by \a j items. If \a j is negative, + the iterator goes forward. + + \sa operator+=(), operator-() +*/ + +/*! \class QJsonObject::const_iterator + \brief The QJsonObject::const_iterator class provides an STL-style const iterator for QJsonObject. + + QJsonObject::const_iterator allows you to iterate over a QJsonObject. + If you want to modify the QJsonObject as you iterate + over it, you must use QJsonObject::iterator instead. It is generally + good practice to use QJsonObject::const_iterator on a non-const QJsonObject as + well, unless you need to change the QJsonObject through the iterator. + Const iterators are slightly faster and improves code + readability. + + The default QJsonObject::const_iterator constructor creates an + uninitialized iterator. You must initialize it using a QJsonObject + function like QJsonObject::constBegin(), QJsonObject::constEnd(), or + QJsonObject::find() before you can start iterating. + + Multiple iterators can be used on the same object. Existing iterators + will however become dangling if the object gets modified. + + \sa QJsonObject::iterator, QJsonObjectIterator +*/ + +/*! \typedef QJsonObject::const_iterator::difference_type + + \internal +*/ + +/*! \typedef QJsonObject::const_iterator::iterator_category + + A synonym for \i {std::bidirectional_iterator_tag} indicating + this iterator is a bidirectional iterator. +*/ + +/*! \typedef QJsonObject::const_iterator::reference + + \internal +*/ + +/*! \typedef QJsonObject::const_iterator::value_type + + \internal +*/ + +/*! \fn QJsonObject::const_iterator::const_iterator() + + Constructs an uninitialized iterator. + + Functions like key(), value(), and operator++() must not be + called on an uninitialized iterator. Use operator=() to assign a + value to it before using it. + + \sa QJsonObject::constBegin() QJsonObject::constEnd() +*/ + +/*! \fn QJsonObject::const_iterator::const_iterator(const iterator &other) + + Constructs a copy of \a other. +*/ + +/*! \fn QString QJsonObject::const_iterator::key() const + + Returns the current item's key. + + \sa value() +*/ + +/*! \fn QJsonValue QJsonObject::const_iterator::value() const + + Returns the current item's value. + + \sa key(), operator*() +*/ + +/*! \fn QJsonValue QJsonObject::const_iterator::operator*() const + + Returns the current item's value. + + Same as value(). + + \sa key() +*/ + +/*! \fn bool QJsonObject::const_iterator::operator==(const const_iterator &other) const + + Returns \c true if \a other points to the same item as this + iterator; otherwise returns \c false. + + \sa operator!=() +*/ + +/*! \fn bool QJsonObject::const_iterator::operator!=(const const_iterator &other) const + + Returns \c true if \a other points to a different item than this + iterator; otherwise returns \c false. + + \sa operator==() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::const_iterator::operator++() + + The prefix ++ operator, \c{++i}, advances the iterator to the + next item in the object and returns an iterator to the new current + item. + + Calling this function on QJsonObject::end() leads to undefined results. + + \sa operator--() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::const_iterator::operator++(int) + + \overload + + The postfix ++ operator, \c{i++}, advances the iterator to the + next item in the object and returns an iterator to the previously + current item. +*/ + +/*! \fn QJsonObject::const_iterator &QJsonObject::const_iterator::operator--() + + The prefix -- operator, \c{--i}, makes the preceding item + current and returns an iterator pointing to the new current item. + + Calling this function on QJsonObject::begin() leads to undefined + results. + + \sa operator++() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::const_iterator::operator--(int) + + \overload + + The postfix -- operator, \c{i--}, makes the preceding item + current and returns an iterator pointing to the previously + current item. +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::const_iterator::operator+(int j) const + + Returns an iterator to the item at \a j positions forward from + this iterator. If \a j is negative, the iterator goes backward. + + This operation can be slow for large \a j values. + + \sa operator-() +*/ + +/*! \fn QJsonObject::const_iterator QJsonObject::const_iterator::operator-(int j) const + + Returns an iterator to the item at \a j positions backward from + this iterator. If \a j is negative, the iterator goes forward. + + This operation can be slow for large \a j values. + + \sa operator+() +*/ + +/*! \fn QJsonObject::const_iterator &QJsonObject::const_iterator::operator+=(int j) + + Advances the iterator by \a j items. If \a j is negative, the + iterator goes backward. + + This operation can be slow for large \a j values. + + \sa operator-=(), operator+() +*/ + +/*! \fn QJsonObject::const_iterator &QJsonObject::const_iterator::operator-=(int j) + + Makes the iterator go back by \a j items. If \a j is negative, + the iterator goes forward. + + This operation can be slow for large \a j values. + + \sa operator+=(), operator-() +*/ + + +/*! + \internal + */ +void QJsonObject::detach(uint reserve) +{ + if (!d) { + d = new QJsonPrivate::Data(reserve, QJsonValue::Object); + o = static_cast(d->header->root()); + d->ref.ref(); + return; + } + /* + if (reserve == 0 && d->ref.load() == 1) + return; + */ + if (reserve == 0 && int(d->ref) == 1) + return; + + QJsonPrivate::Data *x = d->clone(o, reserve); + x->ref.ref(); + if (!d->ref.deref()) + delete d; + d = x; + o = static_cast(d->header->root()); +} + +/*! + \internal + */ +void QJsonObject::compact() +{ + if (!d || !d->compactionCounter) + return; + + detach(); + d->compact(); + o = static_cast(d->header->root()); +} + +/*! + \internal + */ +QString QJsonObject::keyAt(int i) const +{ + Q_ASSERT(o && i >= 0 && i < (int)o->length); + + QJsonPrivate::Entry *e = o->entryAt(i); + return e->key(); +} + +/*! + \internal + */ +QJsonValue QJsonObject::valueAt(int i) const +{ + if (!o || i < 0 || i >= (int)o->length) + return QJsonValue(QJsonValue::Undefined); + + QJsonPrivate::Entry *e = o->entryAt(i); + return QJsonValue(d, o, e->value); +} + +/*! + \internal + */ +void QJsonObject::setValueAt(int i, const QJsonValue &val) +{ + Q_ASSERT(o && i >= 0 && i < (int)o->length); + + QJsonPrivate::Entry *e = o->entryAt(i); + insert(e->key(), val); +} + +/*! \typedef QJsonObject::Iterator + + Qt-style synonym for QJsonObject::iterator. +*/ + +/*! \typedef QJsonObject::ConstIterator + + Qt-style synonym for QJsonObject::const_iterator. +*/ + + +/*! \class QJsonObject::iterator + \ingroup json + \reentrant + \since 5.0 + + \brief The QJsonDocument::iterator class provides a way to iterate over q QJsonObject + + + */ + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QJsonObject &o) +{ + if (!o.o) { + dbg << "QJsonObject()"; + return dbg; + } + QByteArray json; + QJsonPrivate::Writer::objectToJson(o.o, json, 0, true); + dbg.nospace() << "QJsonObject(" + << json.constData() // print as utf-8 string without extra quotation marks + << ")"; + return dbg.space(); +} +#endif + +QT_END_NAMESPACE diff --git a/qjson/qjsonobject.h b/qjson/qjsonobject.h new file mode 100644 index 0000000..c52e617 --- /dev/null +++ b/qjson/qjsonobject.h @@ -0,0 +1,219 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONOBJECT_H +#define QJSONOBJECT_H + +#include "qjsonvalue.h" +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QDebug; +template class QMap; +typedef QMap QVariantMap; + +class Q_JSONRPC_EXPORT QJsonObject +{ +public: + QJsonObject(); + ~QJsonObject(); + + QJsonObject(const QJsonObject &other); + QJsonObject &operator =(const QJsonObject &other); + + static QJsonObject fromVariantMap(const QVariantMap &map); + QVariantMap toVariantMap() const; + + QStringList keys() const; + int size() const; + inline int count() const { return size(); } + inline int length() const { return size(); } + bool isEmpty() const; + + QJsonValue value(const QString &key) const; + QJsonValue operator[] (const QString &key) const; + QJsonValueRef operator[] (const QString &key); + + void remove(const QString &key); + QJsonValue take(const QString &key); + bool contains(const QString &key) const; + + bool operator==(const QJsonObject &other) const; + bool operator!=(const QJsonObject &other) const; + + class const_iterator; + + class iterator + { + friend class const_iterator; + friend class QJsonObject; + QJsonObject *o; + int i; + + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef int difference_type; + typedef QJsonValue value_type; +// typedef T *pointer; + typedef QJsonValueRef reference; + + inline iterator() : o(0), i(0) {} + inline iterator(QJsonObject *obj, int index) : o(obj), i(index) {} + + inline QString key() const { return o->keyAt(i); } + inline QJsonValueRef value() const { return QJsonValueRef(o, i); } + inline QJsonValueRef operator*() const { return QJsonValueRef(o, i); } + //inline T *operator->() const { return &concrete(i)->value; } + inline bool operator==(const iterator &other) const { return i == other.i; } + inline bool operator!=(const iterator &other) const { return i != other.i; } + + inline iterator &operator++() { ++i; return *this; } + inline iterator operator++(int) { iterator r = *this; ++i; return r; } + inline iterator &operator--() { --i; return *this; } + inline iterator operator--(int) { iterator r = *this; --i; return r; } + inline iterator operator+(int j) const + { iterator r = *this; r.i += j; return r; } + inline iterator operator-(int j) const { return operator+(-j); } + inline iterator &operator+=(int j) { i += j; return *this; } + inline iterator &operator-=(int j) { i -= j; return *this; } + + public: + inline bool operator==(const const_iterator &other) const { return i == other.i; } + inline bool operator!=(const const_iterator &other) const { return i != other.i; } + }; + friend class iterator; + + class const_iterator + { + friend class iterator; + const QJsonObject *o; + int i; + + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef int difference_type; + typedef QJsonValue value_type; + typedef QJsonValue reference; + + inline const_iterator() : o(0), i(0) {} + inline const_iterator(const QJsonObject *obj, int index) + : o(obj), i(index) {} + inline const_iterator(const iterator &other) + : o(other.o), i(other.i) {} + + inline QString key() const { return o->keyAt(i); } + inline QJsonValue value() const { return o->valueAt(i); } + inline QJsonValue operator*() const { return o->valueAt(i); } + //inline const T *operator->() const { return &concrete(i)->value; } + inline bool operator==(const const_iterator &other) const { return i == other.i; } + inline bool operator!=(const const_iterator &other) const { return i != other.i; } + + inline const_iterator &operator++() { ++i; return *this; } + inline const_iterator operator++(int) { const_iterator r = *this; ++i; return r; } + inline const_iterator &operator--() { --i; return *this; } + inline const_iterator operator--(int) { const_iterator r = *this; --i; return r; } + inline const_iterator operator+(int j) const + { const_iterator r = *this; r.i += j; return r; } + inline const_iterator operator-(int j) const { return operator+(-j); } + inline const_iterator &operator+=(int j) { i += j; return *this; } + inline const_iterator &operator-=(int j) { i -= j; return *this; } + + inline bool operator==(const iterator &other) const { return i == other.i; } + inline bool operator!=(const iterator &other) const { return i != other.i; } + }; + friend class const_iterator; + + // STL style + inline iterator begin() { detach(); return iterator(this, 0); } + inline const_iterator begin() const { return const_iterator(this, 0); } + inline const_iterator constBegin() const { return const_iterator(this, 0); } + inline iterator end() { detach(); return iterator(this, size()); } + inline const_iterator end() const { return const_iterator(this, size()); } + inline const_iterator constEnd() const { return const_iterator(this, size()); } + iterator erase(iterator it); + + // more Qt + typedef iterator Iterator; + typedef const_iterator ConstIterator; + iterator find(const QString &key); + const_iterator find(const QString &key) const { return constFind(key); } + const_iterator constFind(const QString &key) const; + iterator insert(const QString &key, const QJsonValue &value); + + // STL compatibility + typedef QJsonValue mapped_type; + typedef QString key_type; + typedef int size_type; + + inline bool empty() const { return isEmpty(); } + +private: + friend class QJsonPrivate::Data; + friend class QJsonValue; + friend class QJsonDocument; + friend class QJsonValueRef; + + friend Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonObject &); + + QJsonObject(QJsonPrivate::Data *data, QJsonPrivate::Object *object); + void detach(uint reserve = 0); + void compact(); + + QString keyAt(int i) const; + QJsonValue valueAt(int i) const; + void setValueAt(int i, const QJsonValue &val); + + QJsonPrivate::Data *d; + QJsonPrivate::Object *o; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonObject &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QJSONOBJECT_H diff --git a/qjson/qjsonparser.cpp b/qjson/qjsonparser.cpp new file mode 100644 index 0000000..b1e6a5a --- /dev/null +++ b/qjson/qjsonparser.cpp @@ -0,0 +1,801 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "qjsonparser_p.h" +#include "qjson_p.h" + +//#define PARSER_DEBUG +#ifdef PARSER_DEBUG +static int indent = 0; +#define BEGIN qDebug() << QByteArray(4*indent++, ' ').constData() << "pos=" << current +#define END --indent +#define DEBUG qDebug() << QByteArray(4*indent, ' ').constData() +#else +#define BEGIN if (1) ; else qDebug() +#define END do {} while (0) +#define DEBUG if (1) ; else qDebug() +#endif + +QT_BEGIN_NAMESPACE + +using namespace QJsonPrivate; + +Parser::Parser(const char *json, int length) + : head(json), json(json), data(0), dataLength(0), current(0), lastError(QJsonParseError::NoError) +{ + end = json + length; +} + + + +/* + +begin-array = ws %x5B ws ; [ left square bracket + +begin-object = ws %x7B ws ; { left curly bracket + +end-array = ws %x5D ws ; ] right square bracket + +end-object = ws %x7D ws ; } right curly bracket + +name-separator = ws %x3A ws ; : colon + +value-separator = ws %x2C ws ; , comma + +Insignificant whitespace is allowed before or after any of the six +structural characters. + +ws = *( + %x20 / ; Space + %x09 / ; Horizontal tab + %x0A / ; Line feed or New line + %x0D ; Carriage return + ) + +*/ + +enum { + Space = 0x20, + Tab = 0x09, + LineFeed = 0x0a, + Return = 0x0d, + BeginArray = 0x5b, + BeginObject = 0x7b, + EndArray = 0x5d, + EndObject = 0x7d, + NameSeparator = 0x3a, + ValueSeparator = 0x2c, + Quote = 0x22 +}; + + + +bool Parser::eatSpace() +{ + while (json < end) { + if (*json > Space) + break; + if (*json != Space && + *json != Tab && + *json != LineFeed && + *json != Return) + break; + ++json; + } + return (json < end); +} + +char Parser::nextToken() +{ + if (!eatSpace()) + return 0; + char token = *json++; + switch (token) { + case BeginArray: + case BeginObject: + case NameSeparator: + case ValueSeparator: + case EndArray: + case EndObject: + eatSpace(); + case Quote: + break; + default: + token = 0; + break; + } + return token; +} + +/* + JSON-text = object / array +*/ +QJsonDocument Parser::parse(QJsonParseError *error) +{ +#ifdef PARSER_DEBUG + indent = 0; + qDebug() << ">>>>> parser begin"; +#endif + // allocate some space + dataLength = qMax(end - json, (ptrdiff_t) 256); + data = (char *)malloc(dataLength); + + // fill in Header data + QJsonPrivate::Header *h = (QJsonPrivate::Header *)data; + h->tag = QJsonDocument::BinaryFormatTag; + h->version = 1u; + + current = sizeof(QJsonPrivate::Header); + + char token = nextToken(); + DEBUG << token; + if (token == BeginArray) { + if (!parseArray()) + goto error; + } else if (token == BeginObject) { + if (!parseObject()) + goto error; + } else { + goto error; + } + + END; + { + if (error) { + error->offset = 0; + error->error = QJsonParseError::NoError; + } + QJsonPrivate::Data *d = new QJsonPrivate::Data(data, current); + return QJsonDocument(d); + } + +error: +#ifdef PARSER_DEBUG + qDebug() << ">>>>> parser error"; +#endif + if (error) { + error->offset = json - head; + error->error = lastError; + } + free(data); + return QJsonDocument(); +} + + +void Parser::ParsedObject::insert(uint offset) { + const QJsonPrivate::Entry *newEntry = reinterpret_cast(parser->data + objectPosition + offset); + int min = 0; + int n = offsets.size(); + while (n > 0) { + int half = n >> 1; + int middle = min + half; + if (*entryAt(middle) >= *newEntry) { + n = half; + } else { + min = middle + 1; + n -= half + 1; + } + } + if (min < offsets.size() && *entryAt(min) == *newEntry) { + offsets[min] = offset; + } else { + offsets.insert(min, offset); + } +} + +/* + object = begin-object [ member *( value-separator member ) ] + end-object +*/ + +bool Parser::parseObject() +{ + int objectOffset = reserveSpace(sizeof(QJsonPrivate::Object)); + BEGIN << "parseObject pos=" << objectOffset << current << json; + + ParsedObject parsedObject(this, objectOffset); + + char token = nextToken(); + while (token == Quote) { + int off = current - objectOffset; + if (!parseMember(objectOffset)) + return false; + parsedObject.insert(off); + token = nextToken(); + if (token != ValueSeparator) + break; + token = nextToken(); + if (token == EndObject) { + lastError = QJsonParseError::MissingObject; + return false; + } + } + + DEBUG << "end token=" << token; + if (token != EndObject) { + lastError = QJsonParseError::UnterminatedObject; + return false; + } + + DEBUG << "numEntries" << parsedObject.offsets.size(); + int table = objectOffset; + // finalize the object + if (parsedObject.offsets.size()) { + int tableSize = parsedObject.offsets.size()*sizeof(uint); + table = reserveSpace(tableSize); +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + memcpy(data + table, parsedObject.offsets.constData(), tableSize); +#else + offset *o = (offset *)(data + table); + for (int i = 0; i < tableSize; ++i) + o[i] = parsedObject.offsets[i]; + +#endif + } + + QJsonPrivate::Object *o = (QJsonPrivate::Object *)(data + objectOffset); + o->tableOffset = table - objectOffset; + o->size = current - objectOffset; + o->is_object = true; + o->length = parsedObject.offsets.size(); + + DEBUG << "current=" << current; + END; + return true; +} + +/* + member = string name-separator value +*/ +bool Parser::parseMember(int baseOffset) +{ + int entryOffset = reserveSpace(sizeof(QJsonPrivate::Entry)); + BEGIN << "parseMember pos=" << entryOffset; + + bool latin1; + if (!parseString(&latin1)) + return false; + char token = nextToken(); + if (token != NameSeparator) { + lastError = QJsonParseError::MissingNameSeparator; + return false; + } + QJsonPrivate::Value val; + if (!parseValue(&val, baseOffset)) + return false; + + // finalize the entry + QJsonPrivate::Entry *e = (QJsonPrivate::Entry *)(data + entryOffset); + e->value = val; + e->value.latinKey = latin1; + + END; + return true; +} + +/* + array = begin-array [ value *( value-separator value ) ] end-array +*/ +bool Parser::parseArray() +{ + BEGIN << "parseArray"; + int arrayOffset = reserveSpace(sizeof(QJsonPrivate::Array)); + + QVarLengthArray values; + + if (!eatSpace()) { + lastError = QJsonParseError::UnterminatedArray; + return false; + } + if (*json == EndArray) { + nextToken(); + } else { + while (1) { + QJsonPrivate::Value val; + if (!parseValue(&val, arrayOffset)) + return false; + values.append(val); + char token = nextToken(); + if (token == EndArray) + break; + else if (token != ValueSeparator) { + if (!eatSpace()) + lastError = QJsonParseError::UnterminatedArray; + else + lastError = QJsonParseError::MissingValueSeparator; + return false; + } + } + } + + DEBUG << "size =" << values.size(); + int table = arrayOffset; + // finalize the object + if (values.size()) { + int tableSize = values.size()*sizeof(QJsonPrivate::Value); + table = reserveSpace(tableSize); + memcpy(data + table, values.constData(), tableSize); + } + + QJsonPrivate::Array *a = (QJsonPrivate::Array *)(data + arrayOffset); + a->tableOffset = table - arrayOffset; + a->size = current - arrayOffset; + a->is_object = false; + a->length = values.size(); + + DEBUG << "current=" << current; + END; + return true; +} + +/* +value = false / null / true / object / array / number / string + +*/ + +bool Parser::parseValue(QJsonPrivate::Value *val, int baseOffset) +{ + BEGIN << "parse Value" << json; + val->_dummy = 0; + + switch (*json++) { + case 'n': + if (end - json < 4) { + lastError = QJsonParseError::IllegalValue; + return false; + } + if (*json++ == 'u' && + *json++ == 'l' && + *json++ == 'l') { + val->type = QJsonValue::Null; + DEBUG << "value: null"; + END; + return true; + } + lastError = QJsonParseError::IllegalValue; + return false; + case 't': + if (end - json < 4) { + lastError = QJsonParseError::IllegalValue; + return false; + } + if (*json++ == 'r' && + *json++ == 'u' && + *json++ == 'e') { + val->type = QJsonValue::Bool; + val->value = true; + DEBUG << "value: true"; + END; + return true; + } + lastError = QJsonParseError::IllegalValue; + return false; + case 'f': + if (end - json < 5) { + lastError = QJsonParseError::IllegalValue; + return false; + } + if (*json++ == 'a' && + *json++ == 'l' && + *json++ == 's' && + *json++ == 'e') { + val->type = QJsonValue::Bool; + val->value = false; + DEBUG << "value: false"; + END; + return true; + } + lastError = QJsonParseError::IllegalValue; + return false; + case Quote: { + val->type = QJsonValue::String; + val->value = current - baseOffset; + bool latin1; + if (!parseString(&latin1)) + return false; + val->latinOrIntValue = latin1; + DEBUG << "value: string"; + END; + return true; + } + case BeginArray: + val->type = QJsonValue::Array; + val->value = current - baseOffset; + if (!parseArray()) + return false; + DEBUG << "value: array"; + END; + return true; + case BeginObject: + val->type = QJsonValue::Object; + val->value = current - baseOffset; + if (!parseObject()) + return false; + DEBUG << "value: object"; + END; + return true; + case EndArray: + lastError = QJsonParseError::MissingObject; + return false; + default: + --json; + if (!parseNumber(val, baseOffset)) + return false; + DEBUG << "value: number"; + END; + } + + return true; +} + + + + + +/* + number = [ minus ] int [ frac ] [ exp ] + decimal-point = %x2E ; . + digit1-9 = %x31-39 ; 1-9 + e = %x65 / %x45 ; e E + exp = e [ minus / plus ] 1*DIGIT + frac = decimal-point 1*DIGIT + int = zero / ( digit1-9 *DIGIT ) + minus = %x2D ; - + plus = %x2B ; + + zero = %x30 ; 0 + +*/ + +bool Parser::parseNumber(QJsonPrivate::Value *val, int baseOffset) +{ + BEGIN << "parseNumber" << json; + val->type = QJsonValue::Double; + + const char *start = json; + bool isInt = true; + + // minus + if (json < end && *json == '-') + ++json; + + // int = zero / ( digit1-9 *DIGIT ) + if (json < end && *json == '0') { + ++json; + } else { + while (json < end && *json >= '0' && *json <= '9') + ++json; + } + + // frac = decimal-point 1*DIGIT + if (json < end && *json == '.') { + isInt = false; + ++json; + while (json < end && *json >= '0' && *json <= '9') + ++json; + } + + // exp = e [ minus / plus ] 1*DIGIT + if (json < end && (*json == 'e' || *json == 'E')) { + isInt = false; + ++json; + if (json < end && (*json == '-' || *json == '+')) + ++json; + while (json < end && *json >= '0' && *json <= '9') + ++json; + } + + if (json >= end) { + lastError = QJsonParseError::EndOfNumber; + return false; + } + + QByteArray number(start, json - start); + DEBUG << "numberstring" << number; + + if (isInt) { + bool ok; + int n = number.toInt(&ok); + if (ok && n < (1<<25) && n > -(1<<25)) { + val->int_value = n; + val->latinOrIntValue = true; + END; + return true; + } + } + + bool ok; + union { + quint64 ui; + double d; + }; + d = number.toDouble(&ok); + + if (!ok) { + lastError = QJsonParseError::IllegalNumber; + return false; + } + + int pos = reserveSpace(sizeof(double)); + *(quint64 *)(data + pos) = qToLittleEndian(ui); + val->value = pos - baseOffset; + val->latinOrIntValue = false; + + END; + return true; +} + +/* + + string = quotation-mark *char quotation-mark + + char = unescaped / + escape ( + %x22 / ; " quotation mark U+0022 + %x5C / ; \ reverse solidus U+005C + %x2F / ; / solidus U+002F + %x62 / ; b backspace U+0008 + %x66 / ; f form feed U+000C + %x6E / ; n line feed U+000A + %x72 / ; r carriage return U+000D + %x74 / ; t tab U+0009 + %x75 4HEXDIG ) ; uXXXX U+XXXX + + escape = %x5C ; \ + + quotation-mark = %x22 ; " + + unescaped = %x20-21 / %x23-5B / %x5D-10FFFF + */ +static inline bool addHexDigit(char digit, uint *result) +{ + *result <<= 4; + if (digit >= '0' && digit <= '9') + *result |= (digit - '0'); + else if (digit >= 'a' && digit <= 'f') + *result |= (digit - 'a') + 10; + else if (digit >= 'A' && digit <= 'F') + *result |= (digit - 'A') + 10; + else + return false; + return true; +} + +static inline bool scanEscapeSequence(const char *&json, const char *end, uint *ch) +{ + ++json; + if (json >= end) + return false; + + DEBUG << "scan escape" << (char)*json; + uint escaped = *json++; + switch (escaped) { + case '"': + *ch = '"'; break; + case '\\': + *ch = '\\'; break; + case '/': + *ch = '/'; break; + case 'b': + *ch = 0x8; break; + case 'f': + *ch = 0xc; break; + case 'n': + *ch = 0xa; break; + case 'r': + *ch = 0xd; break; + case 't': + *ch = 0x9; break; + case 'u': { + *ch = 0; + if (json > end - 4) + return false; + for (int i = 0; i < 4; ++i) { + if (!addHexDigit(*json, ch)) + return false; + ++json; + } + return true; + } + default: + // this is not as strict as one could be, but allows for more Json files + // to be parsed correctly. + *ch = escaped; + return true; + } + return true; +} + +static inline bool isUnicodeNonCharacter(uint ucs4) +{ + // Unicode has a couple of "non-characters" that one can use internally, + // but are not allowed to be used for text interchange. + // + // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF, + // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and + // U+FDEF (inclusive) + + return (ucs4 & 0xfffe) == 0xfffe + || (ucs4 - 0xfdd0U) < 16; +} + +static inline bool scanUtf8Char(const char *&json, const char *end, uint *result) +{ + int need; + uint min_uc; + uint uc; + uchar ch = *json++; + if (ch < 128) { + *result = ch; + return true; + } else if ((ch & 0xe0) == 0xc0) { + uc = ch & 0x1f; + need = 1; + min_uc = 0x80; + } else if ((ch & 0xf0) == 0xe0) { + uc = ch & 0x0f; + need = 2; + min_uc = 0x800; + } else if ((ch&0xf8) == 0xf0) { + uc = ch & 0x07; + need = 3; + min_uc = 0x10000; + } else { + return false; + } + + if (json >= end - need) + return false; + + for (int i = 0; i < need; ++i) { + ch = *json++; + if ((ch&0xc0) != 0x80) + return false; + uc = (uc << 6) | (ch & 0x3f); + } + + if (isUnicodeNonCharacter(uc) || uc >= 0x110000 || + (uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff)) + return false; + + *result = uc; + return true; +} + +bool Parser::parseString(bool *latin1) +{ + *latin1 = true; + + const char *start = json; + int outStart = current; + + // try to write out a latin1 string + + int stringPos = reserveSpace(2); + BEGIN << "parse string stringPos=" << stringPos << json; + while (json < end) { + uint ch = 0; + if (*json == '"') + break; + else if (*json == '\\') { + if (!scanEscapeSequence(json, end, &ch)) { + lastError = QJsonParseError::StringEscapeSequence; + return false; + } + } else { + if (!scanUtf8Char(json, end, &ch)) { + lastError = QJsonParseError::StringUTF8Scan; + return false; + } + } + if (ch > 0xff) { + *latin1 = false; + break; + } + int pos = reserveSpace(1); + DEBUG << " " << ch << (char)ch; + data[pos] = (uchar)ch; + } + ++json; + DEBUG << "end of string"; + if (json >= end) { + lastError = QJsonParseError::EndOfString; + return false; + } + + // no unicode string, we are done + if (*latin1) { + // write string length + *(QJsonPrivate::qle_ushort *)(data + stringPos) = current - outStart - sizeof(ushort); + int pos = reserveSpace((4 - current) & 3); + while (pos & 3) + data[pos++] = 0; + END; + return true; + } + + *latin1 = false; + DEBUG << "not latin"; + + json = start; + current = outStart + sizeof(int); + + while (json < end) { + uint ch = 0; + if (*json == '"') + break; + else if (*json == '\\') { + if (!scanEscapeSequence(json, end, &ch)) { + lastError = QJsonParseError::StringEscapeSequence; + return false; + } + } else { + if (!scanUtf8Char(json, end, &ch)) { + lastError = QJsonParseError::StringUTF8Scan; + return false; + } + } + if (ch > 0xffff) { + int pos = reserveSpace(4); + *(QJsonPrivate::qle_ushort *)(data + pos) = QChar::highSurrogate(ch); + *(QJsonPrivate::qle_ushort *)(data + pos + 2) = QChar::lowSurrogate(ch); + } else { + int pos = reserveSpace(2); + *(QJsonPrivate::qle_ushort *)(data + pos) = (ushort)ch; + } + } + ++json; + + if (json >= end) { + lastError = QJsonParseError::EndOfString; + return false; + } + + // write string length + *(QJsonPrivate::qle_int *)(data + stringPos) = (current - outStart - sizeof(int))/2; + int pos = reserveSpace((4 - current) & 3); + while (pos & 3) + data[pos++] = 0; + END; + return true; +} + +QT_END_NAMESPACE diff --git a/qjson/qjsonparser_p.h b/qjson/qjsonparser_p.h new file mode 100644 index 0000000..05e870e --- /dev/null +++ b/qjson/qjsonparser_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONPARSER_P_H +#define QJSONPARSER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qjsondocument.h" +#include + +QT_BEGIN_NAMESPACE + +namespace QJsonPrivate { + +class Parser +{ +public: + Parser(const char *json, int length); + + QJsonDocument parse(QJsonParseError *error); + + class ParsedObject + { + public: + ParsedObject(Parser *p, int pos) : parser(p), objectPosition(pos) {} + void insert(uint offset); + + Parser *parser; + int objectPosition; + QVector offsets; + + inline QJsonPrivate::Entry *entryAt(int i) const { + return reinterpret_cast(parser->data + objectPosition + offsets[i]); + } + }; + + +private: + inline bool eatSpace(); + inline char nextToken(); + + bool parseObject(); + bool parseArray(); + bool parseMember(int baseOffset); + bool parseString(bool *latin1); + bool parseValue(QJsonPrivate::Value *val, int baseOffset); + bool parseNumber(QJsonPrivate::Value *val, int baseOffset); + const char *head; + const char *json; + const char *end; + + char *data; + int dataLength; + int current; + QJsonParseError::ParseError lastError; + + inline int reserveSpace(int space) { + if (current + space >= dataLength) { + dataLength = 2*dataLength + space; + data = (char *)realloc(data, dataLength); + } + int pos = current; + current += space; + return pos; + } +}; + +} + +QT_END_NAMESPACE + +#endif diff --git a/qjson/qjsonvalue.cpp b/qjson/qjsonvalue.cpp new file mode 100644 index 0000000..a0f7cea --- /dev/null +++ b/qjson/qjsonvalue.cpp @@ -0,0 +1,592 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjsonobject.h" +#include "qjsonvalue.h" +#include "qjsonarray.h" +#include +#include +#include + +#include "qjson_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QJsonValue + \ingroup json + \reentrant + \since 5.0 + + \brief The QJsonValue class encapsulates a value in JSON. + + A value in JSON can be one of 6 basic types: + + JSON is a format to store structured data. It has 6 basic data types: + + \list + \o bool QJsonValue::Bool + \o double QJsonValue::Double + \o string QJsonValue::String + \o array QJsonValue::Array + \o object QJsonValue::Object + \o null QJsonValue::Null + \endlist + + A value can represent any of the above data types. In addition, QJsonValue has one special + flag to represent undefined values. This can be queried with isUndefined(). + + The type of the value can be queried with type() or accessors like isBool(), isString(), and so on. + Likewise, the value can be converted to the type stored in it using the toBool(), toString() and so on. + + Values are strictly typed internally and contrary to QVariant will not attempt to do any implicit type + conversions. This implies that converting to a type that is not stored in the value will return a default + constructed return value. +*/ + +/*! + Creates a QJsonValue of type \a type. + + The default is to create a Null value. + */ +QJsonValue::QJsonValue(Type type) + : ui(0), d(0), t(type) +{ +} + +/*! + \internal + */ +QJsonValue::QJsonValue(QJsonPrivate::Data *data, QJsonPrivate::Base *base, const QJsonPrivate::Value &v) + : d(0) +{ + t = (Type)(uint)v.type; + switch (t) { + case Undefined: + case Null: + dbl = 0; + break; + case Bool: + b = v.toBoolean(); + break; + case Double: + dbl = v.toDouble(base); + break; + case String: { + /* + QString s = v.toString(base); + stringData = s.data_ptr(); + stringData->ref.ref(); + */ + stringValue = v.toString(base); + break; + } + case Array: + case Object: + d = data; + this->base = v.base(base); + break; + } + if (d) + d->ref.ref(); +} + +/*! + Creates a value of type Bool, with value \a b. + */ +QJsonValue::QJsonValue(bool b) + : d(0), t(Bool) +{ + this->b = b; +} + +/*! + Creates a value of type Double, with value \a n. + */ +QJsonValue::QJsonValue(double n) + : d(0), t(Double) +{ + this->dbl = n; +} + +/*! + \overload + Creates a value of type Double, with value \a n. + */ +QJsonValue::QJsonValue(int n) + : d(0), t(Double) +{ + this->dbl = n; +} + +/*! + Creates a value of type String, with value \a s. + */ +QJsonValue::QJsonValue(const QString &s) + : d(0), t(String) +{ + /* + stringData = *(QStringData **)(&s); + stringData->ref.ref(); + */ + stringValue = s; +} + +/*! + Creates a value of type String, with value \a s. + */ +QJsonValue::QJsonValue(const QLatin1String &s) + : d(0), t(String) +{ + // ### FIXME: Avoid creating the temp QString below + /* + QString str(s); + stringData = *(QStringData **)(&str); + stringData->ref.ref(); + */ + stringValue = s; +} + +/*! + Creates a value of type Array, with value \a a. + */ +QJsonValue::QJsonValue(const QJsonArray &a) + : d(a.d), t(Array) +{ + base = a.a; + if (d) + d->ref.ref(); +} + +/*! + Creates a value of type Object, with value \a o. + */ +QJsonValue::QJsonValue(const QJsonObject &o) + : d(o.d), t(Object) +{ + base = o.o; + if (d) + d->ref.ref(); +} + + +/*! + Destroys the value. + */ +QJsonValue::~QJsonValue() +{ + /* + if (t == String && stringData && !stringData->ref.deref()) + free(stringData); + */ + + if (d && !d->ref.deref()) + delete d; +} + +/*! + Creates a copy of \a other. + */ +QJsonValue::QJsonValue(const QJsonValue &other) +{ + t = other.t; + d = other.d; + ui = other.ui; + stringValue = other.stringValue; + + if (d) + d->ref.ref(); + + /* + if (t == String && stringData) + stringData->ref.ref(); + */ +} + +/*! + Assigns the value stored in \a other to this object. + */ +QJsonValue &QJsonValue::operator =(const QJsonValue &other) +{ + /* + if (t == String && stringData && !stringData->ref.deref()) + free(stringData); + */ + + t = other.t; + dbl = other.dbl; + stringValue = other.stringValue; + + if (d != other.d) { + + if (d && !d->ref.deref()) + delete d; + d = other.d; + if (d) + d->ref.ref(); + + } + + /* + if (t == String && stringData) + stringData->ref.ref(); + */ + + return *this; +} + +/*! + Converts \a variant to a QJsonValue and returns it. + + The conversion will convert QVariant types as follows: + + \list + \o QVariant::Bool to Bool + \o QVariant::Int + \o QVariant::Double + \o QVariant::LongLong + \o QVariant::ULongLong + \o QVariant::UInt to Double + \o QVariant::String to String + \o QVariant::StringList + \o QVariant::VariantList to Array + \o QVariant::VariantMap to Object + \endlist + + For all other QVariant types a conversion to a QString will be attempted. If the returned string + is empty, a Null QJsonValue will be stored, otherwise a String value using the returned QString. + + \sa toVariant() + */ +QJsonValue QJsonValue::fromVariant(const QVariant &variant) +{ + switch (variant.type()) { + case QVariant::Bool: + return QJsonValue(variant.toBool()); + case QVariant::Int: + case QVariant::Double: + case QVariant::LongLong: + case QVariant::ULongLong: + case QVariant::UInt: + return QJsonValue(variant.toDouble()); + case QVariant::String: + return QJsonValue(variant.toString()); + case QVariant::StringList: + return QJsonValue(QJsonArray::fromStringList(variant.toStringList())); + case QVariant::List: + return QJsonValue(QJsonArray::fromVariantList(variant.toList())); + case QVariant::Map: + return QJsonValue(QJsonObject::fromVariantMap(variant.toMap())); + default: + break; + } + QString string = variant.toString(); + if (string.isEmpty()) + return QJsonValue(); + return QJsonValue(string); +} + +/*! + Converts the value to a QVariant. + + The QJsonValue types will be converted as follows: + + \value Null QVariant() + \value Bool QVariant::Bool + \value Double QVariant::Double + \value String QVariant::String + \value Array QVariantList + \value Object QVariantMap + \value Undefined QVariant() + + \sa fromVariant() + */ +QVariant QJsonValue::toVariant() const +{ + switch (t) { + case Bool: + return b; + case Double: + return dbl; + case String: + return toString(); + case Array: + return QJsonArray(d, static_cast(base)).toVariantList(); + case Object: + return QJsonObject(d, static_cast(base)).toVariantMap(); + case Null: + case Undefined: + break; + } + return QVariant(); +} + +/*! + \enum QJsonValue::Type + + This enum describes the type of the JSON value. + + \value Null A Null value + \value Bool A boolean value. Use toBool() to convert to a bool. + \value Double A double. Use toDouble() to convert to a double. + \value String A string. Use toString() to convert to a QString. + \value Array An array. Use toArray() to convert to a QJsonArray. + \value Object An object. Use toObject() to convert to a QJsonObject. + \value Undefined The value is undefined. This is usually returned as an + error condition, when trying to read an out of bounds value + in an array or a non existant key in an object. +*/ + +/*! + Returns the type of the value. + + \sa QJsonValue::Type + */ +QJsonValue::Type QJsonValue::type() const +{ + return t; +} + +/*! + Converts the value to a bool and returns it. + + If type() is not bool, false will be returned. + */ +bool QJsonValue::toBool() const +{ + if (t != Bool) + return false; + return b; +} + +/*! + Converts the value to a double and returns it. + + If type() is not Double, 0. will be returned. + */ +double QJsonValue::toDouble() const +{ + if (t != Double) + return 0; + return dbl; +} + +/*! + Converts the value to a QString and returns it. + + If type() is not String, a QString() will be returned. + */ +QString QJsonValue::toString() const +{ + if (t != String) + return QString(); + + /* + stringData->ref.ref(); // the constructor below doesn't add a ref. + return QString(*(const QConstStringData<1> *)stringData); + */ + return stringValue; +} + +/*! + Converts the value to an array and returns it. + + If type() is not Array, a QJsonArray() will be returned. + */ +QJsonArray QJsonValue::toArray() const +{ + if (!d || t != Array) + return QJsonArray(); + + return QJsonArray(d, static_cast(base)); +} + +/*! + Converts the value to an object and returns it. + + If type() is not Object, a QJsonObject() will be returned. + */ +QJsonObject QJsonValue::toObject() const +{ + if (!d || t != Object) + return QJsonObject(); + + return QJsonObject(d, static_cast(base)); +} + +/*! + Returns true if the value is equal to \a other. + */ +bool QJsonValue::operator==(const QJsonValue &other) const +{ + if (t != other.t) + return false; + + switch (t) { + case Undefined: + case Null: + break; + case Bool: + return b == other.b; + case Double: + return dbl == other.dbl; + case String: + return toString() == other.toString(); + case Array: + return QJsonArray(d, static_cast(base)) + == QJsonArray(other.d, static_cast(other.base)); + case Object: + return QJsonObject(d, static_cast(base)) + == QJsonObject(other.d, static_cast(other.base)); + } + return true; +} + +/*! + Returns true if the value is not equal to \a other. + */ +bool QJsonValue::operator!=(const QJsonValue &other) const +{ + return !(*this == other); +} + +/*! + \internal + */ +void QJsonValue::detach() +{ + if (!d) + return; + + QJsonPrivate::Data *x = d->clone(base); + x->ref.ref(); + if (!d->ref.deref()) + delete d; + d = x; + base = static_cast(d->header->root()); +} + + +/*! + \class QJsonValueRef + \reentrant + \brief The QJsonValueRef class is a helper class for QJsonValue. + + \internal + + \ingroup json + + When you get an object of type QJsonValueRef, if you can assign to it, + the assignment will apply to the character in the string from + which you got the reference. That is its whole purpose in life. + + You can use it exactly in the same way as a reference to a QJsonValue. + + The QJsonValueRef becomes invalid once modifications are made to the + string: if you want to keep the character, copy it into a QJsonValue. + + Most of the QJsonValue member functions also exist in QJsonValueRef. + However, they are not explicitly documented here. +*/ + + +QJsonValueRef &QJsonValueRef::operator =(const QJsonValue &val) +{ + if (is_object) + o->setValueAt(index, val); + else + a->replace(index, val); + + return *this; +} + +QJsonArray QJsonValueRef::toArray() const +{ + return toValue().toArray(); +} + +QJsonObject QJsonValueRef::toObject() const +{ + return toValue().toObject(); +} + +QJsonValue QJsonValueRef::toValue() const +{ + if (!is_object) + return a->at(index); + return o->valueAt(index); +} + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QJsonValue &o) +{ + switch (o.t) { + case QJsonValue::Undefined: + dbg.nospace() << "QJsonValue(undefined)"; + break; + case QJsonValue::Null: + dbg.nospace() << "QJsonValue(null)"; + break; + case QJsonValue::Bool: + dbg.nospace() << "QJsonValue(bool, " << o.toBool() << ")"; + break; + case QJsonValue::Double: + dbg.nospace() << "QJsonValue(double, " << o.toDouble() << ")"; + break; + case QJsonValue::String: + dbg.nospace() << "QJsonValue(string, " << o.toString() << ")"; + break; + case QJsonValue::Array: + dbg.nospace() << "QJsonValue(array, "; + dbg.nospace() << o.toArray(); + dbg.nospace() << ")"; + break; + case QJsonValue::Object: + dbg.nospace() << "QJsonValue(object, "; + dbg.nospace() << o.toObject(); + dbg.nospace() << ")"; + break; + } + return dbg.space(); +} +#endif + +QT_END_NAMESPACE diff --git a/qjson/qjsonvalue.h b/qjson/qjsonvalue.h new file mode 100644 index 0000000..313386b --- /dev/null +++ b/qjson/qjsonvalue.h @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONVALUE_H +#define QJSONVALUE_H + +#include +#include +#include + +#include "qjsonexport.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QDebug; +class QVariant; +class QJsonArray; +class QJsonObject; + +namespace QJsonPrivate { + class Data; + class Base; + class Object; + class Header; + class Array; + class Value; + class Entry; +} + +class Q_JSONRPC_EXPORT QJsonValue +{ +public: + enum Type { + Null = 0x0, + Bool = 0x1, + Double = 0x2, + String = 0x3, + Array = 0x4, + Object = 0x5, + Undefined = 0x80 + }; + + QJsonValue(Type = Null); + QJsonValue(bool b); + QJsonValue(double n); + QJsonValue(int n); + QJsonValue(const QString &s); + QJsonValue(const QLatin1String &s); + QJsonValue(const QJsonArray &a); + QJsonValue(const QJsonObject &o); + + ~QJsonValue(); + + QJsonValue(const QJsonValue &other); + QJsonValue &operator =(const QJsonValue &other); + + static QJsonValue fromVariant(const QVariant &variant); + QVariant toVariant() const; + + Type type() const; + inline bool isNull() const { return type() == Null; } + inline bool isBool() const { return type() == Bool; } + inline bool isDouble() const { return type() == Double; } + inline bool isString() const { return type() == String; } + inline bool isArray() const { return type() == Array; } + inline bool isObject() const { return type() == Object; } + inline bool isUndefined() const { return type() == Undefined; } + + bool toBool() const; + double toDouble() const; + QString toString() const; + QJsonArray toArray() const; + QJsonObject toObject() const; + + bool operator==(const QJsonValue &other) const; + bool operator!=(const QJsonValue &other) const; + inline QJsonValue(const void *) {} +private: + // avoid implicit conversions from char * to bool + + friend class QJsonPrivate::Value; + friend class QJsonArray; + friend class QJsonObject; + friend Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonValue &); + + QJsonValue(QJsonPrivate::Data *d, QJsonPrivate::Base *b, const QJsonPrivate::Value& v); + + void detach(); + + union { + quint64 ui; + bool b; + double dbl; +// QStringData *stringData; + QJsonPrivate::Base *base; + }; + + QString stringValue; + + QJsonPrivate::Data *d; // needed for Objects and Arrays + Type t; +}; + +class Q_JSONRPC_EXPORT QJsonValueRef +{ +public: + QJsonValueRef(QJsonArray *array, int idx) + : a(array), is_object(false), index(idx) {} + QJsonValueRef(QJsonObject *object, int idx) + : o(object), is_object(true), index(idx) {} + + inline operator QJsonValue() const { return toValue(); } + QJsonValueRef &operator = (const QJsonValue &val); + + inline QJsonValue::Type type() const { return toValue().type(); } + inline bool isNull() const { return type() == QJsonValue::Null; } + inline bool isBool() const { return type() == QJsonValue::Bool; } + inline bool isDouble() const { return type() == QJsonValue::Double; } + inline bool isString() const { return type() == QJsonValue::String; } + inline bool isArray() const { return type() == QJsonValue::Array; } + inline bool isObject() const { return type() == QJsonValue::Object; } + inline bool isUndefined() const { return type() == QJsonValue::Undefined; } + + inline bool toBool() const { return toValue().toBool(); } + inline double toDouble() const { return toValue().toDouble(); } + inline QString toString() const { return toValue().toString(); } + QJsonArray toArray() const; + QJsonObject toObject() const; + + inline bool operator==(const QJsonValue &other) const { return toValue() == other; } + inline bool operator!=(const QJsonValue &other) const { return toValue() != other; } + +private: + QJsonValue toValue() const; + + union { + QJsonArray *a; + QJsonObject *o; + }; + uint is_object : 1; + uint index : 31; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_JSONRPC_EXPORT QDebug operator<<(QDebug, const QJsonValue &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QJSONVALUE_H diff --git a/qjson/qjsonwriter.cpp b/qjson/qjsonwriter.cpp new file mode 100644 index 0000000..d544e61 --- /dev/null +++ b/qjson/qjsonwriter.cpp @@ -0,0 +1,280 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qjsonwriter_p.h" +#include "qjson_p.h" + +QT_BEGIN_NAMESPACE + +using namespace QJsonPrivate; + +static void objectContentToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact); +static void arrayContentToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact); + +// some code from qutfcodec.cpp, inlined here for performance reasons +// to allow fast escaping of strings +static inline bool isUnicodeNonCharacter(uint ucs4) +{ + // Unicode has a couple of "non-characters" that one can use internally, + // but are not allowed to be used for text interchange. + // + // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF, + // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and + // U+FDEF (inclusive) + + return (ucs4 & 0xfffe) == 0xfffe + || (ucs4 - 0xfdd0U) < 16; +} + +static inline uchar hexdig(uint u) +{ + return (u < 0xa ? '0' + u : 'a' + u - 0xa); +} + +static QByteArray escapedString(const QString &s) +{ + const uchar replacement = '?'; + QByteArray ba(s.length(), Qt::Uninitialized); + + uchar *cursor = (uchar *)ba.data(); + const uchar *ba_end = cursor + ba.length(); + + const QChar *ch = (const QChar *)s.constData(); + const QChar *end = ch + s.length(); + + int surrogate_high = -1; + + while (ch < end) { + if (cursor >= ba_end - 6) { + // ensure we have enough space + int pos = cursor - (const uchar *)ba.constData(); + ba.resize(ba.size()*2); + cursor = (uchar *)ba.data() + pos; + ba_end = (const uchar *)ba.constData() + ba.length(); + } + + uint u = ch->unicode(); + if (surrogate_high >= 0) { + if (ch->isLowSurrogate()) { + u = QChar::surrogateToUcs4(surrogate_high, u); + surrogate_high = -1; + } else { + // high surrogate without low + *cursor = replacement; + ++ch; + surrogate_high = -1; + continue; + } + } else if (ch->isLowSurrogate()) { + // low surrogate without high + *cursor = replacement; + ++ch; + continue; + } else if (ch->isHighSurrogate()) { + surrogate_high = u; + ++ch; + continue; + } + + if (u < 0x80) { + if (u < 0x20 || u == 0x22 || u == 0x5c) { + *cursor++ = '\\'; + switch (u) { + case 0x22: + *cursor++ = '"'; + break; + case 0x5c: + *cursor++ = '\\'; + break; + case 0x8: + *cursor++ = 'b'; + break; + case 0xc: + *cursor++ = 'f'; + break; + case 0xa: + *cursor++ = 'n'; + break; + case 0xd: + *cursor++ = 'r'; + break; + case 0x9: + *cursor++ = 't'; + break; + default: + *cursor++ = 'u'; + *cursor++ = '0'; + *cursor++ = '0'; + *cursor++ = hexdig(u>>4); + *cursor++ = hexdig(u & 0xf); + } + } else { + *cursor++ = (uchar)u; + } + } else { + if (u < 0x0800) { + *cursor++ = 0xc0 | ((uchar) (u >> 6)); + } else { + // is it one of the Unicode non-characters? + if (isUnicodeNonCharacter(u)) { + *cursor++ = replacement; + ++ch; + continue; + } + + if (u > 0xffff) { + *cursor++ = 0xf0 | ((uchar) (u >> 18)); + *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f); + } else { + *cursor++ = 0xe0 | (((uchar) (u >> 12)) & 0x3f); + } + *cursor++ = 0x80 | (((uchar) (u >> 6)) & 0x3f); + } + *cursor++ = 0x80 | ((uchar) (u&0x3f)); + } + ++ch; + } + + ba.resize(cursor - (const uchar *)ba.constData()); + return ba; +} + +static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value &v, QByteArray &json, int indent, bool compact) +{ + QJsonValue::Type type = (QJsonValue::Type)(uint)v.type; + switch (type) { + case QJsonValue::Bool: + json += v.toBoolean() ? "true" : "false"; + break; + case QJsonValue::Double: + json += QByteArray::number(v.toDouble(b)); + break; + case QJsonValue::String: + json += '"'; + json += escapedString(v.toString(b)); + json += '"'; + break; + case QJsonValue::Array: + json += compact ? "[" : "[\n"; + arrayContentToJson(static_cast(v.base(b)), json, indent + (compact ? 0 : 1), compact); + json += QByteArray(4*indent, ' '); + json += "]"; + break; + case QJsonValue::Object: + json += compact ? "{" : "{\n"; + objectContentToJson(static_cast(v.base(b)), json, indent + (compact ? 0 : 1), compact); + json += QByteArray(4*indent, ' '); + json += "}"; + break; + case QJsonValue::Null: + default: + json += "null"; + } +} + +static void arrayContentToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact) +{ + if (!a || !a->length) + return; + + QByteArray indentString(4*indent, ' '); + + uint i = 0; + while (1) { + json += indentString; + valueToJson(a, a->at(i), json, indent, compact); + + if (++i == a->length) { + if (!compact) + json += '\n'; + break; + } + + json += compact ? "," : ",\n"; + } +} + + +static void objectContentToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact) +{ + if (!o || !o->length) + return; + + QByteArray indentString(4*indent, ' '); + + uint i = 0; + while (1) { + QJsonPrivate::Entry *e = o->entryAt(i); + json += indentString; + json += '"'; + json += escapedString(e->key()); + json += "\": "; + valueToJson(o, e->value, json, indent, compact); + + if (++i == o->length) { + if (!compact) + json += '\n'; + break; + } + + json += compact ? "," : ",\n"; + } +} + +void Writer::objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact) +{ + json.reserve(json.size() + (o ? (int)o->size : 16)); + json += compact ? "{" : "{\n"; + objectContentToJson(o, json, indent + (compact ? 0 : 1), compact); + json += QByteArray(4*indent, ' '); + json += compact ? "}" : "}\n"; +} + +void Writer::arrayToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact) +{ + json.reserve(json.size() + (a ? (int)a->size : 16)); + json += compact ? "[" : "[\n"; + arrayContentToJson(a, json, indent + (compact ? 0 : 1), compact); + json += QByteArray(4*indent, ' '); + json += compact ? "]" : "]\n"; +} + +QT_END_NAMESPACE diff --git a/qjson/qjsonwriter_p.h b/qjson/qjsonwriter_p.h new file mode 100644 index 0000000..14dfe6b --- /dev/null +++ b/qjson/qjsonwriter_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QJSONWRITER_P_H +#define QJSONWRITER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// +#include "qjsonvalue.h" + +QT_BEGIN_NAMESPACE + +namespace QJsonPrivate +{ + +class Writer +{ +public: + static void objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact = false); + static void arrayToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact = false); +}; + +} + +QT_END_NAMESPACE + +#endif diff --git a/qjson/upQJson.pri b/qjson/upQJson.pri new file mode 100644 index 0000000..79df2ab --- /dev/null +++ b/qjson/upQJson.pri @@ -0,0 +1,24 @@ +!greaterThan(QT_MAJOR_VERSION, 4): { + + INCLUDEPATH += \ + $$PWD + + SOURCES += \ + $$PWD/qjson.cpp \ + $$PWD/qjsonarray.cpp \ + $$PWD/qjsondocument.cpp \ + $$PWD/qjsonobject.cpp \ + $$PWD/qjsonparser.cpp \ + $$PWD/qjsonvalue.cpp \ + $$PWD/qjsonwriter.cpp + + HEADERS += \ + $$PWD/qjson_p.h \ + $$PWD/qjsonarray.h \ + $$PWD/qjsondocument.h \ + $$PWD/qjsonobject.h \ + $$PWD/qjsonparser_p.h \ + $$PWD/qjsonvalue.h \ + $$PWD/qjsonwriter_p.h + +} \ No newline at end of file diff --git a/qt4 b/qt4 new file mode 100644 index 0000000..b94909d --- /dev/null +++ b/qt4 @@ -0,0 +1,38 @@ +#!/bin/sh + +export TSLIB_TSDEVICE=/dev/input/event0 +export TSLIB_CONFFILE=/usr/local/etc/ts.conf +export TSLIB_PLUGINDIR=/usr/local/lib/ts +export TSLIB_CALIBFILE=/etc/pointercal +export LD_LIBRARY_PATH=/usr/local/lib +export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin + +export QWS_DISPLAY=:1 + +TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent +if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen < $TS_INFO_FILE" ]; then + export QWS_MOUSE_PROTO="Tslib:/dev/input/event0 MouseMan:/dev/input/mice" + if [ ! -s /etc/pointercal ] ; then + rm /etc/pointercal + /usr/local/bin/ts_calibrate + fi +else + export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice" +fi +unset TS_INFO_FILE + +export QWS_KEYBOARD=TTY:/dev/tty1 + +export HOME=/root + +#cd /usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher +cd /home/plg +chmod a+x QtUI +hotplug +if [ ! -f /home/plg/runFlag ];then + chmod a+x emergency + ./emergency -qws +fi +rm /home/plg/runFlag +killall QtUI +./QtUI -qws & diff --git a/qt_zh_CN.qm b/qt_zh_CN.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/qt_zh_CN.qm @@ -0,0 +1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/scene/SceneEditOption.cpp b/scene/SceneEditOption.cpp new file mode 100644 index 0000000..b716e41 --- /dev/null +++ b/scene/SceneEditOption.cpp @@ -0,0 +1,674 @@ +#include "SceneEditOption.h" +#include "pictextitem.h" +#include "ui_sceneEditOption.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "myview.h" +#include "LogInfo.h" +#include +#include + +MoveInput* moveInput; +SceneEditOption::SceneEditOption(QWidget *parent) : + QWidget(parent), + ui(new Ui::SceneEditOption) +{ + ui->setupUi(this); + editMode = SCENE; + xmlfileName = ""; + dialogFileOperation = new DialogFileOperation(0); +#ifdef MYSAVEFILEDLG + dialogSaveFile =new DialogSaveFile(0); + //connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); +#endif + m_CreateImageFlag = false; + m_pSavePicScene = new QGraphicsScene(); + m_pSavePicScene->setSceneRect(QRectF(0, 0, 3200, MAX_PRINT_ROW_NUM)); //生成图片的场景 + moveInput = new MoveInput(parent); +} + +SceneEditOption::~SceneEditOption() +{ + if(m_pSavePicScene) + { + delete m_pSavePicScene; + } + if(moveInput) + { + delete moveInput; + } +} + +void SceneEditOption::bindStackWidget(QStackedWidget *stackedWidgetOption,QStackedWidget *stackedWidgetText){ + this->stackedWidgetOption = stackedWidgetOption;// stackedWidgetOption + this->stackedWidgetText = stackedWidgetText; +} + +void SceneEditOption::bindSysPara(SysPara *sysPara){ + this->sysPara = sysPara; +} +void SceneEditOption::enableButtonSave(){ + if(!ui->saveButton->isEnabled()) + ui->saveButton->setEnabled(true); +} + +void SceneEditOption::bindScene(PicScene *pPicScene, QGraphicsView *pGraphicViewer,QTextEdit *pTextEdit){ + this->pPicScene = pPicScene; + this->pViewer = pGraphicViewer; + this->textEdit = pTextEdit; + //connect(pPicScene,SIGNAL(xmlContentChanged ()),this,SLOT(enableButtonSave())); + connect(pPicScene,SIGNAL(selectionChanged()),this,SLOT(enableButtonSave())); + + ui->saveButton->setEnabled(false); + connect(dialogFileOperation,SIGNAL(openFile(QString,bool)),this,SLOT(onFileOpen(QString,bool))); + connect(dialogFileOperation,SIGNAL(createSceneImage(QString)),this,SLOT(onCreateSceneImage(QString))); +#ifdef MYSAVEFILEDLG + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); +#endif +} + +void SceneEditOption::on_previewButton_pressed() +{ + emit previewScene(); +} + +void SceneEditOption::on_addButton_pressed() +{ + pPicScene->clearSelection(); +#if 0 + emit addPicTextItem(); +#else + textItem = new PicTextItem(); + + //textItem->setFont(myFont); + //textItem->setTextInteractionFlags(Qt::TextEditorInteraction); + pPicScene->addItem(textItem); + //textItem->setDefaultTextColor(myTextColor); + //QFont font = textItem->font(); + //font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + //textItem->setFont(font); + textItem->setPos(0,0); + textItem->setPlainText("Vernon Bach Printer"); + ui->saveButton->setEnabled(true); + //qDebug()<<"sysPara->para.textEditCharSpace:"<para.textEditCharSpace; +#endif +} +bool SceneEditOption::maybeSave(){ + + if (xmlfileName.startsWith(QLatin1String(":/"))) + return true; + + QMessageBox msgBox(QMessageBox::Information,tr("提示"),tr("文档已经改变,是否保存?")); + QPushButton *saveButton = msgBox.addButton(tr("保存"), QMessageBox::ActionRole); + QPushButton *cancleSaveButton = msgBox.addButton(tr("放弃保存"), QMessageBox::ActionRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel); + + msgBox.exec(); + + if (msgBox.clickedButton() == saveButton) { + on_saveButton_pressed(); + return false; + } else if (msgBox.clickedButton() == cancleSaveButton) { + return true; + } + else + return false; + + return true; +} +void SceneEditOption::on_newfileButton_pressed() +{ + if (maybeSave()) { + pPicScene->clear(); + pViewer->viewport()->update(); + unsigned char SpecialVarEnable = 0; + sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&SpecialVarEnable,1); + xmlfileName = ""; + QFile file(xmlfileName); + emit fileNameChanged(QFileInfo(xmlfileName).fileName()); + } +#ifdef VARCOLOR + textEdit->insertHtml(QString("  ")); +#endif +} + +void SceneEditOption::on_delButton_pressed() +{ +#if 0 + +#else + foreach (QGraphicsItem *item, pPicScene->selectedItems()) { + pPicScene->removeItem(item); + delete item; + ui->saveButton->setEnabled(true); + } +#endif +} + +void SceneEditOption::on_saveAsButton_pressed() +{ + pPicScene->clearSelection(); +#ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->refreshListView(editMode); + dialogSaveFile->show(); + dialogSaveFile->setEnterFileName(""); +#endif +} + +void SceneEditOption::on_saveButton_pressed() +{ + pPicScene->clearSelection(); +#if 0 + +#else + if(xmlfileName.isEmpty()) + { + qDebug()<<"xml file null"; + #ifdef MYSAVEFILEDLG + disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0); + connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool))); + dialogSaveFile->refreshListView(editMode); + dialogSaveFile->show(); + dialogSaveFile->setEnterFileName(""); + + #endif + } + else + { + pPicScene->update(); + saveFile(); + if(sysPara){ + sysPara->sysFile =xmlfileName; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toAscii().constData()); + } + //snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toAscii().constData()); + ui->saveButton->setEnabled(false); + emit fileNameChanged(QFileInfo(xmlfileName).fileName()); + } +#endif +} + +void SceneEditOption::on_openfileButton_pressed() +{ + pPicScene->clearSelection(); +#if 0 + } +#else + dialogFileOperation->refreshListView(editMode); + dialogFileOperation->exec(); +#endif +} + +void SceneEditOption::on_EditItemButton_pressed() +{ +#if 0 + +#else + foreach (QGraphicsItem *item, pPicScene->selectedItems()) + { + if(item) + { + PicTextItem *pTextItem = (PicTextItem *)item; + //qDebug()<<"edit Item"; + //ui->textEdit->setText(pTextItem->toHtml()); + textEdit->setHtml(pTextItem->toHtml()); + //切换到textedit的界面 + emit editItemMode(); + //stackedWidgetText->setCurrentWidget(ui->pageTextEdit); + //stackedWidgetOption->setCurrentWidget(ui->textEditOption); + stackedWidgetText->setCurrentIndex(0); + stackedWidgetOption->setCurrentIndex(0); + ui->saveButton->setEnabled(true); + } + + } +#endif +} +void SceneEditOption::onEditItemDone() +{ +#if 1 + //stackedWidgetText->setCurrentWidget(ui->fileSceneViewer); + //stackedWidgetOption->setCurrentWidget(ui->senceEditOption); + stackedWidgetText->setCurrentIndex(3); + stackedWidgetOption->setCurrentIndex(1); + foreach (QGraphicsItem *item, pPicScene->selectedItems()) + { + if(item) + { + PicTextItem *pTextItem = (PicTextItem *)item; + //qDebug()<<"edit Item done"; + QFont font = pTextItem->font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + pTextItem->setFont(font); + pTextItem->setHtml(textEdit->toHtml()); + onSceneAccepted(pTextItem); + } + + } +#endif +} + +void SceneEditOption::onCreateSceneImage(QString filePath) +{ + m_CreateImageFlag = true; + m_pSavePicScene->clear(); + onFileOpen(filePath,false); +#if 1 + m_pSavePicScene->clearSelection(); + QSize size(m_pSavePicScene->itemsBoundingRect().width(),m_pSavePicScene->itemsBoundingRect().height()); + QImage image(size,QImage::Format_ARGB32); + image.fill(0x00ffffff);//填充白色 + //image.save("./printScene.jpg");//图片 + QPainter painter(&image); + m_pSavePicScene->render(&painter,QRectF(),m_pSavePicScene->itemsBoundingRect()); + //qDebug()<<"scene rect:"<itemsBoundingRect(); + image.save("./printSceneView.png");//图片 + +#endif + m_CreateImageFlag = false; +} + +extern QStringList stringListRecive; + +void SceneEditOption::parseVbfile(QXmlStreamReader &reader) { +// int textItemPosX; +// int textItemPosY; +// textItemPosX = picText->pos().x() - pPicScene->itemsBoundingRect().x(); +// textItemPosY = picText->pos().y() - pPicScene->itemsBoundingRect().y(); + float pos_x,pos_y; + bool Condition= false ; + int CatchStartValue = -1; + int CatchValue = -1; + while (!reader.atEnd()) { + reader.readNext(); + if (reader.isStartElement()) { // 开始元素 + QString strElementName = reader.name().toString(); + if (QString::compare(strElementName, "VBfile") == 0) { + //qDebug() << QString::fromLocal8Bit("********** 开始元素 ********** "); + } else if (QString::compare(strElementName, QString("pointer_x")) == 0) { // 方式一 + reader.readNext(); + if (reader.isCharacters()) { + pos_x = reader.text().toString().toDouble(); + //qDebug() << QString("pointer_x:%1").arg(reader.text().toString()); + } + } else if (QString::compare(strElementName, QString("pointer_y")) == 0) { // 方式二 + pos_y = reader.readElementText().toDouble(); + //qDebug() << QString("pointer_y:%1").arg(reader.readElementText()); + } + else if (QString::compare(strElementName, QString("Condition")) == 0) { + Condition = reader.readElementText().toInt() ? true : false; + } + else if (QString::compare(strElementName, QString("CatchStartValue")) == 0) { + CatchStartValue = reader.readElementText().toInt(); + } + else if (QString::compare(strElementName, QString("CatchValue")) == 0) { + CatchValue = reader.readElementText().toInt(); + } + else if (QString::compare(strElementName, QString("html_src")) == 0) { + //qDebug() << QString("html_src:%1").arg(reader.readElementText()); + } + } else if (reader.isEntityReference()) { // 实体引用 + QString strName = reader.name().toString(); + QString strText = reader.text().toString(); + //qDebug() << QString("EntityReference : %1(%2)").arg(strName).arg(strText); + } else if (reader.isCDATA()) { // CDATA + QString strCDATA = reader.text().toString(); + //qDebug() << QString("CDATA : %1").arg(strCDATA); + PicTextItem *pPictText = new PicTextItem(); + if(m_CreateImageFlag) + { + m_pSavePicScene->addItem(pPictText); + } + else + { + pPicScene->addItem(pPictText); + } + QFont font = pPictText->font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + pPictText->setFont(font); + pPictText->setPos(pos_x,pos_y); + pPictText->SpecialConditions = Condition; + pPictText->CatchCnt1StartValue = CatchStartValue; + pPictText->CatchCnt1CurrValue = CatchValue; +// Condition= false ; +// CatchValue = -1; + //LogInfo::setRunStatusText(tr("接收文件解析::2")); + if(!sysPara->status.forTemplateUse || m_CreateImageFlag) + { + pPictText->setHtml(strCDATA); + } + else + { + //qDebug() << tr("接收文件解析:"); + //LogInfo::setRunStatusText(tr("接收文件解析::3")); + //stringListRecive << "aaaa" << "bbbb" << "cccc"; + if(strCDATA.contains("#1111") || strCDATA.contains("")) + { + if(stringListRecive.size() > 0) + { + if(strCDATA.contains("#1111")) + { + strCDATA.replace("#1111",stringListRecive.at(0).toStdString().c_str()); + } + else if(strCDATA.contains("")) + { + emit generateQRCode(stringListRecive.at(0)); + strCDATA.replace("modbusQR#01.bmp","modbusQR.bmp"); + } + } + + } + else if(strCDATA.contains("#2222") || strCDATA.contains("")) + { + if(stringListRecive.size() > 1) + { + if(strCDATA.contains("#2222")) + { + strCDATA.replace("#2222",stringListRecive.at(1).toStdString().c_str()); + } + else if(strCDATA.contains("")) + { + emit generateQRCode(stringListRecive.at(1)); + strCDATA.replace("modbusQR#02.bmp","modbusQR.bmp"); + } + } + } + else if(strCDATA.contains("#3333") || strCDATA.contains("")) + { + if(stringListRecive.size() > 2) + { + if(strCDATA.contains("#3333")) + { + strCDATA.replace("#3333",stringListRecive.at(2).toStdString().c_str()); + } + else if(strCDATA.contains("")) + { + emit generateQRCode(stringListRecive.at(2)); + strCDATA.replace("modbusQR#03.bmp","modbusQR.bmp"); + } + } + } + pPictText->setHtml(strCDATA); + } +// if(Condition) +// { +// SpecialVarPrint specialVarPrint; +// specialVarPrint.SpecialVarEnable = Condition; +// specialVarPrint.SpecialVarCountStart = CatchStartValue; +// specialVarPrint.SpecialVarCountEnd = CatchValue; +// specialVarPrint.SpecialVarColStart = 3 + pos_x- pPicScene->itemsBoundingRect().x(); +// specialVarPrint.SpecialVarColEnd = 3 + pos_x - pPicScene->itemsBoundingRect().x()+ pPictText->boundingRect().width(); +// specialVarPrint.SpecialVarRowStart = pos_y - pPicScene->itemsBoundingRect().y(); +// specialVarPrint.SpecialVarRowEnd = pos_y - pPicScene->itemsBoundingRect().y()+ pPictText->boundingRect().height(); +// sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&specialVarPrint,sizeof(SpecialVarPrint)); // Send specialVarPrint 2022-8-6 +// LogInfo::setRunStatusText(tr("发送特殊变量内容:")); +// LogInfo::setRunStatusText(tr("SpecialVarEnable:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarEnable))); +// LogInfo::setRunStatusText(tr("SpecialVarCountStart:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarCountStart))); +// LogInfo::setRunStatusText(tr("SpecialVarCountEnd:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarCountEnd))); +// LogInfo::setRunStatusText(tr("SpecialVarColStart:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarColStart))); +// LogInfo::setRunStatusText(tr("SpecialVarColEnd:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarColEnd))); +// LogInfo::setRunStatusText(tr("SpecialVarRowStart:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarRowStart))); +// LogInfo::setRunStatusText(tr("SpecialVarRowEnd:%1").arg(QString().sprintf("%02X",specialVarPrint.SpecialVarRowEnd))); +// LogInfo::setRunStatusText(tr("itemsBoundingRect().y():%1").arg(QString().sprintf("%02X",pPicScene->itemsBoundingRect().y()))); +// LogInfo::setRunStatusText(tr("itemsBoundingRect().x():%1").arg(QString().sprintf("%02X",pPicScene->itemsBoundingRect().x()))); +// } + Condition= false ; + CatchValue = -1; + CatchStartValue = -1; + + reader.readNext(); + if (reader.isCharacters()) { + QString strCharacters = reader.text().toString(); + //qDebug() << QString("Characters : %1").arg(strCharacters); + } + } else if (reader.isEndElement()) { // 结束元素 + QString strElementName = reader.name().toString(); + if (QString::compare(strElementName, "Blogs") == 0) { + //qDebug() << QString::fromLocal8Bit("********** 结束元素 ********** "); + break; // 跳出循环(解析 QXmlStreamReader::EndDocument) + } else if (QString::compare(strElementName, "Blog") == 0) { + //qDebug() << QString::fromLocal8Bit("********** 结束元素 ********** "); + } + } + } +} +/* + * 和DialogFileOperation对接 + * */ +void SceneEditOption::onFileOpen(QString filePath,bool insertFlag){ + if(editMode==SCENE) { + if(filePath.endsWith(".xml")) + { + QFile file(filePath); + + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // 以只写模式打开文件 + xmlfileName=filePath; + QXmlStreamReader reader(&file); + if(!m_CreateImageFlag) + { + pPicScene->clear(); + pViewer->viewport()->update(); + unsigned char SpecialVarEnable = 0; + sysPara->devOp->fpgaWr(0xa4b0,(unsigned char *)&SpecialVarEnable,1); + } + // 解析 XML,直到结束 + while (!reader.atEnd()) { + + // 读取下一个元素 + QXmlStreamReader::TokenType nType = reader.readNext(); + + switch (nType) { + case QXmlStreamReader::StartDocument: { // 开始文档 + //qDebug() << QString::fromLocal8Bit("********** 开始文档(XML 声明) ********** "); + // XML 声明 + QString strVersion = reader.documentVersion().toString(); + QString strEncoding = reader.documentEncoding().toString(); + bool bAlone = reader.isStandaloneDocument(); + //qDebug() << QString::fromLocal8Bit("版本:%1 编码:%2 Standalone:%3") + // .arg(strVersion).arg(strEncoding).arg(bAlone) << "\r\n"; + break; + } + case QXmlStreamReader::Comment: { // 注释 + //qDebug() << QString::fromLocal8Bit("********** 注释 ********** "); + QString strComment = reader.text().toString(); + //qDebug() << strComment << "\r\n"; + break; + } + case QXmlStreamReader::ProcessingInstruction: { // 处理指令 + //qDebug() << QString::fromLocal8Bit("********** 处理指令 ********** "); + QString strProcInstr = reader.processingInstructionData().toString(); + //qDebug() << strProcInstr << "\r\n"; + break; + } + case QXmlStreamReader::DTD: { // DTD + //qDebug() << QString::fromLocal8Bit("********** DTD ********** "); + QString strDTD = reader.text().toString(); + QXmlStreamNotationDeclarations notationDeclarations = reader.notationDeclarations(); // 符号声明 + QXmlStreamEntityDeclarations entityDeclarations = reader.entityDeclarations(); // 实体声明 + // DTD 声明 + QString strDTDName = reader.dtdName().toString(); + QString strDTDPublicId = reader.dtdPublicId().toString(); // DTD 公开标识符 + QString strDTDSystemId = reader.dtdSystemId().toString(); // DTD 系统标识符 + //qDebug() << QString::fromLocal8Bit("DTD : %1").arg(strDTD); + //qDebug() << QString::fromLocal8Bit("DTD 名称 : %1").arg(strDTDName); + //qDebug() << QString::fromLocal8Bit("DTD 公开标识符 : %1").arg(strDTDPublicId); + //qDebug() << QString::fromLocal8Bit("DTD 系统标识符 : %1").arg(strDTDSystemId); + //qDebug() << "\r\n"; + + break; + } + case QXmlStreamReader::StartElement: { // 开始元素 + QString strElementName = reader.name().toString(); + if (QString::compare(strElementName, "VBfiles") == 0) { // 根元素 + //qDebug() << QString::fromLocal8Bit("********** 开始元素 ********** "); + QXmlStreamAttributes attributes = reader.attributes(); + if (attributes.hasAttribute("Version")) { + QString strVersion = attributes.value("Version").toString(); + //qDebug() << QString::fromLocal8Bit("属性:Version(%1)").arg(strVersion); + } + + parseVbfile(reader); + } + break; + } + case QXmlStreamReader::EndDocument: { // 结束文档 + //qDebug() << QString::fromLocal8Bit("********** 结束文档 ********** "); + break; + } + } + } + + if (reader.hasError()) { // 解析出错 + //qDebug() << QString::fromLocal8Bit("错误信息:%1 行号:%2 列号:%3 字符位移:%4").arg(reader.errorString()).arg(reader.lineNumber()).arg(reader.columnNumber()).arg(reader.characterOffset()); + } + //qDebug()<<"open done"; + file.close(); // 关闭文件 + //snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",filePath.toAscii().constData()); + if(!m_CreateImageFlag)//生成图片显示 + { + if(sysPara) + { + sysPara->sysFile =filePath; + sysPara->loadParaFromFile(); + //qDebug()<<"textedit txt mode onFileOpen" << sysPara->sysFile; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",filePath.toAscii().constData()); + } + + emit fileNameChanged(QFileInfo(xmlfileName).fileName()); + ui->saveButton->setEnabled(false); + QList items = pPicScene->items(); + foreach (QGraphicsItem *item, items) { + PicTextItem *picText = qgraphicsitem_cast(item); + onSceneAccepted(picText); + } + } + + } + } + } +} +void SceneEditOption::saveFile(){ +#if 1 + //qDebug()<<"SceneEditOption save scene start"; + //QList itemList = pPicScene->items(); + //qDebug()<<"xmlfileName:"<< xmlfileName; + + QFile file(xmlfileName); + if (!file.open(QFile::WriteOnly | QFile::Text)) { // 只写模式打开文件 + qDebug() << QString("Cannot write file %1(%2).").arg(xmlfileName).arg(file.errorString()); + return; + } + //qDebug()<<"open xmlfileName successfull"; + + QXmlStreamWriter writer(&file); + + // writer.setCodec("GBK"); // XML 编码 + writer.setAutoFormatting(true); // 自动格式化 + writer.writeStartDocument("1.0", true); // 开始文档(XML 声明) + writer.writeComment(QString::fromLocal8Bit("Vernon Bach graphic scene file")); // 注释 + //writer.writeProcessingInstruction("xml-stylesheet type=\"text/css\" href=\"style.css\""); // 处理指令 + + // DTD + writer.writeDTD(QString::fromLocal8Bit(" ]>")); + //writer.writeDTD(QString::fromLocal8Bit(" ]>")); + + writer.writeStartElement("VBfiles"); // 开始根元素 + writer.writeAttribute("Version", "1.0"); // 属性 + + QList items = pPicScene->items(); + foreach (QGraphicsItem *item, items) { + PicTextItem *picText = qgraphicsitem_cast(item); + //qDebug()<<"item position: "<< picText->pos(); + writer.writeStartElement("VBfile"); // 开始子元素 + writer.writeTextElement(QString::fromLocal8Bit("pointer_x"), QString::fromLocal8Bit("%1").arg(picText->pos().x())); + writer.writeTextElement(QString::fromLocal8Bit("pointer_y"), QString::fromLocal8Bit("%1").arg(picText->pos().y())); + writer.writeTextElement(QString::fromLocal8Bit("Condition"), QString::fromLocal8Bit("%1").arg(picText->SpecialConditions? 1:0)); + writer.writeTextElement(QString::fromLocal8Bit("CatchStartValue"), QString::fromLocal8Bit("%1").arg(picText->CatchCnt1StartValue)); + writer.writeTextElement(QString::fromLocal8Bit("CatchValue"), QString::fromLocal8Bit("%1").arg(picText->CatchCnt1CurrValue)); + //writer.writeEntityReference("Copyright"); + //writer.writeCDATA(QString::fromLocal8Bit("html code")); + writer.writeTextElement(QString::fromLocal8Bit("html_src"), QString::fromLocal8Bit("my_src")); + writer.writeCDATA((picText->toHtml())); + //qDebug()<<"tohtml"<toHtml(); + //writer.writeCharacters(">"); + //writer.writeEmptyElement(QString::fromLocal8Bit("Empty")); // 空元素 + writer.writeEndElement(); // 结束子元素 + } + + writer.writeEndElement(); // 结束根元素 + writer.writeEndDocument(); // 结束文档 + //qDebug()<<"sceneEditOption save done"; +//#if defined(__CONVERTERBOARD__)|| defined(__VX__) +#if 1 + fsync(file.handle()); +#endif + file.close(); // 关闭文件 + +#endif +} + +void SceneEditOption::onSaveASFile(QString filename,bool Flag){// use for dialogSaveFile class + qDebug()<sysFile =xmlfileName; + snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toAscii().constData()); + } + //snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toAscii().constData()); + ui->saveButton->setEnabled(false); + emit fileNameChanged(QFileInfo(xmlfileName).fileName()); +} + + void SceneEditOption::on_enlargeButton_pressed() + { + ((MyView*)pViewer)->ZoomOut(); + } + + void SceneEditOption::on_reduceButton_pressed() + { + ((MyView*)pViewer)->ZoomIn(); + } + + void SceneEditOption::onSceneAccepted(PicTextItem *pTextItem){ + //dialogLineSpace->getValue(&sysPara->para.textEditLineSpace,&sysPara->para.textEditCharSpace); + for(QTextBlock textBlock = pTextItem->document()->begin();textBlock != pTextItem->document()->end(); textBlock = textBlock.next()){ + // textBlock.setVisible(false); + QTextBlockFormat textBlockFormat = textBlock.blockFormat(); + textBlockFormat.setAlignment(Qt::AlignTop); + textBlockFormat.setTopMargin(-1); + //textBlockFormat.setLineHeight(sysPara->para.fontPixelSize + sysPara->para.textEditLineSpace, QTextBlockFormat::FixedHeight); + //textBlockFormat.setLineHeight(0, QTextBlockFormat::LineDistanceHeight); + textBlockFormat.setBottomMargin(sysPara->para.textEditLineSpace-1); + //textBlockFormat.setBottomMargin(-1); + QTextCursor textCursor = pTextItem->textCursor(); + textCursor.setPosition(textBlock.position()); + textCursor.setBlockFormat(textBlockFormat); + pTextItem->setTextCursor(textCursor); + } + + // QTextCharFormat fmt; + // //fmt.setFontWordSpacing(sysPara->para.textEditCharSpace); + // fmt.setFontLetterSpacing(sysPara->para.textEditCharSpace); qDebug() << sysPara->para.textEditCharSpace; + // mergeFormatOnWordOrSelection(fmt); + QFont font = pTextItem->font(); + font.setLetterSpacing(QFont::AbsoluteSpacing,sysPara->para.textEditCharSpace); + pTextItem->setFont(font); + sysPara->saveParaToFile(); + } \ No newline at end of file diff --git a/scene/SceneEditOption.h b/scene/SceneEditOption.h new file mode 100644 index 0000000..61d90be --- /dev/null +++ b/scene/SceneEditOption.h @@ -0,0 +1,107 @@ +#ifndef SCENEEDITOPTION_H +#define SCENEEDITOPTION_H + +#include +#include +#include +#include +#include +#include +#include +#include "ParaSettingUI.h" +#include "MyFileDialog.h" +#include +#include +#include +#include "DialogFileOperation.h" +#include "DialogInsertVari.h" +#include "DialogFontSize.h" +#include "DialogLineSpace.h" +#include "PicWidget.h" +#include +#include "dlgQrCode.h" +#include "QBarCode.h" +#include "DialogSaveFile.h" +#include "SceneEditOption.h" +#include "pictextitem.h" +#include "picscene.h" +#include "moveinput.h" + +namespace Ui { +class SceneEditOption; +} + +class SceneEditOption : public QWidget,public ParaSettingUI +{ + Q_OBJECT +public: + explicit SceneEditOption(QWidget *parent = 0); + ~SceneEditOption(); + + void bindStackWidget(QStackedWidget *stackedWidgetOption,QStackedWidget *stackedWidgetText); + void bindSysPara(SysPara *sysPara); + void bindScene(PicScene *pPicScene, QGraphicsView *pGraphicViewer, QTextEdit *pTextEdit); +signals: + void previewScene(); + void addPicTextItem(); + void importFile(QString); + void delItem(); + void saveScene(QString); + void openSceneFile(QString); + void editItem(); + void editItemMode(); + void fileNameChanged(QString); + void generateQRCode(QString); +public slots: + void enableButtonSave(); + void onSaveASFile(QString filename,bool Flag); + void saveFile(); + void onFileOpen(QString filePath,bool insertFlag); + void onEditItemDone(); + void onCreateSceneImage(QString filePath);//生成场景图片 + +private slots: + void on_delButton_pressed(); + + void on_saveButton_pressed(); + void on_openfileButton_pressed(); + + void on_previewButton_pressed(); + + void on_addButton_pressed(); + + void on_EditItemButton_pressed(); + + void on_saveAsButton_pressed(); + + void on_newfileButton_pressed(); + void on_enlargeButton_pressed(); + void on_reduceButton_pressed(); + +private: + void parseVbfile(QXmlStreamReader &reader); + bool maybeSave(); + Ui::SceneEditOption *ui; + QStackedWidget *stackedWidgetOption; + QStackedWidget *stackedWidgetText; + PicScene *pPicScene; + QGraphicsView *pViewer; + QTextEdit *textEdit; + QGraphicsScene *m_pSavePicScene; + bool m_CreateImageFlag; + + DialogFileOperation *dialogFileOperation; +#ifdef MYSAVEFILEDLG + DialogSaveFile *dialogSaveFile; +#endif + MyFileDialog *fileDialog; + + PicTextItem *textItem; + //PicScene *scene; + QString currFileName; + void onSceneAccepted(PicTextItem *pTextItem); + int editMode;//保存当前的编辑模式 + QString xmlfileName; +}; + +#endif // SCENEEDITOPTION_H diff --git a/scene/myview.cpp b/scene/myview.cpp new file mode 100644 index 0000000..8ea5b81 --- /dev/null +++ b/scene/myview.cpp @@ -0,0 +1,63 @@ +#include "myview.h" +#include +#include "picscene.h" + +MyView::MyView(QWidget *parent) : + QGraphicsView(parent) +{ + zoomRatio = 1; + //setDragMode(QGraphicsView::ScrollHandDrag);//手型拖动 + //setAlignment(Qt::AlignLeft | Qt::AlignTop); + //setFocusPolicy( Qt::NoFocus ); +} + +void MyView::ZoomOut(void) +{ + if(zoomRatio < 3) + { + zoomRatio++; + scale(2,2); + } +} + +void MyView::ZoomIn(void) +{ + if(zoomRatio > 0) + { + zoomRatio--; + scale(0.5,0.5); + } +} + +//void MyView::wheelEvent(QWheelEvent*event) //滚轮事件 +//{ +//// if(event->delta() > 0) //如果鼠标滚轮远离使用者,则delta()返回正值 +//// scale(0.5,0.5); //视图缩放 +//// else scale(2,2); +//} + + +//void MyView::mousePressEvent(QMouseEvent*event) +//{ +//// rotate(90); //视图旋转顺时针90度 +//} + +void MyView::keyPressEvent(QKeyEvent *event) +{ + //event->accept(); + //parent()->event((QEvent*) event); + if (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right || event->key() == Qt::Key_Up || event->key() == Qt::Key_Down) + { + // 处理上下键事件 + PicScene* picScene = dynamic_cast(this->scene()); + if(picScene) + { + picScene->keyPressEvent(event); + } + } + else + { + // 其他键事件交给父类处理 + QGraphicsView::keyPressEvent(event); + } +} diff --git a/scene/myview.h b/scene/myview.h new file mode 100644 index 0000000..c373ebb --- /dev/null +++ b/scene/myview.h @@ -0,0 +1,27 @@ +#ifndef MYVIEW_H +#define MYVIEW_H + +#include + +class MyView : public QGraphicsView +{ + Q_OBJECT +public: + explicit MyView(QWidget *parent = 0); + + void ZoomOut(void); + void ZoomIn(void); +private: + char zoomRatio; + +signals: + +public slots: + +protected : +// void wheelEvent(QWheelEvent *event); +// void mousePressEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event); +}; + +#endif // MYVIEW_H diff --git a/scene/picscene.cpp b/scene/picscene.cpp new file mode 100644 index 0000000..66811fa --- /dev/null +++ b/scene/picscene.cpp @@ -0,0 +1,108 @@ +#if 1 +#include "picscene.h" +#include +#include +PicScene::PicScene(QObject *parent) : + QGraphicsScene(parent) +{ +} + +void PicScene::setMode(Mode mode) +{ + myMode = mode; +} + +void PicScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ + if (mouseEvent->button() != Qt::LeftButton) + return; + + QGraphicsScene::mousePressEvent(mouseEvent); +} + +//! [9] + +//! [10] +void PicScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ +#if 0 + if (myMode == InsertLine && line != 0) { + QLineF newLine(line->line().p1(), mouseEvent->scenePos()); + line->setLine(newLine); + } else if (myMode == MoveItem) { + QGraphicsScene::mouseMoveEvent(mouseEvent); + } +#else + QGraphicsScene::mouseMoveEvent(mouseEvent); + +#endif +} +//! [10] + +//! [11] +void PicScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) +{ +#if 0 //不需要这个功能 + if (line != 0 && myMode == InsertLine) { + QList startItems = items(line->line().p1()); + if (startItems.count() && startItems.first() == line) + startItems.removeFirst(); + QList endItems = items(line->line().p2()); + if (endItems.count() && endItems.first() == line) + endItems.removeFirst(); + + removeItem(line); + delete line; +//! [11] //! [12] + + if (startItems.count() > 0 && endItems.count() > 0 && + startItems.first()->type() == DiagramItem::Type && + endItems.first()->type() == DiagramItem::Type && + startItems.first() != endItems.first()) { + DiagramItem *startItem = + qgraphicsitem_cast(startItems.first()); + DiagramItem *endItem = + qgraphicsitem_cast(endItems.first()); + Arrow *arrow = new Arrow(startItem, endItem); + arrow->setColor(myLineColor); + startItem->addArrow(arrow); + endItem->addArrow(arrow); + arrow->setZValue(-1000.0); + addItem(arrow); + arrow->updatePosition(); + } + } +//! [12] //! [13] + line = 0; +#endif + QGraphicsScene::mouseReleaseEvent(mouseEvent); + //QRectF Rect=QGraphicsScene.itemsBoundingRect(); + //qDebug()<<"GraphicsScene itemsBoundingRect "<type() == type) + return true; + } + return false; +} +//! [14] + +void PicScene::keyPressEvent(QKeyEvent *event) +{ + QGraphicsScene::keyPressEvent(event); +} + +#endif diff --git a/scene/picscene.h b/scene/picscene.h new file mode 100644 index 0000000..b0b1418 --- /dev/null +++ b/scene/picscene.h @@ -0,0 +1,72 @@ +#ifndef PICSCENE_H +#define PICSCENE_H +#if 1 +#include +#include "pictextitem.h" +#include + +QT_BEGIN_NAMESPACE +class QGraphicsSceneMouseEvent; +class QMenu; +class QPointF; +class QGraphicsLineItem; +class QFont; +class QGraphicsTextItem; +class QColor; +QT_END_NAMESPACE + +class PicScene : public QGraphicsScene +{ + Q_OBJECT +public: + enum Mode { InsertItem, InsertLine, InsertText, InsertPic, MoveItem }; + explicit PicScene(QObject *parent = 0); + + QFont font() const + { return myFont; } + QColor textColor() const + { return myTextColor; } + QColor itemColor() const + { return myItemColor; } + QColor lineColor() const + { return myLineColor; } + void setLineColor(const QColor &color); + void setTextColor(const QColor &color); + void setItemColor(const QColor &color); + void setFont(const QFont &font); + void keyPressEvent(QKeyEvent *event); + +public slots: + void setMode(Mode mode); + //void setItemType(DiagramItem::DiagramType type); + //void editorLostFocus(DiagramTextItem *item); + +signals: + //void itemInserted(DiagramItem *item); + void textInserted(QGraphicsTextItem *item); + void itemSelected(QGraphicsItem *item); + void xmlContentChanged(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent); + +private: + bool isItemChange(int type); + + //DiagramItem::DiagramType myItemType; + QMenu *myItemMenu; + Mode myMode; + bool leftButtonDown; + QPointF startPoint; + QGraphicsLineItem *line; + QFont myFont; + PicTextItem *textItem; + QColor myTextColor; + QColor myItemColor; + QColor myLineColor; + +}; +#endif +#endif // PICSCENE_H diff --git a/scene/pictextitem.cpp b/scene/pictextitem.cpp new file mode 100644 index 0000000..90788d4 --- /dev/null +++ b/scene/pictextitem.cpp @@ -0,0 +1,135 @@ +#if 1 +#include +#include "pictextitem.h" +#include "picscene.h" +#include "moveinput.h" + +extern MoveInput* moveInput; +PicTextItem::PicTextItem(QGraphicsItem *parent, QGraphicsScene *scene) : + QGraphicsTextItem(parent,scene) +{ + setFlag(QGraphicsItem::ItemIsMovable); + setFlag(QGraphicsItem::ItemIsSelectable); + //setFlag(QGraphicsItem::ItemIsFocusScope); + setFlag(QGraphicsItem::ItemIsFocusable); + //setTextInteractionFlags(Qt::NoTextInteraction); + QFont font; + font.setFamily("wenquanyi"); + font.setPixelSize(12); + //document()->setDefaultFont(font);//如果加上这句后,默认的都是wenquanyi 12点阵,看起来这个字体有问题,会黑屏,所以用界面的字体 WenQuanYiMH 代替 + document()->setDefaultStyleSheet("p { margin: 0; }"); + document()->setDocumentMargin(0); + SpecialConditions = false; + CatchCnt1CurrValue = -1; + CatchCnt1StartValue = -1; +} +//! [1] +QVariant PicTextItem::itemChange(GraphicsItemChange change, + const QVariant &value) +{ +#if 0 + if (change == QGraphicsItem::ItemSelectedHasChanged) + emit selectedChange(this); + return value; +#else + //qDebug()<<"item posi: "<< pos(); + if (change == ItemSceneChange && scene()) { + // value is the new position. + QPointF newPos = value.toPoint(); + QRectF rect = scene()->sceneRect(); + if (!rect.contains(newPos)) { + // Keep the item inside the scene rect. + newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); + newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); + //return newPos; + } + } +#if 1 + if (change == ItemSelectedChange && scene()) { + if(moveInput->isHidden() && value == 1){ + QRect rec = QApplication::desktop()->screenGeometry(); + //QPoint point = widget->mapToGlobal (QPoint(0,0)); //全局坐标 + QRect myRec = moveInput->geometry(); + moveInput->setGeometry(rec.width()/2,rec.height()/2 ,myRec.width(),myRec.height()); + + moveInput->show(); + } + if(value == 0) + { + moveInput->hide(); + } + } +#endif + + return QGraphicsItem::itemChange(change, value); +#endif +} +//! [1] + +//! [2] +void PicTextItem::focusOutEvent(QFocusEvent *event) +{ +// setTextInteractionFlags(Qt::NoTextInteraction); + moveInput->hide(); + emit lostFocus(this); + QGraphicsTextItem::focusOutEvent(event); + // +} +//! [2] + +//! [5] +void PicTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) +{ + //if (textInteractionFlags() == Qt::NoTextInteraction) + // setTextInteractionFlags(Qt::TextEditorInteraction); + //setTextInteractionFlags(Qt::TextBrowserInteraction); + QGraphicsTextItem::mouseDoubleClickEvent(event); + //emit itemEdit(toHtml()); +} +//! [5] + +//限制图元拖动范围 +void PicTextItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) +{ + QPointF newPos = this->pos(); + QRectF rect = scene()->sceneRect(); + if (!rect.contains(newPos)) { + // Keep the item inside the scene rect. + newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); + newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); + this->setPos(newPos); + } + QGraphicsTextItem::mouseReleaseEvent(event); +} + +void PicTextItem::keyPressEvent(QKeyEvent *event) +{ + if(event->key() == Qt::Key_Left) + { + moveBy(-1, 0); + } + else if(event->key() == Qt::Key_Right) + { + moveBy(1, 0); + } + else if(event->key() == Qt::Key_Up) + { + moveBy(0, -1); + } + else if(event->key() == Qt::Key_Down) + { + moveBy(0, 1); + } + + QPointF newPos = this->pos(); + QRectF rect = scene()->sceneRect(); + if (!rect.contains(newPos)) { + // Keep the item inside the scene rect. + newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); + newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); + this->setPos(newPos); + } + QGraphicsTextItem::keyPressEvent(event); +} + +#endif diff --git a/scene/pictextitem.h b/scene/pictextitem.h new file mode 100644 index 0000000..4e86682 --- /dev/null +++ b/scene/pictextitem.h @@ -0,0 +1,44 @@ +#ifndef PICTEXTITEM_H +#define PICTEXTITEM_H + +#include +#include +#include +#if 1 +class QFocusEvent; +class QGraphicsItem; +class QGraphicsScene; +class QGraphicsSceneMouseEvent; + +class PicTextItem : public QGraphicsTextItem +{ + Q_OBJECT +public: + enum { Type = UserType + 3 }; + explicit PicTextItem(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0); + + int type() const + { return Type; } + +signals: + void lostFocus(PicTextItem *item); + void selectedChange(QGraphicsItem *item); + void itemEdit(QString); + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant &value); + void focusOutEvent(QFocusEvent *event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); + void keyPressEvent(QKeyEvent *event); + +public slots: + +public: + bool SpecialConditions; + int CatchCnt1StartValue; + int CatchCnt1CurrValue; + +}; +#endif +#endif // PICTEXTITEM_H diff --git a/scene/sceneEditOption.ui b/scene/sceneEditOption.ui new file mode 100644 index 0000000..85a09d9 --- /dev/null +++ b/scene/sceneEditOption.ui @@ -0,0 +1,186 @@ + + + SceneEditOption + + + + 0 + 0 + 924 + 58 + + + + Form + + + + + + + + + 0 + 40 + + + + 预览 + + + + + + + true + + + + 0 + 40 + + + + 新建 + + + + + + + true + + + + 0 + 40 + + + + 打开 + + + + + + + true + + + + 0 + 40 + + + + 保存 + + + + + + + true + + + + 0 + 40 + + + + 另存为 + + + + + + + true + + + + 0 + 40 + + + + 新增图元 + + + + + + + true + + + + 0 + 40 + + + + 编辑图元 + + + + + + + true + + + + 0 + 40 + + + + 删除图元 + + + + + + + + 0 + 40 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + + 0 + 40 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + + + + + diff --git a/scene/sceneviewwidget.cpp b/scene/sceneviewwidget.cpp new file mode 100644 index 0000000..336480d --- /dev/null +++ b/scene/sceneviewwidget.cpp @@ -0,0 +1,8 @@ +#include "sceneviewwidget.h" +#include + +SceneViewWidget::SceneViewWidget(QWidget *parent) : + QWidget(parent) +{ + +} diff --git a/scene/sceneviewwidget.h b/scene/sceneviewwidget.h new file mode 100644 index 0000000..66b7326 --- /dev/null +++ b/scene/sceneviewwidget.h @@ -0,0 +1,18 @@ +#ifndef SCENEVIEWWIDGET_H +#define SCENEVIEWWIDGET_H + +#include +#include +class SceneViewWidget : public QWidget +{ + Q_OBJECT +public: + explicit SceneViewWidget(QWidget *parent = 0); + QGraphicsView *pView; +signals: + +public slots: + +}; + +#endif // SCENEVIEWWIDGET_H diff --git a/serial.cpp b/serial.cpp new file mode 100644 index 0000000..5ac58a8 --- /dev/null +++ b/serial.cpp @@ -0,0 +1,126 @@ +//serial.h的具体实现,要注意的地方是数据类型的转换,QLineEdit的text().toASCII返回的是QByteArray,而PortSend要发送的是 +//char类型的数据,所以就需要转换,在Qt中使用.data()就可以实现转换。还有要注意的地方就是QSocketNotifier不要忘记添加了。 +#include "serial.h" +portinfo_t portinfo = { + '0', // print prompt after receiving + 115200, // baudrate: 115200 + '8', // databit 8 + '0', // debug: off + '0', // echo off + '0', // flow control: software + '0', // default tt: SAC0 + '0', // parity: none + '1', // stopbit: 1 + 0 // reserved +}; +/* +typedef struct //define the uart value struct +{ + char prompt; //prompt after reciving data + int baudrate; //baudrate + char databit; //data bits, 5, 6, 7, 8 + char debug; //debug mode, 0: none, 1: debug + char echo; //echo mode, 0: none, 1: echo + char fctl; //flow control, 0: none, 1: hardware, 2: software + char tty; //tty: 0, 1, 2, 3, 4, 5, 6, 7 + char parity; //parity 0: none, 1: odd, 2: even + char stopbit; //stop bits, 1, 2 + //const int reserved; //reserved, must be zero + int reserved; //reserved, must be zero +}portinfo_t; + */ +static int serial_fd; +char databuffer[20]; +int datalen; +serial::serial(QWidget *parent) + : QWidget(parent) +{ + +// layout();//lay out + +// open_button->setEnabled(true); +// close_button->setEnabled(false); +// send_button->setEnabled(false); + +// connect(open_button,SIGNAL(clicked()),this,SLOT(open_serial())); +// connect(close_button,SIGNAL(clicked()),this,SLOT(close_serial())); +// connect(send_button,SIGNAL(clicked()),this,SLOT(send_setial())); + + QSocketNotifier *notifier=new QSocketNotifier(serial_fd,QSocketNotifier::Read,this); + connect(notifier,SIGNAL(activated(int)),this,SLOT(read_serial())); + read_serial(); +} +serial::~serial() +{ + +} +void serial::init_serial( int baudrate, int portNumber,int stopbit ) +{ + portinfo.baudrate = baudrate; + portinfo.tty = portNumber+'0'; + portinfo.stopbit = stopbit+'0'; + portinfo.fctl = '0'; +} +void serial::open_serial() +{ + serial_fd=PortOpen(&portinfo); + if(serial_fd<0) + { + perror("Error:open serial port error"); + //exit(1); + } + PortSet(serial_fd,&portinfo); + QSocketNotifier *notifier=new QSocketNotifier(serial_fd,QSocketNotifier::Read,this); + connect(notifier,SIGNAL(activated(int)),this,SLOT(read_serial())); + read_serial(); +} +void serial::close_serial() +{ + PortClose(serial_fd); + +} +void serial::read_serial() +{ + datalen=PortRecv(serial_fd,databuffer,10,115200); + //textbrowser->insertPlainText(databuffer); + qDebug()<<"read:"<setText("123489"); +// QVBoxLayout *vlayout1=new QVBoxLayout; +// vlayout1->addWidget(label1); +// vlayout1->addWidget(textbrowser); +// vlayout1->addWidget(label2); +// QVBoxLayout *vlayout3=new QVBoxLayout; +// vlayout3->addWidget(open_button); +// vlayout3->addWidget(close_button); +// QHBoxLayout *hlayout2=new QHBoxLayout; +// hlayout2->addLayout(vlayout1); +// hlayout2->addLayout(vlayout3); +// QHBoxLayout *hlayout1=new QHBoxLayout; +// hlayout1->addWidget(lineedit); +// hlayout1->addWidget(send_button); +// QVBoxLayout *vlayout2=new QVBoxLayout; +// vlayout2->addLayout(hlayout2); +// vlayout2->addLayout(hlayout1); +// setLayout(vlayout2); +//} + +//总结:总算完成了,前后花了两天的时候,很高兴的是自己没有放弃。至于这个串口的QT有什么用,那作用老大了,以前我用VB写过环境 +//监控系统,在PC端实现的,低下用的是ADUC824,那代码,叫宏伟啊。Qt就简单多了(站在巨人的肩膀上)。有了UART的通信,一些 +//控制类的东西都可以实现了,而且界面还可以做得要多漂亮就有多漂亮(看个人的了)。 diff --git a/serial.h b/serial.h new file mode 100644 index 0000000..1308356 --- /dev/null +++ b/serial.h @@ -0,0 +1,19 @@ +#ifndef SERIAL_H +#define SERIAL_H +#include +#include "mycom.h" +class serial : public QWidget +{ + Q_OBJECT +public: + serial(QWidget *parent = 0); + ~serial(); + void init_serial( int baudrate, int portNumber,int stopbit ); + +public slots: + void open_serial(); + void close_serial(); + void read_serial(); + void send_serial(char *buf,int len); +}; +#endif // SERIAL_H diff --git a/spanish.qm b/spanish.qm new file mode 100644 index 0000000..00773ec Binary files /dev/null and b/spanish.qm differ diff --git a/spanish.ts b/spanish.ts new file mode 100644 index 0000000..fc1fd6e --- /dev/null +++ b/spanish.ts @@ -0,0 +1,7687 @@ + + + +UTF-8 + + DevOp + + + + + + + + 警告 + Advertencia + + + + 字高超出范围 + Altura de la palabra fuera del alcance + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + La altura de la palabra es demasiado pequeña o los datos de paquetes de alto voltaje no se inicializan, su error actual ignorará todos los errores de alto voltaje + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + El intervalo de la impresión es demasiado corto para cumplir con el ajuste del ancho de la impresión síncrono, y ¡el ancho de la palabra se acortará automáticamente! + + + + + 错误 + Error + + + + 在同步计米的情况下无打印串或显示区域为零 + No hay cadena de impresión o el área de visualización es cero en el caso de la medición simultánea + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Demasiados pulsos de sincronización de impresión en el caso de la medición simultánea, verifique su configuración + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + La cadena de caracteres de la impresión es demasiado corta, aumente la longitud de la cadena o reduzca la longitud de impresión en la configuración de impresión + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + La longitud de impresión es demasiado corta, reduzca la longitud de la cadena o aumente la longitud de impresión en la configuración de impresión + + + Encoder pulse counter per MM parameter error! + Encoder pulse counter per MM parameter error! + + + + DialogAuthorization + + + Dialog + Dialog + + + + 授权密码: + Contrasena de autorizacion: + + + + 输入密码 + 提升授权 + Elevar la autorizacion + + + + DialogCycleprint + + + Dialog + Dialog + + + + 1循环范围:0- + Rango de 1 ciclo: 0- + + + + 1循环次数: + 1 tiempos de ciclo: + + + + 2循环范围:0- + Rango de 2 ciclo: 0- + + + + 2循环次数: + 2 tiempos de ciclo: + + + + 3循环范围:0- + Rango de 3 ciclo: 0- + + + + 3循环次数: + 3 tiempos de ciclo: + + + + 6循环次数: + 6 tiempos de ciclo: + + + + 6循环范围:0- + Rango de 6 ciclo: 0- + + + + 5循环范围:0- + Rango de 5 ciclo: 0- + + + + 5循环次数: + 5 tiempos de ciclo: + + + + 4循环范围:0- + Rango de 4 ciclo: 0- + + + + 4循环次数: + 4 tiempos de ciclo: + + + + DialogFileOperation + + + Dialog + Dialog + + + + 本地文件 + Archivos locales + + + + U盘文件 + Archivo de la memoria USB + + + + 删除文件 + Eliminar archivos + + + + 删除全部 + Eliminar todo + + + + 从U盘导入 + Importar desde una memoria USB + + + + 导出到U盘 + Exportar a la memoria USB + + + + 插入 + Insertar + + + + 打开文件 + Abrir archivo + + + + 上一个 + Anterior + + + + 下一个 + Siguiente + + + + 退出 + Salida + + + + 文件操作 + Operaciones de archivo + + + + + + 警告 + Advertencia + + + + 是否确认删除当前文件? + ¿Confirma la eliminación del archivo actual? + + + + 是否确认删除所有文件? + ¿Confirma que se eliminan todos los archivos? + + + + + + + 提示 + Consejos + + + + 是否确认从U盘导入所有文件? + ¿Está seguro de importar todos los archivos desde la memoria USB? + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + ¿Importación exitosa desde una memoria USB? + + + + 是否确认将所有文件导出到U盘? + ¿Está seguro de exportar todos los archivos a una memoria USB? + + + + 成功导出到U盘? + ¿Se exporta correctamente a la memoria USB? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + ¡La memoria USB no está insertada o la carpeta doc. en la raíz de la memoria USB no existe! + + + + DialogFontSize + + + Dialog + Dialog + + + + 7点(左横) + 7 píxeles (Izquierda Horizontal) + + + + 5点(英) + 5 píxeles + + + + 7点(右横) + 7 píxeles(Derecha Horizontal) + + + + 12点(中/英) + 12 píxeles + + + + 9点(英) + 9 píxeles + + + + 7点(英) + 7 píxeles + + + + 16点(中/英) + 16 píxeles + + + + 24点(中/英) + 24 píxeles + + + + 9点(左横) + 9 píxeles (Izquierda Horizontal) + + + + 9点(右横) + 9 píxeles(Derecha Horizontal) + + + + 7点(孟加拉) + 7 píxeles(Bangladesh) + + + + 32点 + 32píxeles + + + + 7点(rf7) + 7点(数字) + 7píxeles(rf7) + + + + 21点(rf21) + 7píxeles(rf21) + + + + 12点(新罗马) + + + + + 123456890ABCDEFGWXYZ + 123456890ABCDEFGWXYZ + + + + - + - + + + + 查字库标识 + Consulta la identificación de la biblioteca de palabras + + + + 选择字体大小 + Elija el tamano de fuente + + + + DialogInputTxt + + + Dialog + Dialog + + + + DialogInsertVari + + + Dialog + Dialog + + + + 变量类型 + Tipo de variable + + + + 日 + Dia + + + + 计数器1 + Contador 1 + + + + 月 + Mes + + + + 分 + Minuto + + + + 时 + Hora + + + + 年 + Ano + + + + 计数器2 + #Contador 2 + + + + 秒 + Segundo + + + + 周 + Semana + + + + BarCode128 + BarCode128 + + + + DataMatrix + DataMatrix + + + + QRCode + QRCode + + + + 随机码1 + Codigo aleatorio 1 + + + + 有效日期 + Fecha vigente + + + + 生产日期 + Fecha de produccion + + + + Class + Class + + + + 计数器3 + Contador 3 + + + + 数字个数 + Cantidad de numeros + + + + 9个 + 9 + + + + 11个 + 11 + + + + 10个 + 10 + + + + 2个 + 2 + + + + 1个 + 1 + + + + 3个 + 3 + + + + 4个 + 4 + + + + 5个 + 5 + + + + 6个 + 6 + + + + 7个 + 7 + + + + 8个 + 8 + + + + 12个 + 12 + + + + 13个 + 13 + + + + 14个 + 14 + + + + 15个 + 15 + + + + 变量插入 + Insercion de variable + + + + DialogLineSpace + + + Dialog + Dialog + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + Un pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + Espaciado de linea: + + + + 字符间距: + Espaciado de fuente: + + + + 选择行间距和字符间距 + Seleccione el espaciado de línea y el espaciado de fuente + + + + DialogPointDistanceAdjust + + + Dialog + Dialog + + + + 列首: + Primera de columna + + + + 列中: + En la columna + + + + 列尾: + Fin de columna + + + + 重置 + Restablecer + + + + 测试 + Prueba + + + + DialogSaveFile + + + Dialog + Dialog + + + + 本地文件 + Archivos locales + + + + U盘文件 + Archivo de la memoria USB + + + + 预览文件内容: + Vista previa del contenido del archivo: + + + + 上一个 + Anterior + + + + 下一个 + Siguiente + + + + 请输入文件名: + Introduzca el nombre del archivo: + + + + 取消 + Cancelar + + + + + 保存 + Guardar + + + + 警告 + Advertencia + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + ¡La memoria USB no está insertada o la carpeta doc. en la raíz de la memoria USB no existe! + + + + DialogShowCounter + + + Dialog + Dialog + + + + 米标显示: + Muestra el signo de metros + + + + 目前循环范围: + Rango de ciclo actual: + + + + + + 米 + Metro + + + + 剩余米数: + Los metros restantes: + + + + 循环次数: + Número de ciclos: + + + + 立即重新计米 + Remedir ahora + + + + 起始: + Inicio: + + + + 结束: + Fin: + + + + Dialoginputpasswd + + + Dialog + Dialog + + + + 修改密码: + Cambie su contrasena: + + + + Dialogmodifypasswd + + + Dialog + Dialog + + + + 修改密码: + Cambie su contrasena: + + + + 密码授权 + Autorizacion de contrasena + + + + DigitalInput + + + Form + Form + + + + 9 + 9 + + + + 3 + 3 + + + + 8 + 8 + + + + - + - + + + + 退格 + Retorceso + + + + 1 + 1 + + + + 4 + 4 + + + + 0 + 0 + + + + 5 + 5 + + + + 7 + 7 + + + + 2 + 2 + + + + 6 + 6 + + + + 全选 + Selección completa + + + + DlgInputAddr + + + Dialog + Dialog + + + + 请输入6位机编号(前3位为经销商编号) + Introduzca el número de máquina de 6 dígitos (los primeros 3 son el número del distribuidor) + + + + PowerOnCnt + PowerOnCnt + + + + PrintDotCnt + PrintDotCnt + + + + PowerMax + PowerMax + + + + PrintMax + PrintMax + + + + 开始时间 + Hora de inicio + + + + 结束时间 + Hora de finalizacion + + + + SuperNodeIP: + SuperNodeIP: + + + + edgeIP: + edgeIP: + + + + + + + + + . + . + + + + 喷码机恢复工作! + ¡La máquina de la impresión vuelve a trabajar! + + + + Mac:%1维护时间剩余 + 维护时间剩余 + Tiempo de mantenimiento restante + + + + 小时,喷码机将停止工作.请与供应商联系! + ¡Hora: la máquina parará el trabajo, comunique con la fábrica! + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + ¡Llega el tiempo del mantenimiento, la máquina parará el trabajo, comunique con la fábrica! + + + + + 当前日期: + Fecha actual: + + + + + 正确? + ¿Es correcto? + + + + DlgMutiLanguage + + + 界面语言设置 + Configuración del idioma de la interfaz + + + + 中文 + Chino + + + + 泰语 + + + + + 英语 + ingles + + + + 土耳其语 + turco + + + + 西班牙语 + espanol + + + 汉语(Chinese) + Chino + + + 英语(English) + Ingles + + + 越南语(Vietnam) + Vietnamita + + + 俄罗斯语(Russian) + Ruso + + + 日语(Japanese) + Japones + + + 韩语(Korean) + Coreano + + + English + English + + + + (注意: 选择切换显示语言, 重启后才能生效) + (Nota: si elige cambiar el idioma de la pantalla, tendra efecto despues de reiniciar) + + + Turk + Turk + + + (Nota: Elija cambiar el idioma de visualización, reinicie para tener efecto) + (Nota: Elija cambiar el idioma de visualización, reinicie para tener efecto) + + + + DlgMyWarring + + + 警告 + Advertencia + + + + 确定 + Confirmar + + + + TextLabel + TextLabel + + + + DlgSelectInputLanguage + + + Dialog + Dialog + + + + 汉语(Chinese) + Chino + + + + 英语(English) + Ingles + + + + 越南语(Vietnam) + Vietnamita + + + + DlgShowMsg + + + 警告 + Advertencia + + + + 确定 + Confirmar + + + + DlgVarLength + + + 变长喷印参数 + Alargar parametro de impresion + + + + 头部长度(m) + Longitud de la cabeza(m) + + + + 尾部长度(m) + Longitud de la cola(m) + + + + 总长(m) + Longitud total(m) + + + + + 调整长度(mm) + Ajustar longitud(mm) + + + + 可变长度允许 + Longitud variable permitida + + + + 确定 + Confirmar + + + + InkJetPrinter + + + TabWidget + TabWidget + + + + 主窗口 + Ventana principal + + + + + + 信息编辑 + Editar informacion + + + + 图案编辑 + Editar Imagen + + + + 打印设置 + Configuracion de impresion + + + + 触发设置 + Configuracion del disparador + + + + + 系统设置 + Configuracion del sistema + + + + + 系统管理 + Gestion del sistema + + + + + 其他信息 + Otra Informacion + + + + + 日志信息 + Informacion de registro + + + + + 网络管理 + Administracion de redes + + + + 电压调整 + Ajuste de voltaje + + + + Save + Save + + + + 不连续电压 + Voltaje discontinuo + + + + + vol0 + vol0 + + + + + vol1 + vol1 + + + + + vol2 + vol2 + + + + + vol3 + vol3 + + + + + vol4 + vol4 + + + + + vol5 + vol5 + + + + + vol6 + vol6 + + + + + vol7 + vol7 + + + + + vol8 + vol8 + + + + + vol9 + vol9 + + + + + vol10 + vol10 + + + + + vol11 + vol11 + + + + + vol12 + vol12 + + + + + vol13 + vol13 + + + + + vol14 + vol14 + + + + + vol15 + vol15 + + + + + vol16 + vol16 + + + + + vol17 + vol17 + + + + + vol18 + vol18 + + + + + vol19 + vol19 + + + + + vol20 + vol20 + + + + + vol21 + vol21 + + + + + vol22 + vol22 + + + + + vol23 + vol23 + + + + + vol24 + vol24 + + + + + vol25 + vol25 + + + + + vol26 + vol26 + + + + + vol27 + vol27 + + + + + vol28 + vol28 + + + + + vol29 + vol29 + + + + + vol30 + vol30 + + + + + vol31 + vol31 + + + + + vol32 + vol32 + + + + + vol33 + vol33 + + + + + vol34 + vol34 + + + + + vol35 + vol35 + + + + + vol36 + vol36 + + + + + vol37 + vol37 + + + + + vol38 + vol38 + + + + + vol39 + vol39 + + + + 连续电压 + voltaje continuo + + + + 满列电压 + Voltaje completo + + + + fvol0 + fvol0 + + + + fvol1 + fvol1 + + + + fvol2 + fvol2 + + + + fvol3 + fvol3 + + + + fvol4 + fvol4 + + + + fvol5 + fvol5 + + + + fvol6 + fvol6 + + + + fvol7 + fvol7 + + + + fvol8 + fvol8 + + + + fvol9 + fvol9 + + + + fvol10 + fvol10 + + + + fvol11 + fvol11 + + + + fvol12 + fvol12 + + + + fvol13 + fvol13 + + + + fvol14 + fvol14 + + + + fvol15 + fvol15 + + + + fvol16 + fvol16 + + + + fvol17 + fvol17 + + + + fvol18 + fvol18 + + + + fvol19 + fvol19 + + + + fvol20 + fvol20 + + + + fvol21 + fvol21 + + + + fvol22 + fvol22 + + + + fvol23 + fvol23 + + + + fvol24 + fvol24 + + + + fvol25 + fvol25 + + + + fvol26 + fvol26 + + + + fvol27 + fvol27 + + + + fvol28 + fvol28 + + + + fvol29 + fvol29 + + + + fvol30 + fvol30 + + + + fvol31 + fvol31 + + + + fvol32 + fvol32 + + + + fvol33 + fvol33 + + + + fvol34 + fvol34 + + + + fvol35 + fvol35 + + + + fvol36 + fvol36 + + + + fvol37 + fvol37 + + + + fvol38 + fvol38 + + + + fvol39 + fvol39 + + + + 其他调整 + Otros ajustes + + + + 整体缩放(%) : + Reduccion integral: + + + + WriteByte + WriteByte + + + + ReadByte + ReadByte + + + + + + Address: + Address: + + + + + Value: + Value: + + + + WriteWord + WriteWord + + + + ReadWord + ReadWord + + + + ReadDword + ReadDword + + + + WriteDword + WriteDword + + + + ValueH: + ValueH: + + + + ValueL: + ValueL: + + + + 定时开机 + inicio cronometrado + + + + + 压力泄漏或压力传感器故障! + ¡Fuga de presion o fallo del sensor de presion! + + + + 运行中压力泄漏,停齿轮泵! + ¡Fuga de presion durante el funcionamiento, detenga la bomba de engranajes! + + + + + 测试时间结束,准备关机 + El tiempo de prueba ha terminado, listo para apagar + + + + 定时开机循环完成,准备关机 + El ciclo de encender cronometrado está completo, listo para apagarse + + + + 准备关机 + Listo para apagarse + + + + 与FPGA失去通信!!! + ¡¡¡Perder la comunicación con FPGA!!! + + + + 与FPGA通信恢复正常 + La comunicación con FPGA vuelve a la normalidad + + + + 开始自检,请等待60秒............... + Iniciar autoprueba, por favor espere 60 segundos... + + + + 开始自检,请等待%1秒............... + Iniciar autoprueba, por favor espere %1 segundo... + + + + + 自检完成!!! + Autoprueba completada!!! + + + + + 墨水或溶剂空,准备关机 + Tinta o disolvente vacío, listo para apagar + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + ¡¡¡ La velocidad de impresión por pulverización demasiado rápida!!! ¡¡¡No se puede imprimir por completo, pausar automáticamente!!! + + + + 喷印速度过快!无法喷印完全!!! + ¡¡¡ La velocidad de impresión por pulverización demasiado rápida!!! ¡¡¡No se puede imprimir por completo!!! + + + + 压力波动超过设定的5个值. + La fluctuación de presion supera los 5 valores establecidos. + + + + 停止打印,自动关闭高压. + Parar la impresión y apagarse automáticamente el alto voltaje. + + + + 压力异常:上次压力值%1,当前压力值%2 + Presión anormal: valor de última presión %1, valor de presión actual %2 + + + + 高压异常:上次电流值%1,当前电流值%2 + Anomalía de alto voltaje: último valor de corriente %1, valor actual de corriente %2 + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + iAlta velocidad, detengase y comuniquese con el proveedor! + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + Alta velocidad, limpie el filtro o compruebe si hay fugas! + + + + 提示 + insinuacion + + + + 是否接收新的信息! + Ya sea para recibir nueva informacion! + + + 请立即检查过滤器是否堵塞或者漏气! + iCompruebe inmediatamente si el filtro está obstruido o tiene fugas! + + + 请清理过滤器或者检查是否泄露! + ¡Limpie el filtro o compruebe si hay fugas! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + ¡El calentador no alcanza la temperatura esperada durante mucho tiempo, fallo o configuración incorrecta! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Error!Fallo de la bomba principal de la tinta + + + + + 主墨泵故障!!! + Fallo de la bomba principal de la tinta! + + + + 错误!!!!!!!!!!!压缩机故障 + Error!Fallo del compresor + + + + 压缩机故障!!! + Fallo del compresor! + + + + + 错误!粘度计下位灯故障. + Error!Fallo de la lámpara inferior del viscosímetro. + + + + + 错误!粘度计故障:检测不到上位灯. + Error!!!! No se detecta la lámpara superior del viscosímetro. + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + + + + + 混合阀打开1: + + + + + + 警告!!!!!!!!!!!粘度值偏低 + Advertencia!El valor de viscosidad es bajo + + + + + 错误!!!!!!!!!!!粘度偏大故障 + Error!La viscosidad es demasiado alta + + + + 粘度检测异常,粘度值太大!!! + ¡La detección de viscosidad es anormal, el valor de viscosidad es demasiado alta! + + + + 混合阀打开2: + + + + + + + 电机故障 + Fallo del motor + + + + 电机故障!!! + Fallo del motor! + + + + + 回收槽到头 + Caja de reciclaje llega al final + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + La caja de reciclaje está atascada o la configuración del tiempo de apaertura y cierre está incorrecta + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + ¡la velocidad de la impresión por pulverización demasiado rápida o el intervalo demasiado corto! ¡¡¡No se puede imprimir por completo, pausar automáticamente la impresión!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + ¡la velocidad de la impresión por pulverización demasiado rápida o el intervalo demasiado corto! ¡¡¡No se puede imprimir por completo!!! + + + + InputMethod + + + Form + Form + + + + 1 书 + Libro + + + + 2 输 + Perder + + + + 3 数 + Contar + + + + 4 属 + Permanecer + + + + 5 熟 + Maduro + + + + 上一页 + Pagina Anterior + + + + 下一页 + Pagina Siguiente + + + + ` + ` + + + + 1 + 1 + + + + 2 + 2 + + + + 3 + 3 + + + + 4 + 4 + + + + 5 + 5 + + + + 6 + 6 + + + + 7 + 7 + + + + 8 + 8 + + + + 9 + 9 + + + + 0 + 0 + + + + - + Advertencia + + + + = + = + + + + 退格 + Retroceso + + + + + 英文 + Ingles + + + + q + 1 + + + + w + w + + + + e + e + + + + r + r + + + + t + t + + + + y + y + + + + u + u + + + + i + i + + + + o + o + + + + p + p + + + + [ + [ + + + + ] + ] + + + + \ + \ + + + + + 大写 + Mayuscula + + + + a + a + + + + s + s + + + + d + d + + + + f + f + + + + g + g + + + + h + h + + + + j + j + + + + k + k + + + + l + l + + + + ; + ; + + + + ' + ' + + + + Enter + Enter + + + + Shift + Shift + + + + z + z + + + + x + x + + + + c + c + + + + v + v + + + + b + b + + + + n + n + + + + m + m + + + + , + , + + + + . + . + + + + / + / + + + + 上 + Arriba + + + + 特殊字 + Palabra especial + + + + 隐藏 + Oculto + + + + Ctrl + Ctrl + + + + 删除 + Eliminar + + + + 行首 + Primera Linea + + + + 行尾 + Fin de linea + + + + 左 + Izquierda + + + + 下 + Abajo + + + + 右 + Derecha + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + Hanzi DisplayLabels carece de inicialización + + + + warning + Advertencia + + + + myInputMethod is null + + Advertencia + + + + 找不到输入法初始化文件 + No se pudo encontrar el archivo de inicialización de + + + + 小写 + Minusculas + + + + Tiếng Việt + Tiếng Việt + + + + Russian + Russian + + + + Japanese + Japanese + + + + 全选 + Selección completa + + + + 复制 + Copiar + + + + 粘贴 + Pegar + + + + 剪切 + Cortar + + + + 后退 + Retroceso + + + + InsertSpaceNumDialog + + + 插入空格数 + Número de espacios Insertos + + + + 空格个数: + Número de Espacios: + + + + LogInfo + + + Form + Form + + + + 当前状态 + Estado actual + + + + 清空当前状态 + Vaciar el estado actual + + + + 历史状态 + Estado de la historia + + + + 删除历史文件 + Eliminar archivos históricos + + + + 打开历史文件 + Abrir archivo histórico + + + + TextLabel + TextLabel + + + + 导出日志到U盘 + Exportar registros a disco U + + + + 版本信息 + Información de la versión + + + + 请先打开历史状态文件! + ¡Abra primero el archivo histórico! + + + + + + 警告 + Advertencia + + + + + + 无法打开文件 + El archivo no se puede abrir + + + + + + + 提示 + Consejos + + + + 是否确认将所有日志文件导出到U盘? + ¿Está seguro de exportar todos los archivos de registro a una memoria USB? + + + + 成功导出到U盘? + ¿Se exporta correctamente a la memoria USB? + + + + 选择历史记录文件 + Seleccione el archivo histórico + + + + 是否确认将历史日志文件全部清除? + Estas seguro de borrar todos los archivos de registro del historial? + + + + 是否确认将当前日志全部清除? + Estas seguro de borrar todos los registros actuales? + + + + MainWindow + + + InkJet + InkJet + + + + 编辑 + Editar + + + + 打开文件 + Abrir archivo + + + + 二维码 + Código QR + + + + 条形码 + Código de barras + + + + 缩小 + Reducir + + + + 放大 + Ampliar + + + + 获取数据 + recuperar datos + + + + 交替打印文件名 + Alternativamente imprimir los nombres de archivo + + + + 最大:[40行x 2048列] + Máx.: 40 filas x 2048 columnas + + + + 同步器速度 + Velocidad del sincronizador + + + + 当前时间 + Hora actual + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi';"></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi';"></p></body></html> + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨线开关 + Interruptor del nivel de tinta + + + + 喷头盖开 + Abrieta la tapa de la boquilla + + + + 墨水缸满 + Cilindro de tinta lleno + + + + 墨水液位 + Nivel de tinta + + + + 溶剂液位 + Nivel de disolvente + + + + 回收故障 + Fallo de reciclaje + + + + 粘度故障 + Fallo de viscosidad + + + + 相位故障 + Fallo de fase + + + + 高压故障 + Fallo de alta voltaje + + + + 故障恢复 + Recuperación del fallo + + + + 立即重新计米 + Remedir ahora + + + + 产品计数 + Contar los productos + + + + 产品总计数 + Cuenta total de productos + + + + 关机 + Apagar + + + + 2014-08-23 + 2014-08-23 + + + + 高压包 + Paquete de alta tensión + + + + 粘度 + Viscosidad + + + + 压力 + Presión + + + + + 隔膜位置 + Posición del diafragma + + + + + + + 开 + Encender + + + + + + + 关 + Apagar + + + + + 暂停打印 +停止高压 + Pausar impresión +detener la alta presión + + + + 紧急停机 + parada de emergencia + + + + 泵启动 + La bomba arranca + + + 启动 + Iniciar + + + + 喷嘴逆清洗 + Limpieza inversa de la boquilla + + + + + 机箱: + Chasis: + + + + + + 正在喷印............... + Impresión... + + + + 喷头盖开, 喷印无法正常进行!!! + La boquilla está abierta, la impresión por pulverización no se puede funcionar normalmente!!! + + + + + 墨水缸满报警 + Advertencia del lleno de cilindro de tinta + + + + + 墨水液位报警 + Advertencia del nivel de tinta + + + + + 溶剂液位报警 + Advertencia de nivel de disolvente + + + + + 高压故障,暂停打印 + Fallo de alta tensión, pausar la impresión + + + + + 高压故障,暂停打印. + Fallo de alta tensión, pausar la impresión + + + + 高压故障,关回收槽 + Fallo de alta tensión, cerrar la caja de reciclaje + + + + 高压故障,关回收槽和墨线 + Fallo de alta tensión, cerrar la caja de reciclaje y la línea de tinta + + + + + + + + 回收故障,关闭回收槽,关墨线 + Fallo del reciclaje, cerrar la caja de reciclaje y la línea de tinta + + + + 回收故障. + Fallo de reciclaje. + + + + 回收异常,墨线可能偏离.(%1) + El reciclaje es anormal y la línea de tinta puede desviarse. (%1) + + + + 维护时间已到,喷码机停止工作! + ¡Llega el tiempo del mantenimiento, la máquina para el trabajo! + + + + + 暂停喷印............... + Pausar impresión... + + + + 相位故障:飞行时间错误! + Fallo de fase: hora de vuelo equivocada! + + + + 相位故障:相位检测错误! + Fallo de fase: ¡Error de detección de fase! + + + + + + 相位故障,准备关机 + Fallo de fase, listo para apagarse + + + + + + 相位故障,暂停打印 + Fallo de fase, pausar la impresión + + + + 相位故障,屏蔽DAC输出 + Fallo de fase, bloquea la salida DAC + + + + + 相位故障,屏蔽充电 + Fallo de fase, bloquea la recarga + + + + 齿轮泵转速 + velocidad + + + + 交替打印 + Impresión alternativa + + + + 电眼交替 + Ojo electrónico alternativo + + + + %1.%2[%3.%4]米/分 + %1.%2[%3.%4]metro/minuto + + + + 列延时:%1点 + Retraso de columna:% 1 punto + + + + + + + + + + + + + + + 警告 + Advertencia + + + + 无法打开文件 + El archivo no se puede abrir + + + + 打开文件: + Abrir archivo: + + + + + + 提示 + Consejos + + + + 文件未保存,是否先保存文件! + El archivo no se guarda, quiere guardar el archivo primero! + + + + + + + 变量数大于8个,某些变量将不起作用!!! + El número de variables es mayor que 8 y algunos variables no funcionarán!!! + + + + + 请减少信息中的变量(或计数器)数量. + Reduzca el número de variables (o contadores) en la información + + + + warning,界面上有变量未显示完全 + advertencia, hay variables en la interfaz que no se muestran completamente + + + + + + + [ %1行 x %2列 ] + [%1 fila x %2 columna] + + + + + + + + 错误 + Error + + + + 喷印间隔过短,应高于%1! + El intervalo de impresión es demasiado corto y debe ser superior a %1! + + + + 喷头盖未关,请先关喷头盖! + La tapa de la boquilla no está cerrada, por favor cierre la boquilla primero! + + + + 墨线未开,请先开墨线开关! + La línea de tinta no está abierta, ¡abra primero el interruptor de línea de tinta! + + + + 正在加高压... + Se añade alta presión... + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Número total actual de columnas %1, número total admitido de columnas % 2, reduzca la longitud de la cadena de impresión + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Tiempo de impresión %1ms, intervalo de disparo: %2ms, intervalo de disparo debe ser al menos mayor que 3ms de tiempo de impresión + + + + 同步目标每列有%1.%2个同步脉冲 + Sincronice el objetivo con %1.% 2 pulsos de sincronización por columna + + + + + + 开始打印 + Comenzar a imprimir + + + + 回收槽未到底!!!!!! + No llega al final la caja del reciclaje!!!! + + + + 停止打印 + Cesar a imprimir + + + + + 随机码文本将展出到U盘,请插入U盘 + El texto del código aleatorio se mostrará en la memoria USB, inserte la memoria USB + + + + 暂停打印 + Pausar la impresión + + + + 继续打印 + Continuar imprimiendo + + + + 继续打印 +保持高压 + seguir imprimiendo +mantener alta presión + + + + 正在排气 ............... + agotador ................ + + + + + 停止 + Cesar + + + + 正在打开回收槽... + Está abriendo la caja del reciclaje… + + + + 停止打开 + Cesar a abrir + + + + + 警告!回收槽开关时间未设置! + ¡Advertencia! ¡El tiempo de apertura y cierre de la caja del reciclaje no está configurado! + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Hay un bloqueo antes de que la caja de reciclaje o el tiempo esta configurado incorrectamente. ¿La posición actual está configurada como la posición superior? + + + + 正在关闭回收槽... + Está cerrando la caja del reciclaje… + + + + 停止关闭 + Cesar a cerrar + + + + 准备关机...... + Listo para apagarse + + + + 泵停止 + Bomba detenida + + + + 回收槽未关,是否关闭回收槽后关机! + ¡La caja de reciclaje no está cerrada, quiere cerrarla y apagar! + + + + 是否确认关机? + ¿Confirma apagarse? + + + + + 最多支持的列数目为:%1请减小信息长度. + El número máximo de columnas admitidas es: %1 Reduzca la longitud de la información. + + + + 是否初始化产品计数? + Se inicializa a contar los productos? + + + + 是否清除总产品计数? + Se ha despejado el número total de productos? + + + + 是否立即重新计米? + Desea remedir inmediatamente? + + + + 警告:‘-’和空格的宽度不一样 + Advertencia: '-' no es la misma anchura que un espacio + + + + 条形码信息编辑 + Editar la información sobre códigos de barras + + + + + 二维码信息编辑 + Editar la información de códigos QR + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + ¡El contenido del código Obtener DM está vacío! + + + + + 获取DM码内容: + Obtenga el contenido del código DM: + + + + + 获取DM码内容跟上次相同 + El contenido de obtener el código DM es el mismo que la última vez + + + + 高压故障:两高压偏转板间的电压检测异常 + Fallo de alta tensión: anomalías de detección de voltaje entre dos placas de desviación de alto voltaje + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + Placa de deflexión de alta presión y base de alta presión húmeda, sucia, por favor limpie y seque la placa de alta presión y la base de alta presión; + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + 2. La máquina reemplazar la placa principal o el paquete de alto voltaje, ingrese la "configuración del sistema" haga clic en "restablecer alto voltaje", la altura de la palabra establecida en 90, restablecer el valor de alarma de alto voltaje debe estar entre 480-550; + + + + 3.高压线路漏电,请更换高压线路; + Fuga de línea de alta tensión, reemplace la línea de alta tensión; + + + + 4.高压底座漏电,请更换高压底座。 + Fuga de la base de alto voltaje, reemplace la base de alta tensión. + + + + 墨水过多:墨水溢出 + Demasiada tinta: se derrama la tinta + + + + 1. 请停止添加墨水; + Por favor, deje de agregar tinta; + + + + 2. 请排出多余墨水。 + Por favor, escurra el exceso de tinta. + + + + 墨水液位:墨水即将耗尽 + Nivel de tinta: La tinta se agota. + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + La tinta se agota y se apagará automáticamente después de 3 horas. + + + + 回收故障:未检测到有墨水回收 + Fallo de reciclaje: No se ha detectado la recuperación de tinta + + + + 1. 墨水未射入回收管,请修正墨线方向; + La tinta no entra en el tubo de recuperación, corrija la dirección de la línea de tinta; + + + + 2. 墨水粘度太低,请更换新墨水; + La viscosidad de la tinta es demasiado baja, sustituya la nueva tinta; + + + + 3. 回收管堵塞,请清通或者更换回收管; + Tubo de reciclaje bloqueado, por favor despeje o reemplace el tubo de reciclaje; + + + + 4. 回收泵故障,请清洗或者更换回收泵; + Fallo de la bomba de reciclaje, limpie o reemplace la bomba de recuperación; + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + Después de confirmar que los parámetros y el equipo no son anormales, vaya a la "configuración de impresión" para cancelar la comprobación de "tratamiento de fallos de reciclaje", volver a la interfaz de la ventana principal haga clic en el botón "recuperación de fallos". + + + + 溶剂液位:溶剂即将耗尽 + Nivel de disolvente: El disolvente se está acabando + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + 1. El disolvente se agota y se apagará automáticamente después de 3 horas, por favor agregue el disolvente a tiempo. + + + + + 粘度故障报警 + Alarma de fallo de viscosidad + + + + 粘度故障:墨水粘度无法自动调整 + Fallo de viscosidad: La viscosidad de la tinta no se puede ajustar automáticamente + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + Si la válvula de mezcla no funciona, enjuague o reemplace la válvula de mezcla. + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + La tinta en el depósito de tinta es anormal, por favor reemplace la nueva tinta; + + + + 粘度计异常: + Anomalía del viscosímetro: + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + 1. Filtro frontal de la bomba bloqueado, reemplace el filtro de la bomba; + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + 2. Bomba de viscosidad anormal, limpie o reemplace la bomba de viscosidad; + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + 3. El sensor de viscosidad es anormal, compruebe la línea del sensor o reemplace el sensor. + + + + 相位故障报警 + Alarma de fallo de fase + + + + 相位故障:相位信号检测异常 + Fallo de fase: Detección de señal de fase anormal + + + + 1. 墨水分裂不正常,请调整墨水分裂; + 1. La división de tinta no es normal, ajuste la división de tinta; + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + 2. La caja de carga o el cabezal de inspección de fase está sucio, limpie la caja de carga y el cabezal de inspección de fase; + + + + 3. 放大板功能性异常,请更换放大板; + 3. La placa de amplificación no es funcional, reemplace la placa de aumento; + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + La distancia entre el cabezal de detección de fase y la línea de tinta es demasiado lejos, verifique el mecanismo de movimiento de la boquilla, ajuste la distancia entre el cabezal de detección de fase y la línea de tinta; + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + 5. Si la línea de tierra no está conectada o la interferencia exterior, conecte la línea de tierra o aísle la interferencia exterior; + + + + 6. 墨水质量异常,请更换新墨水。 + 6. La calidad de la tinta es anormal, sustituya la nueva tinta. + + + + 回收槽开关检测完成! + iDeteccion de interruptor completa! + + + + MemDisplayAndEdit + + + Form + Form + + + + 07 + 07 + + + + 02 + 02 + + + + 06 + 06 + + + + 0D + 0D + + + + 09 + 09 + + + + 03 + 03 + + + + 01 + 01 + + + + 04 + 04 + + + + 0C + 0C + + + + 0A + 0A + + + + 0F + 0F + + + + 05 + 05 + + + + 00 + 00 + + + + 08 + 08 + + + + 0B + 0B + + + + 0E + 0E + + + + 基地址: + Dirección de base: + + + + 0x0000 + 0x0000 + + + + 0xb100 + 0xb100 + + + + 0xb200 + 0xb200 + + + + 0xa400 + 0xa400 + + + + 0xe000 + 0xe000 + + + + 读空间 + Espacio de lectura + + + + 写空间 + Espacio de escritura + + + + 进制转换 + Conversión en el sistema + + + + + 编辑 + Editar + + + + 上一页 + Página anterior + + + + 下一页 + Página siguiente + + + + 完成 + Completa + + + + ModbusSerial + + + 接收到开始打印命令 + Comando de inicio de impresión recibido + + + + 接收到暂停打印命令 + Pausar comando de impresión recibido + + + + 接收到停止打印命令 + Recibido comando de parada de impresión + + + + 接收到DM码数据命令 + Comando de datos de código DM recibido + + + + MyFileDialog + + + 确定 + Confirmar + + + + NetworkManager + + + Form + Form + + + + 手动设定 + Ajuste manual + + + + + IP: + IP: + + + + Mask: + Mask: + + + + GW: + GW: + + + + 取消 + Cancelar + + + + 有线LAN + LAN cableada + + + + WiFi: + WIFI: + + + + SSID: + SSID: + + + + Status: + Status: + + + Disconnect + Disconnect + + + + auth: + auth: + + + + Encryption: + Encryption: + + + Scan + Scan + + + + Plaintext (open / no authentication) + Plaintext (open / no authentication) + + + + 主获取数据按钮 + botón principal de obtención de datos + + + + 断开 + + + + + Static WEP (no authentication) + Static WEP (no authentication) + + + + Static WEP (Shared Key authentication) + Static WEP (Shared Key authentication) + + + + IEEE 802.1X + IEEE 802.1X + + + + WPA-Personal (PSK) + WPA-Personal (PSK) + + + + WPA-Enterprise (EAP) + WPA-Enterprise (EAP) + + + + WPA2-Personal (PSK) + WPA2-Personal (PSK) + + + + WPA2-Enterprise (EAP) + WPA2-Enterprise (EAP) + + + + 设备码: + Código del dispositivo: + + + + 服务IP: + IP del servicio: + + + + None + None + + + + WEP + WEP + + + + TKIP + TKIP + + + + CCMP + CCMP + + + + 8754 + 8754 + + + + 服务端口: + Puerto de servicio: + + + + PSK: + PSK: + + + + 连接 + + + + + Password: + Password: + + + + 扫描 + + + + + 清除 + + + + + 获取数据 + recuperar datos + + + + Network: + Network: + + + + 添加网络 + + + + + 测试 + Prueba + + + + 应用配置 + Configuración de la aplicación + + + + 去掉数字码 + eliminar código digital + + + + 去掉QR码 + eliminar código QR + + + + ScanSSID + ScanSSID + + + Connect + Connect + + + + 1 + 1 + + + + 47.111.170.144 + 47.111.170.144 + + + AddNetwork + AddNetwork + + + Remove + Remove + + + + wpa_supplicant service is not running. +Do you want to start it? + wpa_supplicant service is not running. +Do you want to start it? + + + + Disconnected + Disconnected + + + + Inactive + Inactive + + + + Scanning + Scanning + + + + Authenticating + Authenticating + + + + Associating + Associating + + + + Associated + Associated + + + + 4-Way Handshake + 4-Way Handshake + + + + Group Handshake + Group Handshake + + + + Completed + Completed + + + + Unknown + Unknown + + + + Could not get status from wpa_supplicant + Could not get status from wpa_supplicant + + + + Select any network + Select any network + + + + WPS AP in active PBC mode found + WPS AP in active PBC mode found + + + + Press the PBC button on the screen to start registration + Press the PBC button on the screen to start registration + + + + WPS AP with recently selected registrar + WPS AP with recently selected registrar + + + + WPS AP detected + WPS AP detected + + + + PBC mode overlap detected + PBC mode overlap detected + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + + + + Network configuration received + Network configuration received + + + + Registration started + Registration started + + + + Registrar does not yet know PIN + Registrar does not yet know PIN + + + + Registration failed + Registration failed + + + + Registration succeeded + Registration succeeded + + + + WPA Pre-Shared Key Error + WPA Pre-Shared Key Error + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + Network ID Error + Network ID Error + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + + + + Failed to add network to wpa_supplicant +configuration. + Failed to add network to wpa_supplicant +configuration. + + + + Failed to enable network in wpa_supplicant +configuration. + Failed to enable network in wpa_supplicant +configuration. + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + + + + Yes + Yes + + + + No + No + + + + Failed to remove network from wpa_supplicant +configuration. + Failed to remove network from wpa_supplicant +configuration. + + + + 是否去获取数据! + Ya sea para obtener los datos! + + + + 获取数据中... + Obteniendo datos... + + + + + 上报数据中... + Reportando datos... + + + + + + + 提示 + Consejos + + + + + IP设置错误! + ¡Error de configuración de IP! + + + + 应用成功 + éxito de la aplicación + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Posición de fase: + + + + 相位偏移: + Desplazamiento de fase: + + + + 飞行时间: + Tiempo de vuelo: + + + + DetectDelay + DetectDelay + + + + 相检: + Comprobación de fase: + + + 相位偏移: + Compensar: + + + 相检: + Inspección: + + + + FullTimeEn + FullTimeEn + + + + DetectVol + DetectVol + + + + HighLowRatio + HighLowRatio + + + + 充电占空比100% + Ciclo de trabajo del 100% + + + + detect_num + detect_num + + + + + 锁定相位 + cierre + + + + 相位检测电压: + 相位检测电压 + Voltaje de: + + + + 检测点数量: + + + + 检测延时: + Demora: + + + + 检测延迟 : + 检测墨点数量: + cantidad: + + + PhaseVol : + PhaseVol : + + + + 频闪灯周期: + Ciclo de estroboscopio: + + + Num : + Num : + + + DetectDelay : + DetectDelay : + + + + 应用当前配置 + Aplicar la configuración actual + + + + 提示 + Consejos + + + + 应用成功 + Aplicación exitosa + + + + 点 + Puntos + + + + 解锁相位 + Fase desbloqueo + + + + PicEdit + + + Form + Form + + + + 开启软键盘 + Encienda el teclado suave + + + + 插入变量 + Insertar variable + + + + + 保存/打印 + Guardar / Imprimir + + + + 缩小 + Reducir + + + + 放大 + Ampliar + + + + 5点阵 + 5 pixeles + + + + 7点阵 + 7 pixeles + + + + 9点阵 + 9 pixeles + + + + 12点阵宋体 + 12 pixeles + + + + 16点阵宋体 + 16 pixeles + + + + 16点阵黑体 + 16 pixeles Heiti + + + + 24点阵宋体 + 24 pixeles + + + + 24点阵黑体 + 24 pixeles + + + + 列高 + Altura de fija + + + + 无加粗 + Sin negrita + + + + 加粗1倍 + 1 1x negrita + + + + 加粗2倍 + 2 2x negrita + + + + 光栅[X:Y] + Rejilla [X: Y] + + + + 放大比例 + Ampliación + + + + 插入模式 + Modo de inserción + + + + 文件名 + Nombre de archivo + + + + CURR[X,Y] + CURR[X,Y] + + + + 新建信息 + Nueva información creada + + + + 打开文件 + Abrir archivo + + + + 字符间距 + Espaciado de fuente + + + + 插入/修改 + Insertar / Modificar + + + + 删除字符 + Eliminar caracteres + + + + 插入图片 + Insertar imagen + + + + 保存为 + Guardar como + + + + + + 字库编辑 + Edición de la biblioteca de palabras + + + + 网格 + Cuadrícula + + + + 粗体 + Negrita + + + + 显示控制符 + Control de pantalla + + + + 行首 + Primera fila + + + + 行尾 + Fin de fila + + + + 字符光标 + Cursor de caracteres + + + + 像素光标 + Cursor de píxel + + + + 编辑现有的多字体 + Editar fuentes múltiples existentes + + + + 点击光栅可打开键盘,点击空白处关闭 + Toque la rejilla para abrir el teclado, haga clic en el espacio en blanco para cerrar + + + + + + + + + + + 放大倍数:%1 + Ampliación: %1s + + + + + 插入模式 + Modo de inserción + + + + + 修改模式 + Modo Modificar + + + Editar archivos multi-fuente existentes +Utilice el modo de modificación!!! + Advertencia + + + + 编辑现有的多字体文件 +请使用修改模式!!! + 编辑现有的多字体文件 +请使用修改模式!!! + Editar archivos multifuente existentes +Por favor use el modo de modificación!!! + + + + + + 保存 + Guardar + + + + 点击光栅可打开键盘,点击空白处关闭 + Haga clic en la rejilla para abrir el teclado, haga clic en el espacio en blanco para cerrar + + + + 信息编辑 + Edición de información + + + + 字库保存 + Biblioteca de palabras guardada + + + + + 返回信息编辑 + Volver a editar la información + + + + 请选择字体,打开键盘并输入要编辑的字符 + Seleccione una fuente, abra el teclado e introduzca los caracteres que desea editar + + + + + + 提示 + Consejos + + + + 图片已经改变,是否保存? + La imagen ha cambiado, ¿quieres guardarla? + + + + 放弃保存 + Renunciar a guardar + + + + 文件另存为... + Archivo guardado como... + + + + 另存为 + Guardar como + + + + + + + + + 文件名: + Nombre del archivo: + + + + 文件名:) + Nombre de archivo:) + + + + 文件保存为... + Archivo guardado como... + + + + 本条信息的变量超过规定数量! + ¡El número de variables en este mensaje supera el número especificado! + + + + 是否立即喷印当前的文件? + ¿Desea imprimir el archivo actual inmediatamente? + + + + 是 + Sí + + + + 否 + No + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Presione Entrar para agregar una nueva línea. Seleccione la fuente y la rejilla se ajustará automáticamente. + + + + 选择[字体]可改变光标大小. + Seleccione la fuente para cambiar el tamaño del cursor. + + + + 选择[绘图]方式,可以绘制任意图形 + Seleccione el método de dibujo para dibujar cualquier gráfico + + + + 光标不匹配时,不能输入或删除. + No se puede introducir ni eliminar cuando el cursor no coincide. + + + + 点击空白处可关闭键盘. + Haga clic en blanco para apagar el teclado. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + Los usuarios pueden personalizar nuevos caracteres con la función de edición de la biblioteca de Word + + + + 选择[文本模式]可切换到主界面编辑方式. + Seleccione el modo de texto para cambiar al método de edición de la interfaz principal. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Haga clic en la rejilla para abrir el teclado, haga clic en el espacio en blanco para cerrar el teclado + + + + 使用[字库编辑]功能,用户可自己修改字形 + Los usuarios pueden modificar los propios pictogramas utilizando la función Edición de biblioteca de palabras + + + + PicWidget + + + Please input a char. + Please input a char. + + + + 请输入要编辑的字符 + Introduzca los caracteres que desea editar + + + + 编辑字符:%1 + Editar carácter: %1 + + + + [%1行,%2列] + [%1 fila, %2 columna] + + + + 光标[%1,%2] + Cursor .%1,%2 + + + + + + + + + + + + + 警告 + Advertencia + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Ancho máximo de soporte: %1 Altura: %2 Solicitud actual: %3 x %4 + + + + + + 请新创建建图片 + Cree una nueva imagen + + + + + + 文件:%1 无法打开 + %1 no se puede abrir + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + ¡El número de variables en la información supera el máximo (8)! Reduzca el número de variables + + + + + 两个变量之间至少要空出一个墨点! + ¡Al menos un punto de tinta debe ser desocupado entre dos variables! + + + + PrintNet + + + 获取二维码内容: + + + + + 获取数字码: + + + + + PrintSetting + + + Form + Form + + + + 计数器1设置 + Configuración del contador 1 + + + + + + + 起始值: + Valor inicial: + + + + + + + 结束值: + Valor final: + + + + + + 重设值 + Restablecer valor + + + + + + 重复数: + Repeticiones: + + + + + + 清零 + Puesta a Cero + + + + + + + 增量值: + Valor incremental: + + + + + + 当前值: + Valor actual: + + + + 可变长度 + Longitud variable + + + + 计数器2设置 + Configuración del contador 2 + + + + 计数器3设置 + Configuración del contador 3 + + + + 跳米设置 + Ajuste del medidor de salto + + + + 跳米数: + Medidores de salto: + + + + 跳米打印 + Impresión de saltador + + + + + + 输入密码 + 提升权限 + Elevar los Permisos + + + + 墨线时间 + Tiempo de la línea de tinta + + + + 墨线时间: + Tiempo de la línea de tinta: + + + + + + 0 + 0 + + + + 开机次数: + Número de encendidos: + + + + 应用当前配置 + Aplicar la configuración actual + + + + 常用设置 + Configuración común + + + + TextLabel + TextLabel + + + + 打印模式: + Modo de impresión: + + + + 字体宽度: + Ancho de fuente: + + + + 首行电压(%): + Tensión de primera línea (%): + + + + 字体加粗: + Fuente en negrita: + + + + + 快速 + Rápido + + + + + + 标准 + Estándar + + + + + + 慢速1 + Lento 1 + + + + + + 慢速2 + Lento 2 + + + + + 慢速3 + Lento 3 + + + + + 慢速4 + Lento 4 + + + + + 慢速5 + Lento 5 + + + + + 慢速6 + Lento 6 + + + + + 慢速7 + Lento 7 + + + + + 慢速8 + Lento 8 + + + + + 慢速9 + Lento 9 + + + 检测回收槽 + Detección y reciclaje + + + + 每条信息只打印一次 + Cada mensaje se imprime una sola vez + + + + 打印时绿灯常亮 + Luz verde continua al imprimir + + + + 复位发送打印数据 + + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + Nota: El contador 1 no está disponible cuando "Medidor de segmento" está marcado en la página "Otras configuraciones". + + + 生产日期: + Fecha de producción: + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + El contador guarda el valor de apagado + + + + 距离尾部(mm): + Distancia desde la cola (mm): + + + 当计数达到 : + Cuando el conteo llega a: + + + + 特殊条件计数 + recuento de condiciones especiales + + + + 首尾交替 + Alterno de extremo a extremo + + + 显示 + mostrar + + + + 打印电压缩放 + Escala de voltaje de impresión + + + + 整体缩放(%) : + Reduccion integral: + + + + 字高设置(%): + Ajuste de altura de palabra (%): + + + + 行末电压(%): + Tensión de línea final (%): + + + + 修改授权 + Modificar la autorización + + + + 自然数计米 + Medir el número natural + + + + 不打印走米 + No imprime los metros caminados + + + + 相位故障不打印 + El fallo de fase, no se imprime + + + + 信息上下颠倒 + Información al revés de arriba abajo + + + + 字形优化 + Optimización de forma de fuente + + + + 回收故障处理 + Tratamiento de fallo del reciclaje + + + + 高压故障关回收槽 + Fallo de alto voltaje, cierra la caja del reciclaje + + + + 信息左右颠倒 + Información al revés de izquierda a derecha + + + 空列打印 + Impresión de columnas vacías + + + + 省点 + Guardar puntos + + + + 超速暂停打印 + Impresión de pausa rápida + + + + 故障停止走米 + La falla deja de caminar metros + + + + 有效期(天): + Válido (días): + + + + 电眼误触禁止 + Prohibir tocar el ojo eléctrico + + + + date time + date time + + + + yyyy-MM-dd + yyyy-MM-dd + + + + yyyy/MM/dd + yyyy/MM/dd + + + + yyyyMMdd + yyyyMMdd + + + + yyyy年MM月dd日 + yyyy año mm mes dd día + + + + yyyy-MM-dd hh:mm + yyyy-MM-dd hh:mm + + + + yyyy/MM/dd hh:mm + yyyy/MM/dd hh:mm + + + + yyyyMMddhhmm + yyyyMMddhhmm + + + + yyyy年MM月dd日hh:mm + yyyy año mm mes dd día hh:mm + + + + hh:mm + hh:mm + + + + dd MM yy + dd MM yy + + + + 相位故障关机 + Apagado por fallo de fase + + + + + 高级设置 + Configuración avanzada + + + + + 交替扫描隔点(默认为1): + Rupturas de escaneado alternativas (predeterminada 1): + + + + 行末调整点模式: + Modo de punto de ajuste de línea final: + + + + 点距调整值(默认为0): + Ajuste de distancia de punto (predeterminado 0): + + + + + 扫描颠倒 + Escanear al revés + + + + 行末点微调(‰): + Ajuste preciso del punto final de línea (‰): + + + + 点距调整电压位置: + Posición de tensión de ajuste de distancia de punto: + + + + 行末调整点数(默认为0): + Puntos de ajuste de línea final (predeterminado 0): + + + + 去除冗点模式(默认懒惰): + Eliminar el modo redundante (el modo perezoso predeterminado): + + + + 懒惰模式 + Modo perezoso + + + + 贪婪模式 + Modo Codicioso + + + + 均衡模式 + Modo de equilibrio + + + + + 冗点比例(默认为0%): + Relación de redundancia (predeterminado 0%): + + + + + 调整电压 + Ajusta la presión + + + 推荐设置 + Ajustes recomendados + + + + 使用推荐设置 + Utilice los ajustes recomendados + + + + 行业: + Industria: + + + + 快 + Rápido + + + 慢速 + Lento + + + + 电线电缆 + Alambre y Cable + + + + 制药/食品/电子 + Farmacéutica/Alimentación/Electrónica + + + + 建筑管材 + Tubería de construcción + + + + 其他 + Otros + + + + 速度: + Velocidad: + + + + + 锁定脉冲计数 + Contar los pulsos bloqueados + + + + 非字宽 + ancho sin palabra + + + + 使用齿轮泵 + Utilice la bomba de engranajes + + + + 高压阈值: + Valor de válvula de alta tensión: + + + + 导出随机码文本 + Exportar texto de código aleatorio + + + + 不检测喷头盖 + No se detectan tapas de cabezales de impresión + + + + 计数器设置 + Configuraciones de contador + + + + 计数器3 + Contador 3 + + + + 交替打印设置 + Configuración de impresión alternativos + + + + 起始位置: + Posición inicial: + + + + 特殊变量结束值: + Valor final variable especial: + + + + 交替间隔: + Intervalos alternativos: + + + + 重复次数: + Número de repeticiones: + + + + 无交替 + No hay alternativa + + + + 普通交替 + Alteror normal + + + + 电眼触发交替 + Disparador de Ojos Eléctricos Alternativo + + + + 复位到起始值 + Restablecer al valor de inicio + + + + 其它设置 + Otros ajustes + + + + 更换信息文件时执行的动作: + Acciones realizadas al reemplazar archivos de información: + + + + 产品计数器自动清0 + Contador de productos borra automáticamente en 0 + + + + 总产品计数器自动清0 + Contador total del producto borra automáticamente en 0 + + + + 外接显示屏: + Pantalla externa: + + + + 无 + Ninguno + + + + 小屏 + Pantalla pequeña + + + + 大屏 + Pantalla grande + + + + 总产品计数值 + Valor total de recuento de productos + + + + + 计数器1 + Contador 1 + + + + + 计数器2 + Contador 2 + + + + ddhhmm + + + + + 特殊变量起始值: + Valor inicial de la variable especial: + + + + 打印 + Impresión + + + + 显示屏显示: + La pantalla muestra: + + + + 分段计米 + Medidores de metros del segmento + + + + 插 入 + Insertar + + + + 添 加 + Agregar + + + + 全部删除 + Eliminar todo + + + + 删 除 + Eliminar + + + + 米标显示 + Visualización de la marca de metros + + + + 上移 + Subir + + + + 下移 + Bajar + + + 提示:可变长度参数不正确 + Sugerencia: parámetro de longitud variable incorrecto + + + 要求:调整长度小于喷印间隔 + Requisito: ajuste la longitud menos que el intervalo de impresión + + + + + 提示:交替参数不正确 + Consejo: Los parámetros alternativos son incorrectos + + + + 要求:起始位置<交替间隔 + Requisitos: Posición inicial < Intervalos alternativos + + + + 要求:(重复次数+起始位置)<交替间隔 + Requiere :( repeticiones y posiciones de inicio) )< Intervalos alternativos + + + + + + + + 提示 + Consejos + + + + 应用成功 + Aplicación exitosa + + + + + + 错误 + Error + + + + 授权码: + Código de autorización: + + + + 错误 + Error + + + + 喷码机维护设置成功! + ¡Configuración del mantenimiento de la máquina está completa! + + + + 系统维护设置成功! + ¡La configuración de mantenimiento del sistema es exitosa! + + + + 不存在 + no existe + + + + + + 输入密码 + 提升授权 + Autorización elevada + + + + 密码: + + + + + 取消授权 + Cancelar autorización + + + + + + + + + + 警告 + Advertencia + + + + 是否确认使用推荐设置? + ¿Confirma el uso de los ajustes recomendados? + + + + 随机码文件为空,不需要导出 + El archivo de código aleatorio está vacío y no requiere la exportación + + + + 随机码文本将展出到U盘,请插入U盘 + El texto del código aleatorio se mostrará en la memoria USB, inserte la memoria USB + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + El contador 1 (valor final -valor inicial) no se puede dividir por el incremento, el valor final se establecerá en %1 + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + El contador 1 (final - inicial) no se puede dividir por el incremento, el valor final se establecerá en %1 + + + + 1 + 1 + + + + 正在打印第%1组设置,不可删除 + Configuración del conjunto %1 está imprimiendo, no se puede eliminar + + + + 是否确认删除第%1组设置? + ¿Confirmar la eliminación del conjunto %1? + + + + 是否确认删除全部设置? + ¿Confirmar que se han eliminado todos los ajustes? + + + + 字体宽度不能为0 + El ancho de fuente no puede ser 0 + + + + 是否立即重新计米? + ¿Quieres volver a contar los metros ahora? + + + + 解锁脉冲计数 + Desbloquear a contar los pulsos + + + + PulseNumFix + + + Dialog + Dialog + + + + 根据速度 + Según la velocidad + + + + 根据喷印 + Según la impresión + + + + 根据脉冲数 + Según el número de pulsos + + + + 根据同步器参数 + Según los parámetros del sincronizador + + + + 实际皮带速度(毫米/秒): + Velocidad real de la correa (mm/s): + + + + 实际喷印间隔长度(毫米): + Longitud real del intervalo de impresión (mm): + + + + 长度(毫米): + Longitud (mm): + + + + 同步脉冲数 + Número de pulsos de sincronización + + + + 同步器直径(毫米): + Diámetro del sincronizador (mm): + + + + 脉冲数/转: + Pulsos/Vueltas: + + + + 脉冲数修正 + Corrección del número de pulso + + + + + + + 错误 + Error + + + + 速度不应该为0 + La velocidad no debe ser 0 + + + + 实际同步长度不应该为0 + La longitud de sincronización real no debe ser 0 + + + + 长度不应该为0 + La longitud no debe ser 0 + + + + 直径不应该为0 + El diámetro no debe ser 0 + + + + QBarCode + + + Dialog + Dialog + + + + 条形码类型 + Tipo de código de barras + + + + 条形码高度 + Altura del código de barras + + + + 条码宽度 + Ancho del código de barras + + + + 1点 + 1 píxel + + + + 2点 + 2 píxel + + + + 3点 + 3 píxel + + + + 4点 + 4 píxel + + + + + 5点 + 5 píxel + + + + 6点 + 6 píxel + + + + 文本1 + Texto 1 + + + + 显示缩放 + Muestra de reducción + + + + 墨水类型 + Tipo de tinta + + + + 黑墨 + Tinta Negra + + + + 白墨 + Tinta Blanca + + + + 文本3 + Texto 3 + + + + 计数器2 + Contador 2 + + + + 文本2 + Texto 2 + + + + 计数器1 + Contador 1 + + + + 插入文档 + Insertar documentos + + + + 预览 + Vista previa + + + + 返回 + Atrás + + + + 条码保存 + Ahorro de código de barras + + + + FileName + FileName + + + + 增加数字行 + añadir fila de números + + + + 日期 + + + + + 时间 + + + + + 文件未保存 + Archivo no guardado + + + BARCODE_128 + CODE_128 + BARCODE_128 + + + + CODE_128 + BARCODE_93 + BARCODE_93 + + + 自适应编码 + Codificación adaptativa + + + + CODE_93 + + + + + 7点 + 7 píxeles + + + + 9点 + 9 píxeles + + + + 12点 + 12 píxeles + + + + 16点 + 16 píxeles + + + + 24点 + 24 píxeles + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + Ancho de etiqueta: %1, altura de la etiqueta: %2, ancho del texto: %3 + + + + QObject + + + + 手动设定 + Ajuste manual + + + + 应用 + Aplicaciones + + + + 起始值 + Valor inicial + + + + 结束值 + Valor final + + + + 循环值 + Valor de Ciclo + + + + SceneEditOption + + + Form + Form + + + + 预览 + Vista previa + + + + 新建 + Nuevo + + + + 打开 + Abierto + + + + + 保存 + Guardar + + + + 另存为 + Guardar como + + + + 新增图元 + Nuevos elementos agregados + + + + 编辑图元 + Editar elementos + + + + 删除图元 + Eliminar elementos + + + + 放大 + Ampliar + + + + 缩小 + Reducir + + + + 提示 + Consejos + + + + 文档已经改变,是否保存? + El documento ha cambiado, ¿quiere guardarlo? + + + + 放弃保存 + Renunciar a guardar + + + + SystemManage + + + Form + Form + + + + 手动控制泵阀 + Válvula de bomba de control manual + + + 喷嘴逆清洗 + Limpieza inversa de la boquilla + + + + 齿轮泵开 + bombear en + + + + 齿轮泵关 + bombear fuera + + + + 回收槽开 + La caja del reciclaje abierta + + + + + + + + + + + + + 停止 + Parar + + + + 回收槽关 + La caja del reciclaje cerrada + + + + 回收泵 + Bomba de reciclaje + + + + + 压缩机 + Compresor + + + + 主墨泵 + Bomba de tinta principal + + + + 泄压阀 + Válvula de alivio de presión + + + + 循环阀 + Válvula de circulación + + + + 墨水阀 + Válvula de tinta + + + + 粘度泵 + Bomba de viscosidad + + + + 混合阀 + Válvula de mezcla + + + + 时间设置 + Configuración de tiempo + + + + 从U盘导入配置 + Importar la configuración desde la memoria USB + + + + 更新软件 + Actualización de software + + + + 屏幕校正 + Corrección de pantalla + + + + 更新字库 + Actualizar la biblioteca de palabras + + + + 导出字库 + Exportar la biblioteca de palabras + + + + 系统升级 + Actualización del sistema + + + + 出厂设置 + Restablecer la configuración de fábrica + + + + 自动清洗 + Limpieza automática + + + + 电机测试 + Pruebas de motor + + + + 排气 + Escape del aire + + + + 导出配置到U盘 + Exportar la configuración a la memoria USB + + + + + + Cancel + Cancel + + + + (1/2) Cleaning, please wait... + (1/2) Cleaning, please wait... + + + + + + + + + + + + + + + + + + + + 开 + Encender + + + + + + + + + + + + + + + + + + + + + 关 + Apagar + + + + + + + + + + + + + + + + + + 警告 + Advertencia + + + + + + + 请先移开喷头盖! + Retire primero la cubierta de la boquilla! + + + + 是否确认进入手动模式? + ¿Está seguro de entrar en modo manual? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Por favor, primero confirme que la caja de reciclaje ha sido apagada y confirma que está en modo automático? + + + + + 手动 + Manual + + + + + + 自动 + Automático + + + + + + + + + + + 启动 + Iniciar + + + + + + + + + + + + + + + + + 提示 + Consejos + + + + + + + 密码不正确! + ¡La contraseña es incorrecta! + + + + Application + Application + + + + 是否确认更新字库? + ¿Confirma la actualización de la biblioteca de palabras? + + + + 没找到对应字库,更新失败! + No se encontró la biblioteca de fuentes correspondiente y la actualización falló! + + + + 更新字库成功,重启后生效! + ¡La actualización de la biblioteca de palabras se realiza correctamente y entrará en vigor después del reinicio! + + + 是否恢复出厂设置? + ¿Se restablece la configuración de fábrica? + + + + 恢复出厂设置成功,请重新关机上电 + El restablecimiento de la configuración de fábrica es exitoso, por favor apague de nuevo + + + + 校准触摸屏 + Calibración de la pantalla táctil + + + + 是否确认开始校准程序?请小心进行校准! + ¿Confirma que ha iniciado el procedimiento de calibración? ¡Por favor, tenga cuidado con la calibración! + + + + 无法生成脚本 + No se pudo generar el guión + + + + 是否确认更新软件? + ¿Confirma la actualización de software? + + + + + + + + 错误 + Error + + + + 更新失败! + ¡Error al actualizar! + + + + 软件更新成功,重启后生效! + ¡La actualización de software es exitosa y tiene efecto después del reinicio! + + + + 找不到更新软件! + ¡No se han encontrado actualizaciones! + + + + 是否确认更新系统? + ¿Confirma actualizar el sistema? + + + + 系统更新成功,重启后生效! + La actualización del sistema es exitosa y tiene efecto después del reinicio! + + + + 文件不存在! + ¡El archivo no existe! + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + Si comienza a limpiar, asegúrese de que la caja del reciclaje se haya abierta más de 10 mm y dejará de limpiar después de un minuto + + + + 开始清洗 + Iniciar la limpieza + + + + 停止清洗 + Dejar de limpiar + + + + 压力 + Presión + + + + autoclean cancel or status: + autoclean cancel or status: + + + + (2/3) Cleaning + (2/3) Cleaning + + + + (3/3) Cleaning + (3/3) Cleaning + + + + 混合阀打开3: + 混合阀打开3. + + + + + 是否确认导出配置到U盘? + ¿Confirmar a exportar la configuración a la memoria USB? + + + + 检测不到U盘 + Memoria USB indetectable + + + + 成功导出配置到U盘 + Exportar correctamente la configuración a la memoria USB + + + + 是否确认从U盘导入配置? + ¿Está seguro de importar la configuración desde la memoria USB? + + + + 配置文件/udisk/sysPara.bin不存在! + El documento/udisk/sysPara.bin no existe + + + + 从U盘成功导入配置,重启后生效! + Configuración importada con éxito desde la unidad USB, tiene efecto después de reiniciar! + + + + autoclean start + autoclean start + + + + 是否确认启动自动清洗? + ¿Confirma a iniciar la limpieza automática? + + + + 是否确认墨水排除,加入清洗剂? + ¿Se excluye la tinta y se añade el detergente de limpieza? + + + + (1/3) Cleaning + (1/3) Cleaning + + + + 是否确认导出字库到U盘? + ¿Confirmar a exportar la biblioteca de palabras a la memoria USB? + + + + U盘不可识别! + ¡Memoria USB irreconocible! + + + + 字库导出完成! + ¡Exportación de la biblioteca de palabras completada! + + + + 是否开始电机测试? + ¿Confirma a iniciar las pruebas del motor? + + + + 正在排气,是否停止? + Está escapando el aire, ¿quiere pararlo? + + + + SystemSetting + + + Form + Form + + + + 晶振电压(%): + Tensión de cristal (%): + + + + 压力: + Presión: + + + + 高压包容差: + Tolerancia a alta presión: + + + + 粘度: + Viscosidad: + + + + 回收泵力度(%): + Resistencia de la bomba de recuperación (%): + + + + 喷头温度: + Temperatura de la boquilla: + + + + 粘度校正(%): + #Corrección de viscosidad (%): + + + + 晶振频率: + Frecuencia de cristal: + + + + 64K + 64K + + + + 76K + 76K + + + + 96K + 96K + + + + 128K + 128K + + + + 新晶振 + Nuevo Cristal + + + + 频率修正: + Corrección de frecuencia: + + + + Hz + Hz + + + + 回收槽开关时间: + Tiempo de abertura y cierre de la caja del reciclaje: + + + + 电机电流: + Corriente del motor: + + + + 信息编辑模式: + Modo de editar la información: + + + + 文本模式 + Modo de texto + + + + 点阵模式 + Modo de puntos + + + + 场景模式 + Modo Escena + + + + 粘度泵动作间隔(秒): + Intervalo de acción de la bomba de viscosidad (segundos): + + + + 墨水温度: + Temperatura de la tinta: + + + + °C + °C + + + + 0 + 0 + + + + 0.6 + 0.6 + + + + 1.0 + 1.0 + + + + 1.6 + 1.6 + + + + 2.0 + 2.0 + + + 脉冲计数器: + Contador de pulsos: + + + Pulse Counter: + Pulse Counter: + + + + 隔膜位置偏移: + Desplazamiento de la posición del diafragma: + + + + 隔膜位置: + Posición del diafragma: + + + + 风扇开启温度: + + + + + 脉冲计数器: + + + + + 5 + 5 + + + + 10 + 10 + + + + 15 + 15 + + + + 20 + 20 + + + + 25 + 25 + + + + 30 + 30 + + + + 40 + 40 + + + + 45 + 45 + + + + 50 + 50 + + + + 55 + 55 + + + + 60 + 60 + + + PulseCntAtZero: + PulseCntAtZero: + + + + 重置高压 + Restablecer el alto voltaje + + + + 界面语言设置 + Configuración del idioma de la interfaz + + + + 喷嘴逆清洗 + Limpieza inversa de la boquilla + + + + 搜索最佳晶振频率 + Busca la mejor frecuencia de cristal + + + + 搜索最佳晶振电压 + Busca el mejor voltaje de cristal + + + + 应用当前配置 + Aplicar la configuración actual + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + La frecuencia real no puede ser %1 + + + + + 提示 + Consejos + + + + 应用成功 + Aplicar exitosamente + + + + 自动清洗时间约为一分钟,然后自动停止 + El tiempo de limpieza automático es de aproximadamente un minuto, luego se detiene automáticamente + + + + 开始清洗 + Iniciar la limpieza + + + + 停止清洗 + Dejar de limpiar + + + + 正在喷嘴逆清洗...... + Limpieza inversa de la boquilla... + + + + 清洗完成 + Limpieza completa + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + + + + 密码不正确! + ¡La contraseña es incorrecta! + + + + + + Application + Application + + + + 是否更新高压包电流数据? + ¿Se actualizan los datos de corriente del paquete de alto voltaje? + + + + + + 喷头盖未关,请先关喷头盖! + La tapa de la boquilla no está cerrada, por favor apague la cubierta de la boquilla primero! + + + + + 墨线开关未开,请先打开墨线开关! + El interruptor de la línea de tinta no está abierto, por favor abra el interruptor primero! + + + + + 回收槽未全部打开! + ¡La caja de reciclaje no está abierta completa! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + La búsqueda automática tarda mucho tiempo, durante el cual por favor no realice ninguna otra operación, ¿confirma la búsqueda automática de la mejor tensión de cristal? + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + La búsqueda automática tarda mucho tiempo, ¿confirma la búsqueda automática de la frecuencia de cristal óptima en el rango 1K de la frecuencia frontal? + + + + 搜索的起始频率%1 HZ超出范围? + ¿la frecuencia de inicio %1 HZ de la búsqueda está fuera del rango? + + + + 高压设置完成 + Configuración de alto voltaje completa + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Oscilador Freq% 1 --- el reloj de alto nivel más largo% 2 + + + + 最佳晶振频率完成 + Mejor frecuencia de cristal completada + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Oscillator voltage %1 --- el reloj de alto nivel más largo% 2 + + + + + 最佳晶振电压完成 + Mejor voltaje de cristal completado + + + + Tiếng Việt(Vietnamese interface) + Tiếng Việt + + + + Chinese interface(中文界面) + Interfaz en chino + + + + English interface(英文界面) + Interfaz en inglés + + + + TextEditOption + + + Form + Form + + + + 预览 + Vista previa + + + + 新建 + Nuevo + + + + + + 保存 + Guardar + + + + + 另存为 + Guardar como + + + + 文件 + Archivo + + + + 插变量 + Variable Inserto + + + + 间距 + Espaciado + + + + 字体 + Fuente + + + + wenquanyi + wenquanyi + + + + 12 + 12 + + + + 点 + Puntos + + + + 粗体 + Negrita + + + + + + + + + 警告 + Advertencia + + + + + + + 无法打开文件 + El archivo no se puede abrir + + + + + Application + Application + + + + + 是否确认将文件内容追加到打开的文件? + ¿Está seguro de que ha añadido el contenido del archivo a un archivo abierto? + + + + 插入图片 + Insertar una imagen + + + + 插入文本 + Insertar texto + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption El parámetro de construcción textEdit no debe estar vacío + + + + 打开文件 + Abrir archivo + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + Guardar en .txt perderá todos los formatos, ¿quiere guardar en formato .html? + + + + 提醒 + Recordatorio + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Detectado que una imagen %1 viene de una memoria USB, ¿copia la imagen al local? + + + + 无法保存文件 + El archivo no se puede guardar + + + + 保存... + Guardar... + + + + 提示 + Consejos + + + + 文档已经改变,是否保存? + El documento ha cambiado, ¿quiere guardarlo? + + + + 放弃保存 + Renunciar a guardar + + + + 二维码变量设置 + Configuración de la variable de código QR + + + + 完成 + Completado + + + + TimeSettingDialog + + + Dialog + Dialog + + + + 秒: + Segundos: + + + + 分: + Minuto + + + + 月: + Mes + + + + 日: + Día + + + + 时: + Hora + + + + 年: + Año + + + + 设置时间 + Ajuste de la hora + + + + TriggerCtrl + + + Form + Form + + + + 触发模式 + Modo de disparo + + + + 光电电平触发 + Disparador de nivel fotoeléctrico + + + + 光电边沿触发 + Disparador de borde fotoeléctrico + + + + 同步器触发 + Disparador del sincronizador + + + + 延时触发 + Disparador retrasado + + + + + 封锁时间(毫秒) + Tiempo de bloqueo(milisegundos) + + + + 脉冲数/毫米 + Pulsos/mm + + + + 无镜像打印 + Sin impresión de espejos + + + + 自动水平翻转 + Volteo horizontal automático + + + + 自动垂直翻转 + Volteo vertical automático + + + + 中心对称旋转 + Rotación simétrica central + + + + 行末<->行首 + rimera fila <-> fin de fila + + + + 行首<->行首 + Primera fila <-> fin de fila + + + + 镜象交替类型 + Espejo tipo alternativo + + + + 同步器清零 + Puesta en cero del sincronizador + + + + 脉冲数修正 + Corrección del número de pulsos + + + + 脉冲输出使能 + Activación de salida de pulsos + + + + + + + + 重复间隔(毫秒) + Intervalo de repetición (milisegundos) + + + + + + + 延时(毫秒): + Retardo ( milisegundos ): + + + + 字符宽度: + Ancho de carácter: + + + + 同步打印 + Impresión sincrónica + + + + 间隔模式: + Modo de intervalo: + + + + 产生脉冲所需计数: + Contar para generar pulsos: + + + + 镜像交替间隔 + Intervalo alternativo de espejo + + + + 按字符宽度 + Por ancho de carácter + + + + 按喷印比例 + Por relación de impresión + + + + 禁止电眼清零 + Sin puesta a cero del ojo eléctrico + + + + 允许电眼复位 + Se permite el restablecimiento del ojo eléctrico + + + + 允许电眼立即复位 + Permitir el restablecimiento inmediato del ojo eléctrico + + + + 同步喷印模式 + Modo de impresión sincrónica + + + + 重复次数 + Número de repeticiones + + + + + + + 触发延时(毫秒) + Retardo de disparo ( milisegundos ) + + + + 同步器正反转打印 + La impresión del sincronizador en los giros positivo y negativo + + + + 同步器只正转打印 + la impresión del sincronizador solo al giro positivo + + + + 同步器只反转打印 + la impresión del sincronizador solo al giro negativo + + + + 喷印间隔(毫米) + Intervalo de impresión (mm) + + + + 电眼清零 + Puesta en cero el ojo eléctrico + + + + 脉冲信号值: + Valor de la señal de pulso: + + + + 20131228-1 + 20131228-1 + + + + 应用当前配置 + Configuración actual de la aplicación + + + + 独立参数 + Parámetros independientes + + + + + + + 触发延时(毫米) + Retardo del desparo(mm) + + + + + + 重复间隔(毫米) + Intervalo de repetición(mm) + + + + + 封锁间隔(毫米) + Intervalo de bloqueo(mm) + + + + + + + 延时(毫米): + Retardo (mm): + + + + 字符宽度 + Ancho de caracteres + + + + 喷印比例(%) + Relación de pulverización (%) + + + 提示:参数不正确 + Sugerencia: el parámetro es incorrecto + + + 要求:触发长度小于喷印间隔 + Requisito: la longitud del disparador es menor que el intervalo de impresión + + + + 提示 + Consejos + + + + 应用成功 + Aplicación exitosa + + + + 封锁间隔(毫秒) + Intervalo de bloque (ms) + + + + ZkEdit + + + Form + Form + + + + 编辑图案 + Editar Imagen + + + + 缩小 + Reducir + + + + 放大 + Ampliar + + + + 宽度 + Ancho + + + + 新建 + Nuevo + + + + 高度 + Altura + + + + + + 保存 + Guardar + + + + 保存为 + Guardar como + + + + 打开 + Abrir + + + + 导入 + Importar + + + + A + A + + + + 图像扩张 + Expansión de imagen + + + + 图像裁剪 + Imagen recortada + + + + 提示 + Consejos + + + + 图片已经改变,是否保存? + La imagen ha cambiado, ¿quieres guardarla? + + + + 放弃保存 + Renunciar a guardar + + + + + + 放大倍数:%1 + Ampliación : %1 + + + + 图片另存为... + Imagen guardada como ... + + + + 另存为 + Guardar como + + + + 打开文件 + Abrir archivo + + + + 图片保存为... + Imagen guardada como ... + + + + 导入文件 + Importar archivo + + + + dlgDrawInit + + + 图案参数设置 + Configuración de parámetros de Imagen + + + + 图案宽度(像素) + Ancho de Imagen (píxeles) + + + + 图案高度(像素) + Altura de Imagen (píxeles) + + + + 确定 + Confirmar + + + + dlgQrCode + + + Dialog + Dialog + + + + + TextLabel + TextLabel + + + + 计数器(变量) + Contador (variable) + + + + 自动刷新 + Actualización automática + + + + 插入文档 + Insertar documento + + + + 信息前缀 + Prefijo de la información + + + + 变量(初值) + Variable (valor inicial) + + + + 信息后缀 + Sufijo de la información + + + + 返回 + Atrás + + + + DataMatrix + DataMatrix + + + + QRCode + QRCode + + + + 保存 + Guardar + + + + 预览 + Vista previa + + + + 正相打印 + Impresión de fase positiva + + + + 反相打印 + Impresión de fase negativa + + + + 变量增量 + Incremento variable + + + + 条形码 + Código de barras + + + + 默认 + defecto + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + tamaño DM: + + + + 自动插入时间 + + + + + 警告 + Advertencia + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + El contenido de entrada excede el tamaño del código DM seleccionado, ¡seleccione un tamaño más grande! + + + + [%1 X %2] + [%1 X %2] + + + + logo_Form + + + Form + Form + + + + zkWidget + + + + 警告 + Advertencia + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Ancho máximo de soporte: %1 Altura: %2 Solicitud actual: %3 x %4 + + + + 请新创建建图片 + Por favor, cree una nueva imagen + + + diff --git a/systemmanage.ui b/systemmanage.ui new file mode 100644 index 0000000..a38b811 --- /dev/null +++ b/systemmanage.ui @@ -0,0 +1,831 @@ + + + SystemManage + + + + 0 + 0 + 639 + 440 + + + + Qt::StrongFocus + + + Form + + + + + 0 + 0 + 663 + 431 + + + + + 3 + + + + + 6 + + + 3 + + + + + + 0 + 65 + + + + + 130 + 16777215 + + + + Qt::LeftToRight + + + 手动控制泵阀 + + + + :/icon/controlbyhand.png:/icon/controlbyhand.png + + + + + + + + 40 + 0 + + + + + 16777215 + 16777215 + + + + Qt::ClickFocus + + + + + + + + + + + + + 70 + 30 + + + + 100 + + + 300 + + + 20 + + + 100 + + + + + + + + 0 + 40 + + + + + 100 + 16777215 + + + + Qt::NoFocus + + + 齿轮泵开 + + + + + + + + 0 + 40 + + + + 齿轮泵关 + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 回收槽开 + + + + + + + + 45 + 0 + + + + + 16777215 + 16777215 + + + + 停止 + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 回收槽关 + + + + + + + + 45 + 0 + + + + + 16777215 + 16777215 + + + + 停止 + + + + + + + + + 3 + + + 6 + + + 3 + + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 回收泵 + + + + + + + + 55 + 16777215 + + + + + + + + + + + + 55 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 压缩机 + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 主墨泵 + + + + + + + + 0 + 65 + + + + 泄压阀 + + + + + + + + 55 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 循环阀 + + + + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 墨水阀 + + + + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 粘度泵 + + + + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 65 + + + + + 100 + 16777215 + + + + 混合阀 + + + + + + + + + + 30 + 20 + + + + + + + + + + + + 16777215 + 16 + + + + + + + + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + + + + + + + + + + + + 3 + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 时间设置 + + + + :/icon/time.png:/icon/time.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 从U盘导入配置 + + + + :/icon/import.png:/icon/import.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 更新软件 + + + + :/icon/updatesoftware.png:/icon/updatesoftware.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 屏幕校正 + + + + :/icon/screenfix.png:/icon/screenfix.png + + + + + + + + + + 0 + 42 + + + + + 90 + 16777215 + + + + 更新字库 + + + + :/icon/updatefont.png:/icon/updatefont.png + + + + + + + + 0 + 42 + + + + + 90 + 16777215 + + + + 导出字库 + + + + :/icon/udisk.png:/icon/udisk.png + + + + + + + + + true + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 系统升级 + + + + :/icon/factorysetting.png:/icon/factorysetting.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 出厂设置 + + + + :/icon/factorysetting.png:/icon/factorysetting.png + + + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 自动清洗 + + + + image/autoclean.pngimage/autoclean.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 电机测试 + + + + image/autoclean.pngimage/autoclean.png + + + + + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 排气 + + + + image/autoclean.pngimage/autoclean.png + + + + + + + + 0 + 42 + + + + + 16777215 + 16777215 + + + + 导出配置到U盘 + + + + :/icon/export.png:/icon/export.png + + + + + + + + + + + + + + + diff --git a/systemsetting.ui b/systemsetting.ui new file mode 100644 index 0000000..85addd3 --- /dev/null +++ b/systemsetting.ui @@ -0,0 +1,774 @@ + + + SystemSetting + + + + 0 + 0 + 640 + 440 + + + + Qt::StrongFocus + + + Form + + + + + 9 + 9 + 621 + 450 + + + + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + 5000 + + + + + + + 风扇开启温度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + 粘度泵动作间隔(秒): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 隔膜位置: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 500 + + + 3800 + + + + + + + 电机电流: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + °C + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 墨水温度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 粘度校正(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 1 + + + 59 + + + + + + + Hz + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + -30000 + + + 30000 + + + 0 + + + + + + + 脉冲计数器: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 99 + + + 50 + + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 回收槽开关时间: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 0 + + + 70 + + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 5 + + + + + 10 + + + + + 15 + + + + + 20 + + + + + 25 + + + + + 30 + + + + + 40 + + + + + 45 + + + + + 50 + + + + + 55 + + + + + 60 + + + + + + + + + + + + + + + + + + + + + + 晶振频率: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 80 + + + 750 + + + 10 + + + 300 + + + + + + + + + + + + + + 2 + + + 99 + + + 10 + + + + + + + 频率修正: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 晶振电压(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 回收泵力度(%): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 隔膜位置偏移: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + + + + + + + + 文本模式 + + + + + 点阵模式 + + + + + 场景模式 + + + + + + + + 喷头温度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 64K + + + + + 76K + + + + + 96K + + + + + 128K + + + + + 新晶振 + + + + + + + + + 0 + + + + + 0.6 + + + + + 1.0 + + + + + 1.6 + + + + + 2.0 + + + + + + + + 高压包容差: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 5 + + + 300 + + + 5 + + + 50 + + + + + + + + + + + + + + 粘度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + 信息编辑模式: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 30 + + + 59 + + + + + + + 压力: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + true + + + + 0 + 40 + + + + + 260 + 16777215 + + + + Qt::LeftToRight + + + 重置高压 + + + + + + + true + + + + 0 + 40 + + + + + 260 + 16777215 + + + + 界面语言设置 + + + + + + + + 0 + 40 + + + + 喷嘴逆清洗 + + + + + + + + + Qt::Horizontal + + + + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + 0 + 40 + + + + 搜索最佳晶振频率 + + + + :/icon/searchsuitablefrequency.png:/icon/searchsuitablefrequency.png + + + + + + + + 0 + 40 + + + + 搜索最佳晶振电压 + + + + :/icon/searchsuitablevoltage.png:/icon/searchsuitablevoltage.png + + + + + + + + 0 + 40 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + 应用当前配置 + + + + :/icon/apply.png:/icon/apply.png + + + + + + + + + + + ClickLabel + QLabel +
ClickLabel.h
+
+
+ + + + +
diff --git a/textEdit2.html b/textEdit2.html new file mode 100644 index 0000000..916373b --- /dev/null +++ b/textEdit2.html @@ -0,0 +1,5 @@ + + +

f

\ No newline at end of file diff --git a/textEdit3.html b/textEdit3.html new file mode 100644 index 0000000..ad48e49 --- /dev/null +++ b/textEdit3.html @@ -0,0 +1,5 @@ + + +

fdafdsa

\ No newline at end of file diff --git a/textEditnew.html b/textEditnew.html new file mode 100644 index 0000000..0175808 --- /dev/null +++ b/textEditnew.html @@ -0,0 +1,5 @@ + + +

化公为私于机构改革讨价还价液恭恭敬敬用同方

\ No newline at end of file diff --git a/textEditnew3.html b/textEditnew3.html new file mode 100644 index 0000000..40fc439 --- /dev/null +++ b/textEditnew3.html @@ -0,0 +1,5 @@ + + +

yujhfdddeef

\ No newline at end of file diff --git a/texteditoption.ui b/texteditoption.ui new file mode 100644 index 0000000..9309368 --- /dev/null +++ b/texteditoption.ui @@ -0,0 +1,316 @@ + + + TextEditOption + + + + 0 + 0 + 645 + 58 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 1 + + + 5 + + + 1 + + + 1 + + + + + 1 + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 预览 + + + + :/icon/preview.png:/icon/preview.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 新建 + + + + :/icon/filenew.png:/icon/filenew.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 保存 + + + + :/icon/filesave.png:/icon/filesave.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 另存为 + + + + :/icon/filesaveas.png:/icon/filesaveas.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 文件 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + + 0 + 45 + + + + + 65 + 16777215 + + + + 插变量 + + + + :/icon/vari.png:/icon/vari.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 间距 + + + + :/icon/linespace.png:/icon/linespace.png + + + + + + + + 0 + 45 + + + + + 60 + 16777215 + + + + 字体 + + + + :/icon/font.png:/icon/font.png + + + + + + + + + + 80 + 0 + + + + wenquanyi + + + Qt::AlignCenter + + + + + + + + 18 + 0 + + + + + 18 + 16777215 + + + + 12 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 15 + 0 + + + + + 15 + 16777215 + + + + 点 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 16777215 + + + + Qt::LeftToRight + + + 粗体 + + + + :/icon/textbold.png:/icon/textbold.png + + + + + + + + + + + + + + diff --git a/thai.qm b/thai.qm new file mode 100644 index 0000000..c9e290f Binary files /dev/null and b/thai.qm differ diff --git a/thai.ts b/thai.ts new file mode 100644 index 0000000..19a6a04 --- /dev/null +++ b/thai.ts @@ -0,0 +1,8564 @@ + + + +UTF-8 + + DacDisplayAndEdit + + 墨点 + InkDot + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + 默认值 + Default + + + 编辑 + Edit + + + 是 + YES + + + 否 + NO + + + 完成 + OK + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + 提示 + Tips + + + %1 + %1 + + + + DevOp + + + 字高超出范围 + The char height is out of range + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + + + 错误 + ขัดข้อง + + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + + + + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + รหัสผ่าน: + + + + 输入密码 + 提升授权 + ตั้งค่าเลเวล2 + + + 取消授权 + Deauthorize + + + + DialogCycleprint + + + Dialog + + + + + 1循环范围:0- + 1Cycle range:0- + + + + 1循环次数: + 1Number of cycles: + + + + 2循环范围:0- + 2Cycle range:0- + + + + 2循环次数: + 2Number of cycles: + + + + 3循环范围:0- + Cycle range:0- + + + + 3循环次数: + 3Number of cycles: + + + + 6循环次数: + 6Number of cycles: + + + + 6循环范围:0- + Cycle range:0- + + + + 5循环范围:0- + Cycle range:0- + + + + 5循环次数: + 5Number of cycles: + + + + 4循环范围:0- + Cycle range:0- + + + + 4循环次数: + 4Number of cycles: + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + ไฟล์ในเครื่อง + + + + U盘文件 + FlashDiskFiles + โหลดไฟล์จาก USB + + + + 删除文件 + Delete + ลบ + + + + 删除全部 + DeleteAll + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + โหลดไฟล์จาก USB + + + + 导出到U盘 + OutportToFlashDisk + โหลดไฟล์เข้า USB + + + + 插入 + InsertFile + ค้นหาไฟล์ + + + + 打开文件 + OpenFile + เปิดไฟล์ + + + + 上一个 + Previous + ย้อนหลัง + + + + 下一个 + ถัดไป + + + + 退出 + ออก + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + ลบไฟล์ทั้งหมด? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 ดอท + + + + 24点(中/英) + 24 ดอท + + + + 7点(左横) + 7Dot(Left-Horizontal) + + + + 7点(右横) + 7Dot(Right-Horizontal) + + + + 9点(左横) + 9Dot(Left-Horizontal) + + + + 9点(右横) + 9Dot(Right-Horizontal) + + + + 7点(孟加拉) + 7Dot(Bengali) + + + + 32点 + 32 ดอท + + + + 7点(rf7) + 7点(数字) + 7 Dot(rf7) + + + + 21点(rf21) + 21 Dot(rf21) + + + + 12点(新罗马) + + + + + 123456890ABCDEFGWXYZ + + + + + - + + + + + 查字库标识 + check ID + + + + 16点(中/英) + 16 ดอท + + + + 5点(英) + 5 ดอท + + + + 12点(中/英) + 12 ดอท + + + + 7点(英) + 7 ดอท + + + + 选择字体大小 + Choose font size + + + + DialogInputTxt + + + Dialog + + + + + DialogInsertVari + + + Dialog + + + + 二维码: + QRCode + + + + 变量类型 + VariableType + + + + 日 + วัน + + + + 秒 + วินาที + + + + 分 + นาที + + + 变量1 + Counter 1 + + + + 月 + เดือน + + + + 周 + สัปดาห์ + + + + 时 + ชั่วโมง + + + + 年 + ปี + + + 变量2 + Counter 2 + + + + DataMatrix + + + + + QRCode + คิวอาร์โค้ด + + + + BarCode128 + บาร์โค้ด 128 + + + + 计数器1 + เคาน์เตอร์ 1 + + + + 计数器2 + เคาน์เตอร์ 2 + + + + 随机码1 + สุ่ม 1 + + + + 有效日期 + วันหมดอายุอัตโนมัติ + + + + 生产日期 + วันที่อัตโนมัติ + + + + Class + + + + + 计数器3 + เคาน์เตอร์ 3 + + + + 数字个数 + จำนวนหลัก + + + + 9个 + 9 + + + + 11个 + 11 + + + + 10个 + 10 + + + + 3个 + 3 + + + + 6个 + 6 + + + + 12个 + 12 + + + + 13个 + 13 + + + + 14个 + 14 + + + + 15个 + 15 + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + ห่าง 0 + + + + + 1个像素 + ห่าง 1 + + + + + 2个像素 + ห่าง 2 + + + + + 3个像素 + ห่าง 3 + + + + 4个像素 + ห่าง 4 + + + + 5个像素 + ห่าง 5 + + + + 6个像素 + ห่าง 6 + + + + 7个像素 + ห่าง 7 + + + + 行间距: + ระยะห่างบรรทัด: + + + + 字符间距: + ระยะห่างตัวอักษร: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + เริ่มใหม่ + + + + 测试 + ทดสอบ + + + + DialogSaveFile + + + Dialog + File...... + + + + 本地文件 + LocalFiles + ไฟล์ในเครื่อง + + + + U盘文件 + โหลดไฟล์จาก USB + + + + 预览文件内容: + แสดงตัวอย่าง: + + + + 上一个 + ย้อนหลัง + + + + 下一个 + Next + ถัดไป + + + + 请输入文件名: + ชื่อข้อความ: + + + + 取消 + ยกเลิก + + + + + 保存 + บันทึก + + + + 警告 + Warnning + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogShowCounter + + + Dialog + File...... + + + + 米标显示: + Meter scale display: + + + + 目前循环范围: + Current cycle range: + + + + + + 米 + metre + + + + 剩余米数: + Remaining meters: + + + + 循环次数: + Number of cycles: + + + + 立即重新计米 + รีเซ็ตจำนวนนับ + + + + 起始: + เริ่มต้น: + + + + 结束: + สิ้นสุด: + + + + Dialoginputpasswd + + + Dialog + File...... + + + + 修改密码: + เปลี่ยนรหัสผ่าน: + + + + Dialogmodifypasswd + + + Dialog + File...... + + + + 修改密码: + เปลี่ยนรหัสผ่าน: + + + + 密码授权 + รหัสผ่าน + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + 0 + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + เลือกทั้งหมด + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + PrintMax + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + + SuperNodeIP: + SuperNodeIP: + + + + edgeIP: + edgeIP: + + + + + + + + + . + . + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + 警告 + Warnning + + + 无法打开文件 + Cannot open file + + + + 喷码机恢复工作! + InkJet Back to Work! + + + + Mac:%1维护时间剩余 + 维护时间剩余 + Remaining maintenance time + + + + 小时,喷码机将停止工作.请与供应商联系! + Hours, the jet printer will stop working. +Please contact the supplier! + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + The maintenance time has come, the inkjet printer stops working! +Please contact the supplier + + + 喷码机维护时间已到,请148小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! {148小?} + + + 喷码机维护时间已到,请48小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! + + + + + 当前日期: + CurDate: + + + + + 正确? + Correct? + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + DlgMutiLanguage + + + 界面语言设置 + ตั้งค่าภาษา + + + + 中文 + จีน + + + + 泰语 + ไทย + + + + 英语 + อังกฤษ + + + + 土耳其语 + ตุรกี + + + + 西班牙语 + สเปน + + + 汉语(Chinese) + Chinese + + + + (注意: 选择切换显示语言, 重启后才能生效) + (Note: Select toggle display language and restart it to take effect) + + + 警告 + Warnning + + + + DlgMyWarring + + + 警告 + Warnning + + + + 确定 + ยืนยัน + + + + TextLabel + + + + + DlgSelectInputLanguage + + + Dialog + File...... + + + + 汉语(Chinese) + จีน + + + + 英语(English) + อังกฤษ + + + + 越南语(Vietnam) + ตุรกี + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + ยืนยัน + + + + DlgVarLength + + + 变长喷印参数 + Variable length parameter + + + + 头部长度(m) + Head length (m) + + + + 尾部长度(m) + Tail length (m) + + + + + 调整长度(mm) + Adj Length (mm) + + + + 总长(m) + Total Length (m) + + + + 确定 + ยืนยัน + + + + 可变长度允许 + Variable length Enable + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + หน้าหลัก + + + + 图案编辑 + แก้ไขโลโก้ + + + + 打印设置 + ตั้งค่าการพิมพ์ + + + + + 系统设置 + ตั้งค่าระบบการพิมพ์ + + + + + 其他信息 + กราฟ + + + + + 网络管理 + เน็ต เวิร์ค + + + + 电压调整 + VolSet + + + + Save + + + + + 不连续电压 + Discontinuous voltage + + + + + vol0 + + + + + + vol1 + + + + + + vol2 + + + + + + vol3 + + + + + + vol4 + + + + + + vol5 + + + + + + vol6 + + + + + + vol7 + + + + + + vol8 + + + + + + vol9 + + + + + + vol10 + + + + + + vol11 + + + + + + vol12 + + + + + + vol13 + + + + + + vol14 + + + + + + vol15 + + + + + + vol16 + + + + + + vol17 + + + + + + vol18 + + + + + + vol19 + + + + + + vol20 + + + + + + vol21 + + + + + + vol22 + + + + + + vol23 + + + + + + vol24 + + + + + + vol25 + + + + + + vol26 + + + + + + vol27 + + + + + + vol28 + + + + + + vol29 + + + + + + vol30 + + + + + + vol31 + + + + + + vol32 + + + + + + vol33 + + + + + + vol34 + + + + + + vol35 + + + + + + vol36 + + + + + + vol37 + + + + + + vol38 + + + + + + vol39 + + + + + 连续电压 + Continuous voltage + + + + 满列电压 + Full train voltage + + + + fvol0 + + + + + fvol1 + + + + + fvol2 + + + + + fvol3 + + + + + fvol4 + + + + + fvol5 + + + + + fvol6 + + + + + fvol7 + + + + + fvol8 + + + + + fvol9 + + + + + fvol10 + + + + + fvol11 + + + + + fvol12 + + + + + fvol13 + + + + + fvol14 + + + + + fvol15 + + + + + fvol16 + + + + + fvol17 + + + + + fvol18 + + + + + fvol19 + + + + + fvol20 + + + + + fvol21 + + + + + fvol22 + + + + + fvol23 + + + + + fvol24 + + + + + fvol25 + + + + + fvol26 + + + + + fvol27 + + + + + fvol28 + + + + + fvol29 + + + + + fvol30 + + + + + fvol31 + + + + + fvol32 + + + + + fvol33 + + + + + fvol34 + + + + + fvol35 + + + + + fvol36 + + + + + fvol37 + + + + + fvol38 + + + + + fvol39 + + + + + 其他调整 + Other adjustments + + + + 整体缩放(%) : + Overall scaling (%) : + + + + WriteByte + + + + + ReadByte + + + + + + + Address: + + + + + + Value: + + + + + WriteWord + + + + + ReadWord + + + + + ReadDword + + + + + WriteDword + + + + + ValueH: + + + + + ValueL: + + + + + + + 信息编辑 + แก้ไขข้อความ + + + + 触发设置 + ตั้งค่าสัญญาณสั่งพิมพ์ + + + + + 系统管理 + ข้อมูลระบบ + + + + + 日志信息 + LogInfo + + + + 定时开机循环完成,准备关机 + self checking done in alarm resump, ready to poweroff + + + + 准备关机 + ready poweroff + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + ไล่อากาศ 60 s วินาที...... + + + + 开始自检,请等待%1秒............... + ไล่อากาศ %1 s วินาที... + + + + + 自检完成!!! + Self-checking done ! + + + + + 墨水或溶剂空,准备关机 + Ink or mekeup empty, prepare shutdown + + + + 压力波动超过设定的5个值. + The pressure fluctuation exceeds the set 5 values + + + + 停止打印,自动关闭高压. + Stop printing and automatically turn off high voltage + + + + 压力异常:上次压力值%1,当前压力值%2 + Pressure fault:last value is %1, current value is %2 + + + + 高压异常:上次电流值%1,当前电流值%2 + High voltage fault:last current value is %1, current current value is %2 + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + + + + + 混合阀打开2: + The mixing valve opens 2: + + + 混合阀打开1. + The mixing valve opens 1 + + + 混合阀打开2. + The mixing valve opens 2 + + + + 提示 + hint + + + + 是否接收新的信息! + Whether to receive new information! + + + 请立即检查过滤器是否堵塞或者漏气! + Please immediately check whether the filter is blocked or leaking! + + + 请清理过滤器或者检查是否泄露! + Please clean the filter or check for leaks! + + + + + 错误!粘度计下位灯故障. + Error! Viscometer inferior lamp failure. + + + + + 错误!粘度计故障:检测不到上位灯. + Error:Viscometer fault! the upper lamp is not detected. + + + + 粘度检测异常,粘度值太大!!! + The viscosity anomaly detection, viscosity too high!!! + + + + + 错误!!!!!!!!!!!粘度偏大故障 + Error! Viscosity larger fault + + + + 定时开机 + timed start + + + + + 压力泄漏或压力传感器故障! + Pressure leakage or pressure sensor failure! + + + + 运行中压力泄漏,停齿轮泵! + If the pressure leaks during operation, stop the gear pump! + + + + + 测试时间结束,准备关机 + The test time is over, ready to shut down + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + The speed is too high, please stop immediately and contact the supplier! + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + The speed is too high, please clean the filter or check for leaks! + + + + 混合阀打开1: + The mixing valve opens 1: + + + + + 警告!!!!!!!!!!!粘度值偏低 + Warning! Low viscosity + + + 正在开墨线..... + InkLine Openning...... + + + 回收泵全速开 + ReclaimPump ON + + + 粘度泵开 + ViscosityPump ON + + + 循环阀开 + CycleValve ON + + + 墨线阀开 + InkLineValve ON + + + 清洗阀开 + CleanValve ON + + + 清洗阀关 + CleanValve OFF + + + 墨线阀关 + InkLineValve OFF + + + 粘度泵关 + ViscosityPump OFF + + + 供墨阀开 + InkValve ON + + + 正常开墨线状态,请等待%1秒 + InkLine Raedy,Please wait %1 s + + + 循环阀关 + CycleValve OFF + + + 开晶振电压,正在检测相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 正在测试相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 相位检测正常,开启高压 + Phase Ready + + + 相位检测异常 + Phase error + + + 开墨线完成 + InkLine Open Complete + + + 开墨线完成,可以打印! + InkLine Ready,You Can To Print Now + + + 正在关闭墨线 + Closing InkLine..... + + + 回收泵变全压运行 + ReclaimPump ON + + + 清洗阀点动%1次 + CleanValve work %1 times + + + 循环阀开,请等待%1s + CycleValve on,please wait for %1 s + + + 关回收泵 + ReclaimPump OFF + + + %1秒后关回收泵 + Wait %1s and ReclaimPump OFF + + + 可以关机断电 + InkJet can Shoutdown + + + 正在关机..... + Shutdown ...... + + + 正在快速开墨线..... + Is InkLine Openning ...... + + + 打开晶振电压 + OscillatorVoltage ON + + + 5秒后打开晶振电压 + crystals voltage on after 5s + + + 开晶振电压,正在检测相位,请等待%1s + is phase testting, please wait for %1 s + + + 快速开墨线完成 + InkLine Open Finish + + + 快速开墨线完成,可以打印! + InkLine Open Finish + + + 正在快速关闭墨线 + Is InkLine OFF ...... + + + 回收泵关 + ReclaimPump OFF + + + 回收泵变全速运行 + ReclaimPump On + + + 回收泵全速运行 + ReclaimPump ON + + + 回收泵全速运行,请等待%1秒 + Is ReclaimPump On, Wait %1s + + + 快速关闭墨线完成 + Complete the quick closing InkLine + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + Speed is too fast or interval is too short! Unable to print all, stop print now!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + Speed is too fast or interval is too short! Unable to print all char!!! + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + 打开文件出错次数超多3次,自动清除默认喷印文件. + Automatically clear the default file because openFile error. + + + 非法关机次数过多,自动清除默认喷印文件. + Automatically clear the default file because illegal shutdown. + + + 上次出现非法关机. + Illegal shutdown Last time. + + + 自动循环中,请等待%1秒............... + Is AutoCyclling ,Wait %1s...... + + + 自动循环完成!!! + Auto Cycle finish!!! + + + 正在自检,请等待%1秒............... + Is InkJet Testting, Wait %1 s...... + + + 供墨阀关 + InkValve OFF + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + ลบ + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + ขัดข้อง + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + 中文 + Chinese + + + + Tiếng Việt + + + + + Russian + + + + + Japanese + + + + + 全选 + เลือกทั้งหมด + + + + 复制 + สำเนา + + + + 粘贴 + วาง + + + + 剪切 + ตัด + + + + 后退 + กลับ + + + + InsertSpaceNumDialog + + + 插入空格数 + แทรกช่องว่าง + + + + 空格个数: + ตัวเลข: + + + + LogInfo + + + Form + + + + + 当前状态 + สถานะปัจุบัน + + + + 清空当前状态 + ล้างสถานะ + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 导出日志到U盘 + Export logs to USB flash disk + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + + + + 提示 + Tips + + + + 是否确认将所有日志文件导出到U盘? + Are you sure to export all log files to USB flash disk? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + 选择历史记录文件 + Choose record file + + + + 是否确认将历史日志文件全部清除? + Are you sure to clear all history log files? + + + + 是否确认将当前日志全部清除? + Are you sure to clear all current logs? + + + + MainWindow + + + InkJet + + + + + 编辑 + แก้ไข + + + + 条形码 + บาร์โค้ด + + + + 二维码 + คิวอาร์โค้ด + + + + 缩小 + ซูมเข้า + + + + 放大 + ซูมออก + + + + 获取数据 + get the data + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + ความเร็ว + + + + 当前时间 + เวลา + + + + 墨线开关 + สวิตซ์ +หมึก + + + + 喷头盖开 + ฝาหัวพิมพ์ + เปิด + + + + 紧急停机 + ปิดฉุกเฉิน + + + 晶振电压 + CrystalVOL + + + + 粘度 + ความหนืดหมึก + + + + 压力 + แรงดัน + + + + + 隔膜位置 + DiaphragmPOS + + + + + 暂停打印 +停止高压 + Pause to print +Stop high pressure + + + + 喷嘴逆清洗 + ทำความสะอาด +รูฉีดหมึก + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + ระดับหมึก +ต่ำ + + + + 溶剂液位 + เมคอัพ +ต่ำ + + + + 粘度故障 + ความหนืด +ผิดพลาด + + + + 相位故障 + เฟสหมึก +ผิดพลาด + + + + 高压故障 + ไฮโวลท์ +ผิดพลาด + + + + 故障恢复 + รีเซ็ตความ +ผิดพลาด + + + + 立即重新计米 + รีเซ็ตจำนวนนับ + + + + 产品总计数 + Grand Total + + + + 回收故障 + ท่อดูดกลับ +ผิดพลาด + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨水缸满 + ถังหมึก +เต็ม + + + + 产品计数 + การตรวจนับสินค้า + + + + 关机 + ปิดเครื่อง + + + + 2014-08-23 + 1 {2014-08-23?} + + + + 高压包 + ไฮโวลท์ + + + + + + + 开 + เปิดหัว +พิมพ์ + + + + + + + 关 + ปิดหัว +พิมพ์ + + + + 泵启动 + ปั๊มทำงาน + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + เปิดไฟล์ + + + + + + 正在喷印............... + เริ่มพิมพ์... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, Turn OFF collector and inkLine + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + 维护时间已到喷码机停止工作 + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + 开墨线 + OPEN + + + 关墨线 + CLOSE + + + 墨线状态 + INKLINE + + + 喷 嘴 +逆清洗 + nozzles +Clean + + + + + 机箱: + CASE: + + + 正在喷印...... + Printting...... + + + 墨线正常,可以喷印. + InkLine ready to print. + + + 墨线正常. + InkLine Ready. + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + 高压故障,快速关墨线 + high voltage error, closing now. + + + 维护时间已到,喷码机将停止工作! + The maintenance time has come,Inkjet printer stop working! + + + 相位故障,FPGA自动关高压. + phase error,FPGA turnoff the high voltage. + + + + 高压故障,关回收槽 + HighVoltFault,ReclainTank auto Colse + + + + 高压故障,关回收槽和墨线 + HighVoltFault,ReclainTank auto Colse + + + + 回收故障. + Recovery failure. + + + + 回收异常,墨线可能偏离.(%1) + Recovery abnormal, InkLine may deviate (%1) + + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,准备关机 + Phase Fault, ShoutDown Now + + + + 电眼交替 + Alter by electronic Eye + + + %1.%2[%3.%4]米/秒 + %1.%2[%3.%4]m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + เปิดไฟล์: + + + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + File not save,please save it Now! + + + + + + + 变量数大于8个,某些变量将不起作用!!! + The variable number is greater than 8, and some variables will not work!!! + + + + + 请减少信息中的变量(或计数器)数量. + Please reduce the number of variables (or counters) in the printe file. + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + + 错误 + ผิดพลาด + + + + 喷印间隔过短,应高于%1! + Printing interval is too short, +should be higher than %1! + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + 开始打印1 + เริ่มพิมพ์ 1 + + + + 继续打印 +保持高压 + To continue printing + +Keep the high pressure + + + + 正在排气 ............... + Exhausting............... + + + + 泵停止 + ปั๊มหยุดทำงาน + + + + + 最多支持的列数目为:%1请减小信息长度. + The maximum number of columns supported is:%1, please decrease the length of the information. + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + Get DM code content is empty! + + + + + 获取DM码内容: + get DM code data: + + + + + 获取DM码内容跟上次相同 + Get the same DM code content as last time + + + + 高压故障:两高压偏转板间的电压检测异常 + High-voltage fault: two high voltage deflection plate voltage detection abnormal + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + 1. high pressure deflector and high voltage base, wet and dirty, please clean and dry high pressure plate and high voltage base; + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + 2., the machine changes the motherboard or high voltage package, please enter the "system settings", click "reset high", and set the word high to 90, reset the high voltage alarm value should be between 480 and 550; + + + + 3.高压线路漏电,请更换高压线路; + 3. high voltage line leakage, please replace the high voltage line; + + + + 4.高压底座漏电,请更换高压底座。 + 4. high voltage base leakage, please replace the high voltage base. + + + + 墨水过多:墨水溢出 + Excessive ink: ink overflow + + + + 1. 请停止添加墨水; + 1. please stop adding ink; + + + + 2. 请排出多余墨水。 + 2. please discharge excess ink. + + + + 墨水液位:墨水即将耗尽 + Ink level: ink is about to run out + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + 1., the ink is exhausted, 3 hours after the automatic shutdown, please add ink in time. + + + + 回收故障:未检测到有墨水回收 + Recovery failure: no ink recovery was detected + + + + 1. 墨水未射入回收管,请修正墨线方向; + 1. ink not into recycling tube, please correct line direction; + + + + 2. 墨水粘度太低,请更换新墨水; + 2. ink viscosity is too low, please replace the new ink; + + + + 3. 回收管堵塞,请清通或者更换回收管; + 3. recovery of pipe blockage, please clear or replace the recovery tube; + + + + 4. 回收泵故障,请清洗或者更换回收泵; + 4., the recovery pump failure, please clean or replace the recovery pump; + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + 5. after confirming that all the parameters and equipment are not abnormal, please enter the "print settings", cancel the "recovery troubleshooting" check, return to the main window interface, click the "fault recovery" button. + + + + 溶剂液位:溶剂即将耗尽 + Mekeup level: mekeup is about to run out + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + 1. mekeup depletion, 3 hours after the automatic shutdown, please add solvent in time. + + + + + 粘度故障报警 + Viscosity alarm + + + + 粘度故障:墨水粘度无法自动调整 + Viscosity fault: Ink viscosity can not be adjusted automatically + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + 1. the mixing valve fails, please flush or replace the mixing valve; + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + 2. the ink in the ink pot is abnormal. Please replace the ink; + + + + 粘度计异常: + Viscometer anomaly: + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + 1. the filter screen is blocked before the pump. Please replace the strainer before the pump; + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + 2. viscosity pump abnormal, please clean or replace viscosity pump; + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + 3. viscosity sensor abnormal, please check the sensor or replace the it. + + + + 相位故障报警 + Phase alarm + + + + 相位故障:相位信号检测异常 + Phase fault: phase detection exception + + + + 1. 墨水分裂不正常,请调整墨水分裂; + 1. ink dot split abnormal, please adjust the ink split; + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + 2. charging tank or check head dirty, please clean the charging tank and phase head; + + + + 3. 放大板功能性异常,请更换放大板; + 3. the magnifying board is abnormal. Please replace it; + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + 4. phase detection head and its distance is too far away, check the nozzle moving mechanism, adjusting the distance between the head and the ink; + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + 5., the ground has not received or outside interference, please connect the ground wire or isolate the outside interference; + + + + 6. 墨水质量异常,请更换新墨水。 + 6. the ink is of exceptional quality. Please replace the ink. + + + + 回收槽开关检测完成! + Recycling tank switch detection completed! + + + 墨线未开,请先开墨线! + InkLine is Close,Please Open it! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 正在加高压... + High voltage is being up... + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + + + 开始打印 + เริ่มพิมพ์ + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + + 暂停喷印............... + Pause printing... + + + + + 墨水缸满报警 + The ink jar is full of alarm + + + + + 墨水液位报警 + ระดับหมึกต่ำ + + + + + 溶剂液位报警 + ระดับเมคอัพต่ำ + + + + + 高压故障,暂停打印. + High voltage fault, Pause Printing. + + + + 相位故障:飞行时间错误! + Phase fault: wrong flight time! + + + + 相位故障:相位检测错误! + Phase fault: phase detection error! + + + + 齿轮泵转速 + ความเร็มปั๊ม + + + + %1.%2[%3.%4]米/分 + %1.%2[%3.%4]m/min + + + + 停止打印 + หยุดพิมพ์ + + + + + 随机码文本将展出到U盘,请插入U盘 + The RandomCode save U disk. Please insert the U disk + + + + 暂停打印 + Print paused + + + + 继续打印 + พิมพ์ต่อเนื่อง + + + 请切换为自动状态,再继续操作! + Please switch to automatic state, to continue the operation! + + + 打开墨线 + InkLine OPEN + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + หยุด + + + 打开回收槽 + Opening collector + + + + 停止打开 + หยุดเปิด + + + + 正在打开回收槽... + เปิดหัวพิมพ์... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + 关闭墨线 + InkLine Close + + + 关闭回收槽 + Closing collector + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + 墨线未关,是否关闭墨线后关机! + Whether chalk line did not closed, shutdown after the inkline closed! + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + 条形码信息编辑 + แก้ไขบาร์โค้ด + + + + + 二维码信息编辑 + แก้ไขคิวอาร์โค้ด + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + แก้ไข + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + ตกลง + + + + ModbusSerial + + + 接收到开始打印命令 + Start printing command received + + + + 接收到暂停打印命令 + Pause printing command received + + + + 接收到停止打印命令 + Stop printing command received + + + + 接收到DM码数据命令 + DM code data command received + + + + MyFileDialog + + + 确定 + ยืนยัน + + + + NetworkManager + + + Form + + + + + 手动设定 + Manual + + + + + IP: + + + + + Mask: + + + + + GW: + + + + + 取消 + ยกเลิก + + + + 有线LAN + LAN + + + + WiFi: + + + + + SSID: + + + + + Status: + + + + + auth: + + + + + Encryption: + + + + + Plaintext (open / no authentication) + + + + + 主获取数据按钮 + get data button + + + + 断开 + Disconnect + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + 设备码: + Equipment code: + + + + 服务IP: + Service IP: + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + 8754 + 8754 + + + + 服务端口: + Service port: + + + + PSK: + + + + + 连接 + Connect + + + + Password: + + + + + 扫描 + Scan + + + + 清除 + Remove + + + + 获取数据 + get the data + + + + Network: + + + + + 添加网络 + Add network + + + + 测试 + Test + + + + 应用配置 + Application configuration + + + + 去掉数字码 + remove data code + + + + 去掉QR码 + remove QR code + + + + ScanSSID + + + + + 1 + 1 + + + + 47.111.170.144 + 47.111.170.144 + + + 错误 + Error + + + + wpa_supplicant service is not running. +Do you want to start it? + + + + + Disconnected + + + + + Inactive + + + + + Scanning + + + + + Authenticating + + + + + Associating + + + + + Associated + + + + + 4-Way Handshake + + + + + Group Handshake + + + + + Completed + + + + + Unknown + + + + + Could not get status from wpa_supplicant + + + + + Select any network + + + + + WPS AP in active PBC mode found + + + + + Press the PBC button on the screen to start registration + + + + + WPS AP with recently selected registrar + + + + + WPS AP detected + + + + + PBC mode overlap detected + + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + + + + + Network configuration received + + + + + Registration started + + + + + Registrar does not yet know PIN + + + + + Registration failed + + + + + Registration succeeded + + + + + WPA Pre-Shared Key Error + + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + + Network ID Error + + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + + + + + Failed to add network to wpa_supplicant +configuration. + + + + + Failed to enable network in wpa_supplicant +configuration. + + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + + + + + Yes + + + + + No + + + + + Failed to remove network from wpa_supplicant +configuration. + + + + + 是否去获取数据! + to get data ? + + + + 获取数据中... + get data ... + + + + + 上报数据中... + Reported data ... + + + + + + + 提示 + Tips + + + + + IP设置错误! + IP set error! + + + + 应用成功 + ยืนยันสำเร็จ + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + 相检墨点: + Phase Detect Dot: + + + 相检占空比(%) + PhaseDetectDuty + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + DetectDelay + DetectDelay + + + + detect_num + + + + + 相检: + phase: + + + 相位偏移: + Phase offset: + + + 相检: + Phase: + + + + FullTimeEn + + + + + DetectVol + + + + + HighLowRatio + + + + + 充电占空比100% + ChargeDuty {100%} + + + + 相位检测电压: + 相位检测电压 + PhaseVol: + + + 检测延时: + Phase Delay: + + + + 检测点数量: + 检测点数量 + Num: + + + + 检测延迟 : + 检测墨点数量: + Number: + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + ยืนยัน + + + + 频闪灯周期: + StrobePeriod: + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + ยืนยันสำเร็จ + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + ซูมเข้า + + + + 放大 + ซูมออก + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + RowHeight + + + + 无加粗 + Normal + + + + 加粗1倍 + Bold1 + + + + 加粗2倍 + Bold2 + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + ชื่อข้อความ + + + + 字符光标 + Character +Cursor + + + + 像素光标 + Pixel +Cursor + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + บันทึก/เริ่มพิมพ์ + + + + 删除字符 + Delete + ลบ + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + บันทึก + + + + 编辑现有的多字体文件 +请使用修改模式!!! + + + + + 放弃保存 + Quit without save + + + + 文件另存为... + Save As...... + + + + 另存为 + Save As + + + + + + + + + 文件名: + ชื่อข้อความ: + + + + 文件名:) + ชื่อข้อความ:) + + + + 文件保存为... + บันทึก...... + + + + 本条信息的变量超过规定数量! + The variables in this message exceed the specified quantity! + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + เปิดไฟล์ + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + Please input a char. + Please input a char. + + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + 信息中的变量数超过了最大值(8)!,请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + + + 两个变量之间至少要空出一个墨点! + One point between two variables! + + + + PrintNet + + + 获取二维码内容: + + + + + 获取数字码: + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + ความกว้าง: + + + + + 快速 + เร็ว + + + + + + 标准 + ปกติ + + + + + + 慢速1 + ช้า 1 + + + + + + 慢速2 + ช้า 2 + + + + + 慢速3 + ช้า 3 + + + + + 慢速4 + ช้า 4 + + + + + 慢速5 + ช้า 5 + + + + + 慢速6 + ช้า 6 + + + + + 慢速7 + ช้า 7 + + + + + 慢速8 + ช้า 8 + + + + + 慢速9 + ช้า 9 + + + + 打印模式: + โหมดการพิมพ์: + + + + date time + + + + + ddhhmm + + + + + 其它设置 + OtherSetting + + + + 更换信息文件时执行的动作: + Excute when change file: + + + + 产品计数器自动清0 + ProductAutoReset + + + + 总产品计数器自动清0 + TotalProductAutoReset + + + + 高压故障关回收槽 + ReclainTankColse +WhenHighVoltFault + + + + 无交替 + None + + + + 普通交替 + General Alter + + + + 电眼触发交替 + Electronic Trigger + + + 更换信息文件时执行的动作 + Action when File Replace + + + + 导出随机码文本 + ExportRandomCodeFile + + + + 无 + None + + + + 外接显示屏: + Extra Screen: + + + + 复位到起始值 + Reset to the starting value + + + + 小屏 + เล็ก + + + + 大屏 + ใหญ่ + + + + 总产品计数值 + Product Counter + + + + + 计数器1 + เคาน์เตอร์ 1 + + + + + 计数器2 + เคาน์เตอร์ 2 + + + + + + + 起始值: + StartValue: + + + + + + + 结束值: + EndValue: + + + + + + 清零 + ResetCnt + + + + 可变长度 + VariableLength + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 墨线时间 + InkLineTime + + + + 墨线时间: + WorkingTime: + + + + + + 0 + 1 {0?} + + + + 开机次数: + PowerOnTimes: + + + + 应用当前配置 + ยืนยัน + + + + 常用设置 + ตั้งค่าทั่วไป + + + 速度优先 + Speed First + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + 慢速 + Slowly + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + ความสูงตัวอักษร: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + ตัวอักษร +ซ้าย-ขวา + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + ทิศทางตั +วอังษร + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + Not print +continue counter + + + 打印优化 + Print +optimization + + + + 电眼误触禁止 + Prohibition +ElectricEye re-trigger + + + + TextLabel + + + + 0211模式 + 0211 Mode + + + 空列打印 + Blank column +print + + + + 字形优化 + char Optimize + + + + 有效期(天): + วันหมดอายุอัตโนมัติ + + + 2018-05-24 + 24Dot {2018-05-24?} + + + 2018/05/24 + 24Dot {2018/05/24?} + + + + + 高级设置 + AdvancedSetting + + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 修改授权 + Modify authorization + + + + 省点 + save point + + + + dd MM yy + + + + + + 调整电压 + Adjust the voltage + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + เร็ว + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + ความเร็ว: + + + 检测回收槽 + detect Collector + + + + + 锁定脉冲计数 + Lock pulse count + + + + 每条信息只打印一次 + Print once per message + + + + 非字宽 + Not word wide + + + + 使用齿轮泵 + Use gear pumps + + + + 高压阈值: + High voltage threshold: + + + + 不检测喷头盖 + Do not test sprinkler caps + + + 维护时间: + Maintenance time: + + + + 打印时绿灯常亮 + green light is always on +when printing + + + + 复位发送打印数据 + Reset sending print data + + + + 计数器设置 + Counter setting + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + Note: when "section meter" under "other settings" page is checked, counter 1 is not available. + + + + 计数器3设置 + Counter 3 Setup + + + + 计数器3 + เคาน์เตอร์ 3 + + + 生产日期: + วันที่อัตโนมัติ: + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + Counter save shutdown value + + + + 距离尾部(mm): + Distance from tail (mm): + + + 当计数达到 : + Count reached: + + + + 特殊条件计数 + Special condition count + + + + 首尾交替 + Head tail alternation + + + 显示 + display + + + + 米标显示 + M the display + + + + 上移 + ขยับขึ้น + + + + 下移 + ขยับลง + + + + 打印电压缩放 + Print voltage scaling + + + + 整体缩放(%) : + Overall scaling (%) : + + + + 显示屏显示: + Show on Screen: + + + 显示小数点 + Show Decimal separator + + + 循环产品计数 + Cycle Product Count + + + + 特殊变量结束值: + Special variable end value: + + + + 特殊变量起始值: + Special variable starting value: + + + + 打印 + เริ่มพิมพ์ + + + + 分段计米 + CNT1 by Group + + + + 插 入 + ค้นหา + + + + 添 加 + เพิ่มข้อมูล + + + + 全部删除 + DeleteAll + ลบทั้งหมด + + + + 删 除 + Delete + ลบ + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + + 重设值 + ResetCurrentCounter + + + + + + 重复数: + RepeatTimes: + + + + + + 当前值: + Current: + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + + + 输入密码 + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + + + 提示 + Tips + + + + 应用成功 + ยืนยันสำเร็จ + + + %4d天 %02d:%02d:%02d + %4d Day %02d:%02d:%02d + + + + + + + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + + + 错误 + ขัดข้อง + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + 提示:可变长度参数不正确 + Hint: Incorrect variable length parameter + + + 要求:调整长度小于喷印间隔 + Requirement: Adjust the length less than the printing interval + + + 小时 + ชั่วโมง + + + + 错误 + ขัดข้อง + + + + + + 输入密码 + 提升授权 + ตั้งค่าเลเวล2 + + + + 密码: + + + + + 取消授权 + ออกจากตั้งค่าเลเวล2 + + + + 随机码文件为空,不需要导出 + No randomCode file to export + + + + 随机码文本将展出到U盘,请插入U盘 + The RandomCode save U disk. Please insert the U disk + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + CNT1 distance can not divisible by Increment. the end value will set to %1 + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + CNT1 distance can not divisible by Increment. the end value will set to %1 + + + + 1 + 1 + + + + 正在打印第%1组设置,不可删除 + %1 is printing,can not delete + + + + 是否确认删除第%1组设置? + delete %1? + + + + 是否确认删除全部设置? + delete all? + + + + 字体宽度不能为0 + Font width cannot be 0 + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 解锁脉冲计数 + Unlock pulse count + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QBarCode + + + Dialog + + + + + 条形码类型 + BarType + + + 文本信息 + Input: + + + + 显示缩放 + Scale + + + + 条形码高度 + BarHeight + + + + 1点 + 1Dot + + + + 2点 + 2Dot + + + + 3点 + 3Dot + + + + 4点 + 4Dot + + + + + 5点 + 5Dot + + + + 6点 + 6Dot + + + + 文本1 + TEXT1 + + + + 文本3 + TEXT3 + + + + 计数器2 + เคาน์เตอร์ 2 + + + + 文本2 + TEXT2 + + + + 计数器1 + เคาน์เตอร์ 1 + + + + 插入文档 + InsertToDoc + + + + 条码保存 + บันทึก + + + + 增加数字行 + add number row + + + + 日期 + Date + + + + 时间 + เวลา + + + 增加数字行 + Add number line + + + + 条码宽度 + BarWidth + + + 字体 + Font + + + 文本宽度调整 + TextWidth + + + 居中对齐 + CenterAlign + + + 左对齐 + LeftAlign + + + 右对齐 + RightAlign + + + 文本对齐 + TextAlign + + + 文本加粗 + TextBold + + + 插入到文档 + InsertToDoc + + + + FileName + ชื่อข้อความ + + + + 预览 + แสดงตัวอย่าง + + + 条形码保存 + Save + + + + 墨水类型 + InkType + + + + 黑墨 + BlackInk + + + + 白墨 + WhiteInk + + + 条形保存 + Save + + + + 返回 + ย้อนกลับ + + + + 文件未保存 + File Not Saved + + + 5点阵 + 5 Matrix + + + 7点阵 + 7 Matrix + + + 9点阵 + 9 Matrix + + + 12点阵 + 12 Matrix + + + 16点阵 + 16 Matrix + + + + CODE_128 + BARCODE_128 + + + + 自适应编码 + AUTO + + + + CODE_93 + + + + + 7点 + 7ดอท + + + + 9点 + 9ดอท + + + + 12点 + 12ดอท + + + + 16点 + 16ดอท + + + + 24点 + 24ดอท + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + TabWidth: %1,Height: %2,TextWidth: %3 + + + + QObject + + + + 手动设定 + Manual Mode + + + + 应用 + Apply + + + + 起始值 + StartValue + + + + 结束值 + EndValue + + + + 循环值 + RepeatValue + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SceneEditOption + + + Form + Form + + + + 预览 + แสดงตัวอย่าง + + + + 新建 + เริ่มใหม่ + + + + 打开 + เปิดไฟล์ + + + + + 保存 + บันทึก + + + + 另存为 + SaveAs + + + + 新增图元 + เริ่มไอเทมใหม่ + + + + 编辑图元 + แก้ไขไอเทม + + + + 删除图元 + DelItem + ลบไอเทม + + + + 放大 + ซูมออก + + + + 缩小 + ซูมเข้า + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + without save it + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + ควบคุมด้วยมือ + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + เปิดหัวพิมพ์ + + + + + + + + + + + + + 停止 + หยุดพิมพ์ + + + + 回收槽关 + ปิดหัวพิมพ์ + + + 回路阀 + FeedBack +Valve + + + + 回收泵 + ปั๊มดูดกลับ + + + + + 压缩机 + Compressor + + + + 主墨泵 + ปั๊มหลักหมึก + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + วาล์วดูดกลับ + + + + 墨水阀 + วาล์วหมึก + + + + 粘度泵 + ปั๊มวัดหมึก + + + + 混合阀 + วาล์วผสม + + + + 时间设置 + ตั้งค่าเวลา + + + + 系统升级 + System upgrade + + + + 排气 + ไล่อากาศ + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + โหลดไฟล์เข้า USB + + + + 自动清洗 + AutoClean + + + 齿轮泵 + The gear pump + + + + 电机测试 + Motor Test + + + + 更新字库 + UpdateFontLibrary + + + + 齿轮泵开 + เปิดปั๊ม + + + + 齿轮泵关 + ปิดปั๊ม + + + + 导出字库 + Export Character Library + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + โหลดไฟล์จาก USB + + + + 屏幕校正 + แก้ไขหน้าจอทัสกรีน + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + Cancel + ยกเลิก + + + + (1/2) Cleaning, please wait... + (1/2) Cleaning, please wait... + + + + + + + + + + + + + + + + + + + + 开 + เปิด + + + + + + + + + + + + + + + + + + + + + 关 + ปิด + + + + + + + + + + + + + + + + + + 警告 + Warnning + + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + + 手动 + ความคุมด้วยมือ + + + + + + 自动 + อัตโนมัติ + + + + + + + + + + + 启动 + เริ่ม + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + แก้ไขทัชสกรีน + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + + + + 密码不正确! + Incorrect Password! + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + + + 错误 + ขัดข้อง + + + + 没找到对应字库,更新失败! + No corresponding word library found, update failed! + + + + 更新失败! + Update failed! + + + + 找不到更新软件! + Unable to find update software! + + + + 是否确认更新系统? + Are you sure to update the system? + + + + 系统更新成功,重启后生效! + The system has been updated successfully and will take effect after reboot! + + + + 文件不存在! + File does not exist! + + + + 压力 + แรงดัน + + + + autoclean cancel or status: + autoclean cancel or status: + + + + (2/3) Cleaning + (2/3) ทำความสะอาด + + + + (3/3) Cleaning + (3/3) ทำความสะอาด" + + + + 混合阀打开3: + 混合阀打开3. + The mixing valve opens 3: + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + autoclean start + autoclean start + + + + 是否确认启动自动清洗? + Start up auto clean: + + + + 是否确认墨水排除,加入清洗剂? + Ink empty and cleaning agent in? + + + + (1/3) Cleaning + (1/3) Cleaning + + + + 是否确认导出字库到U盘? + Export Character Library to usb disk? + + + + U盘不可识别! + usb disk not recognized! + + + + 字库导出完成! + Character library export done! + + + + 是否开始电机测试? + Startup motor test? + + + + 正在排气,是否停止? + Venting, do you want to stop? + + + 更新文件不存在! + Update file was not found! + + + 是否确认备份系统文件? + Confirm to backup system file? + + + 系统备份成功! + System backup suceess ! + + + 备份操作失败! + Backup operation failed! + + + + + + + + + + + + + + + + + 提示 + Tips + + + 开墨线 + Open InkLine + + + 关墨线 + Close InkLine + + + 清洗阀 + Clean Valve + + + 墨线阀 + InkLine Valve + + + 供墨阀 + InkValve + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + If you start cleaning, be sure the recycling tank has opened more than 10 mm, and stop to clean after 1 minute + + + + 开始清洗 + เริ่มทำความสะอาด + + + + 停止清洗 + หยุดทำความสะอาด + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + แรงดัน: + + + + 粘度: + ความหนืดหมึก: + + + + 高压包容差: + HighVoltTolerance: + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + อุณหภูมิหัวพิมพ์: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 粘度校正(%): + ViscosityAdjust: + + + + 新晶振 + NewCrystal + + + + 场景模式 + SceneMode + + + + 墨水温度: + อุณหภูมิหมึก: + + + + °C + °C + + + + 0 + 0 + + + + 0.6 + 0.6 + + + + 1.0 + 1.0 + + + + 1.6 + 1.6 + + + + 2.0 + 2.0 + + + Pulse Counter: + Pulse Counter: + + + 脉冲计数器: + Pulse Counter: + + + + 隔膜位置偏移: + DiaphragmOffset: + + + + 5 + 5 + + + + 10 + 10 + + + + 15 + 15 + + + + 20 + 20 + + + + 25 + 25 + + + + 30 + 30 + + + + 40 + 40 + + + + 45 + 45 + + + + 50 + 50 + + + + 55 + 55 + + + + 60 + 60 + + + 喷嘴直径: + Nozzle Diameter: + + + + 风扇开启温度: + Fan on temperature: + + + + 重置高压 + Reset High Voltage + + + + 界面语言设置 + ตั้งค่าภาษา + + + + 应用当前配置 + ยืนยัน + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + ปรับค่าการพิมพ์(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 脉冲计数器: + Pulse counter: + + + + 隔膜位置: + DiaphragmPosition: + + + 混合阀管路: + MixingValvePiping: + + + 旧管路 + OldPiping + + + 新管路 + NewPiping + + + + 信息编辑模式: + โหมดการพิมพ์: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + 小喷嘴片 + Small Nozzle + + + 大喷嘴片 + Big Nozzle + + + + 喷嘴逆清洗 + ทำความสะอาด +รูฉีดหมึก + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + ขัดข้อง + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + 提示 + Tips + + + + 应用成功 + ยืนยันสำเร็จ + + + + 自动清洗时间约为一分钟,然后自动停止 + Auto Cleanning,wait 1 minute + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + 正在进入手动模式...... + Enter Manual Mode..... + + + + 正在喷嘴逆清洗...... + Is Nozzles Cleanning..... + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + Automatic search takes a long time. Are you sure to automatically search for the best crystal oscillator frequency within the current frequency range of 2K? + + + + Tiếng Việt(Vietnamese interface) + + + + + Chinese interface(中文界面) + + + + + English interface(英文界面) + + + + 喷嘴逆清洗完成 + Nozzles Cleanning Finish. + + + 正在开回收槽...... + ReclaimTank Openning...... + + + 正在关回收槽...... + ReclaimTank Closing...... + + + + 清洗完成 + The cleaning is done + + + 密码不正确! + Incorrect Password! + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + 重置高压前,请先关墨线! + Please Turnoff InkLine before Reset High voltage! + + + 重置高压前,请先关闭回收槽! + Please Turnoff ReclaimTank before Reset High voltage! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + 墨线未打开! + InkLine Not Opened! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + 高压设置异常 + High Voltage Set False + + + 高压设置异常,本次重置操作无效! + High Voltage Set False! + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + 警告 + Warnning + + + 确定要切换中英文界面? + You want to switch Language? + + + 重启后切换到英文界面 + Switch to English GUI After the restart + + + 重启后切换到中文界面 + Switch to Chinese GUI After the restart + + + + TextEditOption + + + Form + Form + + + + 新建 + เริ่มใหม่ + + + + + 另存为 + SaveAs + + + + 预览 + แสดงตัวอย่าง + + + + + + 保存 + บันทึก + + + + 文件 + แฟ้ม + + + + 插变量 + วันที่อัตโนมัติ + + + + 间距 + ระยะห่าง + + + + 字体 + ฟอนต์ + + + + wenquanyi + + + + + 12 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + + 警告 + Warnning + + + + + + + 无法打开文件 + Cannot open file + + + + + Application + Application + + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + ขัดข้อง + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + เปิดไฟล์ + + + + 二维码变量设置 + QR Variable Edit + + + + 完成 + ตกลง + + + 另存为123 + SaveAs + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 保存... + บันทึก..... + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + วินาที: + + + + 分: + นาที: + + + + 月: + เดือน: + + + + 日: + วัน: + + + + 时: + ชั่วโมง: + + + + 年: + ปี: + + + + 设置时间 + ตั้งค่าเวลา + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + พิมพ์ต่อเนื่อง + + + + 光电边沿触发 + เซ็นเซอร์ + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + เอ็นโค้ดเดอร์ + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + + 触发延时(毫秒) + ตำแหน่งการพิมพ์(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + + + + 延时(毫秒): + ดีเลย์(ms): + + + + 允许电眼复位 + Allows ELE-EYE Reset + + + + 允许电眼立即复位 + Allows ELE-EYE Reset now + + + + 电眼清零 + PhotodEyeResetCounter + + + + 镜像交替间隔 + MirrorAlternately + + + + 镜象交替类型 + MirrorMode + + + + 无镜像打印 + NoMirror + + + + 自动水平翻转 + AutoRollover + + + + 自动垂直翻转 + AutoVerticalFlip + + + + 中心对称旋转 + CenterRotation + + + + 同步器正反转打印 + EncoderAlwasyValid + + + + 同步器只正转打印 + EncoderValidOnlyForward + + + + 同步器只反转打印 + EncoderValidOnlyReverse + + + 对应编码器脉冲数 + Encoder/pulse + + + + 脉冲信号值: + Pulse signal value: + + + + + 封锁时间(毫秒) + LockTime(ms) + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 禁止电眼清零 + ForbiddenMagicEyeReset + + + 允许电眼清零 + AllowMagicEyeReset + + + 允许电眼立即清零 + AllowMagicEyeResetNow + + + 镜像交替间隔数 + Mirror interval + + + + 20131228-1 + + + + + 应用当前配置 + ยืนยัน + + + + 独立参数 + Independent parameter + + + + + + + 触发延时(毫米) + ตำแหน่งการพิมพ์(ms) + + + + + + 重复间隔(毫米) + Repeat Gap (mm) + + + + + 封锁间隔(毫米) + Lock Gap(mm) + + + + + + + 延时(毫米): + ดีเลย์(mm): + + + + 字符宽度 + ระยะห่างตัวอักษร + + + + 喷印比例(%) + PrintingScale(%) + + + 提示:参数不正确 + Hint: The parameter is incorrect + + + 要求:触发长度小于喷印间隔 + Requirement: The trigger length is less than the printing interval + + + + 提示 + Tips + + + + 应用成功 + ยืนยันสำเร็จ + + + + 封锁间隔(毫秒) + Lock Gap(ms) + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + แก้ไขโลโก้ + + + + 缩小 + ซูมเข้า + + + + 放大 + ซูมออก + + + + 宽度 + ความกว้าง + + + + 新建 + เริ่มใหม่ + + + + 高度 + ความสูง + + + + + + 保存 + บันทึก + + + + 保存为 + SaveAs + + + + 打开 + เปิดไฟล์ + + + + 导入 + โหลด + + + + A + A + + + + 图像扩张 + Image expansion + + + + 图像裁剪 + Image clipping + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 图片另存为... + SaveAs + + + + 另存为 + Save as + + + + 打开文件 + เปิดไฟล์ + + + + 图片保存为... + Save to...... + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + ยืนยัน + + + + dlgQrCode + + + Dialog + + + + + 信息前缀 + Text + + + + 变量(初值) + Curent-Couter + + + + 信息后缀 + Suffix-Text + + + + 条形码 + บาร์โค้ด + + + + 默认 + default + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + DM code size: + + + + 自动插入时间 + Automatic insertion time + + + + 变量增量 + Increment + + + 增量 + Increment + + + + 返回 + 返回 + + + + + TextLabel + + + + 信息 + Text: + + + + 正相打印 + NormalPrint + + + + 反相打印 + RP-Print + + + + DataMatrix + + + + + QRCode + + + + + 插入文档 + InsertToDoc + + + + 计数器(变量) + เคาน์เตอร์(จำนวนนับ) + + + + 保存 + บันทึก + + + + 预览 + แสดงตัวอย่าง + + + 插入到文档 + InsertToDoc + + + + 自动刷新 + AutoShow + + + 黑墨 + BlackInk + + + 白墨 + WhiteInk + + + + 警告 + Warnning + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + Input exceeds the size of the selected DM code, please select a larger size! + + + + [%1 X %2] + + + + + logo_Form + + + Form + + + + + zkWidget + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + 请新创建建图片 + Please set up a new pattern file + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/timesettingdialog.ui b/timesettingdialog.ui new file mode 100644 index 0000000..1ed6c8f --- /dev/null +++ b/timesettingdialog.ui @@ -0,0 +1,242 @@ + + + TimeSettingDialog + + + + 0 + 0 + 449 + 149 + + + + Qt::StrongFocus + + + Dialog + + + + + 230 + 110 + 201 + 41 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 431 + 91 + + + + + + + 0 + + + 59 + + + + + + + + 40 + 16777215 + + + + 秒: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 40 + 16777215 + + + + 分: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0 + + + 59 + + + + + + + 1970 + + + 4000 + + + + + + + + 40 + 16777215 + + + + 月: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 40 + 16777215 + + + + 日: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 40 + 16777215 + + + + 时: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0 + + + 23 + + + 0 + + + + + + + 1 + + + 31 + + + + + + + + 40 + 16777215 + + + + 年: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 1 + + + 12 + + + + + + + + + + buttonBox + accepted() + TimeSettingDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + TimeSettingDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/triggerctrl.ui b/triggerctrl.ui new file mode 100644 index 0000000..7d3b1ad --- /dev/null +++ b/triggerctrl.ui @@ -0,0 +1,965 @@ + + + TriggerCtrl + + + + 0 + 0 + 644 + 460 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + Form + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 60 + + + + 触发模式 + + + + + + 10 + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 28 + + + + Qt::RightToLeft + + + 光电电平触发 + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 28 + + + + Qt::RightToLeft + + + 光电边沿触发 + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 28 + + + + Qt::RightToLeft + + + 同步器触发 + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 28 + + + + Qt::RightToLeft + + + 延时触发 + + + + + + + + + + + + + + + + + + + 6 + + + + + 封锁时间(毫秒) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 6 + + + 9999999 + + + 10 + + + + + + + 脉冲数/毫米 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 无镜像打印 + + + + + 自动水平翻转 + + + + + 自动垂直翻转 + + + + + 中心对称旋转 + + + + + + + + 1 + + + 65535 + + + 1 + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + Qt::ImhNone + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + + 行末<->行首 + + + + + 行首<->行首 + + + + + + + + 镜象交替类型 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 0 + + + 99 + + + 8 + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 同步器清零 + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 脉冲数修正 + + + + :/icon/pulse.png:/icon/pulse.png + + + + + + + 1 + + + 200 + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 1 + + + 65535 + + + 1 + + + + + + + + 0 + 0 + + + + + + + true + + + + + + + 脉冲输出使能 + + + + + + + Qt::LeftToRight + + + 重复间隔(毫秒) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 延时(毫秒): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 字符宽度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 同步打印 + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::LeftToRight + + + 间隔模式: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 0 + + + 65535 + + + 1 + + + 10 + + + + + + + 产生脉冲所需计数: + + + + + + + + 0 + 0 + + + + 重复间隔(毫秒) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 镜像交替间隔 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 0 + + + + 按字符宽度 + + + + + 按喷印比例 + + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 1 + + + 253 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + 禁止电眼清零 + + + + + 允许电眼复位 + + + + + 允许电眼立即复位 + + + + + + + + 同步喷印模式 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 65535 + + + + + + + 重复次数 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 1 + + + 100000 + + + 1 + + + 1 + + + + + + + Qt::Horizontal + + + + + + + 触发延时(毫秒) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 30 + + + + 1 + + + 65535 + + + 6 + + + + + + + + 同步器正反转打印 + + + + + 同步器只正转打印 + + + + + 同步器只反转打印 + + + + + + + + Qt::LeftToRight + + + 喷印间隔(毫米) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 电眼清零 + + + + + + + 脉冲信号值: + + + + + + + + + + 100 + + + + + + + + + Qt::Horizontal + + + + + + + + + 20131228-1 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 20 + + + + + + + + + + + + + + + + 0 + 40 + + + + + 250 + 16777215 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + + 255 + 170 + 127 + + + + + + + + Qt::LeftToRight + + + 应用当前配置 + + + + :/icon/apply.png:/icon/apply.png + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + diff --git a/turkey.qm b/turkey.qm new file mode 100644 index 0000000..49a0377 Binary files /dev/null and b/turkey.qm differ diff --git a/turkey.ts b/turkey.ts new file mode 100644 index 0000000..ac59ca2 --- /dev/null +++ b/turkey.ts @@ -0,0 +1,7680 @@ + + + +UTF-8 + + DevOp + + + + + + + + 警告 + Uyari + + + + 字高超出范围 + Kelime yuksekligi aralik disinda + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + kelimesi cok kucuk veya yuksek baslatilmamis veri bobin atesleme, tum yuksek gerilim akim hata hatayi goz ardi edecektir + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Baski araligi cok kisa. Font genisligi otomatik olarak ayarlanacak! + + + + + 错误 + Hata + + + + 在同步计米的情况下无打印串或显示区域为零 + Senkronizerden gelen degerlere gore baski yapilamiyor + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Ayarlarinizi gozden geciriniz, senkronizerden cok fazla sinyal geliyor + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Karakter dizilimi cok kisa, lutfen karakter arasi bosluk ekleyiniz ya da baski uzunlugunu kisaltiniz + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Baski uzunlugu cok kisa, lutfen karakter boslugunu azaltin ya da baski uzunlugunu artiriniz + + + Encoder pulse counter per MM parameter error! + MM parametre hatası basina kodlayicc darbe sayaci! + + + + DialogAuthorization + + + Dialog + diyalog + + + + 授权密码: + Sifre: + + + + 输入密码 + 提升授权 + Yetkili Ayarlari + + + + DialogCycleprint + + + Dialog + + + + + 1循环范围:0- + 1 dongu araligi: 0- + + + + 1循环次数: + 1 cevrim sureleri: + + + + 2循环范围:0- + 2 dongu araligi: 0- + + + + 2循环次数: + 2 cevrim sureleri: + + + + 3循环范围:0- + 3 dongu araligi: 0- + + + + 3循环次数: + 3 cevrim sureleri: + + + + 6循环次数: + 6 cevrim sureleri: + + + + 6循环范围:0- + 6 dongu araligi: 0- + + + + 5循环范围:0- + 5 dongu araligi: 0- + + + + 5循环次数: + 5 cevrim sureleri: + + + + 4循环范围:0- + 4 dongu araligi: 0- + + + + 4循环次数: + 4 cevrim sureleri: + + + + DialogFileOperation + + + Dialog + Diyalog + + + + 本地文件 + Yerel Dosyalar + + + + U盘文件 + U disk dosyasi + + + + 删除文件 + Sil + + + + 删除全部 + Hepsini Sil + + + + 从U盘导入 + Tasinabilir Bellekten Aktar + + + + 导出到U盘 + Tasinabilir Bellege Aktar + + + + 插入 + Dosya Ekle + + + + 打开文件 + Dosya Ac + + + + 上一个 + Onceki + + + + 下一个 + Sonraki + + + + 退出 + Cikis + + + + 文件操作 + Dosya Islemleri + + + + + + 警告 + Uyari + + + + 是否确认删除当前文件? + Mevcut Dosyayi Sil? + + + + 是否确认删除所有文件? + Tum Dosyalari Sil? + + + + + + + 提示 + Oneriler + + + + 是否确认从U盘导入所有文件? + Tasinabilir Bellekteki Tum Dosyalari Aktar? + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Tasinabilir bellege Aktarim Basarili? + + + + 是否确认将所有文件导出到U盘? + Tum dosyalari Tasinabilir Bellege aktar? + + + + 成功导出到U盘? + Tasinabilir Bellege Aktarim Basarili? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + Tasinabilir bellek bulunamadi, ya da "doc" formatinda uzanti mevcut degil! + + + + DialogFontSize + + + Dialog + Diyalog + + + + 12点(中/英) + 12 Matris + + + + 16点(中/英) + 16 Matris + + + + 5点(英) + 5 Matris + + + + 7点(英) + 7 Matris + + + + 9点(英) + 9 Matris + + + + 24点(中/英) + 24 Matris + + + + 7点(左横) + 7 Matris(Sol-Yatay) + + + + 7点(右横) + 7 Matris(Sag-Yatay) + + + + 9点(左横) + 9 Matris(Sol-Yatay) + + + + 9点(右横) + 9 Matris(Sag-Yatay) + + + + 7点(孟加拉) + 7 Matris (Banglades) + + + + 32点 + 32 Matris + + + + 7点(rf7) + 7点(数字) + 7 Matris (sayi) + + + + 21点(rf21) + 21 Matris (sayi) + + + + 12点(新罗马) + + + + + 123456890ABCDEFGWXYZ + 123456890ABCDEFGWXYZ + + + + - + - + + + + 查字库标识 + Kullanici Adini Kontrol Edin + + + + 选择字体大小 + Font Boyutunu Secin + + + + DialogInputTxt + + + Dialog + Diyalog + + + + DialogInsertVari + + + Dialog + Diyalog + + + + 变量类型 + Degisken Tipi + + + + 日 + Gun + + + + 计数器1 + Sayac 1 + + + + 月 + Ay + + + + 分 + Dakika + + + + 时 + Saat + + + + 年 + Yil + + + + 计数器2 + Sayac 2 + + + + 秒 + Saniye + + + + 周 + Hafta + + + + BarCode128 + BarCode128 + + + + DataMatrix + Veri matrisi + + + + QRCode + QR kod + + + + 随机码1 + RastgeleKod + + + + 有效日期 + Son Kullanim Tarihi + + + + 生产日期 + Mevcut Tarih + + + + Class + Sinif + + + + 计数器3 + sayaç 3 + + + + 数字个数 + Dijit Sayisi + + + + 9个 + 9 + + + + 11个 + 11 + + + + 10个 + 10 + + + + 2个 + 2 + + + + 1个 + 1 + + + + 3个 + 3 + + + + 4个 + 4 + + + + 5个 + 5 + + + + 6个 + 6 + + + + 7个 + 7 + + + + 8个 + 8 + + + + 12个 + 12 + + + + 13个 + 13 + + + + 14个 + 14 + + + + 15个 + 15 + + + + 变量插入 + Degisken Girin + + + + DialogLineSpace + + + Dialog + Diyalog + + + + + 0个像素 + 0 piksel + + + + + 1个像素 + 1 piksel + + + + + 2个像素 + 2 piksel + + + + + 3个像素 + 3 piksel + + + + 4个像素 + 4 piksel + + + + 5个像素 + 5 piksel + + + + 6个像素 + 6 piksel + + + + 7个像素 + 7 piksel + + + + 行间距: + Satir Boslugu: + + + + 字符间距: + Karakter yuksekligi: + + + + 选择行间距和字符间距 + Yazı ve karakterler arasi boslugu seciniz + + + + DialogPointDistanceAdjust + + + Dialog + Diyalog + + + + 列首: + Ilk Sutun: + + + + 列中: + Orta Sutun: + + + + 列尾: + Son Sutun: + + + + 重置 + Sifirla + + + + 测试 + Test + + + + DialogSaveFile + + + Dialog + Diyalog + + + + 本地文件 + Yerel Dosyalar + + + + U盘文件 + U disk dosyasi + + + + 预览文件内容: + Onizleme: + + + + 上一个 + Onceki + + + + 下一个 + Siradaki + + + + 请输入文件名: + Dosya Adi: + + + + 取消 + Vazgec + + + + + 保存 + Kaydet + + + + 警告 + Uyari + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + Tasinabilir bellek bulunamadi, ya da "doc" formatinda uzanti mevcut degil! + + + + DialogShowCounter + + + Dialog + + + + + 米标显示: + Sayac isareti sunlari gosterir: + + + + 目前循环范围: + Mevcut dongu araligi: + + + + + + 米 + Metre + + + + 剩余米数: + Kalan sayaclar: + + + + 循环次数: + donguler: + + + + 立即重新计米 + Sayaci simdi sifirla + + + + 起始: + Baslama: + + + + 结束: + Bitis: + + + + Dialoginputpasswd + + + Dialog + Diyalog + + + + 修改密码: + sifre dehistirme: + + + + Dialogmodifypasswd + + + Dialog + Diyalog + + + + 修改密码: + sifre dehistirme: + + + + 密码授权 + Sifre girisi + + + + DigitalInput + + + Form + Form + + + + 9 + 9 + + + + 3 + 3 + + + + 8 + 8 + + + + - + - + + + + 退格 + Back + + + + 1 + 1 + + + + 4 + 4 + + + + 0 + 0 + + + + 5 + 5 + + + + 7 + 7 + + + + 2 + 2 + + + + 6 + 6 + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + Diyalog + + + + 请输入6位机编号(前3位为经销商编号) + Lutfen 6 adet rakam giriniz + + + + PowerOnCnt + PowerOnCnt + + + + PrintDotCnt + PrintDotCnt + + + + PowerMax + PowerMax + + + + PrintMax + PrintMax + + + + 开始时间 + Baslangic Tarihi + + + + 结束时间 + Bitis Tarihi + + + + SuperNodeIP: + SuperNodel IP: + + + + edgeIP: + edgeIP: + + + + + + + + + . + . + + + + 喷码机恢复工作! + Inkjet calismaya devam ediyor! + + + + Mac:%1维护时间剩余 + 维护时间剩余 + Bakim kalan sure + + + + 小时,喷码机将停止工作.请与供应商联系! + saat,yazici calismayi durduracaktir! + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + Bakim suresi Yazicinin durmasi, yukari! tedarikci temasa gecin + + + + + 当前日期: + Gecerli tarih: + + + + + 正确? + dogru? + + + + DlgMutiLanguage + + + 界面语言设置 + Dil ayarlari + + + + 中文 + Cince + + + + 泰语 + + + + + 英语 + Ingilizce + + + + 土耳其语 + Turk + + + + 西班牙语 + Ispanyol + + + 汉语(Chinese) + Chinese + + + 英语(English) + English + + + 越南语(Vietnam) + Vietnam + + + 俄罗斯语(Russian) + Russian + + + 日语(Japanese) + Japanese + + + 韩语(Korean) + Korean + + + + (注意: 选择切换显示语言, 重启后才能生效) + Not: Ekran dilini degistirmeyi secin, yeniden baslattiktan sonra etkili olacaktir + + + + DlgMyWarring + + + 警告 + Uyari + + + + 确定 + Onayla + + + + TextLabel + TextLabel + + + + DlgSelectInputLanguage + + + Dialog + Diyalog + + + + 汉语(Chinese) + 汉语 + + + + 英语(English) + English + + + + 越南语(Vietnam) + Türk dili + + + + DlgShowMsg + + + 警告 + Uyari + + + + 确定 + Onayla + + + + DlgVarLength + + + 变长喷印参数 + Degisken genislik parametresi + + + + 头部长度(m) + Baslangic Uzunlugu (m) + + + + 尾部长度(m) + Bitis Uzunlugu (m) + + + + 总长(m) + Toplam uzunluk (mm) + + + + + 调整长度(mm) + Uzunlugu ayarla (mm) + + + + 可变长度允许 + Degisken uzunluk aktif + + + + 确定 + Onayla + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + Ana Pencere + + + + + + 信息编辑 + Yazi Duzenle + + + + 图案编辑 + Resim Duzenle + + + + 打印设置 + Baski Ayarlari + + + + 触发设置 + Tetikleme Ayarlari + + + + + 系统设置 + Sistem Ayarlari + + + + + 系统管理 + Sistem Yonetimi + + + + + 其他信息 + Diger ayarlar + + + + + 日志信息 + Kullanici Bilgileri + + + + + 网络管理 + Ag Ayarlari + + + + 电压调整 + Voltaj ayari + + + + Save + + + + + 不连续电压 + sureksiz voltaj + + + + + vol0 + + + + + + vol1 + + + + + + vol2 + + + + + + vol3 + + + + + + vol4 + + + + + + vol5 + + + + + + vol6 + + + + + + vol7 + + + + + + vol8 + + + + + + vol9 + + + + + + vol10 + + + + + + vol11 + + + + + + vol12 + + + + + + vol13 + + + + + + vol14 + + + + + + vol15 + + + + + + vol16 + + + + + + vol17 + + + + + + vol18 + + + + + + vol19 + + + + + + vol20 + + + + + + vol21 + + + + + + vol22 + + + + + + vol23 + + + + + + vol24 + + + + + + vol25 + + + + + + vol26 + + + + + + vol27 + + + + + + vol28 + + + + + + vol29 + + + + + + vol30 + + + + + + vol31 + + + + + + vol32 + + + + + + vol33 + + + + + + vol34 + + + + + + vol35 + + + + + + vol36 + + + + + + vol37 + + + + + + vol38 + + + + + + vol39 + + + + + 连续电压 + surekli voltaj + + + + 满列电压 + Tam sutun voltaji + + + + fvol0 + + + + + fvol1 + + + + + fvol2 + + + + + fvol3 + + + + + fvol4 + + + + + fvol5 + + + + + fvol6 + + + + + fvol7 + + + + + fvol8 + + + + + fvol9 + + + + + fvol10 + + + + + fvol11 + + + + + fvol12 + + + + + fvol13 + + + + + fvol14 + + + + + fvol15 + + + + + fvol16 + + + + + fvol17 + + + + + fvol18 + + + + + fvol19 + + + + + fvol20 + + + + + fvol21 + + + + + fvol22 + + + + + fvol23 + + + + + fvol24 + + + + + fvol25 + + + + + fvol26 + + + + + fvol27 + + + + + fvol28 + + + + + fvol29 + + + + + fvol30 + + + + + fvol31 + + + + + fvol32 + + + + + fvol33 + + + + + fvol34 + + + + + fvol35 + + + + + fvol36 + + + + + fvol37 + + + + + fvol38 + + + + + fvol39 + + + + + 其他调整 + Diger ayarlamalar + + + + 整体缩放(%) : + Toplam yakinlastirma (%): + + + + WriteByte + + + + + ReadByte + + + + + + + Address: + Address: + + + + + Value: + + + + + WriteWord + + + + + ReadWord + + + + + ReadDword + + + + + WriteDword + + + + + ValueH: + + + + + ValueL: + + + + + 定时开机循环完成,准备关机 + Kontrol Tamamlandi, Kapatmaya Hazir + + + + 准备关机 + Kapatmaya Hazir + + + + 与FPGA失去通信!!! + FPGA ile irtibat hatasi! + + + + 与FPGA通信恢复正常 + FPGA ile irtibat kuruldu + + + + 开始自检,请等待60秒............... + POST, 60 sn bekleyiniz... + + + + 开始自检,请等待%1秒............... + POST, %1 sn bekleyiniz... + + + + + 自检完成!!! + Kontrol tamamlandi! + + + + + 墨水或溶剂空,准备关机 + Murekkep veya solvent bitti, kapanabilir + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jet hiz hatasi! Tum icerikler yazdirilamaz! + + + + 喷印速度过快!无法喷印完全!!! + + + + + 压力波动超过设定的5个值. + Basinc dalgalanmasi, ayarlanan 5 degeri asiyor. + + + + 停止打印,自动关闭高压. + Yazi durduruluyor ve yuksek voltaj otomatik olarak kapatiliyor. + + + + 压力异常:上次压力值%1,当前压力值%2 + Basinc Hatasi: Son Deger %1, Suan ki deger %2 + + + + 高压异常:上次电流值%1,当前电流值%2 + Yuksek Voltaj Hatasi: Son akim degeri %1, Mevcut akim degeri %2 + + + + 提示 + ipucu + + + + 是否接收新的信息! + Yeni bilgi almak icin olsun! + + + 请立即检查过滤器是否堵塞或者漏气! + Filtrenin tikali veya sizinti olup olmadigıini hemen kontrol edin! + + + 请清理过滤器或者检查是否泄露! + Lutfen filtreyi temizleyin veya sizinti olup olmadiğini kontrol edin! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + + + + + + 错误!!!!!!!!!!!主墨泵故障 + Hata!! Ana murekkep pompasi hatasi + + + + + 主墨泵故障!!! + Ana Murekkep Pompasi Hatasi! + + + + 错误!!!!!!!!!!!压缩机故障 + Hata!! Kompresor hatasi + + + + 压缩机故障!!! + Kompresor hatasi! + + + + + 错误!粘度计下位灯故障. + Hata! Vizkozite olcum hatasi! (ALT) + + + + + 错误!粘度计故障:检测不到上位灯. + Hata! Vizkozite olcum hatasi! (UST) + + + + 粘度检测异常,粘度值太大!!! + Uygun olmayan vizkozite degeri saptandi, vizkozite cok yuksek!! + + + + + 错误!!!!!!!!!!!粘度偏大故障 + Hata! Vizkozite degeri + + + + 定时开机 + zamanlı başlangıç + + + + + 压力泄漏或压力传感器故障! + Basınc kacagi veya basınc sensoru arizasi! + + + + 运行中压力泄漏,停齿轮泵! + Calisma sirasinda basinc kacagi, disli pompayi durdurun! + + + + + 测试时间结束,准备关机 + Test süresi bitti, kapanmaya hazır + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + Hız çok yüksek, lütfen hemen durun ve tedarikçiyle iletişime geçin! + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + Yüksek hız, lütfen filtreyi temizleyin veya sızıntı olup olmadığını kontrol edin! + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + + + + + 混合阀打开1: + + + + + + 警告!!!!!!!!!!!粘度值偏低 + + + + + 混合阀打开2: + + + + + + + 电机故障 + Motor hatasi + + + + 电机故障!!! + Motor hatasi!! + + + + + 回收槽到头 + + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + Yukari + + + + 下一页 + Asagi + + + + ` + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 0 + + + + + - + + + + + = + + + + + 退格 + Geri Al + + + + + 英文 + Ingilizce + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + [ + + + + + ] + + + + + \ + + + + + + 大写 + CapsLOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + Shift + + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + , + + + + + . + + + + + / + + + + + 上 + Yukari + + + + 特殊字 + Ozel Char + + + + 隐藏 + Sakla + + + + Ctrl + + + + + 删除 + Sil + + + + 行首 + Ana sayfa + + + + 行尾 + Son + + + + 左 + Sol + + + + 下 + Asagi + + + + 右 + Sag + + + + + 错误 + Hata + + + + hanziDisplayLabels缺少初始化 + + + + + warning + + + + + myInputMethod is null + + + + + + 找不到输入法初始化文件 + Yazimin aktarimi bulunamadi + + + + 小写 + CapsLOCK + + + + Tiếng Việt + + + + + Russian + + + + + Japanese + + + + + 全选 + Hepsini Sec + + + + 复制 + Kopyala + + + + 粘贴 + Yapistir + + + + 剪切 + Kes + + + + 后退 + Geri Al + + + + InsertSpaceNumDialog + + + 插入空格数 + Bosluk Gir + + + + 空格个数: + Sayi: + + + + LogInfo + + + Form + Form + + + + 当前状态 + Mevcut Durum + + + + 清空当前状态 + Durumu temizle + + + + 历史状态 + Tarihsel Durum + + + + 删除历史文件 + Tarihsel Durumu Sil + + + + 打开历史文件 + Dosya acilamiyor + + + + TextLabel + + + + + 导出日志到U盘 + Gunlukleri U diske aktar + + + + 版本信息 + Versiyon Bilgisi + + + + 请先打开历史状态文件! + Oncelikle Ana Dosyayi aciniz! + + + + + + 警告 + Uyari + + + + + + 无法打开文件 + Dosya acilamiyor + + + + + + + 提示 + ipucu + + + + 是否确认将所有日志文件导出到U盘? + Tum gunluk dosyalarini bir USB bellege aktaracaginizdan emin misiniz? + + + + 成功导出到U盘? + Tasinabilir Bellege Aktarim Basarili? + + + + 选择历史记录文件 + Kayit Dosyasi Seciniz + + + + 是否确认将历史日志文件全部清除? + Tum gecmis gunluk dosyalarini temizlemek istiyor musunuz? + + + + 是否确认将当前日志全部清除? + Mevcut tum gunlukleri silmek istiyor musunuz? + + + + MainWindow + + + InkJet + InkJet + + + + 编辑 + Duzenle + + + + 打开文件 + Dosya ac + + + + 二维码 + QR kod + + + + 条形码 + Barkod + + + + 缩小 + Uzaklas + + + + 放大 + Yakinlas + + + + 获取数据 + veri almak + + + + 交替打印文件名 + Alternatif baski dosyasi adi + + + + 最大:[40行x 2048列] + azami:[40 Row x 2048 Col] + + + + 同步器速度 + Hiz + + + + 当前时间 + zamani + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨线开关 + Inkjet salter + + + + 喷头盖开 + Kapak acik + + + + 墨水缸满 + Inkstand Dolu + + + + 墨水液位 + InkLevel Ariza + + + + 溶剂液位 + solvent seviyesi + + + + 回收故障 + Geri donusum hatasi + + + + 粘度故障 + viskozite hatasi + + + + 相位故障 + Faz hatasi + + + + 高压故障 + HIGHVOLT Ariza + + + + 故障恢复 + Ariza Sifirla + + + + 立即重新计米 + Sayaci simdi sifirla + + + + 产品计数 + Urun Sayaci + + + + 产品总计数 + Genel toplam + + + + 关机 + Kapat + + + + 2014-08-23 + + + + + 高压包 + Yuksek voltaj + + + + 粘度 + Vizkozite + + + + 压力 + Basinc + + + + + 隔膜位置 + DiyagramPOS + + + + + + + 开 + Acik + + + + + + + 关 + kapali + + + + + 暂停打印 +停止高压 + Yazdirmayi duraklat +yuksek basinci durdur + + + + 紧急停机 + acil kapatma + + + + 泵启动 + Pompa baslar + + + 启动 + Baslat + + + + 喷嘴逆清洗 + Nozul Ters Temizleme + + + + + 机箱: + case: + + + + + + 正在喷印............... + Yazdiriliyor... + + + + 喷头盖开, 喷印无法正常进行!!! + Yazici kafa kapagi acik iken yazdirilamaz! + + + + + 墨水缸满报警 + Murekkep haznesinde birden fazla hata var + + + + + 墨水液位报警 + Murekkep seviye alarmi + + + + + 溶剂液位报警 + Solvent seviye alarmi + + + + + 高压故障,暂停打印 + Yuksek voltaj hatasi, yazi durduruldu + + + + + 高压故障,暂停打印. + Yuksek voltaj hatasi, yazi durduruldu. + + + + 高压故障,关回收槽 + Yuksek voltaj hatasi, ReclainTank otomatik kapaniyor + + + + 高压故障,关回收槽和墨线 + Yuksek voltaj hatasi, ReclainTank otomatik kapaniyor + + + + + + + + 回收故障,关闭回收槽,关墨线 + Geri donusum hatasi, kolektor ve murekkep hattini kapatin + + + + 回收故障. + Geri donusum hatasi. + + + + 回收异常,墨线可能偏离.(%1) + Geri donusum normal disi, Murekkep hatti etkilenebilir (%1) + + + + 维护时间已到,喷码机停止工作! + Bakim zamani ! Yazici duruyor ! + + + + + 暂停喷印............... + Yazi durduruldu... + + + + 相位故障:飞行时间错误! + Faz hatasi: yanlis ucus zamani! + + + + 相位故障:相位检测错误! + Faz hatasi: Faz algilama hatasi! + + + + + + 相位故障,准备关机 + Faz hatasi, kapaniyor + + + + + + 相位故障,暂停打印 + Faz hatasi, yazi durduruldu + + + + 相位故障,屏蔽DAC输出 + Faz hatasi, DAC aktarimi durduruldu + + + + + 相位故障,屏蔽充电 + Faz hatasi, sarj durduruldu + + + + 齿轮泵转速 + Disli pompa hizi + + + + 交替打印 + AltBaski + + + + 电眼交替 + Alter by electronic Eye + + + + %1.%2[%3.%4]米/分 + %1.%2[%3.%4]metre/dakika + + + + 列延时:%1点 + Sutun boslugu: %1 piksel + + + + + + + + + + + + + + + 警告 + Uyari + + + + 无法打开文件 + Dosya acilamiyor + + + + 打开文件: + Dosya ac: + + + + + + 提示 + Oneriler + + + + 文件未保存,是否先保存文件! + Dosya kaydedilmiyor! Lutfen simdi kaydedin! + + + + + + + 变量数大于8个,某些变量将不起作用!!! + Degisken sayisi 8'den buyuk, bazi degiskenler gozukmeyebilir! + + + + + 请减少信息中的变量(或计数器)数量. + Lutfen yazdirilacak dosya icerisindeki degisken(veya sayac) sayisini azaltin. + + + + warning,界面上有变量未显示完全 + Uyari, interface tum degiskenleri gostermeyebilir + + + + + + + [ %1行 x %2列 ] + [ %1row x %2row ] + + + + + + + + 错误 + hatasi + + + + 喷印间隔过短,应高于%1! + Yazdirma araligi cok kisa,%1 den yuksek olmali! + + + + 喷头盖未关,请先关喷头盖! + Lutfen yazici kafa kapagini kapatin! + + + + 墨线未开,请先开墨线开关! + yazici switchini aciniz! + + + + 正在加高压... + Yuksek voltaj ayarlaniyor... + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Mevcut toplam kolon sayisi %1, desteklenen kolon sayisi %2, lutfen karakter boyutlarini azaltiniz + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Yazi zamani %1 ms, tetikleyici araligi %2ms, tetikleyici araligi yazi zamanindan buyuk olmali, bosluk 3ms den az olmamali + + + + 同步目标每列有%1.%2个同步脉冲 + Encoderin Her kolon hedefi %1.%2 encoder pulse + + + + + + 开始打印 + Yaziyi baslat + + + + 回收槽未到底!!!!!! + Kolektor sona ulasmadi! + + + + 停止打印 + yaziyi durdur + + + + + 随机码文本将展出到U盘,请插入U盘 + Rastgele kod bellege kaydedilecek, lutfen bir bellek takiniz + + + + 暂停打印 + Yazi durduruldu + + + + 继续打印 + Yaziya devam et + + + + 继续打印 +保持高压 + yazdirmaya devam et +yuksek basinci korumak + + + + 正在排气 ............... + Yorucu ................ + + + + + 停止 + Sayaci + + + + 正在打开回收槽... + kolektor aciliyor... + + + + 停止打开 + Acmayi durdur + + + + + 警告!回收槽开关时间未设置! + Uyari! Kolektor degisim zamani ayarlanmadi! + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Kolektor tikandi ya da geri donusum saati yanlis ayarlandi, anlik durumu etkin kilmak istiyor musunuz? + + + + 正在关闭回收槽... + tank simdi kapatiliyor... + + + + 停止关闭 + Kapatmayi durdur + + + + 准备关机...... + Yazici kapanacak... + + + + 泵停止 + Pompa durdu + + + + 回收槽未关,是否关闭回收槽后关机! + Kolektor geri donmedi, yaziciyi kapatmadan once kolektoru kapatmak ister misiniz! + + + + 是否确认关机? + Yaziciyi kapatmak istiyor musunuz? + + + + + 最多支持的列数目为:%1请减小信息长度. + Maksimum desteklenen sutun sayisi:%1, lutfen bilginin uzunlugunu kisaltiniz + + + + 是否初始化产品计数? + Urun sayacini aktiflestirmek istiyor musunuz? + + + + 是否清除总产品计数? + Genel toplami temizlemek istiyor musunuz? + + + + 是否立即重新计米? + Sayac sifirlamak istiyor musunuz? + + + + 警告:‘-’和空格的宽度不一样 + Uyari : bosluklarin genisligi es degil + + + + 条形码信息编辑 + Barkod Duzenle + + + + + 二维码信息编辑 + QR kod Duzenle + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + DM kodu al icerigi bos! + + + + + 获取DM码内容: + DM kodu icerigini alin: + + + + + 获取DM码内容跟上次相同 + DM kodu almanin içerigi gecen seferkiyle ayni + + + + 高压故障:两高压偏转板间的电压检测异常 + Yuksek-voltaj hatasi:iki plaka arasinda anormal voltaj algilandi + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + Yuksek basinc deflektoru ve yuksek basinc kaynagi islak ve kirli, lutfen yuksek basinc plakasini ve yuksek basinc kaynagini temizleyin + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + Yuksek voltaj salteri veya anakart degisti, lutfen sistem ayarlari > reset yuksek voltaj adimlarini izleyin ve yuksek voltaj degerini 90 ayarlayin, alarmi resetleyin, deger araligi 480 550 arasi olmali + + + + 3.高压线路漏电,请更换高压线路; + yuksek voltaj hattinda kacak var, degistirin + + + + 4.高压底座漏电,请更换高压底座。 + yuksek voltaj kaynaginda kacak var, degistirin. + + + + 墨水过多:墨水溢出 + Murekkep hatasi, fazla akis + + + + 1. 请停止添加墨水; + Murekkep eklemeyi durdurun + + + + 2. 请排出多余墨水。 + Murekkebi bosaltin. + + + + 墨水液位:墨水即将耗尽 + Murekkep seviyesi: tukenmek uzere + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + murekkep tukendi 3 saat sonra otomatik olarak kapanacak, lutfen zamaninda murekkep ekleyin. + + + + 回收故障:未检测到有墨水回收 + geri donusum hatasi, murekkep algilanmadi + + + + 1. 墨水未射入回收管,请修正墨线方向; + murekkep geri donusum hattine gelmiyor, baglantiyi kontrol edin + + + + 2. 墨水粘度太低,请更换新墨水; + viskozite cok dusuk, yeni murekkep ekleyiniz + + + + 3. 回收管堵塞,请清通或者更换回收管; + geri donusum hatti tikandi, temizleyin ya da degistirin + + + + 4. 回收泵故障,请清洗或者更换回收泵; + geri donusum pompa hatasi, temizleyin ya da degistirin + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + anormal bir parametre olmadigindan emin iseniz, su adimlari izleyin, baski ayarlari > geri donusum hatasini yoksay, ardindan anasayfaya donun ve hatalari temizle butonuna basiniz. + + + + 溶剂液位:溶剂即将耗尽 + solvent seviyesi:tukenmek uzere + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + solvent tukendi, 3 saat sonra otomatik olarak kapanacak, lutfen zamaninda solvent ekleyiniz. + + + + + 粘度故障报警 + viskozite alarmi + + + + 粘度故障:墨水粘度无法自动调整 + viskozite hatasi : otomatik olarak ayarlanamadi + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + karisim valf hatasi : yikayin veya degistirin + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + murekkep haznesindeki murekkep anormal : lutfen degistirin + + + + 粘度计异常: + viskosite olcumu anormal degerde: + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + filtre pompadan onceki kisimdan tikandi, duzenleyici kismini degistirin + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + viskozite pompasi anormal, temizleyin yada degistirin + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + viskozite sensoru anormal, kontrol edin veya degistirin. + + + + 相位故障报警 + Faz alarmi + + + + 相位故障:相位信号检测异常 + Faz hatasi, faz saptama bekleniyor + + + + 1. 墨水分裂不正常,请调整墨水分裂; + murekkep damlaciklari anormal, murekkep splitini temizleyin + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + sarj unitesi kirlenmis olabilir, kafa temizligi ve uniteyi kontrol edin + + + + 3. 放大板功能性异常,请更换放大板; + magnify kartini degistirin + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + nozzle kontrolunu saglayin, damlaciklarin mesafesi anormal + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + topraklama hatasi, topraklama kablosunu kontrol edin + + + + 6. 墨水质量异常,请更换新墨水。 + murekkep degerinde bozulma algilandi, lutfen degistirin. + + + + 回收槽开关检测完成! + Geri donusum tanki anahtari tespiti tamamlandi! + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + Temel adres: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xb200 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + Hafizayi oku + + + + 写空间 + Hafizaya yaz + + + + 进制转换 + Temel donusum + + + + + 编辑 + Uyari + + + + 上一页 + Yukari + + + + 下一页 + Yukari + + + + 完成 + Tamam + + + + ModbusSerial + + + 接收到开始打印命令 + Yazdirmayi baslat komutu alindi + + + + 接收到暂停打印命令 + Alinan yazdirma komutunu duraklat + + + + 接收到停止打印命令 + Yazdirmayi durdur komutu alindi + + + + 接收到DM码数据命令 + DM kodu veri komutu alindi + + + + MyFileDialog + + + 确定 + Onayla + + + + NetworkManager + + + Form + + + + + 手动设定 + Manuel + + + + + IP: + + + + + Mask: + + + + + GW: + + + + + 取消 + iptal + + + + 有线LAN + LAN + + + + WiFi: + + + + + SSID: + + + + + Status: + Durum: + + + Disconnect + baglantiyi kes + + + + auth: + + + + + Encryption: + sifreleme: + + + + Plaintext (open / no authentication) + Duz metin (acik / kimlik dogrulama yok) + + + + 主获取数据按钮 + ana veri al dugmesi + + + + 断开 + baglantiyi kes + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + 设备码: + Cihaz kodu: + + + + 服务IP: + Hizmet IP'si: + + + + None + Hicbiri + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + 8754 + + + + + 服务端口: + Servis portu: + + + + PSK: + + + + + 连接 + baglamak + + + + Password: + Parola: + + + + 扫描 + tarama + + + + 清除 + acik + + + + 获取数据 + veri almak + + + + Network: + Ag: + + + + 添加网络 + ag ekle + + + + 测试 + Test + + + + 应用配置 + Uygulama yapilandirmasi + + + + 去掉数字码 + dijital kodu kaldir + + + + 去掉QR码 + QR kodunu kaldir + + + + ScanSSID + + + + Connect + Baglan + + + + 1 + 1 + + + + 47.111.170.144 + + + + AddNetwork + Ag ekle + + + Remove + Kaldir + + + + wpa_supplicant service is not running. +Do you want to start it? + + + + + Disconnected + ayirin + + + + Inactive + + + + + Scanning + + + + + Authenticating + + + + + Associating + + + + + Associated + + + + + 4-Way Handshake + + + + + Group Handshake + + + + + Completed + + + + + Unknown + + + + + Could not get status from wpa_supplicant + Wpa_supplicant'tan durum alinamadi + + + + Select any network + + + + + WPS AP in active PBC mode found + + + + + Press the PBC button on the screen to start registration + Kaydi baslatmak icin ekrandaki PBC dugmesine basin + + + + WPS AP with recently selected registrar + + + + + WPS AP detected + + + + + PBC mode overlap detected + PBC modu cakismasi algilandi + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + Su anda etkin WPS PBC modunda birden fazla AP var. Birkac dakika bekleyin ve tekrar deneyin + + + + Network configuration received + Ag yapilandirmasi alma + + + + Registration started + + + + + Registrar does not yet know PIN + Kayit sirketi henuz PIN bilmiyor + + + + Registration failed + Kayit basarisiz + + + + Registration succeeded + + + + + WPA Pre-Shared Key Error + + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + + Network ID Error + Ag Kimligi Hatasi + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + Ag Kimligi Dizesi, sozcuk olmayan karakterler icerir. Bosluk icermeyen, yalnizca bu araliktaki karakterleri iceren basit bir dize olmalidir: [A-Za-z0-9_-] + + + + Failed to add network to wpa_supplicant +configuration. + Wpa_supplicant yapilandirmasina ag eklenemedi. + + + + Failed to enable network in wpa_supplicant +configuration. + Wpa_supplicant yapilandirmasinda ag etkinlestirilemedi. + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + Bu kalici olarak yapilandirmadan agi kaldiracaktir. Bu agi gerçekten kaldirmak istiyor musunuz? + + + + Yes + Evet + + + + No + HAYIR + + + + Failed to remove network from wpa_supplicant +configuration. + Wpa_supplicant yapilandirmasından ag kaldirilamadi. + + + + 是否去获取数据! + Verileri almak icin olsun! + + + + 获取数据中... + Veri aliniyor... + + + + + 上报数据中... + Raporlama verileri... + + + + + + + 提示 + ipucu + + + + + IP设置错误! + IP ayar hatasi! + + + + 应用成功 + uygulama basarisi + + + + OtherInfo + + + Form + + + + + 相位位置: + Faz pozisyonu: + + + + 相位偏移: + Faz offseti: + + + + 飞行时间: + Bosluk zamani: + + + + DetectDelay + + + + + 相检: + faz: + + + + FullTimeEn + + + + + DetectVol + + + + + HighLowRatio + + + + + 充电占空比100% + Sarj gorevi (100%) + + + + detect_num + + + + + + 锁定相位 + Tikanmis Faz + + + + 相位检测电压: + 相位检测电压 + Faz algilama voltaji: + + + + 检测点数量: + 检测点数量 + Algilama noktasi sayisi: + + + + 检测延迟 : + 检测墨点数量: + Algilama gecikmesi: + + + + 频闪灯周期: + ParlamaPeriyodu: + + + 相位偏移: + Faz ofseti: + + + 相检: + Faz denetimi: + + + 检测延时: + Faz gecikmesi: + + + + 应用当前配置 + Uygula + + + + 提示 + Oneriler + + + + 应用成功 + Basarili bir sekilde uygula + + + + 点 + Piksel + + + + 解锁相位 + Faz kilidini ac + + + + PicEdit + + + Form + + + + + 开启软键盘 + klavye + + + + 插入变量 + Degisken + + + + + 保存/打印 + Kaydet/yazdir + + + + 缩小 + Uzaklas + + + + 放大 + Yakinlas + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + Satir Yuksekligi + + + + 无加粗 + Normal + + + + 加粗1倍 + kalin1 + + + + 加粗2倍 + kalin2 + + + + 光栅[X:Y] + Grating [X,Y] + + + + 放大比例 + Duzenleme + + + + 插入模式 + Aktar modu + + + + 文件名 + Dosya Adi + + + + CURR[X,Y] + + + + + 新建信息 + Yeni yazi + + + + 打开文件 + Dosya Ac + + + + 字符间距 + Karakter araligi + + + + 插入/修改 + Aktar/duzenle + + + + 删除字符 + sil + + + + 插入图片 + Resim + + + + 保存为 + Farkli Kaydet + + + + + + 字库编辑 + Font duzenle + + + + 网格 + Lattice + + + + 粗体 + Kalin + + + + 显示控制符 + karakter kontrolunu goster + + + + 行首 + Ana sayfa + + + + 行尾 + Son + + + + 字符光标 + Karakter lmleci + + + + 像素光标 + Piksel lmlec + + + + 编辑现有的多字体 + Cok fontlu dosyayi duzenle + + + + 点击光栅可打开键盘,点击空白处关闭 + klavyeye donmek icin tiklayiniz + + + + + + + + + + + 放大倍数:%1 + Buyutme: %1 + + + + + 插入模式 + Aktar modu + + + + + 修改模式 + Duzenle modu + + + + 编辑现有的多字体文件 +请使用修改模式!!! + 编辑现有的多字体文件 +请使用修改模式!!! + cok fontlu dosyayi duzenlerken duzenle modu kullaniniz! + + + + + + 保存 + Kaydet + + + + 点击光栅可打开键盘,点击空白处关闭 + klavyeyi acmak icin simgeye, kapatmak icin bosluga dokunun + + + + 信息编辑 + Yazi Duzenle + + + + 字库保存 + font kutuphanesine kaydet + + + + + 返回信息编辑 + Bilgi Duzenlemeye Geri Don + + + + 请选择字体,打开键盘并输入要编辑的字符 + Font secin(klavyeyi acip yazi giriniz) + + + + + + 提示 + Oneri + + + + 图片已经改变,是否保存? + Resim degisti, kaydetmek istiyor musunuz? + + + + 放弃保存 + Kaydetmeden Cik + + + + 文件另存为... + Kaydet… + + + + 另存为 + Farkli kaydet + + + + + + + + + 文件名: + Dosya Adi: + + + + 文件名:) + Dosya Adi:) + + + + 文件保存为... + Kaydet… + + + + 本条信息的变量超过规定数量! + Bu Mesajin degisken sayisi limit degerini asti! + + + + 是否立即喷印当前的文件? + Mevcut dosyayi yazdirmak istiyor musunuz? + + + + 是 + EVET + + + + 否 + HAYIR + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Yeni bir satir eklemek icin 'Enter'i tiklayin. imlec yazi gore otomatik olarak ayarlanir + + + + 选择[字体]可改变光标大小. + degisiklik imlec boyutu yazi tipini secin. + + + + 选择[绘图]方式,可以绘制任意图形 + Seciniz Drawing,Patern cizmek icin + + + + 光标不匹配时,不能输入或删除. + Imlec yakalamadan giris veya silme islemi yapilamaz. + + + + 点击空白处可关闭键盘. + Klavyeyi kapatmak icin bosluga tiklayiniz. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + Kullanici 'FontLab Edit' ile yeni karakter tanimlayabilir + + + + 选择[文本模式]可切换到主界面编辑方式. + Seciniz: Yazi Modu; ana duzenleme arayuzunu degistirmek icin. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + klavyeyi acmak icin simgeye, kapatmak icin bosluga dokunun + + + + 使用[字库编辑]功能,用户可自己修改字形 + Kullanici 'Fontlab Edit' islevini secerek yazi tipini revize edebilir + + + + PicWidget + + + Please input a char. + Lutfen bir karakter girin. + + + + 请输入要编辑的字符 + Girilen karakter duzenlenmeli + + + + 编辑字符:%1 + Karakteri duzenle: %1 + + + + [%1行,%2列] + [%1row,%2col] + + + + 光标[%1,%2] + Imlec [%1,%2] + + + + + + + + + + + + + 警告 + Uyari + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maksimum boyut genisligi %1 x Yuksekligi %2, mevcut talep %3 x %4 + + + + + + 请新创建建图片 + Lutfen yeni bir temel dosya seciniz + + + + + + 文件:%1 无法打开 + Dosya %1 acilamiyor + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + bilgideki degisken sayisi maksimum degeri asiyor (8)! + + + + + 两个变量之间至少要空出一个墨点! + Iki degisken arasinda bir nokta! + + + + PrintNet + + + 获取二维码内容: + + + + + 获取数字码: + + + + + PrintSetting + + + Form + + + + + 计数器1设置 + Sayac 1 Ayarlari + + + + + + + 起始值: + Baslangic Degeri: + + + + + + + 结束值: + Bitis Degeri: + + + + + + 重设值 + Mevcut sayaci +sifirla + + + + + + 重复数: + Tekrarlama +zamani: + + + + + + 清零 + Sayac Sifirla + + + + + + + 增量值: + Artirim: + + + + + + 当前值: + Mevcut: + + + + 可变长度 + Degisken Uzunlugu + + + + 计数器2设置 + Sayac 2 Ayarlari + + + + 计数器3设置 + Sayac 3 Ayarlari + + + + 跳米设置 + Sayac ayarlarini gec + + + + 跳米数: + Araligi gec: + + + + 跳米打印 + Atla Sayma etkinlestirme + + + + + + 输入密码 + 提升权限 + Daha Fazla Yetki + + + + 墨线时间 + Murekkep Hatti zamani + + + + 墨线时间: + Murekkep Hatti zamani: + + + + + + 0 + + + + + 开机次数: + Baslatma zamani: + + + + 应用当前配置 + Uygula + + + + 常用设置 + Genel Ayarlar + + + + TextLabel + + + + + 打印模式: + Baski Modu: + + + + 字体宽度: + FontGenisligi: + + + + 首行电压(%): + NADIR Voltaji(%): + + + + 字体加粗: + FontKalinligi + + + + + 快速 + Hizli + + + + + + 标准 + Standart + + + + + + 慢速1 + Yavasca1 + + + + + + 慢速2 + Yavasca2 + + + + + 慢速3 + Yavasca3 + + + + + 慢速4 + Yavasca4 + + + + + 慢速5 + Yavasca5 + + + + + 慢速6 + Yavasca6 + + + + + 慢速7 + Yavasca7 + + + + + 慢速8 + Yavasca8 + + + + + 慢速9 + Yavasca9 + + + 检测回收槽 + Alim deposunu kontrol edin + + + + 每条信息只打印一次 + Her mesaj yalnizca bir kez yazdirilir + + + + 打印时绿灯常亮 + Yazdirirken surekli yesil isik + + + + 复位发送打印数据 + + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + Not: Sayac 1, "Diger Ayarlar" sayfasinda "Segment Metre" isaretlendiginde kullanilamaz. + + + 生产日期: + Uretim tarihi: + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + Sayac, kapatma degerini kaydeder + + + + 距离尾部(mm): + Kuyruktan uzaklik (mm): + + + 当计数达到 : + Sayi ulastiginda: + + + + 特殊条件计数 + ozel durum sayisi + + + + 首尾交替 + Alternatif uctan uca + + + 显示 + gostermek + + + + 打印电压缩放 + Baski Gerilimi Olcekleme + + + + 整体缩放(%) : + Toplam yakinlastirma (%): + + + + 字高设置(%): + Font +Yuksekligi(%): + + + + 行末电压(%): + ZENITH Voltaji(%): + + + + 修改授权 + hibe degistirin + + + + 回收故障处理 + Hata lsleme + + + + 超速暂停打印 + asiri hiz nedeniyle baski Pause + + + + 米标显示 + Sayac isareti ekrani + + + + 上移 + yukari tasi + + + + 下移 + asagi inmek + + + + 自然数计米 + Dogal +sayac + + + + 信息上下颠倒 + Ayna +Dikey + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 相位故障不打印 + StopWhile + Faz Hatasi + + + + 故障停止走米 + Dur Sayac iken Ariza + + + + 信息左右颠倒 + Ayna +Yatay + + + + 不打印走米 + Yazdirmiyor sayac devam + + + + 电眼误触禁止 + Yasak electriceye yeniden tetik + + + + 高压故障关回收槽 + ReclainTankColse WhenHighVoltFault + + + + 省点 + noktayi kayde + + + 空列打印 + Bos sutun baski + + + + 字形优化 + karakter +optimizasyon + + + + date time + tarih saat + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + yyyy年MM月dd日 + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + + dd MM yy + + + + + 有效期(天): + Son Kullanim +Tarihi + + + + + 高级设置 + Gelismis Ayarlar + + + + + 交替扫描隔点(默认为1): + Ic Ice aktarma(dot): + + + + 行末调整点模式: + Ayarlanmis baski modu: + + + + 点距调整值(默认为0): + Dot boslugunu ayarla (def 0): + + + + + 扫描颠倒 + Tersten tarama + + + + 行末点微调(‰): + DogruAyarlamaOrani (‰) + + + + 点距调整电压位置: + DotboslukVoltpozisyonu: + + + + 行末调整点数(默认为0): + dot sayilarini ayarla(def 0): + + + + 去除冗点模式(默认懒惰): + MurekkepDamlaAyarlama (def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Daha Az + + + + 均衡模式 + Dengele + + + + + 冗点比例(默认为0%): + SarjOlmamisDamlaOrani (Def 0%) + + + + + 调整电压 + Gerilimi ayarlayin + + + 推荐设置 + OnerilenAyarlar + + + + 使用推荐设置 + Onerilen Ayaro Kullan + + + + 行业: + EndustriyelMod: + + + + 快 + Hizli + + + 慢速 + Yavasca + + + + 电线电缆 + Kablo & Tel + + + + 制药/食品/电子 + Ilac/Gida/Elektronik + + + + 建筑管材 + Boru ve Tup + + + + 其他 + Digerleri + + + + 速度: + Hiz: + + + + + 锁定脉冲计数 + Darbe sayisini kilitle + + + + 非字宽 + kelime disi genislik + + + + 使用齿轮泵 + Disli pompa kullani + + + + 高压阈值: + Yuksek voltaj esigi: + + + + 不检测喷头盖 + Baski kafasi kapaği algilanmadi + + + + 计数器设置 + Sayac ayarlari + + + + 计数器3 + CNT3 + + + + 交替打印设置 + Alternatif baski + + + + 起始位置: + Baslangic Poz: + + + + 特殊变量结束值: + Özel değişken bitiş değeri: + + + + 交替间隔: + Alt. Aralik: + + + + 重复次数: + Tekrarlama adedi: + + + + ddhhmm + + + + + 无交替 + Hicbiri + + + + 普通交替 + Genel Duzenleme + + + + 电眼触发交替 + Elektronik Tetikleme + + + + 特殊变量起始值: + Özel değişken başlangıç ​​değeri: + + + + 打印 + Yazdır + + + + 其它设置 + Diger ayarlar + + + + 更换信息文件时执行的动作: + Dosya degistiginde disari aktar: + + + + 产品计数器自动清0 + Urun Oto-Reset + + + + 总产品计数器自动清0 + Toplam Urun Oto-Reset + + + + 外接显示屏: + Ekstra Ekran: + + + + 无 + Hicbiri + + + + 小屏 + Kucuk + + + + 大屏 + Buyuk + + + + 总产品计数值 + Urun Sayaci + + + + + 计数器1 + CNT1 + + + + + 计数器2 + CNT2 + + + + 显示屏显示: + Ekranda Goster: + + + + 导出随机码文本 + Rastgele bir kod dosyasini disari aktar + + + + 复位到起始值 + baslangic ​​degerine sifirla + + + + 分段计米 + CNT1 Grubundan + + + + 插 入 + Aktar + + + + 添 加 + Ekle + + + + 全部删除 + Del All + + + + 删 除 + Del + + + 提示:可变长度参数不正确 + Ipucu: Yanlis degisken uzunluk parametresi + + + 要求:调整长度小于喷印间隔 + Gereksinim: Uzunlugu yazdirma araligindan daha kisa ayarlayin + + + + + 提示:交替参数不正确 + Pneri: alternatif parametresi yanlis + + + + 要求:起始位置<交替间隔 + Formul: Baslangic pozisyonu <Alternatif aralik + + + + 要求:(重复次数+起始位置)<交替间隔 + Formul: (Tekrarlama Sureleri + Baslangic konumu) <Alternatif aralik + + + + + + + + 提示 + Oneriler + + + + 应用成功 + Basarili uygula + + + + + + 错误 + Hata + + + + 授权码: + Yetki Kodu: + + + + 错误 + Hata + + + + 喷码机维护设置成功! + Makine bakim ayarlari basarili! + + + + 系统维护设置成功! + Sis. Bakim Ayarlari basarili! + + + + 不存在 + Mevcut degil + + + + + + 输入密码 + 提升授权 + Daha fazla yetkilendirme ayarlari + + + + 密码: + + + + + 取消授权 + Yetkilendirme ayarlarindan cik + + + + + + + + + + 警告 + Uyari + + + + 是否确认使用推荐设置? + Onerilen ayarlari kullanmaktan emin misiniz? + + + + 随机码文件为空,不需要导出 + Disa aktarilacak rastgele kod bulunamadi + + + + 随机码文本将展出到U盘,请插入U盘 + Rastgele kod bellege kaydedilecek, lutfen bir bellek takiniz + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + CNT1 mesafesi belirtilen degere ayrilamaz. Bitis degeri %1 ayarlanacak + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + CNT1 mesafesi belirtilen degere ayrilamaz. Bitis degeri %1 ayarlanacak + + + + 1 + + + + + 正在打印第%1组设置,不可删除 + %1 is yazdiriliyor, silinemez + + + + 是否确认删除第%1组设置? + sil %1? + + + + 是否确认删除全部设置? + hepsini sil? + + + + 字体宽度不能为0 + Yazi genisligi 0 olamaz + + + + 是否立即重新计米? + Sayac sifirlamak istiyor musunuz? + + + + 解锁脉冲计数 + Nabiz sayisinin kilidini ac + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + Her hiza gore + + + + 根据喷印 + Her baskiya gore + + + + 根据脉冲数 + Her bir akim +sayaca gore + + + + 根据同步器参数 + Her bir enkoder +verisine gore + + + + 实际皮带速度(毫米/秒): + Konveyor hızı (mm/s): + + + + 实际喷印间隔长度(毫米): + Aralik baskisi (mm): + + + + 长度(毫米): + Uzunluk (mm): + + + + 同步脉冲数 + Senkronizer +Akimi + + + + 同步器直径(毫米): + Senkronizer +Capi (mm): + + + + 脉冲数/转: + Akım Sayisi +(donus) : + + + + 脉冲数修正 + Duzeltme bakliyat + + + + + + + 错误 + Hata + + + + 速度不应该为0 + Hiz sifir olmamali + + + + 实际同步长度不应该为0 + Mevcut senkronizer uzunlugu sifir olmamali + + + + 长度不应该为0 + Uzunluk sifir olmamali + + + + 直径不应该为0 + Cap sifir olmamali + + + + QBarCode + + + Dialog + + + + + 条形码类型 + Bar Tipi + + + + 条形码高度 + Bar +Yuksekligi + + + + 条码宽度 + Bar genisligi + + + + 1点 + 1Dot + + + + 2点 + 2Dot + + + + 3点 + 3Dot + + + + 4点 + 4Dot + + + + + 5点 + 5Dot + + + + 6点 + 6Dot + + + + 文本1 + TEXT1 + + + + 显示缩放 + Skala + + + + 墨水类型 + Murekkep +Tipi + + + + 黑墨 + Siyah Murekkep + + + + 白墨 + Beyaz Murekkep + + + + 文本3 + TEXT3 + + + + 计数器2 + CNT2 + + + + 文本2 + TEXT2 + + + + 计数器1 + CNT1 + + + + 插入文档 + Dokuman icine +aktar + + + + 预览 + Onceki + + + + 返回 + Donus + + + + 条码保存 + Kaydet + + + + FileName + + + + + 增加数字行 + sayı satırı ekle + + + + 日期 + + + + + 时间 + + + + 增加数字行 + sayi satiri ekle + + + + 文件未保存 + Dosya kaydedilmedi + + + + CODE_128 + BARCODE_93 + + + + 自适应编码 + OTO + + + + CODE_93 + + + + + 7点 + 7Dot + + + + 9点 + 9Dot + + + + 12点 + 12Dot + + + + 16点 + 16Dot + + + + 24点 + 24Dot + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + TabGenislik: %1, Yukseklik: %2, Yazi Genisligi : %3 + + + + QObject + + + + 手动设定 + Manuel Mod + + + + 应用 + Uygula + + + + 起始值 + Baslangic degeri + + + + 结束值 + Bitis Degeri + + + + 循环值 + Tekrar degeri + + + + SceneEditOption + + + Form + + + + + 预览 + Onceki + + + + 新建 + Yeni + + + + 打开 + Dosya Ac + + + + + 保存 + Kaydet + + + + 另存为 + Farkli Kaydet + + + + 新增图元 + Yeni Oge + + + + 编辑图元 + Ogeyi +duzenle + + + + 删除图元 + Ogeyi Sil + + + + 放大 + Yakinlas + + + + 缩小 + Uzaklas + + + + 提示 + Oneriler + + + + 文档已经改变,是否保存? + Dosya degisti, kaydetmek istiyor musunuz? + + + + 放弃保存 + Kaydetmeden devam et? + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manuel kontrol + + + 喷嘴逆清洗 + Dokunmatik ekran +ayarlama + + + + 齿轮泵开 + disli pompa acik + + + + 齿轮泵关 + disli pompa kapali + + + + 回收槽开 + Kolektor +Acik + + + + + + + + + + + + + 停止 + Dur + + + + 回收槽关 + Kolektor devre +disi + + + + 回收泵 + Geri donusum +pompasi + + + + + 压缩机 + Kompresor + + + + 主墨泵 + Ana Murekkep +pompasi + + + + 泄压阀 + Baskiyi azaltma +Kapak + + + + 循环阀 + Geri donusum +valfi + + + + 墨水阀 + Murekkep Valfi + + + + 粘度泵 + Vizkozite pompasi + + + + 混合阀 + Karisim +valfi + + + + 时间设置 + Zaman +ayarlama + + + + 从U盘导入配置 + Parametreyi Flash +Diskten lçe Aktar + + + + 更新软件 + Yazici yazilimini guncelle + + + + 屏幕校正 + Dokunmatik ekran +ayarlama + + + + 更新字库 + Font kutuphanesini +guncelle + + + + 导出字库 + Karakter kutuphan- +esinden disa aktar + + + + 系统升级 + Sistem +yukseltme + + + + 出厂设置 + Fabrika ayarlarina + geri don + + + + 自动清洗 + Oto temizlik + + + + 电机测试 + Motor test + + + + 排气 + egzoz + + + + 导出配置到U盘 + Parametreyi Flash Diske Aktar + + + + + + Cancel + lptal + + + + (1/2) Cleaning, please wait... + (1/2) Temizlik, lutfen bekleyin... + + + + + + + + + + + + + + + + + + + + 开 + ile + + + + + + + + + + + + + + + + + + + + + 关 + kapali + + + + + + + + + + + + + + + + + + 警告 + Uyari + + + + + + + 请先移开喷头盖! + Lutfen yazici kafa kapagini acin! + + + + 是否确认进入手动模式? + Manuel Moda gecmek istediginizden emin misiniz? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Kolektorun kapandigini onaylayiniz. Otomatik moda gecmek istediginizden emin misiniz? + + + + + 手动 + Manuel + + + + + + 自动 + Auto + + + + + + + + + + + 启动 + Baslat + + + + + + + + + + + + + + + + + 提示 + Oneriler + + + + + + + 密码不正确! + Yanlis sifre! + + + + Application + Uygulama + + + + 是否确认更新字库? + Font kutuphanesini guncellemek istediginizden emin misiniz? + + + + 没找到对应字库,更新失败! + İlgili yazi tipi kitapligi bulunamadi ve guncelleme basarisiz oldu! + + + + 更新字库成功,重启后生效! + Font kutuphane guncellemesi basarili, uygulamak icin reboot ediniz! + + + 是否恢复出厂设置? + Fabrika ayarlarina geri donmek istediginizden emin misiniz? + + + + 恢复出厂设置成功,请重新关机上电 + Fabrika ayarlarina donuldu, lutfen yeniden baslatiniz + + + + 校准触摸屏 + Ekran kalibrasyonu + + + + 是否确认开始校准程序?请小心进行校准! + Ekran kalibrasyonuna baslamak istediginize emin misiniz? Dikkatli olunuz. + + + + 无法生成脚本 + lslem dokumu hazirlamada hata + + + + 是否确认更新软件? + Yazilimi guncellemek istediginize emin misiniz? + + + + + + + + 错误 + Hata + + + + 更新失败! + Guncelleme basarisiz! + + + + 软件更新成功,重启后生效! + Yazilim guncelleme basarili, lutfen yeniden baslatiniz! + + + + 找不到更新软件! + Guncellenen yazilimi bulamiyor! + + + + 是否确认更新系统? + Sistemi guncellediginizden emin misiniz? + + + + 系统更新成功,重启后生效! + Sistem guncellemesi yeniden baslatildiktan sonra almak etkisine, basarili! + + + + 文件不存在! + Dosya mevcut degil! + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + Eger temizligi baslatirsaniz, geri donusum tanki 10mm'den fazla acilacaktir, 1 dk sonra duracaktir + + + + 开始清洗 + Temizligi baslat + + + + 停止清洗 + Temizligi durdur + + + + 压力 + Basinc + + + + autoclean cancel or status: + autoclean iptal veya durum: + + + + (2/3) Cleaning + (2/3)Temizlik + + + + (3/3) Cleaning + (3/3)Temizlik + + + + 混合阀打开3: + 混合阀打开3. + + + + + 是否确认导出配置到U盘? + Konfigurasyonu flash bellege aktarmak istiyor musunuz? + + + + 检测不到U盘 + Flashdisk algilanamadi + + + + 成功导出配置到U盘 + Konfigurasyon flash bellege basarili bir sekilde aktarildi + + + + 是否确认从U盘导入配置? + Konfigurasyonu flash bellekten aktarmak istiyor musunuz? + + + + 配置文件/udisk/sysPara.bin不存在! + Yapilandirma dosyasi /udisk/sysPara.bin mevcut degil! + + + + 从U盘成功导入配置,重启后生效! + Konfigurasyon ice aktarimi basarili, lutfen yeniden baslatiniz. + + + + autoclean start + otomatik temizleme + + + + 是否确认启动自动清洗? + Oto temizligi baslat? + + + + 是否确认墨水排除,加入清洗剂? + Murekkep bos ve temizlik sivisi eklendi mi? + + + + (1/3) Cleaning + (1/3)Temizlik + + + + 是否确认导出字库到U盘? + Karakter kutuphanesini USB diske aktar? + + + + U盘不可识别! + USB disk algilanamadi! + + + + 字库导出完成! + Karakter kutuphanesi aktarimi tamamlandi! + + + + 是否开始电机测试? + Motor test baslat? + + + + 正在排气,是否停止? + Yorucu, dur mu? + + + + SystemSetting + + + Form + + + + + 晶振电压(%): + KristalVoltaji(%): + + + + 压力: + Basinc: + + + + 高压包容差: + YuksekVoltajToleransi: + + + + 粘度: + Vizkozite: + + + + 回收泵力度(%): + Geri donusum +pompa potansiyeli (%): + + + + 喷头温度: + YaziciKafaSicakligi: + + + + 粘度校正(%): + VizkoAyari(%): + + + + 晶振频率: + KristalFrekansi: + + + + 64K + + + + + 76K + + + + 83K + 24Dot {83K?} + + + + 96K + + + + + 128K + + + + + 新晶振 + YeniKristal + + + + 频率修正: + Frekans Ayarlamasi: + + + + Hz + + + + + 回收槽开关时间: + KolektorDegisimZamani: + + + + 电机电流: + MotorElektrikAkimi: + + + + 信息编辑模式: + Yazi duzenleme modu: + + + + 文本模式 + Matris modu + + + + 点阵模式 + Matris modu + + + + 场景模式 + EkranModu + + + + 粘度泵动作间隔(秒): + VizkoPompasiHareketAraligi(s): + + + + 墨水温度: + MurekkepSicakligi: + + + + °C + + + + + 0 + + + + + 0.6 + + + + + 1.0 + + + + + 1.6 + + + + + 2.0 + + + + + 脉冲计数器: + Nabiz Sayaci: + + + 脉冲计数器: + Nabiz Sayaci: + + + + 隔膜位置偏移: + Diyagram +Otelemesi + + + + 隔膜位置: + Diyagram +pozisyonu: + + + + 风扇开启温度: + + + + + 5 + + + + + 10 + + + + + 15 + + + + + 20 + + + + + 25 + + + + + 30 + + + + + 40 + + + + + 45 + + + + + 50 + + + + + 55 + + + + + 60 + + + + + 重置高压 + Yuksek Voltaj Resetle + + + + 界面语言设置 + Dil ayarlari + + + + 喷嘴逆清洗 + Agizlik Ters +Temizlik + + + + 搜索最佳晶振频率 + Uygun frekans ara + + + + 搜索最佳晶振电压 + Uygun voltaj ara + + + + 应用当前配置 + Uygula + + + + + + + + + + + + 错误 + Hata + + + + 实际频率不能为%1 + Mevcut frekans %1 olamaz + + + + + 提示 + Oneriler + + + + 应用成功 + Basarili uygula + + + + 自动清洗时间约为一分钟,然后自动停止 + Oto temizleme, 1 dk bekleyiniz + + + + 开始清洗 + Temizligi baslat + + + + 停止清洗 + Temizligi durdur + + + + 正在喷嘴逆清洗...... + Nozzlelar temizleniyor… + + + + 清洗完成 + Temizlik tamamlandi + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + + + + 密码不正确! + Yanlis sifre! + + + + + + Application + + + + + 是否更新高压包电流数据? + Donusturucu cikti hattinin elektrik akim verisini guncellemek istiyor musunuz? + + + + + + 喷头盖未关,请先关喷头盖! + Lutfen yazici kafa kapagini kapatin! + + + + + 墨线开关未开,请先打开墨线开关! + Inkjet anahtarini aciniz! + + + + + 回收槽未全部打开! + Kolektor tamamaen acik degil! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + Otomatik aramayi baslatmak istiyor musunuz? Otomatik olarak yapilmasi vakit alabilir, arama sirasinda baska bir islem yapmayiniz? + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + Limit deger 1K Hz icinde kalacak sekilde otomatik aramayi baslatmak istiyor musunuz? Otomatik olarak yapilmasi vakit alabilir? + + + + 搜索的起始频率%1 HZ超出范围? + Arama baslamak icin frekans degeri %1 limit disidir? + + + + 高压设置完成 + Yuksek voltaj ayarlamasi tamamlandi + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Kristal frekansi %1 -- En uzun yuksek level zamanlamasi %2 + + + + 最佳晶振频率完成 + Uygun frekans aramasi tamamlandi + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Kristal voltaj %1 -- En uzun yuksek level zamanlamasi %2 + + + + + 最佳晶振电压完成 + Uygun voltaj aramasi tamamlandi + + + + Tiếng Việt(Vietnamese interface) + + + + + Chinese interface(中文界面) + + + + + English interface(英文界面) + + + + + TextEditOption + + + Form + + + + + 预览 + Onizleme + + + + 新建 + Yeni + + + + + + 保存 + Kaydet + + + + + 另存为 + Farkli +kaydet + + + + 文件 + Dosya + + + + 插变量 + Degisken +Tipi + + + + 间距 + Bosluk + + + + 字体 + yazi + + + + wenquanyi + + + + + 12 + + + + + 点 + dot + + + + 粗体 + Bold + + + + + + + + + 警告 + Uyari + + + + + + + 无法打开文件 + Dosya acilamiyor + + + + + Application + + + + + + 是否确认将文件内容追加到打开的文件? + Acilmis dosyayi icerige eklemeyi onayla? + + + + 插入图片 + Ekle +Desen + + + + 插入文本 + Ekle +Metin + + + + 错误 + Hata + + + + TextEditOption 构造函数参数textEdit 不应当为空 + YaziDuzenleme yapim parametreleri YaziDuzenle bos olamaz + + + + 打开文件 + Dosya ac + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + .txt formatinda kaydetmek mumkun degil. .html olarak kaydetmek ister misiniz? + + + + 提醒 + Geriye kalan + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Patern %1 flash-bellekten aktariliyor. Yerel diske kaydetmek ister misiniz? + + + + 无法保存文件 + Dosya kaydedilemiyor + + + + 保存... + Kaydet… + + + + 提示 + Oneriler + + + + 文档已经改变,是否保存? + Dosya degisti, kaydetmek istiyor musunuz? + + + + 放弃保存 + Kaydedilenleri terket + + + + 二维码变量设置 + QR degisken duzenle + + + + 完成 + OK + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Saniye: + + + + 分: + Dakika: + + + + 月: + Ay: + + + + 日: + Gun: + + + + 时: + Saat: + + + + 年: + Yil: + + + + 设置时间 + Zaman ayarlama + + + + TriggerCtrl + + + Form + + + + + 触发模式 + Tetik Modu + + + + 光电电平触发 + Elektrik sinyali +tetikleme + + + + 光电边沿触发 + OptikGoz +Tetikleme + + + + 同步器触发 + Senkronizer +tetikleme + + + + 延时触发 + Gecikmeli +tetikleme + + + + 脉冲数/毫米 + Sinyal/ +milimetre + + + + 喷印间隔(毫米) + Bosluk +genisligi(mm) + + + + 脉冲信号值: + Darbe sinyali degeri: + + + + 同步喷印模式 + Senkronizer +modu + + + + 按字符宽度 + her font genisliginde + + + + 按喷印比例 + her oranda + + + + 字符宽度: + karakter +genisligi: + + + + 重复次数 + Tekrarlama +zamani: + + + + + + + + 重复间隔(毫秒) + Tetikleme gecikmesi(ms) + + + + + + + 触发延时(毫秒) + Tetikleme +gecikmesi (ms) + + + + 间隔模式: + aralik modu + + + + 行末<->行首 + sondan basa + + + + 行首<->行首 + bastan sona + + + + 产生脉冲所需计数: + sinyal basi say: + + + + + + + 延时(毫秒): + gecikme(ms): + + + + 同步打印 + Senkronizer +aktif + + + + 同步器清零 + Senkronizer +sifirlama sayaci + + + + 脉冲数修正 + Sinyal dogrulama + + + + 脉冲输出使能 + Sinyal cikisi +aktif + + + + 禁止电眼清零 + Fotosel sifirlama + + + + 允许电眼复位 + Fotosel resetlemesine izin ver + + + + 允许电眼立即复位 + Fotosel resetlemesine simdi izin ver + + + + + 封锁时间(毫秒) + Kitleme- +Zamani(ms) + + + + 电眼清零 + Fotoselsifir- +lamasayaci + + + + 镜像交替间隔 + Alternatif +Aynala + + + + 镜象交替类型 + Ayna modu + + + + 无镜像打印 + Aynalama yok + + + + 自动水平翻转 + Oto uzerine cevirme + + + + 自动垂直翻转 + oto dikey cevirme + + + + 中心对称旋转 + merkezi cevirme + + + + 同步器正反转打印 + Enkoder daima gecerli + + + + 同步器只正转打印 + enkoder sadece ileri gecerli + + + + 同步器只反转打印 + enkoder sadece terse gecerli + + + + 20131228-1 + + + + + 应用当前配置 + Uygula + + + + 独立参数 + bagimsiz parametreler + + + + + + + 触发延时(毫米) + Tetikleme gecikmesi (ms) + + + + + + 重复间隔(毫米) + Tekrarlama boslugu(mm) + + + + + 封锁间隔(毫米) + Kilit boslugu (mm) + + + + + + + 延时(毫米): + Gecikme (mm): + + + + 字符宽度 + karakter genisligi + + + + 喷印比例(%) + Baski skalasi(%) + + + 提示:参数不正确 + Ipucu: Parametre yanlis + + + 要求:触发长度小于喷印间隔 + Gereksinim: Tetik uzunlugu, yazdirma araligindan daha kisa + + + + 提示 + oneriler + + + + 应用成功 + Basarili bir sekilde uygulandi + + + + 封锁间隔(毫秒) + Blok Araligi (ms) + + + + ZkEdit + + + Form + + + + + 编辑图案 + Patern duzenle + + + + 缩小 + Uzaklas + + + + 放大 + Yakinlas + + + + 宽度 + Genislik + + + + 新建 + Yeni Dosya + + + + 高度 + Yukseklik + + + + + + 保存 + Kaydet + + + + 保存为 + Farkli kaydet + + + + 打开 + Dosya Ac + + + + 导入 + Yukle + + + + A + + + + + 图像扩张 + Goruntu genisletme + + + + 图像裁剪 + Goruntu kirpma + + + + 提示 + Oneri + + + + 图片已经改变,是否保存? + Patern degisti, kaydetmek istiyor musunuz? + + + + 放弃保存 + Kaydedilenleri terket + + + + + + 放大倍数:%1 + duzenleme: %1 + + + + 图片另存为... + Farkli kaydet... + + + + 另存为 + Farkli kaydet + + + + 打开文件 + Dosya Ac + + + + 图片保存为... + Suraya kaydet... + + + + 导入文件 + Onemli dosya + + + + dlgDrawInit + + + 图案参数设置 + Patern parametre ayarlari + + + + 图案宽度(像素) + Patern yuksekligi (pixel) + + + + 图案高度(像素) + Patern genisligi (pixel) + + + + 确定 + Onayla + + + + dlgQrCode + + + Dialog + Diyalog + + + + + TextLabel + TextLabel + + + + 计数器(变量) + CNT(VAR) + + + + 自动刷新 + Oto-Goster + + + + 插入文档 + Dokuman icine aktar + + + + 信息前缀 + Yazi + + + + 变量(初值) + Akim sayaci + + + + 信息后缀 + Suffix-Yazi + + + + 返回 + Geri don + + + + DataMatrix + Veri matrisi + + + + QRCode + QR kod + + + + 保存 + Kaydet + + + + 预览 + Onceki + + + + 正相打印 + Normalbaski + + + + 反相打印 + RP-Baski + + + + 变量增量 + Artirim + + + + 条形码 + Barkod + + + + 默认 + varsayilan + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + DM boyutu: + + + + 自动插入时间 + + + + + 警告 + Uyari + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + Giris icerigi, secilen DM kodunun boyutunu asiyor, lutfen daha buyuk bir boyut secin! + + + + [%1 X %2] + [%1 X %2] + + + + logo_Form + + + Form + Form + + + + zkWidget + + + + 警告 + Uyari + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maksimum boyut genisligi %1 x Yuksekligi %2, mevcut talep %3 x %4 + + + + 请新创建建图片 + Lutfen yeni bir temel dosya seciniz + + + diff --git a/vena.qm b/vena.qm new file mode 100644 index 0000000..c5d8a5a Binary files /dev/null and b/vena.qm differ diff --git a/vena.ts b/vena.ts new file mode 100644 index 0000000..80ee690 --- /dev/null +++ b/vena.ts @@ -0,0 +1,8426 @@ + + + +UTF-8 + + DacDisplayAndEdit + + 墨点 + InkDot + + + 点距电压系数调整,该参数仅代表电压比例关系,不是电压实际值。 + This is PROPORTIONAL index of voltage, NOT actual voltage. + + + 默认值 + Default + + + 编辑 + Edit + + + 是 + YES + + + 否 + NO + + + 完成 + OK + + + 是否将点距微调参数设置为默认值? + adjust the pitch parameter is set to the default value? + + + 提示 + Tips + + + %1 + %1 + + + + DevOp + + + 字高超出范围 + + + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + + + 错误 + Error + + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + + + + + + 警告 + Warnning + + + 无法打开设备 + Unable to open the device + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + lines:% 1 redundant Points:% 2, redundant points too manny, +please modify your configuration!! + + + + + Warnning + + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + The parameters of Ignition-Coil are not initialized! + + + + DialogAuthorization + + + Dialog + + + + + 授权密码: + Password: + + + + 输入密码 + 提升授权 + Authorized setting + + + 取消授权 + Deauthorize + + + + DialogCycleprint + + + Dialog + + + + + 1循环范围:0- + + + + + 1循环次数: + + + + + 2循环范围:0- + + + + + 2循环次数: + + + + + 3循环范围:0- + + + + + 3循环次数: + + + + + 6循环次数: + + + + + 6循环范围:0- + + + + + 5循环范围:0- + + + + + 5循环次数: + + + + + 4循环范围:0- + + + + + 4循环次数: + + + + + DialogFileOperation + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 删除文件 + Delete + + + + 删除全部 + DeleteAll + + + + 从U盘导入 + ImportFromFlashDisk + + + + 导出到U盘 + OutportToFlashDisk + + + + 插入 + InsertFile + + + + 打开文件 + OpenFile + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 退出 + Exit + + + + 文件操作 + File Operation + + + + + + 警告 + Warnning + + + + 是否确认删除当前文件? + Delete present file? + + + + 是否确认删除所有文件? + Delete all files? + + + + + + + 提示 + Tips + + + + 是否确认从U盘导入所有文件? + Import all files from flashdisk ? + + + + mv %1/VoltParaHi.bin %1/VoltParaStd.bin %2/ + + + + + cp %1/* %2/ + cp %1/* %2/ + + + + 成功从U盘导入? + Import from flashdisk suceess ? + + + + 是否确认将所有文件导出到U盘? + Export all files to flashdisk ? + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogFontSize + + + Dialog + + + + + 9点(英) + 9 Matrix + + + + 24点(中/英) + 24 Matrix + + + + 7点(左横) + + + + + 7点(右横) + + + + + 9点(左横) + + + + + 9点(右横) + + + + + 7点(孟加拉) + + + + + 32点 + 24Dot {83K?} {32点?} + + + + 7点(rf7) + 7点(数字) + + + + + 21点(rf21) + + + + + 12点(新罗马) + + + + + 123456890ABCDEFGWXYZ + + + + + - + + + + + 查字库标识 + + + + + 16点(中/英) + 16 Matrix + + + + 5点(英) + 5 Matrix + + + + 12点(中/英) + 12 Matrix + + + + 7点(英) + 7 Matrix + + + + 选择字体大小 + Choose font size + + + + DialogInputTxt + + + Dialog + + + + + DialogInsertVari + + + Dialog + + + + 二维码: + QRCode + + + + 变量类型 + VariableType + + + + 日 + Day + + + + 秒 + Second + + + + 分 + Minute + + + 变量1 + Counter 1 + + + + 月 + Month + + + + 周 + Week + + + + 时 + Hour + + + + 年 + Year + + + 变量2 + Counter 2 + + + + DataMatrix + + + + + QRCode + + + + + BarCode128 + + + + + 计数器1 + + + + + 计数器2 + + + + + 随机码1 + + + + + 有效日期 + + + + + 生产日期 + + + + + Class + + + + + 计数器3 + + + + + 数字个数 + Digit Number + + + + 9个 + 24Dot {9个?} + + + + 11个 + 24Dot {11个?} + + + + 10个 + 24Dot {10个?} + + + + 3个 + 3 + + + + 6个 + 6 + + + + 12个 + 24Dot {12个?} + + + + 13个 + 24Dot {13个?} + + + + 14个 + 24Dot {14个?} + + + + 15个 + 24Dot {15个?} + + + + 5个 + 5 + + + + 8个 + 8 + + + + 2个 + 2 + + + + 7个 + 7 + + + + 4个 + 4 + + + + 1个 + 1 + + + + 变量插入 + Insert Variable + + + + DialogLineSpace + + + Dialog + + + + + + 0个像素 + 0 pixel + + + + + 1个像素 + 1 pixel + + + + + 2个像素 + 2 pixel + + + + + 3个像素 + 3 pixel + + + + 4个像素 + 4 pixel + + + + 5个像素 + 5 pixel + + + + 6个像素 + 6 pixel + + + + 7个像素 + 7 pixel + + + + 行间距: + LineSpacing: + + + + 字符间距: + CharacterPitch: + + + + 选择行间距和字符间距 + Choose intevel between lines and characters + + + + DialogPointDistanceAdjust + + + Dialog + + + + + 列首: + FirstColumn: + + + + 列中: + MidColumn: + + + + 列尾: + EndColumn: + + + + 重置 + Reset + + + + 测试 + Test + + + + DialogSaveFile + + + Dialog + + + + + 本地文件 + LocalFiles + + + + U盘文件 + FlashDiskFiles + + + + 预览文件内容: + Preview: + + + + 上一个 + Previous + + + + 下一个 + Next + + + + 请输入文件名: + File Name: + + + + 取消 + Cancel + + + + + 保存 + Save + + + + 警告 + Warnning + + + + U盘未插入或U盘根目录下的doc文件夹不存在! + The flash disk was not found, or the folder ‘doc’ under disk root directory does not exist ! + + + + DialogShowCounter + + + Dialog + + + + + 米标显示: + + + + + 目前循环范围: + + + + + + + 米 + + + + + 剩余米数: + + + + + 循环次数: + + + + + 立即重新计米 + ResetCounterNow + + + + 起始: + + + + + 结束: + + + + + Dialoginputpasswd + + + Dialog + + + + + 修改密码: + + + + + Dialogmodifypasswd + + + Dialog + + + + + 修改密码: + + + + + 密码授权 + + + + + DigitalInput + + + Form + + + + + 9 + + + + + 3 + + + + + 8 + + + + + - + + + + + 退格 + Backspace + + + + 1 + + + + + 4 + + + + + 0 + + + + + 5 + + + + + 7 + + + + + 2 + + + + + 6 + + + + + 全选 + SelectAll + + + + DlgInputAddr + + + Dialog + + + + + 请输入6位机编号(前3位为经销商编号) + Please enter the six-number (the former number three of the dealer) + + + + PowerOnCnt + + + + + PrintDotCnt + + + + + PowerMax + + + + + PrintMax + PrintMax + + + + 开始时间 + StartDate + + + + 结束时间 + EndDate + + + + SuperNodeIP: + + + + + edgeIP: + + + + + + + + + + . + + + + 机器很长时间没有进行保养了!请联系厂家进行保养! + It’s been a long time since last maintenance, please contact supplier for routine maintenance !! + + + 请使用原厂家提供的墨水! + Use original ink is strongly recommended! + + + 累计工作时间(分钟): + Total working time(min): + + + 累计墨水用量: + Total ink cost: + + + 警告 + Warnning + + + 无法打开文件 + Cannot open file + + + + 喷码机恢复工作! + InkJet Back to Work! + + + + Mac:%1维护时间剩余 + 维护时间剩余 + + + + + 小时,喷码机将停止工作.请与供应商联系! + + + + + Mac:%1维护时间已到,喷码机停止工作!请与供应商联系 + 维护时间已到,喷码机停止工作!请与供应商联系 + + + + 喷码机维护时间已到,请148小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! {148小?} + + + 喷码机维护时间已到,请48小时内与厂家联系! + InkJet Servicing is timeout,Please contacted with manufacturer in 48 hours! + + + + + 当前日期: + CurDate: + + + + + 正确? + Correct? + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + DlgMutiLanguage + + + 界面语言设置 + + + + + 中文 + Chinese + + + + 英语 + + + + + 土耳其语 + + + + + 西班牙语 + + + + + 泰语 + + + + + (注意: 选择切换显示语言, 重启后才能生效) + + + + 警告 + Warnning + + + + DlgMyWarring + + + 警告 + Warnning + + + + 确定 + Confirm + + + + TextLabel + + + + + DlgSelectInputLanguage + + + Dialog + + + + + 汉语(Chinese) + + + + + 英语(English) + + + + + 越南语(Vietnam) + + + + + DlgShowMsg + + + 警告 + Warnning + + + + 确定 + Confirm + + + + DlgVarLength + + + 变长喷印参数 + + + + + 头部长度(m) + + + + + 尾部长度(m) + + + + + + 调整长度(mm) + + + + + 总长(m) + + + + + 确定 + Confirm + + + + 可变长度允许 + + + + + InkJetPrinter + + + TabWidget + + + + + 主窗口 + MainWindow + + + + 图案编辑 + PictureEdit + + + + 打印设置 + PrintSetup + + + + + 系统设置 + SystemSetup + + + + + 其他信息 + Others + + + + + 网络管理 + + + + + 电压调整 + + + + + Save + + + + + 不连续电压 + + + + + + vol0 + + + + + + vol1 + + + + + + vol2 + + + + + + vol3 + + + + + + vol4 + + + + + + vol5 + + + + + + vol6 + + + + + + vol7 + + + + + + vol8 + + + + + + vol9 + + + + + + vol10 + + + + + + vol11 + + + + + + vol12 + + + + + + vol13 + + + + + + vol14 + + + + + + vol15 + + + + + + vol16 + + + + + + vol17 + + + + + + vol18 + + + + + + vol19 + + + + + + vol20 + + + + + + vol21 + + + + + + vol22 + + + + + + vol23 + + + + + + vol24 + + + + + + vol25 + + + + + + vol26 + + + + + + vol27 + + + + + + vol28 + + + + + + vol29 + + + + + + vol30 + + + + + + vol31 + + + + + + vol32 + + + + + + vol33 + + + + + + vol34 + + + + + + vol35 + + + + + + vol36 + + + + + + vol37 + + + + + + vol38 + + + + + + vol39 + + + + + 连续电压 + + + + + 满列电压 + + + + + fvol0 + + + + + fvol1 + + + + + fvol2 + + + + + fvol3 + + + + + fvol4 + + + + + fvol5 + + + + + fvol6 + + + + + fvol7 + + + + + fvol8 + + + + + fvol9 + + + + + fvol10 + + + + + fvol11 + + + + + fvol12 + + + + + fvol13 + + + + + fvol14 + + + + + fvol15 + + + + + fvol16 + + + + + fvol17 + + + + + fvol18 + + + + + fvol19 + + + + + fvol20 + + + + + fvol21 + + + + + fvol22 + + + + + fvol23 + + + + + fvol24 + + + + + fvol25 + + + + + fvol26 + + + + + fvol27 + + + + + fvol28 + + + + + fvol29 + + + + + fvol30 + + + + + fvol31 + + + + + fvol32 + + + + + fvol33 + + + + + fvol34 + + + + + fvol35 + + + + + fvol36 + + + + + fvol37 + + + + + fvol38 + + + + + fvol39 + + + + + 其他调整 + + + + + 整体缩放(%) : + + + + + WriteByte + + + + + ReadByte + + + + + + + Address: + + + + + + Value: + + + + + WriteWord + + + + + ReadWord + + + + + ReadDword + + + + + WriteDword + + + + + ValueH: + + + + + ValueL: + + + + + + + 信息编辑 + EditText + + + + 触发设置 + TriggerSetup + + + + + 系统管理 + SystemManage + + + + + 日志信息 + LogInfo + + + + 定时开机循环完成,准备关机 + + + + + 准备关机 + + + + + 与FPGA失去通信!!! + Lose contact with FPGA ! + + + + 与FPGA通信恢复正常 + The contact with FPGA recovered + + + + 开始自检,请等待60秒............... + POST,Wait for 60 s...... + + + + 开始自检,请等待%1秒............... + POST,Wait for %1 s ...... + + + + + 自检完成!!! + Self-checking done ! + + + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + 压力波动超过设定的5个值. + + + + + 停止打印,自动关闭高压. + + + + + 压力异常:上次压力值%1,当前压力值%2 + + + + + 高压异常:上次电流值%1,当前电流值%2 + + + + + + 错误!粘度计下位灯故障. + Error! Viscometer inferior lamp failure. + + + + + 错误!粘度计故障:检测不到上位灯. + Error:Viscometer fault! the upper lamp is not detected. + + + + 混合阀打开2: + + + + + 粘度检测异常,粘度值太大!!! + The viscosity anomaly detection, viscosity too high!!! + + + + 提示 + Tips + + + + 是否接收新的信息! + + + + + + 错误!!!!!!!!!!!粘度偏大故障 + Error! Viscosity larger fault + + + + 定时开机 + + + + + + 压力泄漏或压力传感器故障! + + + + + 运行中压力泄漏,停齿轮泵! + + + + + + 测试时间结束,准备关机 + + + + + + 齿轮泵转速过高,请立即停机并联系供应商! + + + + + + 齿轮泵转速过高,请清理过滤器或者检查是否泄露! + + + + + 粘度过大,可能是粘度传感器或粘度计损坏,请联系厂家! + + + + + 混合阀打开1: + + + + + + 警告!!!!!!!!!!!粘度值偏低 + Warning! Low viscosity + + + 正在开墨线..... + InkLine Openning...... + + + 回收泵全速开 + ReclaimPump ON + + + 粘度泵开 + ViscosityPump ON + + + 循环阀开 + CycleValve ON + + + 墨线阀开 + InkLineValve ON + + + 清洗阀开 + CleanValve ON + + + 清洗阀关 + CleanValve OFF + + + 墨线阀关 + InkLineValve OFF + + + 粘度泵关 + ViscosityPump OFF + + + 供墨阀开 + InkValve ON + + + 正常开墨线状态,请等待%1秒 + InkLine Raedy,Please wait %1 s + + + 循环阀关 + CycleValve OFF + + + 开晶振电压,正在检测相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 正在测试相位,请等待%1秒 + Is testing phase, please wait for %1 s + + + 相位检测正常,开启高压 + Phase Ready + + + 相位检测异常 + Phase error + + + 开墨线完成 + InkLine Open Complete + + + 开墨线完成,可以打印! + InkLine Ready,You Can To Print Now + + + 正在关闭墨线 + Closing InkLine..... + + + 回收泵变全压运行 + ReclaimPump ON + + + 清洗阀点动%1次 + CleanValve work %1 times + + + 循环阀开,请等待%1s + CycleValve on,please wait for %1 s + + + 关回收泵 + ReclaimPump OFF + + + %1秒后关回收泵 + Wait %1s and ReclaimPump OFF + + + 可以关机断电 + InkJet can Shoutdown + + + 正在关机..... + Shutdown ...... + + + 正在快速开墨线..... + Is InkLine Openning ...... + + + 打开晶振电压 + OscillatorVoltage ON + + + 5秒后打开晶振电压 + crystals voltage on after 5s + + + 开晶振电压,正在检测相位,请等待%1s + is phase testting, please wait for %1 s + + + 快速开墨线完成 + InkLine Open Finish + + + 快速开墨线完成,可以打印! + InkLine Open Finish + + + 正在快速关闭墨线 + Is InkLine OFF ...... + + + 回收泵关 + ReclaimPump OFF + + + 回收泵变全速运行 + ReclaimPump On + + + 回收泵全速运行 + ReclaimPump ON + + + 回收泵全速运行,请等待%1秒 + Is ReclaimPump On, Wait %1s + + + 快速关闭墨线完成 + Complete the quick closing InkLine + + + 警告 + Warnning + + + + 喷印速度过快或间隔太短!无法喷印完全,自动暂停喷印!!! + Speed is too fast or interval is too short! Unable to print all, stop print now!!! + + + + 喷印速度过快或间隔太短!无法喷印完全!!! + Speed is too fast or interval is too short! Unable to print all char!!! + + + + 喷印速度过快!无法喷印完全,自动暂停喷印!!! + Jetting overspeed ! Cannot print all content. +Printing paused automatically! + + + 打开文件出错次数超多3次,自动清除默认喷印文件. + Automatically clear the default file because openFile error. + + + 非法关机次数过多,自动清除默认喷印文件. + Automatically clear the default file because illegal shutdown. + + + 上次出现非法关机. + Illegal shutdown Last time. + + + 自动循环中,请等待%1秒............... + Is AutoCyclling ,Wait %1s...... + + + 自动循环完成!!! + Auto Cycle finish!!! + + + 正在自检,请等待%1秒............... + Is InkJet Testting, Wait %1 s...... + + + 供墨阀关 + InkValve OFF + + + + 喷印速度过快!无法喷印完全!!! + Jetting overspeed ! Cannot print all content! + + + + 警告:加热器长时间无法达到预期温度,故障或设置错误! + Warning: The heater cannot reach pre-set temperature, +it may caused by fault or setting mistake ! + + + + + 错误!!!!!!!!!!!主墨泵故障 + Wrong!!! Main ink pump fault + + + + + 主墨泵故障!!! + Main ink pump fault! + + + + 错误!!!!!!!!!!!压缩机故障 + Wrong!!! Compressor fault + + + + 压缩机故障!!! + Compressor fault ! + + + 错误!!!!!!!!!!!粘度计故障 + Wrong!!! Viscosimeter fault + + + 错误!!!!!!!!!!!粘度故障 + Wrong!!! Viscosity fault + + + + + + 电机故障 + Motor fault + + + + 电机故障!!! + Motor fault ! + + + + + 回收槽到头 + Collector reaches the end + + + + + + + 回收槽卡住或者回收槽开关时间设置错误 + Collector seized, or the collector's switch time was setted in wrong + + + + InputMethod + + + Form + + + + + 1 书 + + + + + 2 输 + + + + + 3 数 + + + + + 4 属 + + + + + 5 熟 + + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 退格 + BackSpace + + + + Shift + Shift + + + + q + + + + + w + + + + + e + + + + + r + + + + + t + + + + + y + + + + + u + + + + + i + + + + + o + + + + + p + + + + + \ + + + + + + 英文 + English + + + + + 大写 + Caps +LOCK + + + + a + + + + + s + + + + + d + + + + + f + + + + + g + + + + + h + + + + + j + + + + + k + + + + + l + + + + + ; + + + + + ' + + + + + Enter + + + + + 删除 + Delete + + + + z + + + + + x + + + + + c + + + + + v + + + + + b + + + + + n + + + + + m + + + + + 上 + UP + + + + 行首 + Home + + + + 行尾 + End + + + + 左 + Left + + + + 下 + Down + + + + 右 + Right + + + + ` + ~ + + + + + 1 + ! + + + + + 2 + @ + + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + ^ + + + + + 7 + & + + + + + 8 + * + + + + + 9 + ( + + + + + 0 + ) + + + + + - + _ + + + + + = + + + + + + + 隐藏 + Hide + + + + [ + { + + + + + ] + } + + + + + , + < + + + + + . + > + + + + + / + ? + + + + + 特殊字 + Special +Char + + + + Ctrl + Ctrl + + + + warning + Warning + + + + myInputMethod is null + + myInputMethod is null + + + + + 错误 + Error + + + + hanziDisplayLabels缺少初始化 + DisplayLabel not init + + + + 找不到输入法初始化文件 + The initialization file of typewriting was not found + + + + 小写 + Caps +LOCK + + + 中文 + Chinese + + + + Tiếng Việt + + + + + Russian + + + + + Japanese + + + + + 全选 + SelectAll + + + + 复制 + Copy + + + + 粘贴 + Paste + + + + 剪切 + Cut + + + + 后退 + Back + + + + InsertSpaceNumDialog + + + 插入空格数 + Insert Spaces + + + + 空格个数: + Number: + + + + LogInfo + + + Form + + + + + 当前状态 + Current Status + + + + 清空当前状态 + Clear Status + + + + 历史状态 + Historical Status + + + + 删除历史文件 + Delete Historical Files + + + + 打开历史文件 + Open Historical File + + + + TextLabel + + + + + 导出日志到U盘 + + + + + 版本信息 + 调试信息 + Version Info + + + + 请先打开历史状态文件! + Open state file at first! + + + + + + 警告 + Warnning + + + + + + 无法打开文件 + Cannot open file + + + + + + + 提示 + Tips + + + + 是否确认将所有日志文件导出到U盘? + + + + + 成功导出到U盘? + Export to flashdisk success ? + + + + 选择历史记录文件 + Choose record file + + + + 是否确认将历史日志文件全部清除? + + + + + 是否确认将当前日志全部清除? + + + + + MainWindow + + + InkJet + + + + + 编辑 + Edit + + + + 条形码 + BarCode + + + + 二维码 + QRCode + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 获取数据 + + + + + 交替打印文件名 + Alternate printing file name + + + + 最大:[40行x 2048列] + + + + + 同步器速度 + SPEED + + + + 当前时间 + Time + + + + 墨线开关 + Inkjet +Switch + + + + 喷头盖开 + Cover +Open + + + + 高压包 + 晶振电压 + + + + + 粘度 + + + + + 压力 + + + + + + 隔膜位置 + + + + + 紧急停机 + + + + 启动 + Start + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + 墨水泄漏 + InkLeak +Fault + + + + 墨水液位 + InkLevel +Fault + + + + 溶剂液位 + Solvent +Level + + + + 粘度故障 + Viscosity +Fault + + + + 相位故障 + Phase +Fault + + + + 高压故障 + HighVolt +Fault + + + + 故障恢复 + Fault +Reset + + + + 立即重新计米 + ResetCounterNow + + + + 产品总计数 + Grand Total + + + + + 暂停打印 +停止高压 + + + + + 泵启动 + + + + + 回收故障 + Recycle +Fault + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt; vertical-align:bottom;"><br /></p></body></html> + + + + + 墨水缸满 + Inkstand +Full + + + + 产品计数 + Product Count + + + + 关机 + Power +OFF + + + + 2014-08-23 + 1 {2014-08-23?} + + + + + + + 开 + Collector +Open + + + + + + + 关 + Collector +Off + + + + 交替打印 + AltPrint + + + 编辑文件 + Edit File + + + + 打开文件 + OpenFile + + + + + + 正在喷印............... + Printing... + + + 喷头盖开,喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + + + 高压故障,暂停打印 + High voltage failure, printing was paused + + + 墨水或溶剂空,准备关机 + Ink or solvent empty, prepare shutdown + + + + + + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, Turn OFF collector and inkLine + + + 回收故障,关闭回收槽,关墨线 + Recycle fault, turn collector and ink-jet off + + + 维护时间已到喷码机停止工作 + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,暂停打印 + Phase fault, printing was paused + + + + 相位故障,屏蔽DAC输出 + Phase fault, DAC export was shield + + + + + 相位故障,屏蔽充电 + Phase fault, charging was shield + + + 开墨线 + OPEN + + + 关墨线 + CLOSE + + + 墨线状态 + INKLINE + + + 喷 嘴 +逆清洗 + nozzles +Clean + + + + + 机箱: + CASE: + + + 正在喷印...... + Printting...... + + + 墨线正常,可以喷印. + InkLine ready to print. + + + 墨线正常. + InkLine Ready. + + + + 喷头盖开, 喷印无法正常进行!!! + Cannot print while printhead cover is open ! + + + %1.%2[%3.%4] 米/秒 + %1.%2[%3.%4] m/s + + + 高压故障,快速关墨线 + high voltage error, closing now. + + + 维护时间已到,喷码机将停止工作! + The maintenance time has come,Inkjet printer stop working! + + + 相位故障,FPGA自动关高压. + phase error,FPGA turnoff the high voltage. + + + + 高压故障,关回收槽 + HighVoltFault,ReclainTank auto Colse + + + + 高压故障,关回收槽和墨线 + HighVoltFault,ReclainTank auto Colse + + + + 回收故障. + + + + + 回收异常,墨线可能偏离.(%1) + + + + + 维护时间已到,喷码机停止工作! + The maintenance time has come,Inkjet printer stop working! + + + + + + 相位故障,准备关机 + Phase Fault, ShoutDown Now + + + + 电眼交替 + + + + %1.%2[%3.%4]米/秒 + %1.%2[%3.%4]m/s + + + + 列延时:%1点 + Column interval: %1 pixel + + + + + + + + + + + + + + + 警告 + Warnning + + + + 无法打开文件 + Cannot open file + + + + 打开文件: + Open file: + + + + + + 提示 + Tips + + + + 文件未保存,是否先保存文件! + File not save,please save it Now! + + + + + + + 变量数大于8个,某些变量将不起作用!!! + + + + + + 请减少信息中的变量(或计数器)数量. + + + + + warning,界面上有变量未显示完全 + Warning,Interface shows not all variables + + + + + + + [ %1行 x %2列 ] + %1 row x %2 column + + + + + + + + 错误 + Error + + + + 喷印间隔过短,应高于%1! + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + + 继续打印 +保持高压 + + + + + 正在排气 ............... + + + + + 泵停止 + + + + + + 最多支持的列数目为:%1请减小信息长度. + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'wenquanyi'; font-size:10pt;"><br /></p></body></html> + + + + + 获取DM码内容为空! + + + + + + 获取DM码内容: + + + + + + 获取DM码内容跟上次相同 + + + + + 高压故障:两高压偏转板间的电压检测异常 + + + + + 1.高压偏转板和高压底座潮湿、脏污,请清洗并吹干高压板和高压底座; + + + + + 2.机器更换主板或者高压包,请进入“系统设置”点击“重置高压”,字高设置为90时,重置高压报警值应在480—550之间; + + + + + 3.高压线路漏电,请更换高压线路; + + + + + 4.高压底座漏电,请更换高压底座。 + + + + + 墨水过多:墨水溢出 + + + + + 1. 请停止添加墨水; + + + + + 2. 请排出多余墨水。 + + + + + 墨水液位:墨水即将耗尽 + + + + + 1. 墨水耗尽,3小时后将自动关机,请及时添加墨水。 + + + + + 回收故障:未检测到有墨水回收 + + + + + 1. 墨水未射入回收管,请修正墨线方向; + + + + + 2. 墨水粘度太低,请更换新墨水; + + + + + 3. 回收管堵塞,请清通或者更换回收管; + + + + + 4. 回收泵故障,请清洗或者更换回收泵; + + + + + 5. 确认各参数及设备无异常后请进入“打印设置”取消“回收故障处理”的勾选,退回主窗口界面点击“故障恢复”按钮. + + + + + 溶剂液位:溶剂即将耗尽 + + + + + 1. 溶剂耗尽,3小时后将自动关机,请及时添加溶剂。 + + + + + + 粘度故障报警 + + + + + 粘度故障:墨水粘度无法自动调整 + + + + + 1. 混合阀失灵,请冲洗或者更换混合阀; + + + + + 2. 墨水罐内的墨水异常,请更换新墨水; + + + + + 粘度计异常: + + + + + 1. 泵前过滤网堵塞,请更换泵前滤网; + + + + + 2. 粘度泵异常,请清洗或更换粘度泵; + + + + + 3. 粘度传感器异常,请检查传感器线路或者更换传感器. + + + + + 相位故障报警 + + + + + 相位故障:相位信号检测异常 + + + + + 1. 墨水分裂不正常,请调整墨水分裂; + + + + + 2. 充电槽或者相检头脏污,请清洗充电槽和相检头; + + + + + 3. 放大板功能性异常,请更换放大板; + + + + + 4. 相检头和墨线的距离过远,请检测喷头活动机构,调整相检头和墨线间的距离; + + + + + 5. 地线未接或者外界干扰,请连接地线或者隔离外界干扰; + + + + + 6. 墨水质量异常,请更换新墨水。 + + + + + 回收槽开关检测完成! + + + + 墨线未开,请先开墨线! + InkLine is Close,Please Open it! + + + + 墨线未开,请先开墨线开关! + Please turn on the inkjet switch ! + + + + 正在加高压... + + + + + 当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度 + Present total column number is %1, system support total column number is %2, please reduce the length of character string + + + 有效打印区域 %1行 x %2 列 + Effective print area %1 row x %2 column + + + 打印耗时 %1.%2 毫秒 /次 + Print time %1.%2 ms/time + + + + 打印耗时 %1ms ,触发间隔 :%2ms ,触发间隔至少应当大于打印耗时3ms + Print time: %1ms, trigger interval: %2ms, trigger interval must be greater than print time, and the gap should not less than 3ms + + + + 同步目标每列有%1.%2个同步脉冲 + Each column of synchronized targe has %1.%2 synchronizing pulse + + + + + + 开始打印 + Print start + + + + 回收槽未到底!!!!!! + Collector does not return to the end ! + + + + + 暂停喷印............... + Pause printing... + + + + + 墨水缸满报警 + + + + + + 墨水液位报警 + + + + + + 溶剂液位报警 + + + + + + 高压故障,暂停打印. + + + + + 相位故障:飞行时间错误! + + + + + 相位故障:相位检测错误! + + + + + 齿轮泵转速 + + + + + %1.%2[%3.%4]米/分 + + + + + 停止打印 + Stop printing + + + + + 随机码文本将展出到U盘,请插入U盘 + + + + + 暂停打印 + Print paused + + + + 继续打印 + Continue printing + + + 请切换为自动状态,再继续操作! + Please switch to automatic state, to continue the operation! + + + 打开墨线 + InkLine OPEN + + + + + 回收槽之前发生阻塞或回收槽时间设置错误,是否强制将当前位置设为到顶位置? + Collector blocked or recycle time wrong set at before. Do you want to set present positon as the end position forcibly ? + + + + + 停止 + Stop + + + 打开回收槽 + Opening collector + + + + 停止打开 + Stop opening + + + + 正在打开回收槽... + Opening collector... + + + + + 警告!回收槽开关时间未设置! + Warning! The switch time of collector does not set! + + + 关闭墨线 + InkLine Close + + + 关闭回收槽 + Closing collector + + + + 停止关闭 + Stop closing + + + + 正在关闭回收槽... + closing reatank now... + + + + 准备关机...... + Printer is going to close shutdown... + + + 墨线未关,是否关闭墨线后关机! + Whether chalk line did not closed, shutdown after the inkline closed! + + + + 回收槽未关,是否关闭回收槽后关机! + Collector does not return. Do you want to turn off the collector before shutdown ? + + + + 是否确认关机? + Do you want to turn the printer off ? + + + 最多支持的列数目为:%1 + Maximum column number is:%1 + + + + 是否初始化产品计数? + Do you want to initialize the Product Count ? + + + + 是否清除总产品计数? + Do you want to clear the Grand Total ? + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 警告:‘-’和空格的宽度不一样 + Warning: the width of '-'is not same as a space + + + + 条形码信息编辑 + BarCode Edit + + + + + 二维码信息编辑 + QRCode Edit + + + + MemDisplayAndEdit + + + Form + + + + + 07 + + + + + 02 + + + + + 06 + + + + + 0D + + + + + 09 + + + + + 03 + + + + + 01 + + + + + 04 + + + + + 0C + + + + + 0A + + + + + 0F + + + + + 05 + + + + + 00 + + + + + 08 + + + + + 0B + + + + + 0E + + + + + 基地址: + BaseAddress: + + + + 0x0000 + + + + + 0xb100 + + + + + 0xa400 + + + + + 0xe000 + + + + + 读空间 + ReadMemery + + + + 写空间 + WriteMemery + + + + 进制转换 + BaseConversion + + + + + 编辑 + Edit + + + + 上一页 + PageUP + + + + 下一页 + PageDown + + + + 0xb200 + + + + + 完成 + OK + + + + ModbusSerial + + + 接收到开始打印命令 + + + + + 接收到暂停打印命令 + + + + + 接收到停止打印命令 + + + + + 接收到DM码数据命令 + + + + + MyFileDialog + + + 确定 + Confirm + + + + NetworkManager + + + Form + + + + + 手动设定 + + + + + + IP: + + + + + Mask: + + + + + GW: + + + + + 取消 + Cancel + + + + 有线LAN + + + + + WiFi: + + + + + SSID: + + + + + Status: + + + + + 连接 + + + + + auth: + + + + + Encryption: + + + + + Plaintext (open / no authentication) + + + + + 主获取数据按钮 + + + + + 断开 + + + + + Static WEP (no authentication) + + + + + Static WEP (Shared Key authentication) + + + + + IEEE 802.1X + + + + + WPA-Personal (PSK) + + + + + WPA-Enterprise (EAP) + + + + + WPA2-Personal (PSK) + + + + + WPA2-Enterprise (EAP) + + + + + 设备码: + + + + + 服务IP: + + + + + None + + + + + WEP + + + + + TKIP + + + + + CCMP + + + + + 8754 + 24Dot {83K?} {8754?} + + + + 服务端口: + + + + + PSK: + + + + + Password: + + + + + 扫描 + + + + + 清除 + + + + + 获取数据 + + + + + Network: + + + + + 添加网络 + + + + + 测试 + Test + + + + 应用配置 + + + + + 去掉数字码 + + + + + 去掉QR码 + + + + + ScanSSID + + + + + 1 + 24Dot {1?} + + + + 47.111.170.144 + 24Dot {83K?} {47.111.170.144?} + + + 错误 + Error + + + + wpa_supplicant service is not running. +Do you want to start it? + + + + + Disconnected + + + + + Inactive + + + + + Scanning + + + + + Authenticating + + + + + Associating + + + + + Associated + + + + + 4-Way Handshake + + + + + Group Handshake + + + + + Completed + + + + + Unknown + + + + + Could not get status from wpa_supplicant + + + + + Select any network + + + + + WPS AP in active PBC mode found + + + + + Press the PBC button on the screen to start registration + + + + + WPS AP with recently selected registrar + + + + + WPS AP detected + + + + + PBC mode overlap detected + + + + + More than one AP is currently in active WPS PBC mode. Wait couple of minutes and try again + + + + + Network configuration received + + + + + Registration started + + + + + Registrar does not yet know PIN + + + + + Registration failed + + + + + Registration succeeded + + + + + WPA Pre-Shared Key Error + + + + + WPA-PSK requires a passphrase of 8 to 63 characters +or 64 hex digit PSK + + + + + Network ID Error + + + + + Network ID String contains non-word characters. +It must be a simple string, without spaces, containing +only characters in this range: [A-Za-z0-9_-] + + + + + + Failed to add network to wpa_supplicant +configuration. + + + + + Failed to enable network in wpa_supplicant +configuration. + + + + + This will permanently remove the network +from the configuration. Do you really want +to remove this network? + + + + + Yes + + + + + No + + + + + Failed to remove network from wpa_supplicant +configuration. + + + + + 是否去获取数据! + + + + + 获取数据中... + + + + + + 上报数据中... + + + + + + + + 提示 + Tips + + + + + IP设置错误! + + + + + 应用成功 + Apply success + + + + OtherInfo + + + Form + Form + + + + 相位位置: + Phase position: + + + 相检墨点: + Phase Detect Dot: + + + 相检占空比(%) + PhaseDetectDuty + + + 相检电压(‰): + PhaseVol(‰): + + + + + 锁定相位 + LockedPhase + + + + 相位偏移: + Phase Offset: + + + + 飞行时间: + Fly Time: + + + + DetectDelay + + + + + 相检: + + + + + detect_num + + + + + 检测点数量: + + + + + FullTimeEn + + + + + DetectVol + + + + + HighLowRatio + + + + + 充电占空比100% + ChargeDuty {100%?} + + + + 相位检测电压: + 相位检测电压 + + + + + 检测延迟 : + 检测墨点数量: + + + + 相检周期(墨点): + Detect Period(Dot): + + + + 应用当前配置 + Apply + + + + 频闪灯周期: + StrobePeriod: + + + 充电占空比100% + ChargeDuty + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 点 + Pixel + + + + 解锁相位 + Unclock phase + + + + PicEdit + + + Form + PictureEdit + + + 光栅高度 + Cursor height + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + 宽度 + Width + + + 新建 + NewFile + + + + 保存为 + SaveAs + + + 打开 + OpenFile + + + 字体 + Font + + + + 5点阵 + 5 Matrix + + + + 7点阵 + 7 Matrix + + + + 9点阵 + 9 Matrix + + + + 12点阵宋体 + 12 Matrix + + + + 16点阵宋体 + 16 Matrix + + + + 16点阵黑体 + 16 Matrix(BOLD) + + + + 24点阵宋体 + 24 Matrix + + + + 24点阵黑体 + 24 Matrix(BOLD) + + + + 列高 + RowHeight + + + + 无加粗 + Normal + + + + 加粗1倍 + Bold1 + + + + 加粗2倍 + Bold2 + + + + 显示控制符 + Display control character + + + 设定:高度 + Height + + + + 开启软键盘 + KeyBord + + + + 插入变量 + Variable + + + + 光栅[X:Y] + Grating[X:Y] + + + + CURR[X,Y] + + + + + 文件名 + FileName + + + + 字符光标 + Character +Cursor + + + + 像素光标 + Pixel +Cursor + + + + 点击光栅可打开键盘,点击空白处关闭 + Click grating to turn on keyboard, + click blank to turn off + + + + 插入模式 + Insert + + + + 放大比例 + Magnification + + + + 行首 + Home + + + + 行尾 + End + + + + 插入图片 + Picture + + + + + 保存/打印 + Save/Print + + + + 删除字符 + Delete + + + + + + 字库编辑 + FontsEdit + + + 新建图案 + New pattern + + + + 新建信息 + New text + + + + 粗体 + Bold + + + + 网格 + Lattice + + + 绘图 + Draw + + + + 字符间距 + Character +Spacing + + + 插变量 + Insert +Variable + + + + 插入/修改 + Insert/Modify + + + + 编辑现有的多字体 + Edit current multifont file + + + 字符 +光标 + Character +Cursor + + + 像素 +光标 + Pixel +Cursor + + + + + + + + + + + 放大倍数:%1 + Magnification: %1 + + + + + 插入模式 + Insert mode + + + + + 修改模式 + Revise mode + + + 编辑现有的多字体文件 +请使用修改模式!!! + Use Revise mode while editing current multifont file! + + + + 点击光栅可打开键盘,点击空白处关闭 + Click cursor to open the soft keyboard, click blank to close + + + + 字库保存 + Save font library + + + + + 返回信息编辑 + Return to Information Edit + + + + 请选择字体,打开键盘并输入要编辑的字符 + Choose font,turn on soft keyboard and input text + + + + 信息编辑 + Edit Text + + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Picture has changed, do you want t save it ? + + + + + + 保存 + Save + + + + 编辑现有的多字体文件 +请使用修改模式!!! + + + + + 放弃保存 + Quit without save + + + + 文件另存为... + Save As...... + + + + 另存为 + Save As + + + + + + + + + 文件名: + File name: + + + + 文件名:) + File Name:) + + + + 文件保存为... + Save...... + + + + 本条信息的变量超过规定数量! + + + + + 按回车键(Enter)可增加新行. 选择字体,光栅会自动调整 + Click 'Enter' to add a new line. Cursor adjusted automatically as per font + + + + 选择[字体]可改变光标大小. + Choose font to change cursor's size. + + + + 选择[绘图]方式,可以绘制任意图形 + Choose 'Drawing' to draft pattern + + + + 光标不匹配时,不能输入或删除. + Can not input or delete while cursor does not match. + + + + 点击空白处可关闭键盘. + Click any blank position to close keyboard. + + + + 通过[字库编辑]功能,用户可以自定义新字符 + User can define new character by 'FontLab Edit' + + + + 选择[文本模式]可切换到主界面编辑方式. + Choose 'Text Mode' to shift to the main editing interface. + + + + 点击光栅可打开键盘,点击空白处关闭键盘 + Click cursor to open the soft keyboard, click blank to close + + + + 使用[字库编辑]功能,用户可自己修改字形 + User can revise font by choose 'Fontlab Edit' function + + + + 打开文件 + Open File + + + Picture files (*.png) + Picture files (*.png) + + + + 是否立即喷印当前的文件? + Do you want to print the present file? + + + + 是 + YES + + + + 否 + NO + + + + PicWidget + + + Please input a char. + + + + + 请输入要编辑的字符 + Input the character needed to be edit + + + + 编辑字符:%1 + Edit character: %1 + + + + [%1行,%2列] + [%1 Line,%2 Column] + + + + 光标[%1,%2] + Cursor[%1,%2] + + + + + + + + + + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + + + 请新创建建图片 + Please set up a new pattern file + + + + + + 文件:%1 无法打开 + File %1 cannot be opened + + + + 信息中的变量数超过了最大值(8)!请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + 信息中的变量数超过了最大值(8)!,请减小变量数. + The number of variables in the information exceeds the maximum (8)! +Please reduce the number of variables. + + + + + 两个变量之间至少要空出一个墨点! + + + + + PrintNet + + + 获取二维码内容: + + + + + 获取数字码: + + + + + PrintSetting + + + Form + + + + + 字体加粗: + FontBolding: + + + + 字体宽度: + FontWidth: + + + + + 快速 + Fast + + + + + + 标准 + Standard + + + + + + 慢速1 + Slow 1 + + + + + + 慢速2 + Slow 2 + + + + + 慢速3 + Slow 3 + + + + + 慢速4 + Slow 4 + + + + + 慢速5 + Slow 5 + + + + + 慢速6 + Slow 6 + + + + + 慢速7 + Slow 7 + + + + + 慢速8 + Slow 8 + + + + + 慢速9 + Slow 9 + + + + 打印模式: + PrintMode: + + + + 其它设置 + OtherSetting + + + + 产品计数器自动清0 + ProductAutoReset + + + + 总产品计数器自动清0 + TotalProductAutoReset + + + + 高压故障关回收槽 + ReclainTankColse +WhenHighVoltFault + + + + 无交替 + + + + + 普通交替 + + + + + 电眼触发交替 + + + + + 导出随机码文本 + + + + + ddhhmm + + + + + 复位到起始值 + + + + + 特殊变量结束值: + + + + + 特殊变量起始值: + + + + + 打印 + + + + + 无 + + + + + 小屏 + + + + + 大屏 + + + + + 总产品计数值 + + + + + + 计数器1 + + + + + + 计数器2 + + + + + + + + 起始值: + StartValue: + + + + + + + 结束值: + EndValue: + + + + + + 清零 + ResetCnt + + + + 可变长度 + + + + + 计数器2设置 + Counter 2 Setup + + + + 重复次数: + RepeatTimes: + + + + + + + 增量值: + Increment: + + + + 计数器1设置 + Counter 1 Setup + + + + 墨线时间 + + + + + 墨线时间: + WorkingTime: + + + + + + 0 + 1 {0?} + + + + 开机次数: + PowerOnTimes: + + + + 应用当前配置 + Apply + + + + 常用设置 + General Setting + + + + date time + + + + + yyyy-MM-dd + + + + + yyyy/MM/dd + + + + + yyyyMMdd + + + + + yyyy年MM月dd日 + + + + + yyyy-MM-dd hh:mm + + + + + yyyy/MM/dd hh:mm + + + + + yyyyMMddhhmm + + + + + yyyy年MM月dd日hh:mm + + + + + hh:mm + + + + 慢速 + Slowly + + + + 米标显示 + + + + + 上移 + + + + + 下移 + + + + + 首行电压(%): + NadirVolt(%): + + + + 字高设置(%): + FontHeight: + + + + 行末电压(%): + ZenithVolt(%): + + + + 信息左右颠倒 + Mirror +Horizontal + + + + 相位故障关机 + ShutdownWhile +PhaseFault + + + + 信息上下颠倒 + Mirror +Vertical + + + + 故障停止走米 + Stop Counter +While Fault + + + + 相位故障不打印 + StopPrintWhile +Phase Fault + + + + 回收故障处理 + RecycleFault + Processing + + + + 自然数计米 + Natural +Counter + + + + 超速暂停打印 + Pause printing +for overspeed + + + + 不打印走米 + Not print +continue counter + + + 打印优化 + Print +optimization + + + + 电眼误触禁止 + Prohibition +ElectricEye re-trigger + + + + TextLabel + + + + + 字形优化 + + + + + 有效期(天): + + + + 2018-05-24 + 24Dot {2018-05-24?} + + + 2018/05/24 + 24Dot {2018/05/24?} + + + + + 高级设置 + AdvancedSetting + + + + + 交替扫描隔点(默认为1): + Interlacing(Dot): + + + + 行末调整点模式: + Adjusted PrintMode: + + + + 点距调整值(默认为0): + AdjustDotSpacing (Def 0): + + + + + 扫描颠倒 + ReversalScan + + + + 点距调整电压位置: + DotGapVoltPos: + + + + 行末调整点数(默认为0): + FineAdjDotNum(Def 0): + + + + 去除冗点模式(默认懒惰): + InkDotUtilization (Def Normal): + + + + 懒惰模式 + Normal + + + + 贪婪模式 + Less + + + + 均衡模式 + Balance + + + + + 冗点比例(默认为0%): + UnchargedDotRate (Def 0%): + + + + 行末点微调(‰): + FineAdjRate(‰): + + + + 修改授权 + + + + + 省点 + + + + + dd MM yy + + + + + + 调整电压 + + + + 推荐设置 + RecommendedSetting + + + + 使用推荐设置 + UseRecommended + Setting + + + + 行业: + IndustryMode: + + + + 快 + Fast + + + + 电线电缆 + Cable & Wire + + + + 制药/食品/电子 + Pharmacy/Food/Electronics + + + + 建筑管材 + Pipe & Tube + + + + 其他 + Others + + + + 速度: + Speed: + + + + + 锁定脉冲计数 + + + + + 每条信息只打印一次 + + + + + 非字宽 + + + + + 使用齿轮泵 + + + + + 高压阈值: + + + + + 不检测喷头盖 + + + + + 打印时绿灯常亮 + + + + + 复位发送打印数据 + + + + + 计数器设置 + + + + + 注意:“其它设置”页下的"分段计米“勾选时,计数器1不可用。 + + + + + 计数器3 + + + + + dd/MM/yy + + + + + dd/MM/yyyy + + + + + dd-MM-yy + + + + + dd-MM-yyyy + + + + + 计数器保存关机值 + + + + + 距离尾部(mm): + + + + + 特殊条件计数 + + + + + 首尾交替 + + + + + 更换信息文件时执行的动作: + + + + + 外接显示屏: + + + + + 显示屏显示: + + + + + 全部删除 + 删除全部 + DeleteAll + + + + 打印电压缩放 + + + + + 整体缩放(%) : + + + + + 插 入 + 插入 + InsertFile + + + + 删 除 + 删除 + Delete + + + + 添 加 + 添加 + + + + + 分段计米 + + + + 喷印测试文件 + Print Test File + + + 备份测试文件 + Backup Test File + + + 备份系统参数 + BackupSysPara + + + + 交替打印设置 + AlternatePrint + + + + 起始位置: + StartPos: + + + + 交替间隔: + AltInterval: + + + 交替打印 + AlternatePrint + Enable + + + 点距微调设置 + VoltageFineAdjSetting + + + + + + 重设值 + ResetCurrentCounter + + + + + + 重复数: + RepeatTimes: + + + + + + 当前值: + Current: + + + + 计数器3设置 + Counter 1 Setup {3设?} + + + + 跳米设置 + SkipCountingSetting + + + + 跳米数: + SkipInterval: + + + + 跳米打印 + SkipCounting +Enable + + + + + + 输入密码 + 提升权限 + MoreAuthorization + + + + + 提示:交替参数不正确 + + + + + 要求:起始位置<交替间隔 + Formula: Starting position < Alternate interval + + + + 要求:(重复次数+起始位置)<交替间隔 + Formula: (Repeat Times + Starting position) < Alternate interval + + + + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + %4d天 %02d:%02d:%02d + %4d Day %02d:%02d:%02d + + + + + + + + + + 警告 + Warnning + + + + 是否确认使用推荐设置? + Are you sure to use Recommended Setting ? + + + + 系统维护设置成功! + Syster maintenance setting success ! + + + + 喷码机维护设置成功! + Machine maintenance setting success ! + + + + + + 错误 + Error + + + + 不存在 + Not-existent + + + + 授权码: + Authorization code: + + + + 错误 + + + + + + + 输入密码 + 提升授权 + More authorized setting + + + + 密码: + + + + + 取消授权 + Quit authorized setting + + + + 随机码文件为空,不需要导出 + + + + + 随机码文本将展出到U盘,请插入U盘 + + + + + 计数器1(结束值-开始值)不能被增量整除,结束值将被设为%1 + + + + + 计数器1(结束-开始)不能被增量整除,结束值将被设为%1 + + + + + 1 + 24Dot {1?} + + + + 正在打印第%1组设置,不可删除 + + + + + 是否确认删除第%1组设置? + + + + + 是否确认删除全部设置? + + + + + 字体宽度不能为0 + + + + + 是否立即重新计米? + Are you want to reset counter! + + + + 解锁脉冲计数 + + + + 点距电压微调 + Fine adjust the space voltage + + + + PulseNumFix + + + Dialog + + + + + 根据速度 + As per Speed + + + + 根据喷印 + As per Print + + + + 根据脉冲数 + As per Pulse Count + + + + 根据同步器参数 + As per Synchronizer Data + + + + 实际皮带速度(毫米/秒): + Conveyor Speed(mm/s): + + + + 实际喷印间隔长度(毫米): + Print Interval(mm): + + + + 长度(毫米): + Length(mm): + + + + 同步脉冲数 + Synchronizer Pulse + + + + 同步器直径(毫米): + Synchronizer Diameter(mm): + + + + 脉冲数/转: + Pulse Number(Round): + + + + 脉冲数修正 + Correction +Pulses + + + + + + + 错误 + Error + + + + 速度不应该为0 + Speed should not be 0 + + + + 实际同步长度不应该为0 + The actual synchronization length should not be 0 + + + + 长度不应该为0 + Length should not be 0 + + + + 直径不应该为0 + Diameter should not be 0 + + + + QBarCode + + + Dialog + + + + + 条形码类型 + BarType + + + 文本信息 + Input: + + + + 显示缩放 + Scale + + + + 条形码高度 + BarHeight + + + + 1点 + 1Dot + + + + 2点 + 2Dot + + + + 3点 + 3Dot + + + + 4点 + 4Dot + + + + + 5点 + 5Dot + + + + 6点 + 6Dot + + + + 文本1 + + + + + 文本3 + + + + + 计数器2 + + + + + 文本2 + + + + + 计数器1 + + + + + 插入文档 + InsertToDoc + + + + 条码保存 + + + + + 增加数字行 + + + + + 日期 + + + + + 时间 + + + + + 条码宽度 + BarWidth + + + 字体 + Font + + + 文本宽度调整 + TextWidth + + + 居中对齐 + CenterAlign + + + 左对齐 + LeftAlign + + + 右对齐 + RightAlign + + + 文本对齐 + TextAlign + + + 文本加粗 + TextBold + + + 插入到文档 + InsertToDoc + + + + FileName + + + + + 预览 + Preview + + + 条形码保存 + Save + + + + 墨水类型 + InkType + + + + 黑墨 + BlackInk + + + + 白墨 + WhiteInk + + + 条形保存 + Save + + + + 返回 + Return + + + + 文件未保存 + File Not Saved + + + 5点阵 + 5 Matrix + + + 7点阵 + 7 Matrix + + + 9点阵 + 9 Matrix + + + 12点阵 + 12 Matrix + + + 16点阵 + 16 Matrix + + + + CODE_128 + BARCODE_93 + + + + 自适应编码 + AUTO + + + + CODE_93 + + + + + 7点 + 7Dot + + + + 9点 + 9Dot + + + + 12点 + 12Dot + + + + 16点 + 16Dot + + + + 24点 + 24Dot + + + + + 标签宽度:%1,标签高度:%2,文本宽度:%3 + TabWidth: %1,Height: %2,TextWidth: %3 + + + + QObject + + + 起始值 + + + + + 结束值 + End(结束) + + + + + 循环值 + Loop(循环) + + + + + + 手动设定 + + + + + 应用 + + + + + QTranslator + + 错误 + Error + + + DevOp构造函数的sysParam不能为空 + SysParam of the constructor can not be empty + + + 警告 + Warnning + + + 当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!! + Present column pixel: %1 , Uncharged dot rate: %2 , Too many uncharged dot, please correct your setting! + + + 字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误 + Short Font may caused by the data of line output transformer is uninitialized, your present operation will ignore all high voltage mistake + + + 喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短! + Printing interval is too short to fulfill width’s setting. The font width will be narrowed automatic! + + + 在同步计米的情况下无打印串或显示区域为零 + Cannot print the string or no display area under synchronized counting + + + 在同步计米的情况下喷印同步脉冲数过多,请检查你的配置 + Too much printing pulse under synchronized counting, please review your setting + + + 喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度 + Character string is too short, please add character string length, or reduce printing length in Print Setup + + + 喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度 + Printing length is too short, please reduce character string length, or add printing length in Print Setup + + + + SceneEditOption + + + Form + + + + + 预览 + Preview + + + + 新建 + + + + + 打开 + OpenFile + + + + + 保存 + Save + + + + 另存为 + + + + + 新增图元 + + + + + 编辑图元 + + + + + 删除图元 + + + + + 放大 + Zoom In + + + + 缩小 + Zoom Out + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + + + + + SystemManage + + + Form + + + + + 手动控制泵阀 + Manual Control + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 回收槽开 + Collector Open + + + + + + + + + + + + + 停止 + Stop + + + + 回收槽关 + Collector Off + + + 回路阀 + FeedBack +Valve + + + + 回收泵 + Recycle Pump + + + + + 压缩机 + Compressor + + + + 主墨泵 + Main Ink Pump + + + + 泄压阀 + Decompression +Valve + + + + 循环阀 + Recycle Valve + + + + 墨水阀 + Ink Valve + + + + 粘度泵 + Viscosity Pump + + + + 混合阀 + Mixing Valve + + + + 时间设置 + Time Setting + + + + 系统升级 + + + + + 排气 + + + + + 导出配置到U盘 + Export Parameter +To Flash Disk + + + + 自动清洗 + + + + + 电机测试 + + + + + 更新字库 + UpdateFontLibrary + + + + 齿轮泵开 + + + + + 齿轮泵关 + + + + + 导出字库 + + + + + 从U盘导入配置 + Import Parameter +From Flash Disk + + + + 屏幕校正 + Touch-Screen +Calibration + + + + 更新软件 + Update InkJet SolftWare + + + + 出厂设置 + Factory Default + + + 系统备份 + System Backup + + + 设定机器码 + MachineryCodeSetting + + + + + + Cancel + + + + + (1/2) Cleaning, please wait... + + + + + + + + + + + + + + + + + + + + + 开 + On + + + + + + + + + + + + + + + + + + + + + 关 + Off + + + + + + + + + + + + + + + + + + 警告 + Warnning + + + + + + + 请先移开喷头盖! + Please move the printhead cover off! + + + + 是否确认进入手动模式? + Are you sure to enter Manual Mode ? + + + + 请先确认已经关闭回收槽,确认进入自动模式? + Please confirm collector is closed. Are you sure to enter Automatic Mode ? + + + + + 手动 + Manul + + + + + + 自动 + Auto + + + + + + + + + + + 启动 + Start + + + + Application + Application + + + + 是否确认更新字库? + Are you sure to update the font library ? + + + + 更新字库成功,重启后生效! + Font library update success, reboot to apply ! + + + 是否恢复出厂设置? + Are you sure to resume the factory default ? + + + + 恢复出厂设置成功,请重新关机上电 + Factory default recovered, please shutdown the printer and power on again + + + + 校准触摸屏 + Touch-screen calibration + + + + 是否确认开始校准程序?请小心进行校准! + Are you sure to start calibrate the touch-screen? Please operate carefully! + + + + 无法生成脚本 + Fail to generate script + + + + + + + 密码不正确! + Incorrect Password! + + + + 是否确认更新软件? + Are you sure to update software? + + + + 软件更新成功,重启后生效! + Software update success, reboot to apply ! + + + + + + + + 错误 + Error + + + + 没找到对应字库,更新失败! + + + + + 更新失败! + + + + + 找不到更新软件! + + + + + 是否确认更新系统? + + + + + 系统更新成功,重启后生效! + + + + + 文件不存在! + + + + + 压力 + + + + + autoclean cancel or status: + + + + + (2/3) Cleaning + + + + + (3/3) Cleaning + + + + + 混合阀打开3: + 混合阀打开3. + + + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + autoclean start + + + + + 是否确认启动自动清洗? + + + + + 是否确认墨水排除,加入清洗剂? + + + + + (1/3) Cleaning + + + + + 是否确认导出字库到U盘? + + + + + U盘不可识别! + + + + + 字库导出完成! + + + + + 是否开始电机测试? + + + + + 正在排气,是否停止? + + + + 更新文件不存在! + Update file was not found! + + + 是否确认备份系统文件? + Confirm to backup system file? + + + 系统备份成功! + System backup suceess ! + + + 备份操作失败! + Backup operation failed! + + + + + + + + + + + + + + + + + 提示 + Tips + + + 开墨线 + Open InkLine + + + 关墨线 + Close InkLine + + + 清洗阀 + Clean Valve + + + 墨线阀 + InkLine Valve + + + 供墨阀 + InkValve + + + + 如果开始清洗,务必确认回收槽已经打开10毫米以上,并且在一分钟后将停止清洗 + If you start cleaning, be sure the recycling tank has opened more than 10 mm, and stop to clean after 1 minute + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + + 是否确认导出配置到U盘? + Do you want to export configuration to flashdisk ? + + + + 检测不到U盘 + Flashdisk was not detected + + + + 成功导出配置到U盘 + Configuration was exported to flashdisk success + + + + 是否确认从U盘导入配置? + Are you sure to import configuration from flash disk ? + + + 配置文件/udisk/sysPara.bin不存在! + configuration file /udisk/sysPara.bin does not exist! + + + + 从U盘成功导入配置,重启后生效! + Configuration import success. Reboot to apply ! + + + + SystemSetting + + + Form + + + + + 压力: + Pressure: + + + + 粘度: + Viscosity: + + + + 高压包容差: + HighVoltTolerance: + + + 粘度校正: + ViscosityAdjustment: + + + + 回收槽开关时间: + CollectorSwitchingTime: + + + + 喷头温度: + Printhead Temperature: + + + + 电机电流: + Motor Electric Current: + + + + 64K + + + + + 76K + + + + + 96K + + + + + 晶振频率: + Crystal Frequence: + + + + 粘度校正(%): + + + + 83K + 24Dot {83K?} + + + + 新晶振 + + + + + 场景模式 + + + + + 墨水温度: + + + + + °C + + + + + 0 + 1 {0?} + + + + 0.6 + 24Dot {0.6?} + + + + 1.0 + 24Dot {1.0?} + + + + 1.6 + 24Dot {1.6?} + + + + 2.0 + 24Dot {2.0?} + + + + 隔膜位置偏移: + + + + + 5 + 24Dot {5?} + + + + 风扇开启温度: + + + + + 脉冲计数器: + + + + + 10 + 24Dot {10?} + + + + 15 + 24Dot {15?} + + + + 20 + 24Dot {20?} + + + + 25 + 24Dot {25?} + + + + 30 + 24Dot {30?} + + + + 40 + 24Dot {40?} + + + + 45 + 24Dot {45?} + + + + 50 + 24Dot {50?} + + + + 55 + 24Dot {55?} + + + + 60 + 24Dot {60?} + + + + 重置高压 + Reset High Voltage + + + + 界面语言设置 + + + + + 应用当前配置 + Apply + + + 脉冲计数: + Total Pulse: + + + + 粘度泵动作间隔(秒): + ViscosityPumpActionInterval(s) : + + + + 晶振电压(%): + CrystalVoltage(%): + + + + 频率修正: + Frequence Adjustment: + + + + Hz + + + + + 回收泵力度(%): + Recycle Pump Potency (%): + + + + 隔膜位置: + DiaphragmPosition: + + + 混合阀管路: + MixingValvePiping: + + + 旧管路 + OldPiping + + + 新管路 + NewPiping + + + + 信息编辑模式: + Text editing mode: + + + + 文本模式 + Text mode + + + + 点阵模式 + Matrix mode + + + 小喷嘴片 + Small Nozzle + + + 大喷嘴片 + Big Nozzle + + + + 喷嘴逆清洗 + Nozzle Reverse +Cleaning + + + + 搜索最佳晶振频率 + Search Suitable Frequence + + + + 搜索最佳晶振电压 + Search Suitable Voltage + + + + 128K + + + + + + + + + + + + + 错误 + Error + + + + 实际频率不能为%1 + Actual frequency cannot be %1 + + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 自动清洗时间约为一分钟,然后自动停止 + Auto Cleanning,wait 1 minute. + + + + 开始清洗 + Start cleaning + + + + 停止清洗 + Stop cleaning + + + 正在进入手动模式...... + Enter Manual Mode..... + + + + 正在喷嘴逆清洗...... + Is Nozzles Cleanning..... + + + + 自动搜索耗时较长,是否确认自动搜索当前频率2K范围内最佳晶振频率? + + + + + Tiếng Việt(Vietnamese interface) + + + + + Chinese interface(中文界面) + + + + + English interface(英文界面) + + + + 喷嘴逆清洗完成 + Nozzles Cleanning Finish. + + + 正在开回收槽...... + ReclaimTank Openning...... + + + 正在关回收槽...... + ReclaimTank Closing...... + + + + 清洗完成 + The cleaning is done + + + 密码不正确! + Incorrect Password! + + + + + + Application + Application + + + + 是否更新高压包电流数据? + Do you want to update the electric current data of line output transformer ? + + + + + + 喷头盖未关,请先关喷头盖! + Please close the printhead cover ! + + + 重置高压前,请先关墨线! + Please Turnoff InkLine before Reset High voltage! + + + 重置高压前,请先关闭回收槽! + Please Turnoff ReclaimTank before Reset High voltage! + + + + + 墨线开关未开,请先打开墨线开关! + Please turn on the inkjet switch ! + + + 墨线未打开! + InkLine Not Opened! + + + + + 回收槽未全部打开! + Collector does not open fully ! + + + + 自动搜索耗时较长,期间请不要进行其他操作,是否确认自动搜索最佳晶振电压? + It may cost a long time to search automatically, do not carry on any other operation while searching. Do you want to start automatical search now? + + + 自动搜索耗时较长,是否确认自动搜索但前频率1K范围内最佳晶振频率? + It may cost a long time to search automatically, Do you want to start automatical search but limit range within 1K Hz? + + + + 搜索的起始频率%1 HZ超出范围? + The search starting frequence %1 Hz is over range + + + + 高压设置完成 + High voltage setting done + + + 高压设置异常 + High Voltage Set False + + + 高压设置异常,本次重置操作无效! + High Voltage Set False! + + + + Oscillator Freq %1 --- 最长高电平时钟 %2 + Crystal Frequence %1 --- The longest high level clock %2 + + + + 最佳晶振频率完成 + Suitable frequence search done + + + + + Oscillator voltage %1 --- 最长高电平时钟 %2 + Crystal voltage %1 --- The longest high level clock %2 + + + + + 最佳晶振电压完成 + Suitable voltage search done + + + 警告 + Warnning + + + 确定要切换中英文界面? + You want to switch Language? + + + 重启后切换到英文界面 + Switch to English GUI After the restart + + + 重启后切换到中文界面 + Switch to Chinese GUI After the restart + + + + TextEditOption + + + Form + Form + + + + 新建 + New + + + + + 另存为 + SaveAs + + + + 预览 + Preview + + + + + + 保存 + Save + + + + 文件 + File + + + + 插变量 + Variable + + + + 间距 + Spacing + + + + 字体 + Font + + + + wenquanyi + + + + + 12 + + + + + 点 + Pixel + + + + 粗体 + Bold + + + + + + + + + 警告 + Warnning + + + + + + + 无法打开文件 + Cannot open file + + + + + Application + Application + + + + + 是否确认将文件内容追加到打开的文件? + Confirm to add content to opened file? + + + + 插入图片 + Insert +pattern + + + + 插入文本 + Insert +text + + + + 错误 + Error + + + + TextEditOption 构造函数参数textEdit 不应当为空 + TextEditOption constructor parameters textEdit cannot be blank + + + + 打开文件 + Open file + + + + 二维码变量设置 + QR Variable Edit + + + + 完成 + OK + + + 另存为123 + SaveAs + + + + 以.txt保存将丢失所有格式,你是否愿意保存为.html格式? + To save in .txt format will abandon all form, do you want to save it as .html format ? + + + + 提醒 + Reminding + + + + 检测到有图片 %1 来自U盘,是否拷贝图片到本地? + Pattern %1 comes from flashdisk, do you want to copy it to local disk ? + + + + 无法保存文件 + File cannot be saved + + + + 保存... + Save..... + + + + 提示 + Tips + + + + 文档已经改变,是否保存? + File has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + TimeSettingDialog + + + Dialog + + + + + 秒: + Second: + + + + 分: + Minute : + + + + 月: + Month: + + + + 日: + Day: + + + + 时: + Hour: + + + + 年: + Year: + + + + 设置时间 + Time setting + + + + TriggerCtrl + + + Form + + + + + 触发模式 + TriggerMode + + + + 延时触发 + Delayed Triggering + + + + 光电边沿触发 + OpticalEdge Triggering + + + + 光电电平触发 + Electrical LevelTriggering + + + + 同步器触发 + SynchronizerTriggering + + + + 脉冲数/毫米 + Pulse/Millimeter + + + + 喷印间隔(毫米) + SpaceWidth(mm) + + + + 同步喷印模式 + SynchronizerMode + + + + 按字符宽度 + as per font width + + + + 按喷印比例 + as per proportion + + + + 字符宽度: + CharacterWidth: + + + + 重复次数 + RepeatTimes + + + + + + + + 重复间隔(毫秒) + RepeatInterval(ms) + + + + + + + 触发延时(毫秒) + TriggerDelay(ms) + + + + 间隔模式: + Interval Mode: + + + + 行末<->行首 + End To Head + + + + 行首<->行首 + Head To Head + + + + 产生脉冲所需计数: + Count for Pulse: + + + + + + + 延时(毫秒): + Delay(ms): + + + + 允许电眼复位 + + + + + 允许电眼立即复位 + + + + + 电眼清零 + PhotodEyeResetCounter + + + + 镜像交替间隔 + + + + + 镜象交替类型 + + + + + 无镜像打印 + + + + + 自动水平翻转 + + + + + 自动垂直翻转 + + + + + 中心对称旋转 + + + + + 同步器正反转打印 + + + + + 同步器只正转打印 + + + + + 同步器只反转打印 + + + + + 脉冲信号值: + + + + + + 封锁时间(毫秒) + LockTime(ms) + + + 自动调速 + AutoSpeedEnable + + + + 同步打印 + SynchronizerEnable + + + + 同步器清零 + SynchronizerResetCounter + + + + 脉冲数修正 + CorrectionPulses + + + + 脉冲输出使能 + PulseOutputEnable + + + + 禁止电眼清零 + ForbiddenMagicEyeReset + + + 允许电眼清零 + AllowMagicEyeReset + + + 允许电眼立即清零 + AllowMagicEyeResetNow + + + 镜像交替间隔数 + Mirror interval + + + + 20131228-1 + + + + + 应用当前配置 + Apply + + + + 独立参数 + Independent parameter + + + + + + + 触发延时(毫米) + Trigging delay (ms) + + + + + + 重复间隔(毫米) + Repeat Gap (mm) + + + + + 封锁间隔(毫米) + Lock Gap(mm) + + + + + + + 延时(毫米): + + + + + 字符宽度 + CharWidth + + + + 喷印比例(%) + PrintingScale(%) + + + + 提示 + Tips + + + + 应用成功 + Apply success + + + + 封锁间隔(毫秒) + + + + + ZkEdit + + + Form + + + + ZiKuEdit + Font library Edit + + + + 编辑图案 + Edit Pattern + + + + 缩小 + Zoom Out + + + + 放大 + Zoom In + + + + 宽度 + Width + + + + 新建 + NewFile + + + + 高度 + Height + + + + + + 保存 + Save + + + + 保存为 + SaveAs + + + + 打开 + OpenFile + + + + 导入 + Load + + + + A + A + + + + 图像扩张 + + + + + 图像裁剪 + + + + + 提示 + Tips + + + + 图片已经改变,是否保存? + Pattern has changed, do you want t save it ? + + + + 放弃保存 + Give up saving + + + + + + 放大倍数:%1 + Magnification: %1 + + + + 图片另存为... + SaveAs + + + + 另存为 + Save as + + + + 打开文件 + Open file + + + + 图片保存为... + Save to...... + + + + 导入文件 + Import file + + + + dlgDrawInit + + + 图案参数设置 + Pattern parameters setting + + + + 图案宽度(像素) + Pattern width (pixel) + + + + 图案高度(像素) + Pattern height (pixel) + + + + 确定 + Confirm + + + + dlgQrCode + + + Dialog + + + + + 信息前缀 + Text + + + + 变量(初值) + Curent-Couter + + + + 信息后缀 + Suffix-Text + + + + 默认 + + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 + + + + + DM码尺寸: + + + + + 自动插入时间 + + + + + 变量增量 + Increment + + + 增量 + Increment + + + + 返回 + Return + + + + + TextLabel + + + + 信息 + Text: + + + + 正相打印 + NormalPrint + + + + 反相打印 + RP-Print + + + + DataMatrix + + + + + QRCode + + + + + 插入文档 + InsertToDoc + + + + 计数器(变量) + CNT(Var) + + + + 保存 + Save + + + + 预览 + Preview + + + + 条形码 + BarCode + + + 插入到文档 + InsertToDoc + + + + 自动刷新 + AutoShow + + + 黑墨 + BlackInk + + + 白墨 + WhiteInk + + + + 警告 + Warnning + + + + 输入内容超出选择DM码尺寸大小,请选择更大的尺寸! + + + + + [%1 X %2] + + + + + logo_Form + + + Form + + + + + zkWidget + + + + 警告 + Warnning + + + + 最大支持宽度:%1 高度:%2 当前请求:%3 x %4 + Maximium size width %1 x Height %2, present request %3 x %4 + + + + 请新创建建图片 + Please set up a new pattern file + + + 文件:%1 无法打开 + Document %1 cannot be opened + + + diff --git a/x86_build b/x86_build new file mode 100644 index 0000000..6a01a85 --- /dev/null +++ b/x86_build @@ -0,0 +1,2 @@ +/usr/local/Trolltech/QtEmbedded-4.6.3/bin/qmake -project +/usr/local/Trolltech/QtEmbedded-4.6.3/bin/qmake diff --git a/zkWidget.cpp b/zkWidget.cpp new file mode 100644 index 0000000..fad4cc1 --- /dev/null +++ b/zkWidget.cpp @@ -0,0 +1,351 @@ +/* + * zkWidget.cpp + * + * Created on: Jul 2, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#include "zkWidget.h" +#include +#include +#include +#include +#include "SysPara.h" + +zkWidget::zkWidget(QWidget *parent):QWidget(parent){ + memset(pointMap,0,sizeof(pointMap)); + heightPoint = 0; + widthPoint = 0; + scale = 16; + currXpos = 0; + currYpos = 0; + modified = false; +} + +zkWidget::~zkWidget(){ + +} + +void zkWidget::paintEvent(QPaintEvent *event){ + QPainter painter(this); + QRect rect = event->rect(); + int x = (int)(rect.x()/scale); + int y = (int)(rect.y()/scale); + int x_ = rect.x() + rect.width(); + int y_ = rect.y() + rect.height(); + int last_x = x_/scale; + int last_y = y_/scale; + //qDebug() << "x:" << rect.x() << "y:" << rect.y() << "width:" << rect.width() << "heigh:" << rect.height(); + for(int i = x; i < widthPoint && i <= last_x; i++){ + for(int j = y; j < heightPoint && j <= last_y; j++){ + QPen pen; + int width = 0; + if(currXpos == i && currYpos == j){ + width = (scale>4)?2:1; + pen.setColor(QColor(Qt::red)); + + } + else { + width = (scale > 3)?1:0; + pen.setColor(QColor(Qt::gray)); + } + pen.setWidth(width); + painter.setPen(width?pen:Qt::NoPen); + if(pointMap[i*MAX_PIC_WIDGET_HEIGHT + j]){ + painter.setBrush(QColor(Qt::black)); + } + else{ + painter.setBrush(QColor(Qt::white)); + } + painter.drawRect(i*scale + width,j*scale + width,scale - 2*width,scale - 2*width); // + } + } +} + +void zkWidget::mousePressEvent ( QMouseEvent * event ){ + int x = (int )(event->x()/(scale)); + int y = (int )(event->y()/scale); + + if(x < widthPoint && y < heightPoint){ + int oriX = currXpos; + int oriY = currYpos; + currXpos = x; + currYpos = y; + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = pointMap[x*MAX_PIC_WIDGET_HEIGHT + y]?0:1; + update(oriX*scale,oriY*scale,scale,scale); //将原来的焦点去掉 + update(x*scale,y*scale,scale,scale); + modified = true; + emit picWidgetModify(widthPoint,heightPoint); + } + +} + +void zkWidget::currPositionMove(int shiftX,int shiftY,bool moveAllPic,bool trimPic,bool expandPic) +{ + if((widthPoint && heightPoint) || expandPic){ + if(moveAllPic){ + shiftX = - shiftX; + shiftY = -shiftY; + int init_x = (shiftX < 0)?(widthPoint - 1):0; + int end_x = (shiftX >= 0)?(widthPoint):-1; + int step_x = (shiftX < 0)?-1:1; + int init_y = (shiftY < 0)?(heightPoint - 1):0; + int end_y = (shiftY >= 0)?(heightPoint):- 1; + int step_y = (shiftY < 0)?-1:1;; + for(int x = init_x; x != end_x; x+= step_x){ + for(int y = init_y; y != end_y; y+= step_y){ + int new_x = x + shiftX; + int new_y = y + shiftY; + if(new_x < 0 || new_x >= widthPoint || new_y < 0 || new_y >= heightPoint){ + //pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = trueColorEnable?backGround.rgba():0xffffffff; + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = 0x00000000; + } + else + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = pointMap[new_x*MAX_PIC_WIDGET_HEIGHT + new_y]; + } + } + update(); + } + else if(trimPic){ + + int diffX = (widthPoint > qAbs(shiftX))?qAbs(shiftX):widthPoint; + int diffY = (heightPoint > qAbs(shiftY))?qAbs(shiftY):heightPoint; + if(shiftX > 0){ + currPositionMove(- diffX,0,true,false,false); + } + if(shiftY > 0){ + currPositionMove(0,-diffY,true,false,false); + } + heightPoint -= diffY; + widthPoint -= diffX; + resize(widthPoint*scale,heightPoint*scale); + update(); + } + else if(expandPic){ + int diffX = ((MAX_PIC_WIDGET_WIDTH - widthPoint) > qAbs(shiftX))?qAbs(shiftX):(MAX_PIC_WIDGET_WIDTH - widthPoint); + int diffY = ((MAX_PIC_WIDGET_HEIGHT - heightPoint) > qAbs(shiftY))?qAbs(shiftY):(MAX_PIC_WIDGET_HEIGHT - heightPoint); + for(int y = 0; y < heightPoint + diffY;y ++){ + for(int x = 0; x < widthPoint + diffX; x++){ + if(y < heightPoint && x < widthPoint){ + + } + else { + //pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = trueColorEnable?backGround.rgba():0xffffffff; + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = 0x0000000; + } + } + } + heightPoint += diffY; + widthPoint += diffX; + resize(widthPoint*scale,heightPoint*scale); + if(shiftX < 0){ + currPositionMove(diffX,0,true,false,false); + } + if(shiftY < 0){ + currPositionMove(0,diffY,true,false,false); + } + //qDebug() << "diffX:" << diffX << "diffY:" << diffY << "heightPoint:" << heightPoint << "widthPoint" << widthPoint; + update(); + } + else { + int oriX = currXpos; + int oriY = currYpos; + currXpos += shiftX; + currYpos += shiftY; + currXpos = (currXpos >= 0)?(currXpos%widthPoint):(currXpos + widthPoint); + currYpos = (currYpos >= 0)?(currYpos%heightPoint):(currYpos + heightPoint); + update(oriX*scale,oriY*scale,scale,scale); + update(currXpos*scale,currYpos*scale,scale,scale); + } + emit picWidgetModify(widthPoint,heightPoint); + } +} +void zkWidget::ensureCurrPos(){ + if(heightPoint && widthPoint){ + int x = currXpos; + int y = currYpos; + pointMap[x*MAX_PIC_WIDGET_HEIGHT + y] = pointMap[x*MAX_PIC_WIDGET_HEIGHT + y]?0:1; + update(x*scale,y*scale,scale,scale); + modified = true; + emit picWidgetModify(widthPoint,heightPoint); + } +} + +bool zkWidget::isModified(){ + return modified; +} + +void zkWidget::setModified(bool m){ + modified = m; +} + +int zkWidget::getHeight(){ + return heightPoint; +} + +int zkWidget::getWidth(){ + return widthPoint; + +} + +int zkWidget::getScaleValue(){ + return scale; +} + +void zkWidget::initWidget(int w,int h){ + scale = 30; + if(parentWidget()){ + QWidget *widget = parentWidget(); + int width = widget->geometry().width(); + int height = widget->geometry().height(); + int scaleX = w?width/w:width; //不要除零 + int scaleY = h?height/h:height; + scaleX = scaleX > 0?scaleX:1; //scale不能小于零 + scaleY = scaleY > 0?scaleY:1; + scale = scaleX > scaleY?scaleY:scaleX; + } + currXpos = 0; + currYpos = 0; + memset(pointMap,0,sizeof(pointMap)); + resizeWidget(w,h); + modified = false; +} + + +void zkWidget::resizeWidget(int w,int h){ + if(w > MAX_PIC_WIDGET_WIDTH || h > MAX_PIC_WIDGET_HEIGHT){ + QMessageBox::warning(0,tr("警告"),tr("最大支持宽度:%1 高度:%2 当前请求:%3 x %4").arg(MAX_PIC_WIDGET_WIDTH).arg(MAX_PIC_WIDGET_HEIGHT).arg(w).arg(h)); + widthPoint = (w > MAX_PIC_WIDGET_WIDTH)?MAX_PIC_WIDGET_WIDTH:w; + heightPoint = (h > MAX_PIC_WIDGET_HEIGHT)?MAX_PIC_WIDGET_HEIGHT:h; + } + else{ + widthPoint = w; + heightPoint = h; + } + resize(w*scale,h*scale); + update(); +} + + +void zkWidget::enlargeDisplay(){ + if(scale < (1<<10)){ + scale = scale + ((scale>2)?scale/2:1); + resize(widthPoint*scale,heightPoint*scale); + update(); + } +} + + +void zkWidget::reduceDisplay(){ + if(scale > 1){ + scale = scale - ((scale > 2)?scale/3:1); + resize(widthPoint*scale,heightPoint*scale); + update(); + } +} + +void zkWidget::setScale(int scale){ + if(scale > 1) + this->scale = scale; + else + scale = 1; + resize(widthPoint*scale,heightPoint*scale); + update(); +} + +void zkWidget::loadImage(QString filename,bool forceSize,QString charStr,QFont *font){ + if((widthPoint == 0 || heightPoint == 0) && forceSize){ + QMessageBox::warning(0,"警告","请新创建建图片"); + } + else { + bool forceForegroundBackgroundColorFill = false; + QImage img; + QFile file(filename); + if(!filename.isEmpty() && file.exists()) + img.load(filename); + else if(charStr.size()){ + if(font){ + QFontMetrics fontMetrics(*font); + //int rightBearing = fontMetrics.rightBearing(QChar(unicode)); + //int leftBearing = fontMetrics.leftBearing(QChar(unicode)); + int width = forceSize?widthPoint:(fontMetrics.width(charStr)) ; + int height = forceSize?heightPoint:(fontMetrics.ascent() + fontMetrics.descent()); + if(width == 0){ + QMessageBox::warning(0,"警告",QString("字串:%1 在字体%2中不存在").arg(charStr).arg(font->family())); + return ; + } + QSize size(width,height); + QImage image(size,QImage::Format_ARGB32); + img = image; + img.fill(0xffffffff); + QPainter painter(&img); + painter.setFont(*font); + painter.drawText(QPoint(0,fontMetrics.ascent()),charStr); + forceForegroundBackgroundColorFill = true; + } + } + if(img.isNull()){ + QMessageBox::warning(0,"Warning",QString("File:%1 open failed").arg(filename)); + } + else { + int w = img.rect().width(); + int h = img.rect().height(); + memset(pointMap,0,sizeof(pointMap)); + if(!forceSize){ + widthPoint = (w > MAX_PIC_WIDGET_WIDTH)?MAX_PIC_WIDGET_WIDTH:w; + heightPoint = (h > MAX_PIC_WIDGET_HEIGHT)?MAX_PIC_WIDGET_HEIGHT:h; + resize(widthPoint*scale,heightPoint*scale); + } + QRgb argb = 0; + for(int i = 0; i < widthPoint;i++){ + for(int j = 0; j < heightPoint ; j++){ + bool pixelVisible = false; + int init_x = i*w/widthPoint; + int end_x = (w >= widthPoint)?(i + 1)*w/widthPoint:init_x + 1; + int init_y = j*h/heightPoint; + int end_y = (h >= heightPoint)?(j + 1)*h/heightPoint:init_y + 1; + for(int l = init_x; l < end_x; l++){ + for(int m = init_y; m < end_y; m ++){ + argb = img.pixel(l,m); + //qDebug() << "i:" << i << "j" << j << " " << QString::number(argb,16); + if(argb == 0xffffffff) //节约时钟周期 + continue; + if((argb & 0xff000000) && (((argb&0xff0000) < 0x800000) + || ((argb&0xff00) < 0x8000) || ((argb&0xff) < 0x80))){ + pixelVisible = true; + break; + } + } + if(pixelVisible) + break; + } + if(pixelVisible) + pointMap[i*MAX_PIC_WIDGET_HEIGHT + j] = 1; + } + } + update(); + setModified(false); + } + } +} +void zkWidget::saveImage(QString filename){ + if(widthPoint == 0 || heightPoint == 0){ + QMessageBox::warning(0,tr("警告"),tr("请新创建建图片")); + } + else { + QSize size(widthPoint,heightPoint); + QImage image(size,QImage::Format_ARGB32); + image.fill(qRgba(0,0,0,0xff)); + for(int i = 0 ; i < widthPoint; i++){ + for(int j = 0; j < heightPoint; j++){ + image.setPixel(i,j,pointMap[i*MAX_PIC_WIDGET_HEIGHT + j]?0xff000000:0xffffffff); + } + } + filename = DOC_ROOT_DIR+ QFileInfo(filename).baseName()+".jpg"; + image.save( filename ); + } + setModified(false); +} diff --git a/zkWidget.h b/zkWidget.h new file mode 100644 index 0000000..1a70c0d --- /dev/null +++ b/zkWidget.h @@ -0,0 +1,73 @@ +/* + * zkWidget.h + * + * Created on: Jul 2, 2013 + * Author: yiyu + * QQ:1036184468 + * Descriptoin: + + */ + +#ifndef ZKWIDGET_H_ +#define ZKWIDGET_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#define MAX_PIC_WIDGET_HEIGHT 256 +#define MAX_PIC_WIDGET_WIDTH 256 +class zkWidget:public QWidget{ + + Q_OBJECT + +public: + explicit zkWidget(QWidget *parent = 0); + ~zkWidget(); + + void resizeWidget(int w,int h); + void initWidget(int w,int h); + //void loadImage(QString filename,bool forceSize = true); + void loadImage(QString filename,bool forceSize = true ,QString charStr = "",QFont *font = 0); + void saveImage(QString filename); + void enlargeDisplay(); + void reduceDisplay(); + void setScale(int scale); + + void paintEvent(QPaintEvent *); + void mousePressEvent ( QMouseEvent * event ); + + //void currPositionMove(int shiftX,int shiftY); + void currPositionMove(int shiftX,int shiftY,bool moveAllPic,bool trimPic,bool expandPic); + void ensureCurrPos(); + int getScaleValue(); + bool isModified(); + + + int getHeight(); + int getWidth(); + +Q_SIGNALS: + void picWidgetModify(int w,int h); + +private: + unsigned char pointMap[MAX_PIC_WIDGET_HEIGHT * MAX_PIC_WIDGET_WIDTH]; + int heightPoint; + int widthPoint; + int scale; + + int currXpos; + int currYpos; + bool modified; + void setModified(bool m); + + +}; + +#endif /* PICWIDGET_H_ */ diff --git a/zkedit.ui b/zkedit.ui new file mode 100644 index 0000000..2d6ef4d --- /dev/null +++ b/zkedit.ui @@ -0,0 +1,403 @@ + + + ZkEdit + + + + 0 + 0 + 626 + 437 + + + + Qt::StrongFocus + + + Form + + + + + 10 + 10 + 612 + 436 + + + + + + + false + + + Qt::AlignCenter + + + + + 0 + 16 + 400 + 400 + + + + + + + + + 0 + + + 0 + + + + + 编辑图案 + + + + + + + + 180 + 16777215 + + + + + + + + + + + 0 + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + + :/icon/arrowleft.png:/icon/arrowleft.png + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + + :/icon/arrowup.png:/icon/arrowup.png + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + + :/icon/sure.png:/icon/sure.png + + + + 24 + 24 + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + + :/icon/arrowright.png:/icon/arrowright.png + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + + :/icon/arrowdown.png:/icon/arrowdown.png + + + + + + + + + 5 + + + + + 1 + + + 256 + + + 12 + + + + + + + 1 + + + 256 + + + 12 + + + + + + + + 0 + 45 + + + + 缩小 + + + + :/icon/zoomout.png:/icon/zoomout.png + + + + + + + + 0 + 45 + + + + 放大 + + + + :/icon/zoomin.png:/icon/zoomin.png + + + + + + + + 16777215 + 20 + + + + 宽度 + + + + + + + 新建 + + + + :/icon/filenew.png:/icon/filenew.png + + + + + + + + 16777215 + 20 + + + + 高度 + + + + + + + 保存 + + + + :/icon/filesave.png:/icon/filesave.png + + + + + + + 保存为 + + + + :/icon/filesaveas.png:/icon/filesaveas.png + + + + + + + 打开 + + + + :/icon/fileopen.png:/icon/fileopen.png + + + + + + + 导入 + + + + :/icon/fileimport.png:/icon/fileimport.png + + + + + + + false + + + + 80 + 16777215 + + + + A + + + 11 + + + + + + + 图像扩张 + + + + + + + 图像裁剪 + + + + + + + + + + + + + zkWidget + QWidget +
zkWidget.h
+ 1 +
+
+ + + + +