# ioeditor **Repository Path**: brt2/ioeditor ## Basic Information - **Project Name**: ioeditor - **Description**: 一个基于PyQt的简易IO/PLC数据编辑器 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-07 - **Last Updated**: 2022-06-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 依赖 1. yaml 1. sqlite3 1. dbus-python 1. pyqt5 # 安装 1. apt install python3-yaml 1. apt install python3-dbus 1. apt install python3-pyqt5 1. apt install python3-dbus.mainloop.pyqt5 # 开发工具 设计过程中,静态页面的布局用到了Qt-Designer: - 在Windows环境请安装Qt-Creator - Ubuntu环境下: apt-get install qttools5-dev-tools 补充一句废话: Linux环境下的qt-designer的默认安装位置在:/usr/lib/i386-linux-gnu/qt5/bin/designer # Todo List 1. 排查 ?? 标识,修缮代码 1. cmake libioslave.so by setup.py 1. 应用状态模式实现对数据插入完整性的控制 1. 测试中,曾出现CPU高达60%的情况:这是由于后台监听线程轮训IO时,iopin模块的logger.debug()产生的 -> 尽管已经设定了 logger.setLevel(20),logger并没有打印出来,但logger的执行动作却没有停止——而这个消耗也远高于print。但深入思考:为何iopin不断的check_type?因为后台监听的list存储的是io-name(字符串),而slave.get_value()也是传入一个字符串——但字符串的解析用到了iopin.check_type()。所以,每 get_value() 一次,就会产生一次类型检查……这个并不合理! # 待完善 IO-Name的解析是通过正则表达式进行的,在data.iopin模块中;目前只针对已知引脚格式进行了适配,后期拓展还需要更改代码实现。 目前格式包括了: - regex_plc_format = re.compile(r"([a-z]+)\.([a-z]+)([\d\.]+)", re.IGNORECASE) # 例如 PLC.MB2018.10, tool.uuu2.0 - regex_sep_format = re.compile(r"([a-z]+)\.(\S+)\.(.*)", re.IGNORECASE) # 通过.分隔为三段: mfunction.code.out, tool.2323.0 - regex_cnc_format = re.compile(r"(\w+)\.(\w+)", re.IGNORECASE) # 字母+数字开头,通过.分隔为两段 cnc.abc, probe0.ibgxt - regex_cncparam_f = re.compile(r"([\w\[\]]+$)", re.IGNORECASE) # CNCPARAM, AXFEEDBACKPOS[X]