Simple Python SECS/GEM implementation
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 5 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 11 年前 | ||
| 1 年前 | ||
| 5 个月前 | ||
| 5 个月前 |
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
secsgem
简易 Python SECS/GEM 实现
本模块仍在开发中。非常欢迎您提供意见、分享使用场景,无论您是否拥有 SECS 相关经验。
安装
如需安装最新官方版本(0.3.0,2024-09-14,https://pypi.python.org/pypi/secsgem):
$ pip install secsgem
要安装当前的开发代码(可能不稳定):
$ pip install git+git://github.com/bparzella/secsgem
示例
import logging
import code
import secsgem.common
import secsgem.gem
import secsgem.hsms
from communication_log_file_handler import CommunicationLogFileHandler
class SampleHost(secsgem.gem.GemHostHandler):
def __init__(self, settings: secsgem.common.Settings):
super().__init__(settings)
self.MDLN = "gemhost"
self.SOFTREV = "1.0.0"
commLogFileHandler = CommunicationLogFileHandler("log", "h")
commLogFileHandler.setFormatter(logging.Formatter("%(asctime)s: %(message)s"))
logging.getLogger("communication").addHandler(commLogFileHandler)
logging.getLogger("communication").propagate = False
logging.basicConfig(format='%(asctime)s %(name)s.%(funcName)s: %(message)s', level=logging.DEBUG)
settings = secsgem.hsms.HsmsSettings(
address="127.0.0.1",
port=5000,
connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE,
device_type=secsgem.common.DeviceType.HOST
)
h = SampleHost(settings)
h.enable()
code.interact("host object is available as variable 'h'", local=locals())
h.disable()
贡献
本项目仍处于起步阶段。如果您能提供建议、补充信息或帮助,请与我联系。