UniPRT 软件开发工具包 v1.0.0.0-pyd (Python)
 
载入中...
搜索中...
未找到
JsonSDK.JsonSDK类 参考

Public 成员函数

 __init__ (self)
 
 MessengerGet (self, Any ptrComm, COMM_TYP commTyp, int maxInputMsgCapacity, bool usingDataPort)
 建立一个频道,用于发送/接收管理讯息,并指定最大容量。
 
 MessengerRelease (self)
 释放讯息传输接口资源
 
 MessengerSendMsg (self, str strCommand, str strContent)
 向印表机发送管理指令和数据/内容。
 
 MessengerReadNextMsg (self, strNextMsg)
 读取已经从打印机异步接收的下一条消息。
 
 MessengerSendMsgAndWaitForResponse (self, strCommand, strContent, maxWaitTimeSecs, strResponse)
 将管理命令和数据/内容发送到印表机,并等待 maxWaitTimeSecs 秒的回应。
 
 MessengerUnreadMsgCount (self)
 获取未读讯息的数量。
 
 RfidMonitorConnection (self, lpAddress)
 使用网络接口 (NET Interface) 连接印表机以启用 RFID 监控功能。
 
 OdvMonitorConnection (self, lpAddress)
 使用网络接口 (NET Interface) 连接印表机以启用 ODV 监控功能。
 
 PrinterMonitorConnection (self, lpAddress, InfoTyp)
 使用网络接口 (NET Interface) 连接印表机以启用印表机监控功能。
 
 GetPrinterInfo (self, pPrtInfo, InfoTyp)
 获取印表机功能的相关资讯。
 
 GetRfidReportListening (self)
 獲取 RFID 報告監聽的標誌。
 
 SetRfidReportListening (self, value)
 设置 RFID 报告监听的标志。
 
 GetOdvReportListening (self)
 獲取 ODV 報告監聽的標誌。
 
 SetOdvReportListening (self, value)
 设置 ODV 报告监听的标志。
 
 RfidMonitorDispose (self)
 释放 RFID 监控资源。
 
 OdvMonitorDispose (self)
 释放 ODV 监控资源。
 
 PrinterMonitorDispose (self, InfoTyp)
 释放印表机监控资源。
 
 SetRfidReportCallback (self, callback)
 设置一个回调函数来获取 RFID 报告。
 
 SetOdvReportCallback (self, callback)
 设置一个回调函数来获取 ODV报告。
 
 SetEngineStatusListening (self, value)
 设置印表机报告监听引擎状态的标志。
 
 SetDisplayStatusListening (self, value)
 设置印表机报告监听屏幕状态的标志。
 
 SetAlertStatusListening (self, value)
 设置印表机报告监听警报状态的标志。
 
 GetEngineStatusListening (self)
 獲取引擎狀態監聽的標誌。
 
 GetDisplayStatusListening (self)
 獲取顯示狀態監聽的標誌。
 
 GetAlertStatusListening (self)
 獲取警報狀態監聽的標誌。
 
 SetEngineStatusCallback (self, callback)
 设置印表机报告监听警报状态的标志。
 
 SetDisplayStatusCallback (self, callback)
 设置印表机报告监听屏幕状态的标志。
 
 SetAlertStatusCallback (self, callback)
 设置印表机报告监听警报状态的标志。
 
 GetPrinterAllValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 获取印表机的所有设置。
 
 GetPrinterValue (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key)
 获取印表机的单一设置。
 
 GetPrinterValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keys)
 获取印表机的多个设置。
 
 SetPrinterValue (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key, value)
 设置印表机的单一设置。
 
 SetPrinterValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keysToSet)
 设置印表机的多个设置。
 
 GetPrinterProperties (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key)
 获取印表机的单一属性。
 
 GetPrinterPropertiesEx (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keys)
 获取印表机的多个属性。
 
 GetPrinterAllProperties (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 获取印表机的所有属性。
 
 GetPrinterConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, CfgNumber)
 获取印表机的单一组态设定。
 
 SetPrinterConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, Config)
 设置印表机的单一组态设定。
 
 GetPrinterAllConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 获取印表机的所有组态设定。
 

Public 属性

 AllMsg
 

构造及析构函数说明

◆ __init__()

JsonSDK.JsonSDK.__init__ ( self)

成员函数说明

◆ GetAlertStatusListening()

JsonSDK.JsonSDK.GetAlertStatusListening ( self)

獲取警報狀態監聽的標誌。

返回
bool

◆ GetDisplayStatusListening()

JsonSDK.JsonSDK.GetDisplayStatusListening ( self)

獲取顯示狀態監聽的標誌。

返回
bool

◆ GetEngineStatusListening()

JsonSDK.JsonSDK.GetEngineStatusListening ( self)

獲取引擎狀態監聽的標誌。

返回
bool

◆ GetOdvReportListening()

JsonSDK.JsonSDK.GetOdvReportListening ( self)

獲取 ODV 報告監聽的標誌。

返回
bool

◆ GetPrinterAllConfig()

JsonSDK.JsonSDK.GetPrinterAllConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

获取印表机的所有组态设定。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
返回
str
程序代码
AllConfig = GetPrinterAllConfig(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterAllProperties()

JsonSDK.JsonSDK.GetPrinterAllProperties ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

获取印表机的所有属性。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
返回
str
程序代码
AllProperties = GetPrinterAllProperties(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterAllValues()

JsonSDK.JsonSDK.GetPrinterAllValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

获取印表机的所有设置。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
返回
str
程序代码
AllValues = GetPrinterAllValues(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterConfig()

JsonSDK.JsonSDK.GetPrinterConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
CfgNumber )

获取印表机的单一组态设定。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]CfgNumber: 组态设定索引值, 范围是 0~8
返回
str
程序代码
Config = GetPrinterConfig(comm_ptr, COMM_TYP.TCP_COMM, False, 2)

◆ GetPrinterInfo()

JsonSDK.JsonSDK.GetPrinterInfo ( self,
pPrtInfo,
InfoTyp )

获取印表机功能的相关资讯。

参数
[out]pPrtInfo: 用来存储印表机资讯的结构体
[in]InfoTyp: 设置 RFID 或 ODV 资讯的类型
返回
程序代码
prt_info = PrinterInfo()
GetPrinterInfo(prt_info, INFO_TYP.RFID_TYP)

◆ GetPrinterProperties()

JsonSDK.JsonSDK.GetPrinterProperties ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key )

获取印表机的单一属性。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]key印表机设置的一个键值
返回
str
程序代码
key_ = "Speed.Print-mmps"
properties = GetPrinterProperties(comm_ptr, COMM_TYP.TCP_COMM, False, key_)

◆ GetPrinterPropertiesEx()

JsonSDK.JsonSDK.GetPrinterPropertiesEx ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keys )

获取印表机的多个属性。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]keys印表机设置的多个键值
返回
str
程序代码
keys = ["Speed", "Label.Sensor"]
properties = GetPrinterPropertiesEx(comm_ptr, COMM_TYP.TCP_COMM, False, keys)

◆ GetPrinterValue()

JsonSDK.JsonSDK.GetPrinterValue ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key )

获取印表机的单一设置。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]key印表机设置的一个键值
返回
str
程序代码
key = "Ethernet.MAC";
value = GetPrinterValue(commPtr, commTyp, false, key.c_str());

◆ GetPrinterValues()

JsonSDK.JsonSDK.GetPrinterValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keys )

获取印表机的多个设置。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]keys印表机设置的多个键值
返回
str
程序代码
keys = ["Ethernet.IP", "Ethernet.MAC", "Ethernet.Speed"]
values = GetPrinterValues(comm_ptr, COMM_TYP.TCP_COMM, False, keys)

◆ GetRfidReportListening()

JsonSDK.JsonSDK.GetRfidReportListening ( self)

獲取 RFID 報告監聽的標誌。

返回
bool

◆ MessengerGet()

JsonSDK.JsonSDK.MessengerGet ( self,
Any ptrComm,
COMM_TYP commTyp,
int maxInputMsgCapacity,
bool usingDataPort )

建立一个频道,用于发送/接收管理讯息,并指定最大容量。

参数
[out]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]maxInputMsgCapacity: 最大讯息输入容量, 默认 MAX_INPUT_MSG_CAPACITY(20)
[in]usingDataPort: 使用数据端口传输, 默认是 false
返回
程序代码
comm_typ = COMM_TYP.TCP_COMM
commPtr = None
MessengerGet(commPtr, comm_typ, MAX_INPUT_MSG_CAPACITY, False)

◆ MessengerReadNextMsg()

JsonSDK.JsonSDK.MessengerReadNextMsg ( self,
strNextMsg )

将下一条可能已从印表机异步接收的讯息读取出来。

参数
[out]strNextMsg: 用来存储下一个返回讯息的缓冲区
返回
程序代码
str_next_msg = (c_char_p * 1)()
MessengerReadNextMsg(str_next_msg)

◆ MessengerRelease()

JsonSDK.JsonSDK.MessengerRelease ( self)

释放讯息传输接口资源

返回
程序代码
MessengerRelease();

◆ MessengerSendMsg()

JsonSDK.JsonSDK.MessengerSendMsg ( self,
str strCommand,
str strContent )

向印表机发送管理指令和数据/内容。

参数
[in]strCommand: 管理指令字符串
[in]strContent: 管理数据/内容字符串
返回
程序代码
pCmdStr = "Cfg.Item"
content = "{\r\n"
content += "\"Speed\" : null,\r\n"
content += "\"ODV.Symbol\" : null,\r\n"
content += "\"Label.Sensor\":null\r\n"
content += "}\r\n"
pContentStr = content
MessengerSendMsg(pCmdStr, pContentStr)

◆ MessengerSendMsgAndWaitForResponse()

JsonSDK.JsonSDK.MessengerSendMsgAndWaitForResponse ( self,
strCommand,
strContent,
maxWaitTimeSecs,
strResponse )

将管理命令和数据/内容发送到印表机,并等待 maxWaitTimeSecs 秒的回应。

参数
[in]strCommand: 一个管理命令字符串
[in]strContent: 一个管理数据/内容字符串
[in]maxWaitTimeSecs: 最大等待时间
[out]strResponse: 用来存储 JSON 字符串回应的缓冲区
返回
程序代码
MAX_WAIT_TIME_SECS = 5
pCmdStr = "Cfg.Item"
content = "{\r\n"
content += "\"Speed\" : null,\r\n"
content += "\"ODV.Symbol\" : null,\r\n"
content += "\"Label.Sensor\":null\r\n"
content += "}\r\n"
pContentStr = content
strResponse = None
MessengerSendMsgAndWaitForResponse(pCmdStr, pContentStr, MAX_WAIT_TIME_SECS, strResponse)

◆ MessengerUnreadMsgCount()

JsonSDK.JsonSDK.MessengerUnreadMsgCount ( self)

获取未读讯息的数量。

返回
int
程序代码
int iUnreadMsgCount = MessengerUnreadMsgCount();

◆ OdvMonitorConnection()

JsonSDK.JsonSDK.OdvMonitorConnection ( self,
lpAddress )

使用网络接口 (NET Interface) 连接印表机以启用 ODV 监控功能。

参数
[in]lpAddress: IP 地址
返回
程序代码
ptr_ip_odv = "10.0.10.171"
OdvMonitorConnection(ptr_ip_odv)

◆ OdvMonitorDispose()

JsonSDK.JsonSDK.OdvMonitorDispose ( self)

释放 ODV 监控资源。

返回

◆ PrinterMonitorConnection()

JsonSDK.JsonSDK.PrinterMonitorConnection ( self,
lpAddress,
InfoTyp )

使用网络接口 (NET Interface) 连接印表机以启用印表机监控功能。

参数
[in]lpAddress: IP 地址
返回
程序代码
ptr_ip_rfid = "10.0.10.178"
rfid_monitor_connection(ptr_ip_rfid)
PrinterMonitorConnection(ptr_ip_rfid, INFO_TYP.RFID_TYP)

◆ PrinterMonitorDispose()

JsonSDK.JsonSDK.PrinterMonitorDispose ( self,
InfoTyp )

释放印表机监控资源。

返回

◆ RfidMonitorConnection()

JsonSDK.JsonSDK.RfidMonitorConnection ( self,
lpAddress )

使用网络接口 (NET Interface) 连接印表机以启用 RFID 监控功能。

参数
[in]lpAddress: IP 地址
返回
程序代码
ptr_ip_rfid = "10.0.10.178"
RfidMonitorConnection(ptr_ip_rfid)

◆ RfidMonitorDispose()

JsonSDK.JsonSDK.RfidMonitorDispose ( self)

释放 RFID 监控资源。

返回

◆ SetAlertStatusCallback()

JsonSDK.JsonSDK.SetAlertStatusCallback ( self,
callback )

设置印表机报告监听警报状态的标志。

参数
[in]callback:回调函数
返回
程序代码
SetAlertStatusCallback(PtrAlertNoticeListener);

◆ SetAlertStatusListening()

JsonSDK.JsonSDK.SetAlertStatusListening ( self,
value )

设置印表机报告监听警报状态的标志。

参数
[in]value: 用来设置印表机报告监听的标志
返回
程序代码
SetAlertStatusListening(true);

◆ SetDisplayStatusCallback()

JsonSDK.JsonSDK.SetDisplayStatusCallback ( self,
callback )

设置印表机报告监听屏幕状态的标志。

参数
[in]callback:回调函数
返回
程序代码
SetEngineStatusCallback(PtrEngineStatusNoticeListener);

◆ SetDisplayStatusListening()

JsonSDK.JsonSDK.SetDisplayStatusListening ( self,
value )

设置印表机报告监听屏幕状态的标志。

参数
[in]value: 用来设置印表机报告监听的标志
返回
程序代码
SetDisplayStatusListening(True);

◆ SetEngineStatusCallback()

JsonSDK.JsonSDK.SetEngineStatusCallback ( self,
callback )

设置印表机报告监听警报状态的标志。

参数
[in]callback:回调函数
返回
程序代码
SetEngineStatusCallback(PtrEngineStatusNoticeListener);

◆ SetEngineStatusListening()

JsonSDK.JsonSDK.SetEngineStatusListening ( self,
value )

设置印表机报告监听引擎状态的标志。

参数
[in]value: 用来设置印表机报告监听的标志
返回
程序代码
SetEngineStatusListening(True);

◆ SetOdvReportCallback()

JsonSDK.JsonSDK.SetOdvReportCallback ( self,
callback )

设置一个回调函数来获取 ODV报告。

参数
[in]callback:回调函数
返回
程序代码
SetOdvReportCallback(OdvReportCallback);

◆ SetOdvReportListening()

JsonSDK.JsonSDK.SetOdvReportListening ( self,
value )

设置 ODV 报告监听的标志。

参数
[in]value: 用来设置 ODV 报告监听的标志
返回
程序代码
SetRfidReportListening(True);

◆ SetPrinterConfig()

JsonSDK.JsonSDK.SetPrinterConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
Config )

设置印表机的单一组态设定。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]Config: 组态设定
返回
bool
程序代码
result = SetPrinterConfig(comm_ptr, COMM_TYP.TCP_COMM, False, Config)

◆ SetPrinterValue()

JsonSDK.JsonSDK.SetPrinterValue ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key,
value )

设置印表机的单一设置。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]key印表机设置的一个键值
[in]value一個印表机设置值
返回
bool
程序代码
key = "Ethernet.Speed"
value = "eAutomatic"
result = SetPrinterValue(comm_ptr, COMM_TYP.TCP_COMM, False, key, value)
if result:
print(f"Successfully set {key} to {value}")
else:
print(f"Failed to set {key}")

◆ SetPrinterValues()

JsonSDK.JsonSDK.SetPrinterValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keysToSet )

设置印表机的多个设置。

参数
[in]ptrComm: 界面指针
[in]commTyp: 接口种类
[in]usingDataPort: 使用数据端口传输, 默认是 false
[in]keysToSet印表机设置的多个键值
返回
bool
程序代码
key_values = {
"Ethernet.Speed": "eAutomatic",
"Image.Width-in": "3.5"
}
result = SetPrinterValues(comm_ptr, COMM_TYP.TCP_COMM, False, key_values)
if result:
print("Successfully set values.")
else:
print("Failed to set values.")

◆ SetRfidReportCallback()

JsonSDK.JsonSDK.SetRfidReportCallback ( self,
callback )

设置一个回调函数来获取 RFID 报告。

参数
[in]callback:回调函数
返回
程序代码
SetRfidReportCallback(RfidReportCallback);

◆ SetRfidReportListening()

JsonSDK.JsonSDK.SetRfidReportListening ( self,
value )

设置 RFID 报告监听的标志。

参数
[in]value: 用来设置 RFID 报告监听的标志
返回
程序代码
SetRfidReportListening(True);

类成员变量说明

◆ AllMsg

JsonSDK.JsonSDK.AllMsg