# python_module_demo **Repository Path**: quincyzh/python_module_demo ## Basic Information - **Project Name**: python_module_demo - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-13 - **Last Updated**: 2026-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 智能仪器仪表接口。 ## 安装 ```bash pip install inst-mngr ``` 安装后还需要本机可用的 VISA 后端,以便 `pyvisa` 能连接实际仪器。 ## 基本用法 ```python from inst_mngr import InstrumentManager, InstrumentInfo, Category # 创建管理器(内置 VISA 后端) mgr = InstrumentManager() # 发现仪器 instruments = mgr.discover() for info in instruments: print(info.address, info.label, info.category, info.supported) # 打开仪器 inst = mgr.open( "USB0::0x0957::0x2807::MY62000107::INSTR", "AGILENT::33512B", ) inst.configure(...) inst.set(key="frequency", value=1000) inst.stop() mgr.close_all() ``` ## 当前导出 API - `InstrumentBase`: 仪器抽象基类(不依赖 pyvisa) - `InstrumentInfo`: 已发现仪器的完整信息(地址、标识、类别、支持能力) - `Category`: 仪器类别枚举(MEASURE / SOURCE) - `TransportBackend`: 传输后端抽象基类,自定义 backend 需继承此接口 - `VisaTransportBackend`: VISA 传输后端默认实现 - `InstrumentManager`: 仪器管理器(发现、连接、生命周期管理)